Reputation: 1
I am new to ANTLRWorks and I am doing my final year project. Could anyone please help me in how to write ANTLR grammar just for recognising a class in java "and printing it in any file as an output". On the same lines then I will be able to write the grammar for my project.
Upvotes: 0
Views: 2250
Reputation: 61
Creating all required java classes from grammar.
Execute
java -cp antlr-3.3-complete.jar org.antlr.Tool Java.g
OR
java -jar antlr-3.3-complete.jar Java.g
from the directory where you have antlr-3.3-complete.jar
and Java.g
file.
Java Grammer which is compatible with Java 1.3 to 1.6
Reference Resources:
This exaplains how can we generate AST Tree
Upvotes: 2