Using C# and gppg, how would I construct an abstract syntax tree?

Posted by Rupert on Stack Overflow See other posts from Stack Overflow or by Rupert
Published on 2008-11-14T16:47:13Z Indexed on 2010/05/06 0:48 UTC
Read the original article Hit count: 273

Filed under:
|
|
|
|

Is there a way to do this almost out-of-the-box?

I could go and write a big method that would use the collected tokens to figure out which leaves should be put in which branches and in the end populate a TreeNode object, but since gppg already handled everything by using supplied regular expressions, I was wondering if there's an easier way? Even if not, any pointers as to how best to approach the problem of creating an AST would be appreciated.

Apologies if I said anything silly, I'm only just beginning to play the compiler game. :)

© Stack Overflow or respective owner

Related posts about c#

Related posts about gppg