History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ANTLR-14
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Terence Parr
Reporter: Terence Parr
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ANTLR v3

rewrite with pure action gets syntax error

Created: 06/Nov/06 06:22 PM   Updated: 10/Apr/07 06:00 PM
Component/s: ANTLR Core
Affects Version/s: 3.0
Fix Version/s: 3.0b7


 Description  « Hide
STRING -> {%{$STRING.text}} // how not to interpret string?
gets

codegen.g:0:0: attribute is not a token, parameter, or return value: $STRING
-> {...} doesn't work for trees; tree/template not consistent; one
has ALT above...templ doesn't.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Terence Parr - 23/Mar/07 01:45 PM
Benjamin Niemann says same for trees:

grammar T;
options {
    language = Java;
    output = AST;
}

r
    : INT -> {new CommonTree(new CommonToken(FLOAT,$INT.text+".0"))}
    ;

INT : '0'..'9'+;
WS: (' ' | '\n' | '\t')+ {$channel = HIDDEN;};

Terence Parr - 10/Apr/07 06:00 PM
Altered antlr.g so it properly distinguished between rewrites for templates and ASTs. Let the ACTION come through properly then as an element of a rewrite alt for ASTs.