Skip to content
3 changes: 2 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ YYYY/MM/DD, github id, Full name, email
2012/08/08, Zannick, Benjamin S Wolf, [email protected]
2012/09/15, martint, Martin Traverso, [email protected]
2012/09/16, qmx, Douglas Campos, [email protected]
2012/09/17, ksgokul, Gokulakannan Somasundaram, [email protected]
2012/09/17, ksgokul, Gokulakannan Somasundaram, [email protected]
2012/0921, stephengaito, Stephen Gaito, [email protected]
2 changes: 1 addition & 1 deletion runtime/C/src/antlr3commontree.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ getParent (pANTLR3_BASE_TREE tree)
static void
setParent (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE parent)
{
((pANTLR3_COMMON_TREE)(tree->super))->parent = parent == NULL ? NULL : ((pANTLR3_COMMON_TREE)(parent->super))->parent;
((pANTLR3_COMMON_TREE)(tree->super))->parent = parent == NULL ? NULL : ((pANTLR3_COMMON_TREE)(parent->super));
}

static void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ ADAPTOR->addChild(ADAPTOR, root_<treeLevel>, <label>_tree);

matchRuleBlockSet(s,label,terminalOptions,elementIndex,postmatchCode,treeLevel="0") ::= <<
<matchSet(...)>
<noRewrite()> <! set return tree !>
<noRewrite(...)> <! set return tree !>
>>

matchSetBang(s,label,terminalOptions,elementIndex,postmatchCode) ::= <<
Expand Down Expand Up @@ -319,7 +319,7 @@ if ( <actions.(actionScope).synpredgate> ) {<\n>
}
<endif>
<ruleDescriptor.allTokenRefsInAltsWithRewrites
:{if (stream_<it> != NULL) stream_<it>->free(stream_<it>);}; separator="\n">
:{it | if (stream_<it> != NULL) stream_<it>->free(stream_<it>);}; separator="\n">
<ruleDescriptor.allRuleRefsInAltsWithRewrites
:{if (stream_<it> != NULL) stream_<it>->free(stream_<it>);}; separator="\n">
:{it | if (stream_<it> != NULL) stream_<it>->free(stream_<it>);}; separator="\n">
>>
7 changes: 6 additions & 1 deletion tool/src/main/resources/org/antlr/codegen/templates/C/C.stg
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,9 @@ else
<if(LEXER)>
LRECOVER();
<else>
<! use following code to make it recover inline;
RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_<ruleName><elementIndex>);
!>
<endif>
goto rule<ruleDescriptor.name>Ex;
}<\n>
Expand All @@ -2143,7 +2145,10 @@ CONSTRUCTEX();
EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
<if(PARSER)>
EXCEPTION->expectingSet = NULL;
<! use following code to make it recover inline;
EXCEPTION->expectingSet = &FOLLOW_set_in_<ruleName><elementIndex>;
!>
<endif>
>>

Expand Down Expand Up @@ -2510,7 +2515,7 @@ static const ANTLR3_INT32 dfa<dfa.decisionNumber>_T<i0>[] =
*/
static const ANTLR3_INT32 * const dfa<dfa.decisionNumber>_transitions[] =
{
<dfa.transitionEdgeTables:{xref|dfa<dfa.decisionNumber>_T<xref>}; separator=", ", wrap="\n", null="_empty">
<dfa.transitionEdgeTables:{xref|dfa<dfa.decisionNumber>_T<xref>}; separator=", ", wrap="\n", null="NULL">
};

<if(dfa.specialStateSTs)>
Expand Down