[antlr-interest] Re: #( root children ) syntax change proposal?

lgcraymer lgc at mail1.jpl.nasa.gov
Tue Nov 18 13:40:02 PST 2003


Ter--

There would not be any ambiguity between ^ as a suffix and ^( as a tree notation--"^(" can be interpreted as a token by the lexer.  
However, the current semantics of ^ is "root", not tree or AST node--that's #.  I can see the ^( as a construction syntax, but would 
prefer to keep # as a tree matching prefix.  In fact, I'd be willing to change my tree construction syntax from "#{" to "^{" and "#(" to "^(" 
to emphasize the construct versus match differential.

--Loring

--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> wrote:
> Howdy folks,
> 
> The #(...) notation derives from wanting to use parens like LISP but 
> not wanting the ambiguity with (... | ...) alternative subrules. The # 
> was the only character left in ASCII for me to use ;)  I have always 
> not liked it, but now it's ingrained.  That said, I've been thinking of 
> changing it for ANTLR 3 into
> 
> ^(root c1 ... cn)
> 
> in tree parsers and tree construction actions.  There MAY be some 
> ambiguity with the ^ suffix operator, but I think we might wanna try it 
> out.
> 
> Anybody have any thoughts?  I like it as it's more intuitive that that 
> is a tree ;)  # is random.
> 
> Ter
> --
> Professor Comp. Sci., University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Co-founder, http://www.jguru.com
> Co-founder, http://www.knowspam.net enjoy email again!
> Co-founder, http://www.peerscope.com pure link sharing


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list