Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I have written the grammar for C and have generated lexer and parser programs using ANTLR.The parser and lexer programs are in JAVA.
How do I approach the construction of an Abstract syntax tree?What are the alternative approaches? Pros and cons?
The next step is code generation which I intend to do after a thorough sweep of assembly level language.How do I tackle the problem associated with bringing all the above said modules as one working unit?
Posted
Updated 15-Jul-15 6:14am
v2
Comments
Sergey Alexandrovich Kryukov 15-Jul-15 7:20am    
What do you mean "how"? By doing appropriate software development work. Do you expect us to tech you some complicated fields of programming in one or few Quick Answers?
—SA
[no name] 15-Jul-15 11:52am    
I wanted to know different approaches for constructing abstract syntax trees and being a beginner, I have no idea.That is what I wanted to convey when I asked how to do. Anyways your input is highly appreciated and another thing I definitely did not expect you to teach in few answers, I'm not naive.However a guideline would have helped.Something to start with is better than nothing.
Sergey Alexandrovich Kryukov 15-Jul-15 11:55am    
I agree. In essence, my comment was to invite you to get into finer detail in your question.
As formulated, your question hardly let us figure out exactly what kind pf help you may need.
—SA

1 solution

You may find answers to your questions reading the ANTLR author's book: "The Definitive ANTLR 4 Reference"[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900