[antlr-interest] % in target code

Loring Craymer lgcraymer at yahoo.com
Wed Mar 26 15:29:13 PDT 2008


ANTLR 3 attributes are not first class (ANTLR) language elements, and attributes are effectively referenced only within actions ($ syntax) so that ANTLR effectively deals with a superset of the target language, not the target language itself.  Further, string templates may be instantiated in actions (% syntax).

This problem does not occur in ANTLR Yggdrasil, largely as a consequence of having first class attributes that are strongly typed.  I should have a release out within a month or two; I am currently in the middle of developing the tree grammar generator.

--Loring

----- Original Message ----
From: Olivier Lefevre <lefevrol at yahoo.com>
To: antlr-interest at antlr.org
Sent: Wednesday, March 26, 2008 2:38:39 PM
Subject: [antlr-interest] % in target code

I was using % (residue operator in Java) in an action block and got:

    error(146): invalid StringTemplate % shorthand syntax: '%'

What gives?? Why does ANTLR even try to parse the code within an action 
block? It has no business to: target is target code.

-- O.L.







      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080326/aae9b95b/attachment.html 


More information about the antlr-interest mailing list