use of org.antlr.runtime.RecognitionException in project freud by LMAX-Exchange.
the class JavaParser method exclusiveOrExpression.
// $ANTLR start "exclusiveOrExpression"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:968:1: exclusiveOrExpression : andExpression ( XOR andExpression )* ;
public final JavaParser.exclusiveOrExpression_return exclusiveOrExpression() throws RecognitionException {
JavaParser.exclusiveOrExpression_return retval = new JavaParser.exclusiveOrExpression_return();
retval.start = input.LT(1);
int exclusiveOrExpression_StartIndex = input.index();
CommonTree root_0 = null;
Token XOR395 = null;
JavaParser.andExpression_return andExpression394 = null;
JavaParser.andExpression_return andExpression396 = null;
CommonTree XOR395_tree = null;
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 94)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:969:5: ( andExpression ( XOR andExpression )* )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:969:9: andExpression ( XOR andExpression )*
{
root_0 = (CommonTree) adaptor.nil();
pushFollow(FOLLOW_andExpression_in_exclusiveOrExpression10634);
andExpression394 = andExpression();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
adaptor.addChild(root_0, andExpression394.getTree());
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:969:23: ( XOR andExpression )*
loop114: do {
int alt114 = 2;
int LA114_0 = input.LA(1);
if ((LA114_0 == XOR)) {
alt114 = 1;
}
switch(alt114) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:969:24: XOR andExpression
{
XOR395 = (Token) match(input, XOR, FOLLOW_XOR_in_exclusiveOrExpression10637);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
XOR395_tree = (CommonTree) adaptor.create(XOR395);
root_0 = (CommonTree) adaptor.becomeRoot(XOR395_tree, root_0);
}
pushFollow(FOLLOW_andExpression_in_exclusiveOrExpression10640);
andExpression396 = andExpression();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
adaptor.addChild(root_0, andExpression396.getTree());
}
}
break;
default:
break loop114;
}
} while (true);
}
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, 94, exclusiveOrExpression_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.RecognitionException in project freud by LMAX-Exchange.
the class JavaParser method forInit.
// $ANTLR start "forInit"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:902:1: forInit : ( localVariableDeclaration -> ^( FOR_INIT localVariableDeclaration ) | expressionList -> ^( FOR_INIT expressionList ) | -> ^( FOR_INIT ) );
public final JavaParser.forInit_return forInit() throws RecognitionException {
JavaParser.forInit_return retval = new JavaParser.forInit_return();
retval.start = input.LT(1);
int forInit_StartIndex = input.index();
CommonTree root_0 = null;
JavaParser.localVariableDeclaration_return localVariableDeclaration355 = null;
JavaParser.expressionList_return expressionList356 = null;
RewriteRuleSubtreeStream stream_expressionList = new RewriteRuleSubtreeStream(adaptor, "rule expressionList");
RewriteRuleSubtreeStream stream_localVariableDeclaration = new RewriteRuleSubtreeStream(adaptor, "rule localVariableDeclaration");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 83)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:903:5: ( localVariableDeclaration -> ^( FOR_INIT localVariableDeclaration ) | expressionList -> ^( FOR_INIT expressionList ) | -> ^( FOR_INIT ) )
int alt104 = 3;
alt104 = dfa104.predict(input);
switch(alt104) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:903:9: localVariableDeclaration
{
pushFollow(FOLLOW_localVariableDeclaration_in_forInit9964);
localVariableDeclaration355 = localVariableDeclaration();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_localVariableDeclaration.add(localVariableDeclaration355.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();
// 903:37: -> ^( FOR_INIT localVariableDeclaration )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:903:41: ^( FOR_INIT localVariableDeclaration )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(FOR_INIT, "FOR_INIT"), root_1);
adaptor.addChild(root_1, stream_localVariableDeclaration.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:904:9: expressionList
{
pushFollow(FOLLOW_expressionList_in_forInit9986);
expressionList356 = expressionList();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_expressionList.add(expressionList356.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();
// 904:37: -> ^( FOR_INIT expressionList )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:904:41: ^( FOR_INIT expressionList )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(FOR_INIT, "FOR_INIT"), root_1);
adaptor.addChild(root_1, stream_expressionList.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 3:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:905:37:
{
// 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();
// 905:37: -> ^( FOR_INIT )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:905:41: ^( FOR_INIT )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(FOR_INIT, "FOR_INIT"), root_1);
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
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, 83, forInit_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.RecognitionException in project freud by LMAX-Exchange.
the class JavaParser method genericTypeParameter.
// $ANTLR start "genericTypeParameter"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:479:1: genericTypeParameter : IDENT ( bound )? -> ^( IDENT ( bound )? ) ;
public final JavaParser.genericTypeParameter_return genericTypeParameter() throws RecognitionException {
JavaParser.genericTypeParameter_return retval = new JavaParser.genericTypeParameter_return();
retval.start = input.LT(1);
int genericTypeParameter_StartIndex = input.index();
CommonTree root_0 = null;
Token IDENT41 = null;
JavaParser.bound_return bound42 = null;
CommonTree IDENT41_tree = null;
RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
RewriteRuleSubtreeStream stream_bound = new RewriteRuleSubtreeStream(adaptor, "rule bound");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 13)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:480:5: ( IDENT ( bound )? -> ^( IDENT ( bound )? ) )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:480:9: IDENT ( bound )?
{
IDENT41 = (Token) match(input, IDENT, FOLLOW_IDENT_in_genericTypeParameter5108);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_IDENT.add(IDENT41);
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:480:15: ( bound )?
int alt13 = 2;
int LA13_0 = input.LA(1);
if ((LA13_0 == EXTENDS)) {
int LA13_1 = input.LA(2);
if ((LA13_1 == BOOLEAN || LA13_1 == BYTE || LA13_1 == CHAR || LA13_1 == DOUBLE || LA13_1 == FLOAT || (LA13_1 >= INT && LA13_1 <= LONG) || LA13_1 == SHORT)) {
int LA13_3 = input.LA(3);
if ((synpred17_Java())) {
alt13 = 1;
}
} else if ((LA13_1 == IDENT)) {
int LA13_4 = input.LA(3);
if ((synpred17_Java())) {
alt13 = 1;
}
}
}
switch(alt13) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: bound
{
pushFollow(FOLLOW_bound_in_genericTypeParameter5110);
bound42 = bound();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_bound.add(bound42.getTree());
}
}
break;
}
// 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();
// 481:9: -> ^( IDENT ( bound )? )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:481:13: ^( IDENT ( bound )? )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_IDENT.nextNode(), root_1);
// /home/langera/dev/freud/trunk/src/grammar/Java.g:481:21: ( bound )?
if (stream_bound.hasNext()) {
adaptor.addChild(root_1, stream_bound.nextTree());
}
stream_bound.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, 13, genericTypeParameter_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.RecognitionException in project freud by LMAX-Exchange.
the class JavaParser method qualifiedTypeIdentSimplified.
// $ANTLR start "qualifiedTypeIdentSimplified"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:672:1: qualifiedTypeIdentSimplified : typeIdentSimplified ( DOT typeIdentSimplified )* -> ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ ) ;
public final JavaParser.qualifiedTypeIdentSimplified_return qualifiedTypeIdentSimplified() throws RecognitionException {
JavaParser.qualifiedTypeIdentSimplified_return retval = new JavaParser.qualifiedTypeIdentSimplified_return();
retval.start = input.LT(1);
int qualifiedTypeIdentSimplified_StartIndex = input.index();
CommonTree root_0 = null;
Token DOT178 = null;
JavaParser.typeIdentSimplified_return typeIdentSimplified177 = null;
JavaParser.typeIdentSimplified_return typeIdentSimplified179 = null;
CommonTree DOT178_tree = null;
RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor, "token DOT");
RewriteRuleSubtreeStream stream_typeIdentSimplified = new RewriteRuleSubtreeStream(adaptor, "rule typeIdentSimplified");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 46)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:673:5: ( typeIdentSimplified ( DOT typeIdentSimplified )* -> ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ ) )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:673:9: typeIdentSimplified ( DOT typeIdentSimplified )*
{
pushFollow(FOLLOW_typeIdentSimplified_in_qualifiedTypeIdentSimplified7045);
typeIdentSimplified177 = typeIdentSimplified();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_typeIdentSimplified.add(typeIdentSimplified177.getTree());
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:673:29: ( DOT typeIdentSimplified )*
loop63: do {
int alt63 = 2;
int LA63_0 = input.LA(1);
if ((LA63_0 == DOT)) {
alt63 = 1;
}
switch(alt63) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:673:30: DOT typeIdentSimplified
{
DOT178 = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedTypeIdentSimplified7048);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_DOT.add(DOT178);
}
pushFollow(FOLLOW_typeIdentSimplified_in_qualifiedTypeIdentSimplified7050);
typeIdentSimplified179 = typeIdentSimplified();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_typeIdentSimplified.add(typeIdentSimplified179.getTree());
}
}
break;
default:
break loop63;
}
} 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();
// 674:9: -> ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:674:13: ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(QUALIFIED_TYPE_IDENT, "QUALIFIED_TYPE_IDENT"), root_1);
if (!(stream_typeIdentSimplified.hasNext())) {
throw new RewriteEarlyExitException();
}
while (stream_typeIdentSimplified.hasNext()) {
adaptor.addChild(root_1, stream_typeIdentSimplified.nextTree());
}
stream_typeIdentSimplified.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, 46, qualifiedTypeIdentSimplified_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.RecognitionException in project freud by LMAX-Exchange.
the class JavaParser method genericTypeArgumentListSimplified.
// $ANTLR start "genericTypeArgumentListSimplified"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:711:1: genericTypeArgumentListSimplified : LESS_THAN genericTypeArgumentSimplified ( COMMA genericTypeArgumentSimplified )* genericTypeListClosing -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ ) ;
public final JavaParser.genericTypeArgumentListSimplified_return genericTypeArgumentListSimplified() throws RecognitionException {
JavaParser.genericTypeArgumentListSimplified_return retval = new JavaParser.genericTypeArgumentListSimplified_return();
retval.start = input.LT(1);
int genericTypeArgumentListSimplified_StartIndex = input.index();
CommonTree root_0 = null;
Token LESS_THAN195 = null;
Token COMMA197 = null;
JavaParser.genericTypeArgumentSimplified_return genericTypeArgumentSimplified196 = null;
JavaParser.genericTypeArgumentSimplified_return genericTypeArgumentSimplified198 = null;
JavaParser.genericTypeListClosing_return genericTypeListClosing199 = null;
CommonTree LESS_THAN195_tree = null;
CommonTree COMMA197_tree = null;
RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
RewriteRuleTokenStream stream_LESS_THAN = new RewriteRuleTokenStream(adaptor, "token LESS_THAN");
RewriteRuleSubtreeStream stream_genericTypeArgumentSimplified = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeArgumentSimplified");
RewriteRuleSubtreeStream stream_genericTypeListClosing = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeListClosing");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 53)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:712:5: ( LESS_THAN genericTypeArgumentSimplified ( COMMA genericTypeArgumentSimplified )* genericTypeListClosing -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ ) )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:712:9: LESS_THAN genericTypeArgumentSimplified ( COMMA genericTypeArgumentSimplified )* genericTypeListClosing
{
LESS_THAN195 = (Token) match(input, LESS_THAN, FOLLOW_LESS_THAN_in_genericTypeArgumentListSimplified7351);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_LESS_THAN.add(LESS_THAN195);
}
pushFollow(FOLLOW_genericTypeArgumentSimplified_in_genericTypeArgumentListSimplified7353);
genericTypeArgumentSimplified196 = genericTypeArgumentSimplified();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_genericTypeArgumentSimplified.add(genericTypeArgumentSimplified196.getTree());
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:712:49: ( COMMA genericTypeArgumentSimplified )*
loop69: do {
int alt69 = 2;
int LA69_0 = input.LA(1);
if ((LA69_0 == COMMA)) {
alt69 = 1;
}
switch(alt69) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:712:50: COMMA genericTypeArgumentSimplified
{
COMMA197 = (Token) match(input, COMMA, FOLLOW_COMMA_in_genericTypeArgumentListSimplified7356);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_COMMA.add(COMMA197);
}
pushFollow(FOLLOW_genericTypeArgumentSimplified_in_genericTypeArgumentListSimplified7358);
genericTypeArgumentSimplified198 = genericTypeArgumentSimplified();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_genericTypeArgumentSimplified.add(genericTypeArgumentSimplified198.getTree());
}
}
break;
default:
break loop69;
}
} while (true);
pushFollow(FOLLOW_genericTypeListClosing_in_genericTypeArgumentListSimplified7362);
genericTypeListClosing199 = genericTypeListClosing();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_genericTypeListClosing.add(genericTypeListClosing199.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();
// 713:9: -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:713:13: ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(GENERIC_TYPE_ARG_LIST, LESS_THAN195, "GENERIC_TYPE_ARG_LIST"), root_1);
if (!(stream_genericTypeArgumentSimplified.hasNext())) {
throw new RewriteEarlyExitException();
}
while (stream_genericTypeArgumentSimplified.hasNext()) {
adaptor.addChild(root_1, stream_genericTypeArgumentSimplified.nextTree());
}
stream_genericTypeArgumentSimplified.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, 53, genericTypeArgumentListSimplified_StartIndex);
}
}
return retval;
}
Aggregations