Program: 171854
Project: 171854
Buggy source:
private Preprocessor_expressionContext preprocessor_expression(int _p) throws RecognitionException {
  ParserRuleContext _parentctx=_ctx;
  int _parentState=getState();
  Preprocessor_expressionContext _localctx=new Preprocessor_expressionContext(_ctx,_parentState);
  Preprocessor_expressionContext _prevctx=_localctx;
  int _startState=10;
  enterRecursionRule(_localctx,10,RULE_preprocessor_expression,_p);
  int _la;
  try {
    int _alt;
    enterOuterAlt(_localctx,1);
{
      setState(87);
      _errHandler.sync(this);
switch (_input.LA(1)) {
case TRUE:
{
          _localctx=new PreprocessorConstantContext(_localctx);
          _ctx=_localctx;
          _prevctx=_localctx;
          setState(63);
          match(TRUE);
        }
      break;
case FALSE:
{
      _localctx=new PreprocessorConstantContext(_localctx);
      _ctx=_localctx;
      _prevctx=_localctx;
      setState(64);
      match(FALSE);
    }
  break;
case DECIMAL_LITERAL:
{
  _localctx=new PreprocessorConstantContext(_localctx);
  _ctx=_localctx;
  _prevctx=_localctx;
  setState(65);
  match(DECIMAL_LITERAL);
}
break;
case DIRECTIVE_STRING:
{
_localctx=new PreprocessorConstantContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(66);
match(DIRECTIVE_STRING);
}
break;
case CONDITIONAL_SYMBOL:
{
_localctx=new PreprocessorConditionalSymbolContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(67);
match(CONDITIONAL_SYMBOL);
setState(72);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input,6,_ctx)) {
case 1:
{
setState(68);
match(LPAREN);
setState(69);
preprocessor_expression(0);
setState(70);
match(RPAREN);
}
break;
}
}
break;
case LPAREN:
{
_localctx=new PreprocessorParenthesisContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(74);
match(LPAREN);
setState(75);
preprocessor_expression(0);
setState(76);
match(RPAREN);
}
break;
case BANG:
{
_localctx=new PreprocessorNotContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(78);
match(BANG);
setState(79);
preprocessor_expression(6);
}
break;
case DEFINED:
{
_localctx=new PreprocessorDefinedContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(80);
match(DEFINED);
setState(85);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CONDITIONAL_SYMBOL:
{
setState(81);
match(CONDITIONAL_SYMBOL);
}
break;
case LPAREN:
{
setState(82);
match(LPAREN);
setState(83);
match(CONDITIONAL_SYMBOL);
setState(84);
match(RPAREN);
}
break;
default :
throw new NoViableAltException(this);
}
}
break;
default :
throw new NoViableAltException(this);
}
_ctx.stop=_input.LT(-1);
setState(103);
_errHandler.sync(this);
_alt=getInterpreter().adaptivePredict(_input,10,_ctx);
while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
if (_alt == 1) {
if (_parseListeners != null) triggerExitRuleEvent();
_prevctx=_localctx;
{
setState(101);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input,9,_ctx)) {
case 1:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(89);
if (!(precpred(_ctx,5))) throw new FailedPredicateException(this,"String_Node_Str");
setState(90);
((PreprocessorBinaryContext)_localctx).op=_input.LT(1);
_la=_input.LA(1);
if (!(_la == EQUAL || _la == NOTEQUAL)) {
((PreprocessorBinaryContext)_localctx).op=(Token)_errHandler.recoverInline(this);
}
 else {
if (_input.LA(1) == Token.EOF) matchedEOF=true;
_errHandler.reportMatch(this);
consume();
}
setState(91);
preprocessor_expression(6);
}
break;
case 2:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(92);
if (!(precpred(_ctx,4))) throw new FailedPredicateException(this,"String_Node_Str");
setState(93);
((PreprocessorBinaryContext)_localctx).op=match(AND);
setState(94);
preprocessor_expression(5);
}
break;
case 3:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(95);
if (!(precpred(_ctx,3))) throw new FailedPredicateException(this,"String_Node_Str");
setState(96);
((PreprocessorBinaryContext)_localctx).op=match(OR);
setState(97);
preprocessor_expression(4);
}
break;
case 4:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(98);
if (!(precpred(_ctx,2))) throw new FailedPredicateException(this,"String_Node_Str");
setState(99);
((PreprocessorBinaryContext)_localctx).op=_input.LT(1);
_la=_input.LA(1);
if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LT) | (1L << GT) | (1L << LE)| (1L << GE))) != 0))) {
((PreprocessorBinaryContext)_localctx).op=(Token)_errHandler.recoverInline(this);
}
 else {
if (_input.LA(1) == Token.EOF) matchedEOF=true;
_errHandler.reportMatch(this);
consume();
}
setState(100);
preprocessor_expression(3);
}
break;
}
}
}
setState(105);
_errHandler.sync(this);
_alt=getInterpreter().adaptivePredict(_input,10,_ctx);
}
}
}
 catch (RecognitionException re) {
_localctx.exception=re;
_errHandler.reportError(this,re);
_errHandler.recover(this,re);
}
 finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}

