Program: 83655
Project: 83655
Buggy source:
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (this.mode == 0) {
    if (this.value != null) {
      this.field.setValue(this.value);
    }
    pm.popParser(true);
    return;
  }
switch (type) {
case Symbols.SEMICOLON:
case Symbols.COMMA:
case Tokens.STRING_PART:
case Tokens.STRING_END:
    if (this.value != null) {
      this.field.setValue(this.value);
    }
  pm.popParser(true);
return;
}
if (this.mode == VALUE) {
if (type == Symbols.OPEN_PARENTHESIS) {
this.mode=TUPLE_END;
Tuple tv=new Tuple(token);
this.value=tv;
int nextType=token.next().type();
if (nextType != Symbols.CLOSE_PARENTHESIS) {
  pm.pushParser(new ExpressionListParser(tv));
}
return;
}
if (type == Symbols.OPEN_SQUARE_BRACKET) {
this.mode=ARRAY_END;
Array vl=new Array(token);
this.value=vl;
int nextType=token.next().type();
if (nextType != Symbols.CLOSE_SQUARE_BRACKET) {
  pm.pushParser(new ExpressionListParser(vl));
}
return;
}
if (type == Symbols.OPEN_CURLY_BRACKET) {
this.mode=LIST_END;
StatementList sl=new StatementList(token);
this.value=sl;
int nextType=token.next().type();
if (nextType != Symbols.CLOSE_CURLY_BRACKET) {
  pm.pushParser(new StatementListParser(sl));
}
return;
}
if (type == Tokens.SYMBOL_IDENTIFIER) {
if (token.nameValue() == Name.at && token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
  Bytecode bc=new Bytecode(token);
  pm.skip();
  pm.pushParser(new BytecodeParser(bc));
  this.mode=BYTECODE_END;
  this.value=bc;
  return;
}
this.getAccess(pm,token.nameValue(),token,type);
return;
}
if ((type & Tokens.IDENTIFIER) != 0) {
this.getAccess(pm,token.nameValue(),token,type);
return;
}
if (this.parseKeyword(pm,token,type)) {
return;
}
this.mode=ACCESS;
}
if (this.mode == PATTERN_IF) {
this.mode=PATTERN_END;
if (type == Keywords.IF) {
pm.pushParser(new ExpressionParser(this));
return;
}
}
if (this.mode == PATTERN_END) {
if (type == Symbols.COLON) {
this.field.setValue(this.value);
pm.popParser();
if (token.next().type() != Keywords.CASE) {
  pm.pushParser(new ExpressionParser((IValued)this.value));
}
return;
}
throw new SyntaxError(token,"String_Node_Str");
}
if (type == Symbols.COLON) {
if (this.value != null) {
this.field.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.mode == ARRAY_END) {
this.value.expandPosition(token);
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
this.mode=ACCESS;
return;
}
this.field.setValue(this.value);
pm.popParser();
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == LIST_END) {
this.field.setValue(this.value);
this.value.expandPosition(token);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
if (token.next().type() == Symbols.DOT) {
  this.mode=ACCESS_2;
  this.dotless=false;
  pm.skip();
  return;
}
pm.popParser();
return;
}
pm.popParser(true);
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == TUPLE_END) {
this.mode=ACCESS | LAMBDA;
if (type == Symbols.CLOSE_PARENTHESIS) {
this.value.expandPosition(token);
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == PARAMETERS) {
this.mode=PARAMETERS_END;
if (type == Symbols.OPEN_PARENTHESIS) {
ICall call=(ICall)this.value;
call.setArguments(this.getArguments(pm,token.next()));
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == PARAMETERS_END) {
this.mode=ACCESS;
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == CONSTRUCTOR_END) {
this.mode=ACCESS;
if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
ClassConstructor cc=((ConstructorCall)this.value).toClassConstructor();
pm.skip();
pm.pushParser(new ClassBodyParser(cc.getNestedClass()));
this.value=cc;
this.mode=LIST_END;
return;
}
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == GENERICS) {
this.mode=GENERICS_END;
if (type == Symbols.OPEN_SQUARE_BRACKET) {
pm.pushParser(new TypeListParser((ITypeList)this.value));
return;
}
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == GENERICS_END) {
this.mode=ACCESS;
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
return;
}
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == FUNCTION_POINTER) {
pm.popParser();
if (ParserUtil.isIdentifier(type)) {
FunctionPointer fl=new FunctionPointer(token.raw(),token.nameValue());
fl.instance=this.value;
this.field.setValue(fl);
return;
}
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == BYTECODE_END) {
this.field.setValue(this.value);
pm.popParser();
this.value.expandPosition(token);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (ParserUtil.isCloseBracket(type)) {
if (this.value != null) {
this.field.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.isInMode(LAMBDA)) {
if (type == Symbols.ARROW_OPERATOR) {
LambdaExpression lv=getLambdaValue(this.value);
if (lv != null) {
  lv.expandPosition(token);
  this.field.setValue(lv);
  pm.popParser();
  pm.pushParser(new ExpressionParser(lv));
  return;
}
throw new SyntaxError(token,"String_Node_Str");
}
}
if (this.isInMode(ACCESS)) {
if (type == Symbols.DOT) {
this.mode=ACCESS_2;
this.dotless=false;
return;
}
if (type == Symbols.HASH) {
this.mode=FUNCTION_POINTER;
return;
}
this.dotless=true;
this.mode=ACCESS_2;
if (type == Keywords.ELSE) {
this.field.setValue(this.value);
pm.popParser(true);
return;
}
if (type == Symbols.EQUALS) {
this.getAssign(pm,token);
return;
}
if (type == Keywords.AS) {
CastOperator co=new CastOperator(token.raw(),this.value);
pm.pushParser(new TypeParser(co));
this.value=co;
return;
}
if (type == Keywords.IS) {
InstanceOfOperator io=new InstanceOfOperator(token.raw(),this.value);
pm.pushParser(new TypeParser(io));
this.value=io;
return;
}
if (type == Symbols.OPEN_PARENTHESIS) {
IToken prev=token.prev();
IToken next=token.next();
IArguments args;
args=this.getArguments(pm,next);
int prevType=prev.type();
if (ParserUtil.isIdentifier(prevType)) {
  MethodCall mc=new MethodCall(prev,null,prev.nameValue());
  mc.arguments=args;
  this.value=mc;
}
 else if (prevType == Symbols.CLOSE_SQUARE_BRACKET) {
  MethodCall mc;
  if (this.value.valueTag() == IValue.FIELD_ACCESS) {
    mc=((FieldAccess)this.value).toMethodCall(null);
  }
 else {
    mc=(MethodCall)this.value;
  }
  mc.arguments=args;
  this.value=mc;
}
 else {
  ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition());
  amc.instance=this.value;
  amc.arguments=args;
  this.value=amc;
}
this.mode=PARAMETERS_END;
return;
}
}
if (this.isInMode(ACCESS_2)) {
if (ParserUtil.isIdentifier(type)) {
Name name=token.nameValue();
if (this.prefix) {
  this.field.setValue(this.value);
  pm.popParser(true);
  return;
}
if (this.dotless && this.operator != null) {
  Operator operator=pm.getOperator(name);
  int p=this.operator.precedence;
  if (p > operator.precedence) {
    this.field.setValue(this.value);
    pm.popParser(true);
    return;
  }
  if (p == operator.precedence) {
switch (operator.type) {
case Operator.INFIX_LEFT:
      this.field.setValue(this.value);
    pm.popParser(true);
  return;
case Operator.INFIX_NONE:
throw new SyntaxError(token,"String_Node_Str" + name + "String_Node_Str");
case Operator.INFIX_RIGHT:
}
}
}
this.getAccess(pm,name,token,type);
return;
}
if (ParserUtil.isTerminator(type)) {
this.field.setValue(this.value);
pm.popParser(true);
return;
}
IToken prev=token.prev();
if (ParserUtil.isIdentifier(prev.type())) {
this.value=null;
pm.reparse();
this.getAccess(pm,prev.nameValue(),prev,type);
return;
}
if (this.value != null) {
ApplyMethodCall call=new ApplyMethodCall(token.raw());
call.instance=this.value;
SingleArgument sa=new SingleArgument();
call.arguments=sa;
this.value=call;
this.mode=0;
pm.pushParser(new ExpressionParser(sa),true);
return;
}
throw new SyntaxError(token,"String_Node_Str" + token);
}
if (this.isInMode(CONSTRUCTOR)) {
ConstructorCall cc=(ConstructorCall)this.value;
if (type == Symbols.OPEN_CURLY_BRACKET) {
ClassConstructor cc2=cc.toClassConstructor();
pm.pushParser(new ClassBodyParser(cc2.getNestedClass()));
this.mode=LIST_END;
this.value=cc2;
return;
}
if (type == Symbols.OPEN_PARENTHESIS) {
ArgumentList list=new ArgumentList();
cc.arguments=list;
pm.pushParser(new ExpressionListParser(list));
this.mode=CONSTRUCTOR_END;
return;
}
SingleArgument sa=new SingleArgument();
cc.arguments=sa;
pm.pushParser(new ExpressionParser(sa),true);
this.mode=0;
return;
}
if (this.value != null) {
this.value.expandPosition(token);
this.field.setValue(this.value);
pm.popParser(true);
return;
}
throw new SyntaxError(token,"String_Node_Str" + token);
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (this.mode == 0) {
    if (this.value != null) {
      this.field.setValue(this.value);
    }
    pm.popParser(true);
    return;
  }
switch (type) {
case Symbols.SEMICOLON:
case Symbols.COMMA:
case Tokens.STRING_PART:
case Tokens.STRING_END:
    if (this.value != null) {
      this.field.setValue(this.value);
    }
  pm.popParser(true);
return;
}
if (this.mode == VALUE) {
if (type == Symbols.OPEN_PARENTHESIS) {
this.mode=TUPLE_END;
Tuple tv=new Tuple(token);
this.value=tv;
int nextType=token.next().type();
if (nextType != Symbols.CLOSE_PARENTHESIS) {
  pm.pushParser(new ExpressionListParser(tv));
}
return;
}
if (type == Symbols.OPEN_SQUARE_BRACKET) {
this.mode=ARRAY_END;
Array vl=new Array(token);
this.value=vl;
int nextType=token.next().type();
if (nextType != Symbols.CLOSE_SQUARE_BRACKET) {
  pm.pushParser(new ExpressionListParser(vl));
}
return;
}
if (type == Symbols.OPEN_CURLY_BRACKET) {
this.mode=LIST_END;
StatementList sl=new StatementList(token);
this.value=sl;
int nextType=token.next().type();
if (nextType != Symbols.CLOSE_CURLY_BRACKET) {
  pm.pushParser(new StatementListParser(sl));
}
return;
}
if (type == Tokens.SYMBOL_IDENTIFIER) {
if (token.nameValue() == Name.at && token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
  Bytecode bc=new Bytecode(token);
  pm.skip();
  pm.pushParser(new BytecodeParser(bc));
  this.mode=BYTECODE_END;
  this.value=bc;
  return;
}
this.getAccess(pm,token.nameValue(),token,type);
return;
}
if ((type & Tokens.IDENTIFIER) != 0) {
this.getAccess(pm,token.nameValue(),token,type);
return;
}
if (this.parseKeyword(pm,token,type)) {
return;
}
this.mode=ACCESS;
}
if (this.mode == PATTERN_IF) {
this.mode=PATTERN_END;
if (type == Keywords.IF) {
pm.pushParser(new ExpressionParser(this));
return;
}
}
if (this.mode == PATTERN_END) {
if (type == Symbols.COLON) {
this.field.setValue(this.value);
pm.popParser();
if (token.next().type() != Keywords.CASE) {
  pm.pushParser(new ExpressionParser((IValued)this.value));
}
return;
}
throw new SyntaxError(token,"String_Node_Str");
}
if (type == Symbols.COLON) {
if (this.value != null) {
this.field.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.mode == ARRAY_END) {
this.value.expandPosition(token);
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
this.mode=ACCESS;
return;
}
this.field.setValue(this.value);
pm.popParser();
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == LIST_END) {
this.field.setValue(this.value);
this.value.expandPosition(token);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
if (token.next().type() == Symbols.DOT) {
  this.mode=ACCESS_2;
  this.dotless=false;
  pm.skip();
  return;
}
pm.popParser();
return;
}
pm.popParser(true);
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == TUPLE_END) {
this.mode=ACCESS | LAMBDA;
if (type == Symbols.CLOSE_PARENTHESIS) {
this.value.expandPosition(token);
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == PARAMETERS) {
this.mode=PARAMETERS_END;
if (type == Symbols.OPEN_PARENTHESIS) {
ICall call=(ICall)this.value;
call.setArguments(this.getArguments(pm,token.next()));
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == PARAMETERS_END) {
this.mode=ACCESS;
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == CONSTRUCTOR_END) {
this.mode=ACCESS;
if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
ClassConstructor cc=((ConstructorCall)this.value).toClassConstructor();
pm.skip();
pm.pushParser(new ClassBodyParser(cc.getNestedClass()));
this.value=cc;
this.mode=LIST_END;
return;
}
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (this.mode == FUNCTION_POINTER) {
pm.popParser();
if (ParserUtil.isIdentifier(type)) {
FunctionPointer fl=new FunctionPointer(token.raw(),token.nameValue());
fl.instance=this.value;
this.field.setValue(fl);
return;
}
throw new SyntaxError(token,"String_Node_Str");
}
if (this.mode == BYTECODE_END) {
this.field.setValue(this.value);
pm.popParser();
this.value.expandPosition(token);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
}
if (ParserUtil.isCloseBracket(type)) {
if (this.value != null) {
this.field.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.isInMode(LAMBDA)) {
if (type == Symbols.ARROW_OPERATOR) {
LambdaExpression lv=getLambdaValue(this.value);
if (lv != null) {
  lv.expandPosition(token);
  this.field.setValue(lv);
  pm.popParser();
  pm.pushParser(new ExpressionParser(lv));
  return;
}
throw new SyntaxError(token,"String_Node_Str");
}
}
if (this.isInMode(ACCESS)) {
if (type == Symbols.DOT) {
this.mode=ACCESS_2;
this.dotless=false;
return;
}
if (type == Symbols.HASH) {
this.mode=FUNCTION_POINTER;
return;
}
this.dotless=true;
this.mode=ACCESS_2;
if (type == Keywords.ELSE) {
this.field.setValue(this.value);
pm.popParser(true);
return;
}
if (type == Symbols.EQUALS) {
this.getAssign(pm,token);
return;
}
if (type == Keywords.AS) {
CastOperator co=new CastOperator(token.raw(),this.value);
pm.pushParser(new TypeParser(co));
this.value=co;
return;
}
if (type == Keywords.IS) {
InstanceOfOperator io=new InstanceOfOperator(token.raw(),this.value);
pm.pushParser(new TypeParser(io));
this.value=io;
return;
}
if (type == Symbols.OPEN_PARENTHESIS) {
IToken prev=token.prev();
IToken next=token.next();
IArguments args;
args=this.getArguments(pm,next);
int prevType=prev.type();
if (ParserUtil.isIdentifier(prevType)) {
  MethodCall mc=new MethodCall(prev,null,prev.nameValue());
  mc.arguments=args;
  this.value=mc;
}
 else if (prevType == Symbols.CLOSE_SQUARE_BRACKET) {
  MethodCall mc;
  if (this.value.valueTag() == IValue.FIELD_ACCESS) {
    mc=((FieldAccess)this.value).toMethodCall(null);
  }
 else {
    mc=(MethodCall)this.value;
  }
  mc.arguments=args;
  this.value=mc;
}
 else {
  ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition());
  amc.instance=this.value;
  amc.arguments=args;
  this.value=amc;
}
this.mode=PARAMETERS_END;
return;
}
}
if (this.isInMode(ACCESS_2)) {
if (ParserUtil.isIdentifier(type)) {
Name name=token.nameValue();
if (this.prefix) {
  this.field.setValue(this.value);
  pm.popParser(true);
  return;
}
if (this.dotless && this.operator != null) {
  Operator operator=pm.getOperator(name);
  int p=this.operator.precedence;
  if (p > operator.precedence) {
    this.field.setValue(this.value);
    pm.popParser(true);
    return;
  }
  if (p == operator.precedence) {
switch (operator.type) {
case Operator.INFIX_LEFT:
      this.field.setValue(this.value);
    pm.popParser(true);
  return;
case Operator.INFIX_NONE:
throw new SyntaxError(token,"String_Node_Str" + name + "String_Node_Str");
case Operator.INFIX_RIGHT:
}
}
}
this.getAccess(pm,name,token,type);
return;
}
if (ParserUtil.isTerminator(type)) {
this.field.setValue(this.value);
pm.popParser(true);
return;
}
IToken prev=token.prev();
if (ParserUtil.isIdentifier(prev.type())) {
this.value=null;
pm.reparse();
this.getAccess(pm,prev.nameValue(),prev,type);
return;
}
if (this.value != null) {
ApplyMethodCall call=new ApplyMethodCall(token.raw());
call.instance=this.value;
SingleArgument sa=new SingleArgument();
call.arguments=sa;
this.value=call;
this.mode=0;
pm.pushParser(new ExpressionParser(sa),true);
return;
}
throw new SyntaxError(token,"String_Node_Str" + token);
}
if (this.isInMode(CONSTRUCTOR)) {
ConstructorCall cc=(ConstructorCall)this.value;
if (type == Symbols.OPEN_CURLY_BRACKET) {
ClassConstructor cc2=cc.toClassConstructor();
pm.pushParser(new ClassBodyParser(cc2.getNestedClass()));
this.mode=LIST_END;
this.value=cc2;
return;
}
if (type == Symbols.OPEN_PARENTHESIS) {
ArgumentList list=new ArgumentList();
cc.arguments=list;
pm.pushParser(new ExpressionListParser(list));
this.mode=CONSTRUCTOR_END;
return;
}
SingleArgument sa=new SingleArgument();
cc.arguments=sa;
pm.pushParser(new ExpressionParser(sa),true);
this.mode=0;
return;
}
if (this.value != null) {
this.value.expandPosition(token);
this.field.setValue(this.value);
pm.popParser(true);
return;
}
throw new SyntaxError(token,"String_Node_Str" + token);
}