Ok - so the parser should just accept whatever is valid syntax and then worry about the semantics (duplicate parameter) by traversing the AST. Right?
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Terence Parr Sent: Wednesday, October 29, 2008 6:13 PM To: Jim Idle Cc: [EMAIL PROTECTED] Subject: Re: [antlr-interest] Enforcing that a statement parm is onlyspecified one time On Oct 29, 2008, at 1:45 PM, Jim Idle wrote: > Warning line 2, offset nn : You have said 'plumber' 12 times in the > same construct. Are you campaigning? > wink joe the plumber plumber joe wink joe the bloody plumber plumber > plumber > ^ ^ ^ ^ > > Basically, for anything other than a one off script parser or > something, never try to do things like this in the grammar itself, > ALWAYS accept anything that is vaguely legal, count or flag what is > present, then give specific errors. Similar things include: > > Error: line 2, offset nn : You cannot combine 'baseball' and 'obama' > in the same timeslot. > schedule blah blah obama blah blah baseball > ^ Error: line 2, offset nn: You're not an idiot, you're a maverick, you're VP is a maverick, and your mother looks like one too. The horse you rode in on is a maverick too. Terence List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-addr ess List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/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 [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 -~----------~----~----~----~------~----~------~--~---
