V3 semantic predicate gate (=>) can only appear after a predicate {...}?, not an action {...}

This commit is contained in:
Sam Harwell 2012-11-18 18:00:19 -06:00
parent 3e91065824
commit aace1ce399
1 changed files with 10 additions and 9 deletions

View File

@ -298,7 +298,7 @@ ARG_ACTION
// //
ACTION ACTION
: NESTED_ACTION : NESTED_ACTION
('?' {$type = SEMPRED;} )? ( '?' {$type = SEMPRED;}
( '=>' // v3 gated sempred ( '=>' // v3 gated sempred
{ {
Token t = new CommonToken(input, state.type, state.channel, state.tokenStartCharIndex, getCharIndex()-1); Token t = new CommonToken(input, state.type, state.channel, state.tokenStartCharIndex, getCharIndex()-1);
@ -308,6 +308,7 @@ ACTION
grammarError(ErrorType.V3_GATED_SEMPRED, t); grammarError(ErrorType.V3_GATED_SEMPRED, t);
} }
)? )?
)?
; ;
// ---------------- // ----------------