Fixed version (ground truth):
private Preprocessor_expressionContext preprocessor_expression(int _p) throws RecognitionException {
  ParserRuleContext _parentctx=_ctx;
  int _parentState=getState();
  Preprocessor_expressionContext _localctx=new Preprocessor_expressionContext(_ctx,_parentState);
  Preprocessor_expressionContext _prevctx=_localctx;
  int _startState=10;
  enterRecursionRule(_localctx,10,RULE_preprocessor_expression,_p);
  int _la;
  try {
    int _alt;
    enterOuterAlt(_localctx,1);
{
      setState(87);
      _errHandler.sync(this);
switch (_input.LA(1)) {
case TRUE:
{
          _localctx=new PreprocessorConstantContext(_localctx);
          _ctx=_localctx;
          _prevctx=_localctx;
          setState(63);
          match(TRUE);
        }
      break;
case FALSE:
{
      _localctx=new PreprocessorConstantContext(_localctx);
      _ctx=_localctx;
      _prevctx=_localctx;
      setState(64);
      match(FALSE);
    }
  break;
case DECIMAL_LITERAL:
{
  _localctx=new PreprocessorConstantContext(_localctx);
  _ctx=_localctx;
  _prevctx=_localctx;
  setState(65);
  match(DECIMAL_LITERAL);
}
break;
case DIRECTIVE_STRING:
{
_localctx=new PreprocessorConstantContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(66);
match(DIRECTIVE_STRING);
}
break;
case CONDITIONAL_SYMBOL:
{
_localctx=new PreprocessorConditionalSymbolContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(67);
match(CONDITIONAL_SYMBOL);
setState(72);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input,6,_ctx)) {
case 1:
{
setState(68);
match(LPAREN);
setState(69);
preprocessor_expression(0);
setState(70);
match(RPAREN);
}
break;
}
}
break;
case LPAREN:
{
_localctx=new PreprocessorParenthesisContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(74);
match(LPAREN);
setState(75);
preprocessor_expression(0);
setState(76);
match(RPAREN);
}
break;
case BANG:
{
_localctx=new PreprocessorNotContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(78);
match(BANG);
setState(79);
preprocessor_expression(6);
}
break;
case DEFINED:
{
_localctx=new PreprocessorDefinedContext(_localctx);
_ctx=_localctx;
_prevctx=_localctx;
setState(80);
match(DEFINED);
setState(85);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CONDITIONAL_SYMBOL:
{
setState(81);
match(CONDITIONAL_SYMBOL);
}
break;
case LPAREN:
{
setState(82);
match(LPAREN);
setState(83);
match(CONDITIONAL_SYMBOL);
setState(84);
match(RPAREN);
}
break;
default :
throw new NoViableAltException(this);
}
}
break;
default :
throw new NoViableAltException(this);
}
_ctx.stop=_input.LT(-1);
setState(103);
_errHandler.sync(this);
_alt=getInterpreter().adaptivePredict(_input,10,_ctx);
while (_alt != 2 && _alt != ATN.INVALID_ALT_NUMBER) {
if (_alt == 1) {
if (_parseListeners != null) triggerExitRuleEvent();
_prevctx=_localctx;
{
setState(101);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input,9,_ctx)) {
case 1:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(89);
if (!(precpred(_ctx,5))) throw new FailedPredicateException(this,"String_Node_Str");
setState(90);
((PreprocessorBinaryContext)_localctx).op=_input.LT(1);
_la=_input.LA(1);
if (!(_la == EQUAL || _la == NOTEQUAL)) {
((PreprocessorBinaryContext)_localctx).op=(Token)_errHandler.recoverInline(this);
}
 else {
if (_input.LA(1) == Token.EOF) matchedEOF=true;
_errHandler.reportMatch(this);
consume();
}
setState(91);
preprocessor_expression(6);
}
break;
case 2:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(92);
if (!(precpred(_ctx,4))) throw new FailedPredicateException(this,"String_Node_Str");
setState(93);
((PreprocessorBinaryContext)_localctx).op=match(AND);
setState(94);
preprocessor_expression(5);
}
break;
case 3:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(95);
if (!(precpred(_ctx,3))) throw new FailedPredicateException(this,"String_Node_Str");
setState(96);
((PreprocessorBinaryContext)_localctx).op=match(OR);
setState(97);
preprocessor_expression(4);
}
break;
case 4:
{
_localctx=new PreprocessorBinaryContext(new Preprocessor_expressionContext(_parentctx,_parentState));
pushNewRecursionContext(_localctx,_startState,RULE_preprocessor_expression);
setState(98);
if (!(precpred(_ctx,2))) throw new FailedPredicateException(this,"String_Node_Str");
setState(99);
((PreprocessorBinaryContext)_localctx).op=_input.LT(1);
_la=_input.LA(1);
if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LT) | (1L << GT) | (1L << LE)| (1L << GE))) != 0))) {
((PreprocessorBinaryContext)_localctx).op=(Token)_errHandler.recoverInline(this);
}
 else {
if (_input.LA(1) == Token.EOF) matchedEOF=true;
_errHandler.reportMatch(this);
consume();
}
setState(100);
preprocessor_expression(3);
}
break;
}
}
}
setState(105);
_errHandler.sync(this);
_alt=getInterpreter().adaptivePredict(_input,10,_ctx);
}
}
}
 catch (RecognitionException re) {
_localctx.exception=re;
_errHandler.reportError(this,re);
_errHandler.recover(this,re);
}
 finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}