[antlr-interest] Enforcing that a statement parm is only specified one time

Loring Craymer lgcraymer at yahoo.com
Wed Oct 29 15:08:40 PDT 2008


The cleanest approach is just to add items to a set (or table) as they are matched; in case of duplicates, post a warning or error message directly instead of throwing an exception that would terminate syntactic analysis.

--Loring




________________________________
From: "Brisard, Fred D" <Fred.Brisard at ca.com>
To: antlr-interest at antlr.org
Sent: Wednesday, October 29, 2008 1:12:46 PM
Subject: [antlr-interest] Enforcing that a statement parm is only specified one time


Is there a standard pattern for allowing a singleinstance of a phrase on a given statement?
For example, Ihave statement of the syntax of
Stmtname [keyword1 keyvalue1] [keyword2 keyvalue2]
I want to allow keyword1 or keyword2 to be specified in any order but I don’t want to allow the specification of either keyword more than once.
I have some statements with up to 8 different keywords that should only occur once but in any order.
Thanks for any suggestions.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081029/a4dccbc5/attachment.html 


More information about the antlr-interest mailing list