[antlr-interest] "protected" lexer rules

John D. Mitchell johnm-antlr at non.net
Sun Nov 7 15:47:57 PST 2004


>>>>> "Terence" == Terence Parr <parrt at cs.usfca.edu> writes:
>>>>>> On Nov 7, 2004, at 3:17 PM, John D. Mitchell wrote:
[...]

>>> "non token"?  "method"?  "macro"?  "internal"?

>> Their only purpose for existence is to provide a single definition of a
>> (sub-)structure of (perhaps many) token(s), right?  So, they are really
>> just "shorthand" (rules).

> Yes, common substructure with optional actions; e.g., DIGIT might compute
> a value from the char.

> So, "shared", "isolated", "common", "sub"?

"Sub" rule is very bad because it's already got a meaning.

"Common" and "shared" rules are both too generic in addition to the fact
that the shorthand rule isn't necessarily commonly used or shared.

At this point, "shorthand" is the best that I can come up with.  That name
is clear; it's not overused in Antlr, the grammar/language community, the
or the general computing world; and it's descriptive of the rule's
functional role.


> perhaps there is a different "section"; one for regular rules and then
> one for these shared rules?

Naw, I prefer to have the helper rules next to the rule that they help.

Hope this helps,
		John


 
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