Ok... this is what I want to do.....

1) Generate Java classes from some expression language....
2) Assume Step#1 is done... I have Java file. I have created JavaLaxer
and JavaParser using Java.g file after modifying Java.g little bit
(http://jumbleagilemanuals.blogspot.com/2008/03/10-steps-to-beginning-
to-parsing-with.html)
3) I am using antlr-3.3-complete.jar for obtaining AST tree. Now I
have wrote Test class where I am obtaining CommonTree object...

static final TreeAdaptor adaptor = new CommonTreeAdaptor() {
                @Override
                public Object create(Token payload) {
                        CommonTree cTree = new CommonTree();
                        cTree.token = payload;
                        return cTree;
                }
};

CharStream c = new ANTLRFileStream(
                                        "C:/Documents and 
Settings/kkk/IBM/rationalsdp/workspace17"+
                                        
"/myproject/src/main/java/com/xyz/abc/infrastructure/"+
                                        
"email/service/impl/EmailServiceImpl.java");

JavaLexer lexer = new JavaLexer(c);

CommonTokenStream tokens = new CommonTokenStream();
tokens.setTokenSource(lexer);

JavaParser parser = new JavaParser(tokens);
parser.setTreeAdaptor(adaptor);

/* AST tree for my java code */
CommonTree tree = (CommonTree) parser.compilationUnit().getTree();

4) Now I want to convert AST tree to XML output so that I can save it
in DB...
5) I want to write Reader class which can read XML file and create
Java source..
6) Use that Java Source to create Object at Runtime...

I am struggling with step-4 to step-6... I couldn't find solution
yet!!

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to