What I need : Find a way to parse a ttcn-3 source code or a ttcn-3 schema into XML or JAVA
I have looked on the internet to see if I can find an IDE or a program that helps me to parse a code in a ttcn-3 language and I have found the ANTLR website. Another tool for language recognition so I would like to know if someone has used ANTLR or knows if it can help me to parse.
Definitely yes. I know many people who have used ANTLR (including myself) and it can be used to solve your problem and parse your language if you can find a grammar for it.
Related
We are using antlr4 to parse a purpose designed language. We have been able to create a grammar, and we are now using it to generate the diagrams we need.
Unfortunately, I need a bit more. I need to add line numbers to a homogeneous AST and get the results in a text file. I see a lot of questions/answers to this but since this is our first time adding to antlr, is there a simple, complete example of this ? We have both books but they assume a lot more familiarity with the process than we have.
Is there a source with a simple extension that we could build from ? I think we can complete it reasonably quickly, but we need a starter guide.
Thanks
I want to use link grammar parser in my eclipse java project. I have downloaded Link Grammar 5.3.13 from http://www.abisource.com/projects/link-grammar/
I have read its README file, but i am unable to understand it.Can anyone provide me with good documentation on how to get on with this parser?
I have studied this link
http://www.abisource.com/projects/link-grammar/api/index.html
But this gives explanation about code not about the installation.
Thanks in advance
For a usage example of the Link Grammar Java binding, see RelEx Semantic Relation Extractor. Especially, see LocalLGParser.java there.
I want to use a math-expression parser of java code. In particular I would like to convert a math-expression given as String to an abstract syntax tree consisted of separate nodes.
Is there anyone to recommend me a relevant open source tool?
If no, how do you reckon the possibility to exploit Intellij source code to do this work?
Which classes are responsible for code parsing and analysis?
Are they included in idea.jar? How can I easily infiltrate their functionality (methods etc)?
I am speaking exclusively for Intellij.
Take a look at MVEL library.
If you only want the results of the math-expression you should revise the question and the answer i selected months ago:
Java 1.5: mathematical formula parser
Brieff description: use the java integration with dinamyc languajes like javascript to let them do the work for you
I would not use IntelliJ, as much as I love it.
If you need an AST, look no further than ANTLR. If you can write a grammar for your equations, ANTLR can generate a lexer/parser to create it for you.
As the title says, I want to parse some Java source code in Java. I'm pretty sure there are other java libraries that already perform this, but I couldn't find any.
Antlr has a grammar file for Java. See this.
Janino can parse, compile and execute Java code.
You may be looking for something like ANTLR: http://www.antlr.org/
Eclipse exposes the Syntax Tree of it's own Java compiler. You can simply access the elements.
See here.
JavaCC has a Java 1.5 grammar including generics.
the tokens are probably more
fine-grained then what I want
Your first requirement is to get an accurate parse, and you will realistically only get that from an existing parser. What you do with the result is up to you.
Does anyone know of a method, or library, to convert SGML into XML?
EDIT: For clarification, I have to do the conversion in Java, and I cannot use the SP parser or the related SX tool.
It seems that the general consensus is that there are no existing libraries for doing SGML work in Java. Certainly after several days of fruitlessly searching Google, and asking this question here, I have found no resources on this subject.
The answer is not always that simple, as it depends on the sgml DTD. I haven't actually found a general SGML parser in Java at all, but this article uses SP which includes a converter.
See http://jclark.com/sp/sx.htm for the SX converter from SGML to XML in the SP package.
There is the mlParser, but I'm having a hard time trying to locate it: http://www.balisage.net/Proceedings/vol1/html/Smith01/BalisageVol1-Smith01.html
There is no api for parsing SGML using Java at this time. There also isn't any api or library for converting SGML to XML and then parsing it using Java. With the status of SGML being supplanted by XML for all the projects I've worked on until now, I don't think there will every be any work done in this area, but that is only a guess.
Here is some open source code code from a University that does it, however I haven't tried it and you would have to search to find the other dependent classes. I believe the only viable solution in Java would require Regular Expressions.
Also, here is a link for public SGML/XML software.