use of org.antlr.runtime.EarlyExitException in project freud by LMAX-Exchange.
the class JavaParser method qualifiedIdentExpression.
// $ANTLR start "qualifiedIdentExpression"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1104:1: qualifiedIdentExpression : ( qualifiedIdentifier -> qualifiedIdentifier ) ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )? ;
public final JavaParser.qualifiedIdentExpression_return qualifiedIdentExpression() throws RecognitionException {
JavaParser.qualifiedIdentExpression_return retval = new JavaParser.qualifiedIdentExpression_return();
retval.start = input.LT(1);
int qualifiedIdentExpression_StartIndex = input.index();
CommonTree root_0 = null;
Token outerDot = null;
Token Super = null;
Token innerDot = null;
Token DOT495 = null;
Token CLASS496 = null;
Token CLASS498 = null;
Token SUPER501 = null;
Token IDENT502 = null;
Token IDENT504 = null;
Token THIS506 = null;
JavaParser.qualifiedIdentifier_return qualifiedIdentifier493 = null;
JavaParser.arrayDeclarator_return arrayDeclarator494 = null;
JavaParser.arguments_return arguments497 = null;
JavaParser.genericTypeArgumentListSimplified_return genericTypeArgumentListSimplified499 = null;
JavaParser.arguments_return arguments500 = null;
JavaParser.arguments_return arguments503 = null;
JavaParser.arguments_return arguments505 = null;
JavaParser.arguments_return arguments507 = null;
JavaParser.innerNewExpression_return innerNewExpression508 = null;
CommonTree outerDot_tree = null;
CommonTree Super_tree = null;
CommonTree innerDot_tree = null;
CommonTree DOT495_tree = null;
CommonTree CLASS496_tree = null;
CommonTree CLASS498_tree = null;
CommonTree SUPER501_tree = null;
CommonTree IDENT502_tree = null;
CommonTree IDENT504_tree = null;
CommonTree THIS506_tree = null;
RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
RewriteRuleTokenStream stream_CLASS = new RewriteRuleTokenStream(adaptor, "token CLASS");
RewriteRuleTokenStream stream_SUPER = new RewriteRuleTokenStream(adaptor, "token SUPER");
RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor, "token DOT");
RewriteRuleTokenStream stream_THIS = new RewriteRuleTokenStream(adaptor, "token THIS");
RewriteRuleSubtreeStream stream_arrayDeclarator = new RewriteRuleSubtreeStream(adaptor, "rule arrayDeclarator");
RewriteRuleSubtreeStream stream_arguments = new RewriteRuleSubtreeStream(adaptor, "rule arguments");
RewriteRuleSubtreeStream stream_qualifiedIdentifier = new RewriteRuleSubtreeStream(adaptor, "rule qualifiedIdentifier");
RewriteRuleSubtreeStream stream_genericTypeArgumentListSimplified = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeArgumentListSimplified");
RewriteRuleSubtreeStream stream_innerNewExpression = new RewriteRuleSubtreeStream(adaptor, "rule innerNewExpression");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 106)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:5: ( ( qualifiedIdentifier -> qualifiedIdentifier ) ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )? )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:9: ( qualifiedIdentifier -> qualifiedIdentifier ) ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )?
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:9: ( qualifiedIdentifier -> qualifiedIdentifier )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:13: qualifiedIdentifier
{
pushFollow(FOLLOW_qualifiedIdentifier_in_qualifiedIdentExpression13286);
qualifiedIdentifier493 = qualifiedIdentifier();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_qualifiedIdentifier.add(qualifiedIdentifier493.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1106:61: -> qualifiedIdentifier
{
adaptor.addChild(root_0, stream_qualifiedIdentifier.nextTree());
}
retval.tree = root_0;
}
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:9: ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )?
int alt144 = 4;
alt144 = dfa144.predict(input);
switch(alt144) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:13: ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:13: ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+
int cnt141 = 0;
loop141: do {
int alt141 = 2;
int LA141_0 = input.LA(1);
if ((LA141_0 == LBRACK)) {
alt141 = 1;
}
switch(alt141) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:17: arrayDeclarator
{
pushFollow(FOLLOW_arrayDeclarator_in_qualifiedIdentExpression13356);
arrayDeclarator494 = arrayDeclarator();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_arrayDeclarator.add(arrayDeclarator494.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1109:57: -> ^( arrayDeclarator $qualifiedIdentExpression)
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:61: ^( arrayDeclarator $qualifiedIdentExpression)
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_arrayDeclarator.nextNode(), root_1);
adaptor.addChild(root_1, stream_retval.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
default:
if (cnt141 >= 1) {
break loop141;
}
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
EarlyExitException eee = new EarlyExitException(141, input);
throw eee;
}
cnt141++;
} while (true);
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1111:13: ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1111:17: DOT CLASS
{
DOT495 = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentExpression13423);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_DOT.add(DOT495);
}
CLASS496 = (Token) match(input, CLASS, FOLLOW_CLASS_in_qualifiedIdentExpression13425);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_CLASS.add(CLASS496);
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1111:57: -> ^( DOT $qualifiedIdentExpression CLASS )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1111:61: ^( DOT $qualifiedIdentExpression CLASS )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
adaptor.addChild(root_1, stream_retval.nextTree());
adaptor.addChild(root_1, stream_CLASS.nextNode());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
}
break;
case 2:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1113:13: arguments
{
pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13495);
arguments497 = arguments();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_arguments.add(arguments497.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1113:57: -> ^( METHOD_CALL qualifiedIdentifier arguments )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1113:61: ^( METHOD_CALL qualifiedIdentifier arguments )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(METHOD_CALL, "METHOD_CALL"), root_1);
adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_1, stream_arguments.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 3:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1114:13: outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) )
{
outerDot = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentExpression13556);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_DOT.add(outerDot);
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1115:13: ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) )
int alt143 = 5;
switch(input.LA(1)) {
case CLASS:
{
alt143 = 1;
}
break;
case LESS_THAN:
{
alt143 = 2;
}
break;
case THIS:
{
alt143 = 3;
}
break;
case SUPER:
{
alt143 = 4;
}
break;
case NEW:
{
alt143 = 5;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
NoViableAltException nvae = new NoViableAltException("", 143, 0, input);
throw nvae;
}
switch(alt143) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1115:17: CLASS
{
CLASS498 = (Token) match(input, CLASS, FOLLOW_CLASS_in_qualifiedIdentExpression13574);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_CLASS.add(CLASS498);
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1115:57: -> ^( DOT qualifiedIdentifier CLASS )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1115:61: ^( DOT qualifiedIdentifier CLASS )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_1, stream_CLASS.nextNode());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1116:17: genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) )
{
pushFollow(FOLLOW_genericTypeArgumentListSimplified_in_qualifiedIdentExpression13637);
genericTypeArgumentListSimplified499 = genericTypeArgumentListSimplified();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_genericTypeArgumentListSimplified.add(genericTypeArgumentListSimplified499.getTree());
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1117:17: (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) )
int alt142 = 3;
int LA142_0 = input.LA(1);
if ((LA142_0 == SUPER)) {
int LA142_1 = input.LA(2);
if ((LA142_1 == DOT)) {
alt142 = 2;
} else if ((LA142_1 == LPAREN)) {
alt142 = 1;
} else {
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
NoViableAltException nvae = new NoViableAltException("", 142, 1, input);
throw nvae;
}
} else if ((LA142_0 == IDENT)) {
alt142 = 3;
} else {
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
NoViableAltException nvae = new NoViableAltException("", 142, 0, input);
throw nvae;
}
switch(alt142) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1117:21: Super= SUPER arguments
{
Super = (Token) match(input, SUPER, FOLLOW_SUPER_in_qualifiedIdentExpression13661);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_SUPER.add(Super);
}
pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13663);
arguments500 = arguments();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_arguments.add(arguments500.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1117:57: -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1117:61: ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(SUPER_CONSTRUCTOR_CALL, Super, "SUPER_CONSTRUCTOR_CALL"), root_1);
adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
adaptor.addChild(root_1, stream_arguments.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:21: SUPER innerDot= DOT IDENT arguments
{
SUPER501 = (Token) match(input, SUPER, FOLLOW_SUPER_in_qualifiedIdentExpression13713);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_SUPER.add(SUPER501);
}
innerDot = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentExpression13717);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_DOT.add(innerDot);
}
IDENT502 = (Token) match(input, IDENT, FOLLOW_IDENT_in_qualifiedIdentExpression13719);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_IDENT.add(IDENT502);
}
pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13721);
arguments503 = arguments();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_arguments.add(arguments503.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleTokenStream stream_outerDot = new RewriteRuleTokenStream(adaptor, "token outerDot", outerDot);
RewriteRuleTokenStream stream_innerDot = new RewriteRuleTokenStream(adaptor, "token innerDot", innerDot);
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1118:57: -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:61: ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(METHOD_CALL, "METHOD_CALL"), root_1);
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:75: ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT )
{
CommonTree root_2 = (CommonTree) adaptor.nil();
root_2 = (CommonTree) adaptor.becomeRoot(stream_innerDot.nextNode(), root_2);
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:87: ^( $outerDot qualifiedIdentifier SUPER )
{
CommonTree root_3 = (CommonTree) adaptor.nil();
root_3 = (CommonTree) adaptor.becomeRoot(stream_outerDot.nextNode(), root_3);
adaptor.addChild(root_3, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_3, stream_SUPER.nextNode());
adaptor.addChild(root_2, root_3);
}
adaptor.addChild(root_2, stream_IDENT.nextNode());
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
adaptor.addChild(root_1, stream_arguments.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 3:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1119:21: IDENT arguments
{
IDENT504 = (Token) match(input, IDENT, FOLLOW_IDENT_in_qualifiedIdentExpression13771);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_IDENT.add(IDENT504);
}
pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13773);
arguments505 = arguments();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_arguments.add(arguments505.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1119:57: -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1119:61: ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(METHOD_CALL, "METHOD_CALL"), root_1);
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1119:75: ^( DOT qualifiedIdentifier IDENT )
{
CommonTree root_2 = (CommonTree) adaptor.nil();
root_2 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_2);
adaptor.addChild(root_2, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_2, stream_IDENT.nextNode());
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
adaptor.addChild(root_1, stream_arguments.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
}
}
break;
case 3:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1121:17: THIS
{
THIS506 = (Token) match(input, THIS, FOLLOW_THIS_in_qualifiedIdentExpression13848);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_THIS.add(THIS506);
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1121:57: -> ^( DOT qualifiedIdentifier THIS )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1121:61: ^( DOT qualifiedIdentifier THIS )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_1, stream_THIS.nextNode());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 4:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1122:17: Super= SUPER arguments
{
Super = (Token) match(input, SUPER, FOLLOW_SUPER_in_qualifiedIdentExpression13914);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_SUPER.add(Super);
}
pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13916);
arguments507 = arguments();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_arguments.add(arguments507.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1122:57: -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1122:61: ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(SUPER_CONSTRUCTOR_CALL, Super, "SUPER_CONSTRUCTOR_CALL"), root_1);
adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_1, stream_arguments.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 5:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1123:17: innerNewExpression
{
pushFollow(FOLLOW_innerNewExpression_in_qualifiedIdentExpression13964);
innerNewExpression508 = innerNewExpression();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_innerNewExpression.add(innerNewExpression508.getTree());
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 1123:57: -> ^( DOT qualifiedIdentifier innerNewExpression )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1123:61: ^( DOT qualifiedIdentifier innerNewExpression )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
adaptor.addChild(root_1, stream_innerNewExpression.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
}
}
break;
}
}
retval.stop = input.LT(-1);
if (state.backtracking == 0) {
retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
} catch (RecognitionException re) {
reportError(re);
recover(input, re);
retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
} finally {
if (state.backtracking > 0) {
memoize(input, 106, qualifiedIdentExpression_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.EarlyExitException in project freud by LMAX-Exchange.
the class JavaParser method catches.
// $ANTLR start "catches"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:871:1: catches : ( catchClause )+ -> ^( CATCH_CLAUSE_LIST ( catchClause )+ ) ;
public final JavaParser.catches_return catches() throws RecognitionException {
JavaParser.catches_return retval = new JavaParser.catches_return();
retval.start = input.LT(1);
int catches_StartIndex = input.index();
CommonTree root_0 = null;
JavaParser.catchClause_return catchClause338 = null;
RewriteRuleSubtreeStream stream_catchClause = new RewriteRuleSubtreeStream(adaptor, "rule catchClause");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 76)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:872:5: ( ( catchClause )+ -> ^( CATCH_CLAUSE_LIST ( catchClause )+ ) )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:872:9: ( catchClause )+
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:872:9: ( catchClause )+
int cnt99 = 0;
loop99: do {
int alt99 = 2;
int LA99_0 = input.LA(1);
if ((LA99_0 == CATCH)) {
alt99 = 1;
}
switch(alt99) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: catchClause
{
pushFollow(FOLLOW_catchClause_in_catches9734);
catchClause338 = catchClause();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_catchClause.add(catchClause338.getTree());
}
}
break;
default:
if (cnt99 >= 1) {
break loop99;
}
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
EarlyExitException eee = new EarlyExitException(99, input);
throw eee;
}
cnt99++;
} while (true);
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 873:9: -> ^( CATCH_CLAUSE_LIST ( catchClause )+ )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:873:13: ^( CATCH_CLAUSE_LIST ( catchClause )+ )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(CATCH_CLAUSE_LIST, "CATCH_CLAUSE_LIST"), root_1);
if (!(stream_catchClause.hasNext())) {
throw new RewriteEarlyExitException();
}
while (stream_catchClause.hasNext()) {
adaptor.addChild(root_1, stream_catchClause.nextTree());
}
stream_catchClause.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if (state.backtracking == 0) {
retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
} catch (RecognitionException re) {
reportError(re);
recover(input, re);
retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
} finally {
if (state.backtracking > 0) {
memoize(input, 76, catches_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.EarlyExitException in project freud by LMAX-Exchange.
the class CssParser method stylesheet.
// $ANTLR start "stylesheet"
// /home/langera/dev/freud/src/grammar/Css.g:40:1: stylesheet : ( importRule )* ( nested | ruleset )+ ;
public final CssParser.stylesheet_return stylesheet() throws RecognitionException {
CssParser.stylesheet_return retval = new CssParser.stylesheet_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CssParser.importRule_return importRule1 = null;
CssParser.nested_return nested2 = null;
CssParser.ruleset_return ruleset3 = null;
try {
// /home/langera/dev/freud/src/grammar/Css.g:41:2: ( ( importRule )* ( nested | ruleset )+ )
// /home/langera/dev/freud/src/grammar/Css.g:41:4: ( importRule )* ( nested | ruleset )+
{
root_0 = (CommonTree) adaptor.nil();
// /home/langera/dev/freud/src/grammar/Css.g:41:4: ( importRule )*
loop1: do {
int alt1 = 2;
int LA1_0 = input.LA(1);
if (((LA1_0 >= 26 && LA1_0 <= 27))) {
alt1 = 1;
}
switch(alt1) {
case 1:
// /home/langera/dev/freud/src/grammar/Css.g:41:4: importRule
{
pushFollow(FOLLOW_importRule_in_stylesheet131);
importRule1 = importRule();
state._fsp--;
adaptor.addChild(root_0, importRule1.getTree());
}
break;
default:
break loop1;
}
} while (true);
// /home/langera/dev/freud/src/grammar/Css.g:41:16: ( nested | ruleset )+
int cnt2 = 0;
loop2: do {
int alt2 = 3;
int LA2_0 = input.LA(1);
if ((LA2_0 == 28)) {
alt2 = 1;
} else if ((LA2_0 == IDENT || (LA2_0 >= 35 && LA2_0 <= 37))) {
alt2 = 2;
}
switch(alt2) {
case 1:
// /home/langera/dev/freud/src/grammar/Css.g:41:17: nested
{
pushFollow(FOLLOW_nested_in_stylesheet135);
nested2 = nested();
state._fsp--;
adaptor.addChild(root_0, nested2.getTree());
}
break;
case 2:
// /home/langera/dev/freud/src/grammar/Css.g:41:26: ruleset
{
pushFollow(FOLLOW_ruleset_in_stylesheet139);
ruleset3 = ruleset();
state._fsp--;
adaptor.addChild(root_0, ruleset3.getTree());
}
break;
default:
if (cnt2 >= 1) {
break loop2;
}
EarlyExitException eee = new EarlyExitException(2, input);
throw eee;
}
cnt2++;
} while (true);
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
} catch (RecognitionException re) {
reportError(re);
recover(input, re);
retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
} finally {
}
return retval;
}
use of org.antlr.runtime.EarlyExitException in project freud by LMAX-Exchange.
the class CssLexer method mWS.
// $ANTLR end "COMMENT"
// $ANTLR start "WS"
public final void mWS() throws RecognitionException {
try {
int _type = WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /home/langera/dev/freud/src/grammar/Css.g:146:4: ( ( ' ' | '\\t' | '\\r' | '\\n' | '\\f' )+ )
// /home/langera/dev/freud/src/grammar/Css.g:146:6: ( ' ' | '\\t' | '\\r' | '\\n' | '\\f' )+
{
// /home/langera/dev/freud/src/grammar/Css.g:146:6: ( ' ' | '\\t' | '\\r' | '\\n' | '\\f' )+
int cnt6 = 0;
loop6: do {
int alt6 = 2;
int LA6_0 = input.LA(1);
if (((LA6_0 >= '\t' && LA6_0 <= '\n') || (LA6_0 >= '\f' && LA6_0 <= '\r') || LA6_0 == ' ')) {
alt6 = 1;
}
switch(alt6) {
case 1:
// /home/langera/dev/freud/src/grammar/Css.g:
{
if ((input.LA(1) >= '\t' && input.LA(1) <= '\n') || (input.LA(1) >= '\f' && input.LA(1) <= '\r') || input.LA(1) == ' ') {
input.consume();
} else {
MismatchedSetException mse = new MismatchedSetException(null, input);
recover(mse);
throw mse;
}
}
break;
default:
if (cnt6 >= 1) {
break loop6;
}
EarlyExitException eee = new EarlyExitException(6, input);
throw eee;
}
cnt6++;
} while (true);
_channel = HIDDEN;
}
state.type = _type;
state.channel = _channel;
} finally {
}
}
use of org.antlr.runtime.EarlyExitException in project freud by LMAX-Exchange.
the class JavaLexer method mEXPONENT.
// $ANTLR end "FLOATING_POINT_LITERAL"
// $ANTLR start "EXPONENT"
public final void mEXPONENT() throws RecognitionException {
try {
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
{
if (input.LA(1) == 'E' || input.LA(1) == 'e') {
input.consume();
} else {
MismatchedSetException mse = new MismatchedSetException(null, input);
recover(mse);
throw mse;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:22: ( '+' | '-' )?
int alt18 = 2;
int LA18_0 = input.LA(1);
if ((LA18_0 == '+' || LA18_0 == '-')) {
alt18 = 1;
}
switch(alt18) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:
{
if (input.LA(1) == '+' || input.LA(1) == '-') {
input.consume();
} else {
MismatchedSetException mse = new MismatchedSetException(null, input);
recover(mse);
throw mse;
}
}
break;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:33: ( '0' .. '9' )+
int cnt19 = 0;
loop19: do {
int alt19 = 2;
int LA19_0 = input.LA(1);
if (((LA19_0 >= '0' && LA19_0 <= '9'))) {
alt19 = 1;
}
switch(alt19) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:34: '0' .. '9'
{
matchRange('0', '9');
}
break;
default:
if (cnt19 >= 1) {
break loop19;
}
EarlyExitException eee = new EarlyExitException(19, input);
throw eee;
}
cnt19++;
} while (true);
}
} finally {
}
}
Aggregations