[antlr-interest] declarations after code

Maassen, H.A.M. H.A.M.Maassen at student.tue.nl
Tue Nov 23 01:27:37 PST 2004


Hello,
 
I'm in a bit of a fix :)
 
I'm currently writing a parser for a language that can have variables declared after the code where they are used. In addition, the language is ambiguous depending on the types of the variables.
 
For example, the following code results in two different trees depending on the types of the variables "a", "b" and "c":
 
Code
  a b c
 
Here, "a" could be a function that takes "b" and "c" as parameters or "a", "b" and "c" could each be separate functions (the language has no statement-separator).
 
It looks like I'll have to do two passes over the code, once to get all the variable types and once to parse the statements (and then a treewalk for full blown semantic checks).
 
Can anyone think of a cleaner solution to this problem?
 
Je vous prie d'agréer, madame, monsieur, l'expression de mes sentiments distingués, 
Harald Maassen 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


More information about the antlr-interest mailing list