Program: 84337
Project: 84337
Buggy source:
@Override public void parse(IParserManager pm,IToken token){
  if (this.mode == END) {
    if (this.value != null) {
      this.valueConsumer.setValue(this.value);
    }
    pm.popParser(true);
    return;
  }
  int type=token.type();
switch (type) {
case Tokens.EOF:
case BaseSymbols.SEMICOLON:
case BaseSymbols.COLON:
case BaseSymbols.COMMA:
case Tokens.STRING_PART:
case Tokens.STRING_END:
    if (this.value != null) {
      this.valueConsumer.setValue(this.value);
    }
  pm.popParser(true);
return;
}
switch (this.mode) {
case VALUE:
switch (type) {
case Tokens.STRING:
this.value=new StringValue(token.raw(),token.stringValue());
this.mode=ACCESS;
return;
case Tokens.STRING_START:
{
StringInterpolation ssv=new StringInterpolation(token);
this.value=ssv;
this.mode=ACCESS;
pm.pushParser(new StingInterpolationParser(ssv),true);
return;
}
case Tokens.SINGLE_QUOTED_STRING:
this.value=new CharValue(token.raw(),token.stringValue());
this.mode=ACCESS;
return;
case Tokens.INT:
this.value=new IntValue(token.raw(),token.intValue());
this.mode=ACCESS;
return;
case Tokens.LONG:
this.value=new LongValue(token.raw(),token.longValue());
this.mode=ACCESS;
return;
case Tokens.FLOAT:
this.value=new FloatValue(token.raw(),token.floatValue());
this.mode=ACCESS;
return;
case Tokens.DOUBLE:
this.value=new DoubleValue(token.raw(),token.doubleValue());
this.mode=ACCESS;
return;
case DyvilSymbols.ELLIPSIS:
this.value=new WildcardValue(token.raw());
this.mode=ACCESS;
return;
case DyvilSymbols.WILDCARD:
return;
case BaseSymbols.OPEN_PARENTHESIS:
IToken next=token.next();
if (next.type() == BaseSymbols.CLOSE_PARENTHESIS) {
if (next.next().type() == DyvilSymbols.ARROW_OPERATOR) {
LambdaExpression le=new LambdaExpression(next.next().raw());
this.value=le;
pm.skip(2);
pm.pushParser(pm.newExpressionParser(le));
this.mode=ACCESS;
return;
}
this.value=new VoidValue(token.to(token.next()));
pm.skip();
this.mode=ACCESS;
return;
}
pm.pushParser(new LambdaOrTupleParser(this),true);
this.mode=ACCESS;
return;
case BaseSymbols.OPEN_SQUARE_BRACKET:
this.mode=ACCESS;
pm.pushParser(new ArrayLiteralParser(this),true);
return;
case BaseSymbols.OPEN_CURLY_BRACKET:
this.mode=END;
pm.pushParser(new StatementListParser(this),true);
return;
case DyvilSymbols.AT:
if (token.next().type() == BaseSymbols.OPEN_CURLY_BRACKET) {
Bytecode bc=new Bytecode(token);
pm.skip();
pm.pushParser(new BytecodeParser(bc));
this.mode=BYTECODE_END;
this.value=bc;
return;
}
Annotation a=new Annotation();
pm.pushParser(new AnnotationParser(a));
this.value=new AnnotationValue(a);
this.mode=0;
return;
case DyvilSymbols.ARROW_OPERATOR:
LambdaExpression le=new LambdaExpression(token.raw());
this.value=le;
this.mode=ACCESS;
pm.pushParser(pm.newExpressionParser(le));
return;
}
if ((type & Tokens.IDENTIFIER) != 0) {
Name name=token.nameValue();
this.parseAccess(pm,token,type,name,pm.getOperator(name));
return;
}
if (this.parseKeyword(pm,token,type)) {
return;
}
this.mode=ACCESS;
break;
case PATTERN_IF:
this.mode=PATTERN_END;
if (type == DyvilKeywords.IF) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setCondition(v)));
return;
}
case PATTERN_END:
if (type == BaseSymbols.COLON || type == DyvilSymbols.ARROW_OPERATOR) {
this.mode=END;
if (token.next().type() != DyvilKeywords.CASE) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setAction(v)));
}
return;
}
pm.report(token,"String_Node_Str");
return;
case ANONYMOUS_CLASS_END:
this.value.expandPosition(token);
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_CURLY_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERS_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type != BaseSymbols.CLOSE_PARENTHESIS) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case SUBSCRIPT_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case CONSTRUCTOR:
{
ConstructorCall cc=(ConstructorCall)this.value;
if (type == BaseSymbols.OPEN_CURLY_BRACKET) {
this.parseBody(pm,cc.toClassConstructor());
return;
}
this.mode=CONSTRUCTOR_PARAMETERS;
pm.reparse();
return;
}
case CONSTRUCTOR_PARAMETERS:
{
ICall icall=(ICall)this.value;
if (type == BaseSymbols.OPEN_PARENTHESIS) {
IArguments arguments=this.parseArguments(pm,token.next());
icall.setArguments(arguments);
this.mode=CONSTRUCTOR_END;
return;
}
if (ParserUtil.isExpressionTerminator(type)) {
this.mode=ACCESS;
pm.reparse();
return;
}
SingleArgument sa=new SingleArgument();
icall.setArguments(sa);
ExpressionParser ep=(ExpressionParser)pm.newExpressionParser(sa);
ep.operator=Operators.DEFAULT;
pm.pushParser(ep,true);
this.mode=END;
return;
}
case CONSTRUCTOR_END:
if (type != BaseSymbols.CLOSE_PARENTHESIS) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
this.value.expandPosition(token);
this.mode=ACCESS;
if (token.next().type() == BaseSymbols.OPEN_CURLY_BRACKET) {
pm.skip();
this.parseBody(pm,((ConstructorCall)this.value).toClassConstructor());
return;
}
return;
case BYTECODE_END:
this.valueConsumer.setValue(this.value);
pm.popParser();
this.value.expandPosition(token);
if (type != BaseSymbols.CLOSE_CURLY_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case TYPE_ARGUMENTS_END:
MethodCall mc=(MethodCall)this.value;
IToken next=token.next();
if (next.type() == BaseSymbols.OPEN_PARENTHESIS) {
pm.skip();
mc.setArguments(this.parseArguments(pm,next.next()));
}
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERIZED_THIS_END:
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERIZED_SUPER_END:
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
}
if (ParserUtil.isCloseBracket(type)) {
if (this.value != null) {
this.valueConsumer.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.mode == ACCESS) {
if (type == BaseSymbols.DOT) {
this.mode=DOT_ACCESS;
this.explicitDot=true;
return;
}
this.explicitDot=false;
switch (type) {
case DyvilKeywords.ELSE:
this.valueConsumer.setValue(this.value);
pm.popParser(true);
return;
case BaseSymbols.EQUALS:
this.parseAssignment(pm,token);
return;
case DyvilKeywords.AS:
CastOperator co=new CastOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(co));
this.value=co;
return;
case DyvilKeywords.IS:
InstanceOfOperator io=new InstanceOfOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(io));
this.value=io;
return;
case DyvilKeywords.MATCH:
MatchExpression me=new MatchExpression(token.raw(),this.value);
pm.pushParser(new MatchExpressionParser(me));
this.value=me;
return;
case BaseSymbols.OPEN_SQUARE_BRACKET:
SubscriptGetter getter=new SubscriptGetter(token,this.value);
this.value=getter;
this.mode=SUBSCRIPT_END;
pm.pushParser(new ExpressionListParser(getter.getArguments()));
return;
case BaseSymbols.OPEN_PARENTHESIS:
ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition(),this.value,this.parseArguments(pm,token.next()));
this.value=amc;
this.mode=PARAMETERS_END;
return;
}
if (ParserUtil.isIdentifier(type)) {
this.parseIdentifierAccess(pm,token,type);
return;
}
if (this.value != null && type != 0) {
if (this.operator != null) {
this.valueConsumer.setValue(this.value);
pm.popParser(true);
return;
}
SingleArgument sa=new SingleArgument();
ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition(),this.value,sa);
this.parseApply(pm,token,sa,Operators.DEFAULT);
pm.reparse();
this.value=amc;
return;
}
}
if (this.mode == DOT_ACCESS) {
if (ParserUtil.isIdentifier(type)) {
this.parseIdentifierAccess(pm,token,type);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token){
  if (this.mode == END) {
    if (this.value != null) {
      this.valueConsumer.setValue(this.value);
    }
    pm.popParser(true);
    return;
  }
  int type=token.type();
switch (type) {
case Tokens.EOF:
case BaseSymbols.SEMICOLON:
case BaseSymbols.COLON:
case BaseSymbols.COMMA:
case Tokens.STRING_PART:
case Tokens.STRING_END:
    if (this.value != null) {
      this.valueConsumer.setValue(this.value);
    }
  pm.popParser(true);
return;
}
switch (this.mode) {
case VALUE:
switch (type) {
case Tokens.STRING:
this.value=new StringValue(token.raw(),token.stringValue());
this.mode=ACCESS;
return;
case Tokens.STRING_START:
{
StringInterpolation ssv=new StringInterpolation(token);
this.value=ssv;
this.mode=ACCESS;
pm.pushParser(new StingInterpolationParser(ssv),true);
return;
}
case Tokens.SINGLE_QUOTED_STRING:
this.value=new CharValue(token.raw(),token.stringValue());
this.mode=ACCESS;
return;
case Tokens.INT:
this.value=new IntValue(token.raw(),token.intValue());
this.mode=ACCESS;
return;
case Tokens.LONG:
this.value=new LongValue(token.raw(),token.longValue());
this.mode=ACCESS;
return;
case Tokens.FLOAT:
this.value=new FloatValue(token.raw(),token.floatValue());
this.mode=ACCESS;
return;
case Tokens.DOUBLE:
this.value=new DoubleValue(token.raw(),token.doubleValue());
this.mode=ACCESS;
return;
case DyvilSymbols.ELLIPSIS:
this.value=new WildcardValue(token.raw());
this.mode=ACCESS;
return;
case DyvilSymbols.WILDCARD:
return;
case BaseSymbols.OPEN_PARENTHESIS:
IToken next=token.next();
if (next.type() == BaseSymbols.CLOSE_PARENTHESIS) {
if (next.next().type() == DyvilSymbols.ARROW_OPERATOR) {
LambdaExpression le=new LambdaExpression(next.next().raw());
this.value=le;
pm.skip(2);
pm.pushParser(pm.newExpressionParser(le));
this.mode=ACCESS;
return;
}
this.value=new VoidValue(token.to(token.next()));
pm.skip();
this.mode=ACCESS;
return;
}
pm.pushParser(new LambdaOrTupleParser(this),true);
this.mode=ACCESS;
return;
case BaseSymbols.OPEN_SQUARE_BRACKET:
this.mode=ACCESS;
pm.pushParser(new ArrayLiteralParser(this),true);
return;
case BaseSymbols.OPEN_CURLY_BRACKET:
this.mode=END;
pm.pushParser(new StatementListParser(this),true);
return;
case DyvilSymbols.AT:
if (token.next().type() == BaseSymbols.OPEN_CURLY_BRACKET) {
Bytecode bc=new Bytecode(token);
pm.skip();
pm.pushParser(new BytecodeParser(bc));
this.mode=BYTECODE_END;
this.value=bc;
return;
}
Annotation a=new Annotation();
pm.pushParser(new AnnotationParser(a));
this.value=new AnnotationValue(a);
this.mode=END;
return;
case DyvilSymbols.ARROW_OPERATOR:
LambdaExpression le=new LambdaExpression(token.raw());
this.value=le;
this.mode=ACCESS;
pm.pushParser(pm.newExpressionParser(le));
return;
}
if ((type & Tokens.IDENTIFIER) != 0) {
Name name=token.nameValue();
this.parseAccess(pm,token,type,name,pm.getOperator(name));
return;
}
if (this.parseKeyword(pm,token,type)) {
return;
}
this.mode=ACCESS;
break;
case PATTERN_IF:
this.mode=PATTERN_END;
if (type == DyvilKeywords.IF) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setCondition(v)));
return;
}
case PATTERN_END:
if (type == BaseSymbols.COLON || type == DyvilSymbols.ARROW_OPERATOR) {
this.mode=END;
if (token.next().type() != DyvilKeywords.CASE) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setAction(v)));
}
return;
}
pm.report(token,"String_Node_Str");
return;
case ANONYMOUS_CLASS_END:
this.value.expandPosition(token);
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_CURLY_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERS_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type != BaseSymbols.CLOSE_PARENTHESIS) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case SUBSCRIPT_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case CONSTRUCTOR:
{
ConstructorCall cc=(ConstructorCall)this.value;
if (type == BaseSymbols.OPEN_CURLY_BRACKET) {
this.parseBody(pm,cc.toClassConstructor());
return;
}
this.mode=CONSTRUCTOR_PARAMETERS;
pm.reparse();
return;
}
case CONSTRUCTOR_PARAMETERS:
{
ICall icall=(ICall)this.value;
if (type == BaseSymbols.OPEN_PARENTHESIS) {
IArguments arguments=this.parseArguments(pm,token.next());
icall.setArguments(arguments);
this.mode=CONSTRUCTOR_END;
return;
}
if (ParserUtil.isExpressionTerminator(type)) {
this.mode=ACCESS;
pm.reparse();
return;
}
SingleArgument sa=new SingleArgument();
icall.setArguments(sa);
ExpressionParser ep=(ExpressionParser)pm.newExpressionParser(sa);
ep.operator=Operators.DEFAULT;
pm.pushParser(ep,true);
this.mode=END;
return;
}
case CONSTRUCTOR_END:
if (type != BaseSymbols.CLOSE_PARENTHESIS) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
this.value.expandPosition(token);
this.mode=ACCESS;
if (token.next().type() == BaseSymbols.OPEN_CURLY_BRACKET) {
pm.skip();
this.parseBody(pm,((ConstructorCall)this.value).toClassConstructor());
return;
}
return;
case BYTECODE_END:
this.valueConsumer.setValue(this.value);
pm.popParser();
this.value.expandPosition(token);
if (type != BaseSymbols.CLOSE_CURLY_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case TYPE_ARGUMENTS_END:
MethodCall mc=(MethodCall)this.value;
IToken next=token.next();
if (next.type() == BaseSymbols.OPEN_PARENTHESIS) {
pm.skip();
mc.setArguments(this.parseArguments(pm,next.next()));
}
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERIZED_THIS_END:
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERIZED_SUPER_END:
this.mode=ACCESS;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
}
if (ParserUtil.isCloseBracket(type)) {
if (this.value != null) {
this.valueConsumer.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.mode == ACCESS) {
if (type == BaseSymbols.DOT) {
this.mode=DOT_ACCESS;
this.explicitDot=true;
return;
}
this.explicitDot=false;
switch (type) {
case DyvilKeywords.ELSE:
this.valueConsumer.setValue(this.value);
pm.popParser(true);
return;
case BaseSymbols.EQUALS:
this.parseAssignment(pm,token);
return;
case DyvilKeywords.AS:
CastOperator co=new CastOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(co));
this.value=co;
return;
case DyvilKeywords.IS:
InstanceOfOperator io=new InstanceOfOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(io));
this.value=io;
return;
case DyvilKeywords.MATCH:
MatchExpression me=new MatchExpression(token.raw(),this.value);
pm.pushParser(new MatchExpressionParser(me));
this.value=me;
return;
case BaseSymbols.OPEN_SQUARE_BRACKET:
SubscriptGetter getter=new SubscriptGetter(token,this.value);
this.value=getter;
this.mode=SUBSCRIPT_END;
pm.pushParser(new ExpressionListParser(getter.getArguments()));
return;
case BaseSymbols.OPEN_PARENTHESIS:
ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition(),this.value,this.parseArguments(pm,token.next()));
this.value=amc;
this.mode=PARAMETERS_END;
return;
}
if (ParserUtil.isIdentifier(type)) {
this.parseIdentifierAccess(pm,token,type);
return;
}
if (this.value != null && type != 0) {
if (this.operator != null) {
this.valueConsumer.setValue(this.value);
pm.popParser(true);
return;
}
SingleArgument sa=new SingleArgument();
ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition(),this.value,sa);
this.parseApply(pm,token,sa,Operators.DEFAULT);
pm.reparse();
this.value=amc;
return;
}
}
if (this.mode == DOT_ACCESS) {
if (ParserUtil.isIdentifier(type)) {
this.parseIdentifierAccess(pm,token,type);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}