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

Key: ANTLR-13
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

manually specified syntactic predicates do not get hoisted upon non-LL(*) decision

Created: 06/Nov/06 06:21 PM   Updated: 08/Nov/06 02:33 PM
Component/s: ANTLR Core
Affects Version/s: 3.0
Fix Version/s: 3.0b5


 Description  « Hide
grammar bt;
// options \{backtrack=true;} works with this option
a : (b ';')=> b ';'
| b '.'
;

b : '(' b ')'
| ID
;

WS : ' '+ \{channel=99;} ;

ID : 'a'..'z'+ ;

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Terence Parr - 07/Nov/06 05:51 PM
Ah. Looks like when backtrack=true, I retry with k=1 which then resolves with the predicates. Somehow I need to avoid doing a bail out if there are semantic predicates. Look in closure and avoid terminating if semantic context exists and covers the state. Call tryToResolveWithSemanticPredicates()?

Terence Parr - 08/Nov/06 02:33 PM
Upon non-LL(*) abort, did not hoist preds. Moved terminate boolean from NFA converter to DFAState.abortedDueToMultipleRecursiveAlts. Refactored how I abort on this and analyzed all code related to error messages and hoisting. Was able to improve things by removing special cases, adding comments etc... For example, getNondeterministicAlts() now knows that aborted states should return all alts. Spent time shuffling some code around so it makes more sense.

Also, removed failsafe that check to see if I'm spending too much time on a single D
FA; I don't think we need it anymore.