[il-antlr-interest: 28323] Re: [antlr-interest] Help with semantic actions commit

2010-03-19 Thread Terence Parr
hi. antlr shouldn't see past actions to sem preds. are you sure that the define sym action is in every path? Do you get an error about insufficiently uncovered alts? Ter On Mar 18, 2010, at 4:54 PM, swalton wrote: I derived my grammar from Terry's C grammar. I have added a lot of

[il-antlr-interest: 28324] [antlr-interest] Problem removing warning

2010-03-19 Thread Gerald Rosenberg
Having a bit of difficulty in figuring out how to unambiguously parse this into an AST. Order of the elements is significant, the parens are significant, and the leading dot is significant. (.buf_unittest.complex_opt1).foo; .buf_unittest.complex_opt1.fum;

[il-antlr-interest: 28326] Re: [antlr-interest] Problem removing warning

2010-03-19 Thread Jim Idle
That will give a tree that isn't very useful ;-) You need to express this in LL form such that the things that can be elements of your compound appear at the bottom of the tree. Then use DOT and not '.', make that be the root node and do not try to impose any semantic verification via

[il-antlr-interest: 28327] Re: [antlr-interest] sematic analysis ?

2010-03-19 Thread Kaleb Pederson
On Fri, Mar 19, 2010 at 10:37 AM, Kaleb Pederson kaleb.peder...@gmail.com wrote: Venkat, One way to do what you've mentioned is to create a tree walker which walks the AST.  Then, within the AST, you'll need to do a couple of things. First, you need to populate a symbol table.  That symbol

[il-antlr-interest: 28328] Re: [antlr-interest] Problem removing warning

2010-03-19 Thread Gerald Rosenberg
Thanks, Jim. Please understand though that I dumbed down the test grammar to minimally illustrate the problem I was asking about - my actual grammar shapes a much more complex tree and uses tidy tokens;). The revision you suggest unfortunately looses a bit too much intrinsic information that

[il-antlr-interest: 28329] Re: [antlr-interest] Problem removing warning

2010-03-19 Thread Jim Idle
Yes - you can retain all that stuff, but if you try to do it the way you have it, you won't get a tree that makes sense. You can see a much more complicated example using my C# parser, which is online at: http://www.temporal-wave.com/index.php?option=com_psrrunview=psrrunItemid=58 All you need

[il-antlr-interest: 28331] Re: [antlr-interest] THelp w/ Tree Grammer - Rule Action Error

2010-03-19 Thread John B. Brodie
Greetings! On Fri, 2010-03-19 at 15:26 -0400, William Koscho wrote: Hi All, I have a tree grammar, and am trying to just print out some information from the tree. This works fine for matching tokens, but not when matching the rules. I'm hoping someone can help explain why this is giving

[il-antlr-interest: 28332] Re: [antlr-interest] Problem removing warning

2010-03-19 Thread Gerald Rosenberg
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups il-antlr-interest group. To post to this group, send email to

[il-antlr-interest: 28333] [antlr-interest] semantic analysis

2010-03-19 Thread venkat medhaj
Hi, I have a simple grammar for which I was able to walk through the AST and printout the input text to the console. I learned that we need to put the information in the symbol table and do the semantic analysis from there on. How , what information should I put into the symbol table and how do I

[il-antlr-interest: 28334] Re: [antlr-interest] semantic analysis

2010-03-19 Thread John B. Brodie
Greetings! On Fri, 2010-03-19 at 17:01 -0400, venkat medhaj wrote: Hi, I have a simple grammar for which I was able to walk through the AST and printout the input text to the console. I learned that we need to put the information in the symbol table and do the semantic analysis from there