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

Key: ANTLR-82
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
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

action after root with optional child misplaces action

Created: 03/Jan/07 11:38 AM   Updated: 03/May/07 06:49 PM
Component/s: ANTLR Core
Affects Version/s: 3.0b5
Fix Version/s: 3.0b8


 Description  « Hide
I wrote the following pattern
            ^(e=entity{value=$e} X?)
 
Antlr produced the following logic
 
            e=entity();
            if( input.LA(1) == Token.DOWN){
                        match(input Token.DOWN, null);
                        value = e;.
            ......
                        match(input Token.UP, null);
            }
 
In other words, Antlr was perfectly willing to deal with the possibility that no X means no tree. But the action was only done if there was a tree.


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Terence Parr - 20/Apr/07 01:50 PM
Looks like it is considering the {...} action as an element (first child). Need to avoid checking for DOWN until after the action.

Terence Parr - 03/May/07 06:49 PM
Made actions after root special.