[antlr-interest] terminology: "protected"

Martin Probst mail at martin-probst.com
Thu Jan 12 03:38:37 PST 2006


I agree that "protected" is a bad wording, but I don't quite agree with
your splicing thing too. Basically your requiring the user to specify
within the rule that is using the "spliced" rule that the rule is
spliced. 

> which tells the reader explicitly that we're dealing with a 
> non-tokenizing splice (no need to look up the defn).

I don't see why that would be desirable. To me, a "spliced" rule is
nothing special, except that it's internal to the lexer (maybe that
would be a much nicer wording?), and cannot be directly accessed from
the parser. The calling rule doesn't care about the fact, it just says
"and at this point, I need the stuff defined in FOO".

Plus: it does not have the properties of a macro expansion, does it? And
if so: who cares? That's IMHO an implementation detail - from the
language point of view it's just a sequence of matches.

I'd propose to call those rules "internal" - as stated, they cannot be
directly accessed from outside of the Lexer (in the rule matching
meaning) and "internal" also expresses the Java protected behaviour.

Martin



More information about the antlr-interest mailing list