[antlr-interest] tree grammar and list via +=

Bastian Asam bastian.asam at amadeus.com
Wed Feb 2 06:17:28 PST 2011


Hello again,
since you helped me nicely last time a have an other question:

Is it now possible to use a list in a tree grammar? I found a mail from 
2007 saying it will be implemented soon.

But when I try it, I get a very long error Message.
Here is the grammar:

tree grammar TreeWalker;
options{
        language=C;
        tokenVocab=Grammar;
        output=AST;
        ASTLabelType=pANTLR3_BASE_TREE;
}
...
idrefs : list+=id+ ;
...

When generating the code, I get this:
error(10): internal error: /TreeWalker.g :
java.util.NoSuchElementException: template listLabelAST has no such 
attribute: elem in template context [outputFile treeParser 
genericParser(...) rule ruleBlockSingleAlt alt element 
positiveClosureBlock altSwitchCase alt element ruleRefAndListLabel <invoke 
listLabelAST arg context>]
...

Sounds to me like I cannot use a list with output AST, but when I set 
output to template I get:
error(10): internal error: no such group file ST.stg

output=AST would be neccessary anyway.

Any suggestions? Thanks in advance
Bastian





IMPORTANT  -  CONFIDENTIALITY  NOTICE  - This e-mail is intended only for 
the use of the individual or entity shown above as addressees. It may 
contain information which is privileged, confidential or otherwise 
protected from disclosure under applicable laws.  If the reader of this 
transmission is not the intended recipient, you are hereby notified that 
any dissemination, printing, distribution, copying, disclosure or the 
taking of any action in reliance on the contents of this information is 
strictly prohibited.  If you have received this transmission in error, 
please immediately notify us by reply e-mail or using the address below 
and delete the message and any attachments from your system. 

Amadeus Data Processing GmbH 
Geschäftsführer: Eberhard Haag 
Sitz der Gesellschaft: Erding 
HR München 48 199 
Berghamer Strasse 6 
85435 Erding 
Germany


More information about the antlr-interest mailing list