use of org.antlr.runtime.tree.CommonTree in project freud by LMAX-Exchange.
the class JavaParser method andExpression.
// $ANTLR start "andExpression"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:972:1: andExpression : equalityExpression ( AND equalityExpression )* ;
public final JavaParser.andExpression_return andExpression() throws RecognitionException {
JavaParser.andExpression_return retval = new JavaParser.andExpression_return();
retval.start = input.LT(1);
int andExpression_StartIndex = input.index();
CommonTree root_0 = null;
Token AND398 = null;
JavaParser.equalityExpression_return equalityExpression397 = null;
JavaParser.equalityExpression_return equalityExpression399 = null;
CommonTree AND398_tree = null;
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 95)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:973:5: ( equalityExpression ( AND equalityExpression )* )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:973:9: equalityExpression ( AND equalityExpression )*
{
root_0 = (CommonTree) adaptor.nil();
pushFollow(FOLLOW_equalityExpression_in_andExpression10661);
equalityExpression397 = equalityExpression();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
adaptor.addChild(root_0, equalityExpression397.getTree());
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:973:28: ( AND equalityExpression )*
loop115: do {
int alt115 = 2;
int LA115_0 = input.LA(1);
if ((LA115_0 == AND)) {
alt115 = 1;
}
switch(alt115) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:973:29: AND equalityExpression
{
AND398 = (Token) match(input, AND, FOLLOW_AND_in_andExpression10664);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
AND398_tree = (CommonTree) adaptor.create(AND398);
root_0 = (CommonTree) adaptor.becomeRoot(AND398_tree, root_0);
}
pushFollow(FOLLOW_equalityExpression_in_andExpression10667);
equalityExpression399 = equalityExpression();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
adaptor.addChild(root_0, equalityExpression399.getTree());
}
}
break;
default:
break loop115;
}
} 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, 95, andExpression_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.tree.CommonTree in project freud by LMAX-Exchange.
the class JavaParser method block.
// $ANTLR start "block"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:825:1: block : LCURLY ( blockStatement )* RCURLY -> ^( BLOCK_SCOPE[$LCURLY, \"BLOCK_SCOPE\"] ( blockStatement )* ) ;
public final JavaParser.block_return block() throws RecognitionException {
JavaParser.block_return retval = new JavaParser.block_return();
retval.start = input.LT(1);
int block_StartIndex = input.index();
CommonTree root_0 = null;
Token LCURLY265 = null;
Token RCURLY267 = null;
JavaParser.blockStatement_return blockStatement266 = null;
CommonTree LCURLY265_tree = null;
CommonTree RCURLY267_tree = null;
RewriteRuleTokenStream stream_LCURLY = new RewriteRuleTokenStream(adaptor, "token LCURLY");
RewriteRuleTokenStream stream_RCURLY = new RewriteRuleTokenStream(adaptor, "token RCURLY");
RewriteRuleSubtreeStream stream_blockStatement = new RewriteRuleSubtreeStream(adaptor, "rule blockStatement");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 72)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:826:5: ( LCURLY ( blockStatement )* RCURLY -> ^( BLOCK_SCOPE[$LCURLY, \"BLOCK_SCOPE\"] ( blockStatement )* ) )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:826:9: LCURLY ( blockStatement )* RCURLY
{
LCURLY265 = (Token) match(input, LCURLY, FOLLOW_LCURLY_in_block8413);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_LCURLY.add(LCURLY265);
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:826:16: ( blockStatement )*
loop88: do {
int alt88 = 2;
int LA88_0 = input.LA(1);
if ((LA88_0 == AT || LA88_0 == DEC || LA88_0 == INC || LA88_0 == LCURLY || LA88_0 == LESS_THAN || LA88_0 == LOGICAL_NOT || (LA88_0 >= LPAREN && LA88_0 <= MINUS) || LA88_0 == NOT || LA88_0 == PLUS || LA88_0 == SEMI || (LA88_0 >= ABSTRACT && LA88_0 <= BYTE) || (LA88_0 >= CHAR && LA88_0 <= CONTINUE) || (LA88_0 >= DO && LA88_0 <= DOUBLE) || LA88_0 == ENUM || (LA88_0 >= FALSE && LA88_0 <= FINAL) || (LA88_0 >= FLOAT && LA88_0 <= IF) || LA88_0 == INTERFACE || (LA88_0 >= INT && LA88_0 <= NULL) || (LA88_0 >= PRIVATE && LA88_0 <= THROW) || (LA88_0 >= TRANSIENT && LA88_0 <= WHILE) || (LA88_0 >= IDENT && LA88_0 <= STRING_LITERAL))) {
alt88 = 1;
}
switch(alt88) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: blockStatement
{
pushFollow(FOLLOW_blockStatement_in_block8415);
blockStatement266 = blockStatement();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_blockStatement.add(blockStatement266.getTree());
}
}
break;
default:
break loop88;
}
} while (true);
RCURLY267 = (Token) match(input, RCURLY, FOLLOW_RCURLY_in_block8418);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_RCURLY.add(RCURLY267);
}
// 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();
// 827:9: -> ^( BLOCK_SCOPE[$LCURLY, \"BLOCK_SCOPE\"] ( blockStatement )* )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:827:13: ^( BLOCK_SCOPE[$LCURLY, \"BLOCK_SCOPE\"] ( blockStatement )* )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(BLOCK_SCOPE, LCURLY265, "BLOCK_SCOPE"), root_1);
// /home/langera/dev/freud/trunk/src/grammar/Java.g:827:51: ( blockStatement )*
while (stream_blockStatement.hasNext()) {
adaptor.addChild(root_1, stream_blockStatement.nextTree());
}
stream_blockStatement.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, 72, block_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.tree.CommonTree in project freud by LMAX-Exchange.
the class JavaParser method qualifiedIdentifier.
// $ANTLR start "qualifiedIdentifier"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:749:1: qualifiedIdentifier : ( IDENT -> IDENT ) ( DOT ident= IDENT -> ^( DOT $qualifiedIdentifier $ident) )* ;
public final JavaParser.qualifiedIdentifier_return qualifiedIdentifier() throws RecognitionException {
JavaParser.qualifiedIdentifier_return retval = new JavaParser.qualifiedIdentifier_return();
retval.start = input.LT(1);
int qualifiedIdentifier_StartIndex = input.index();
CommonTree root_0 = null;
Token ident = null;
Token IDENT220 = null;
Token DOT221 = null;
CommonTree ident_tree = null;
CommonTree IDENT220_tree = null;
CommonTree DOT221_tree = null;
RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor, "token DOT");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 59)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:750:5: ( ( IDENT -> IDENT ) ( DOT ident= IDENT -> ^( DOT $qualifiedIdentifier $ident) )* )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:750:9: ( IDENT -> IDENT ) ( DOT ident= IDENT -> ^( DOT $qualifiedIdentifier $ident) )*
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:750:9: ( IDENT -> IDENT )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:750:13: IDENT
{
IDENT220 = (Token) match(input, IDENT, FOLLOW_IDENT_in_qualifiedIdentifier7738);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_IDENT.add(IDENT220);
}
// 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();
// 750:33: -> IDENT
{
adaptor.addChild(root_0, stream_IDENT.nextNode());
}
retval.tree = root_0;
}
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:752:9: ( DOT ident= IDENT -> ^( DOT $qualifiedIdentifier $ident) )*
loop75: do {
int alt75 = 2;
int LA75_0 = input.LA(1);
if ((LA75_0 == DOT)) {
int LA75_2 = input.LA(2);
if ((LA75_2 == IDENT)) {
int LA75_3 = input.LA(3);
if ((synpred102_Java())) {
alt75 = 1;
}
}
}
switch(alt75) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:752:13: DOT ident= IDENT
{
DOT221 = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentifier7781);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_DOT.add(DOT221);
}
ident = (Token) match(input, IDENT, FOLLOW_IDENT_in_qualifiedIdentifier7785);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_IDENT.add(ident);
}
// wildcard labels:
if (state.backtracking == 0) {
retval.tree = root_0;
RewriteRuleTokenStream stream_ident = new RewriteRuleTokenStream(adaptor, "token ident", ident);
RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
root_0 = (CommonTree) adaptor.nil();
// 752:33: -> ^( DOT $qualifiedIdentifier $ident)
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:752:37: ^( DOT $qualifiedIdentifier $ident)
{
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_ident.nextNode());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
default:
break loop75;
}
} 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, 59, qualifiedIdentifier_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.tree.CommonTree in project freud by LMAX-Exchange.
the class JavaParser method typeIdent.
// $ANTLR start "typeIdent"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:677:1: typeIdent : IDENT ( genericTypeArgumentList )? ;
public final JavaParser.typeIdent_return typeIdent() throws RecognitionException {
JavaParser.typeIdent_return retval = new JavaParser.typeIdent_return();
retval.start = input.LT(1);
int typeIdent_StartIndex = input.index();
CommonTree root_0 = null;
Token IDENT180 = null;
JavaParser.genericTypeArgumentList_return genericTypeArgumentList181 = null;
CommonTree IDENT180_tree = null;
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 47)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:678:5: ( IDENT ( genericTypeArgumentList )? )
// /home/langera/dev/freud/trunk/src/grammar/Java.g:678:9: IDENT ( genericTypeArgumentList )?
{
root_0 = (CommonTree) adaptor.nil();
IDENT180 = (Token) match(input, IDENT, FOLLOW_IDENT_in_typeIdent7089);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
IDENT180_tree = (CommonTree) adaptor.create(IDENT180);
root_0 = (CommonTree) adaptor.becomeRoot(IDENT180_tree, root_0);
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:678:16: ( genericTypeArgumentList )?
int alt64 = 2;
int LA64_0 = input.LA(1);
if ((LA64_0 == LESS_THAN)) {
alt64 = 1;
}
switch(alt64) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: genericTypeArgumentList
{
pushFollow(FOLLOW_genericTypeArgumentList_in_typeIdent7092);
genericTypeArgumentList181 = genericTypeArgumentList();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
adaptor.addChild(root_0, genericTypeArgumentList181.getTree());
}
}
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, 47, typeIdent_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.tree.CommonTree in project freud by LMAX-Exchange.
the class JavaParser method unaryExpressionRest.
// $ANTLR start "unaryExpressionRest"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1037:1: unaryExpressionRest : ( NOT unaryExpressionAll -> ^( NOT unaryExpressionAll ) | LOGICAL_NOT unaryExpressionAll -> ^( LOGICAL_NOT unaryExpressionAll ) | LPAREN simpleType RPAREN unaryExpressionAll -> ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] simpleType unaryExpressionAll ) | LPAREN objectType RPAREN unaryExpressionRest -> ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] objectType unaryExpressionRest ) | postfixedExpression );
public final JavaParser.unaryExpressionRest_return unaryExpressionRest() throws RecognitionException {
JavaParser.unaryExpressionRest_return retval = new JavaParser.unaryExpressionRest_return();
retval.start = input.LT(1);
int unaryExpressionRest_StartIndex = input.index();
CommonTree root_0 = null;
Token NOT436 = null;
Token LOGICAL_NOT438 = null;
Token LPAREN440 = null;
Token RPAREN442 = null;
Token LPAREN444 = null;
Token RPAREN446 = null;
JavaParser.unaryExpressionAll_return unaryExpressionAll437 = null;
JavaParser.unaryExpressionAll_return unaryExpressionAll439 = null;
JavaParser.simpleType_return simpleType441 = null;
JavaParser.unaryExpressionAll_return unaryExpressionAll443 = null;
JavaParser.objectType_return objectType445 = null;
JavaParser.unaryExpressionRest_return unaryExpressionRest447 = null;
JavaParser.postfixedExpression_return postfixedExpression448 = null;
CommonTree NOT436_tree = null;
CommonTree LOGICAL_NOT438_tree = null;
CommonTree LPAREN440_tree = null;
CommonTree RPAREN442_tree = null;
CommonTree LPAREN444_tree = null;
CommonTree RPAREN446_tree = null;
RewriteRuleTokenStream stream_RPAREN = new RewriteRuleTokenStream(adaptor, "token RPAREN");
RewriteRuleTokenStream stream_LOGICAL_NOT = new RewriteRuleTokenStream(adaptor, "token LOGICAL_NOT");
RewriteRuleTokenStream stream_NOT = new RewriteRuleTokenStream(adaptor, "token NOT");
RewriteRuleTokenStream stream_LPAREN = new RewriteRuleTokenStream(adaptor, "token LPAREN");
RewriteRuleSubtreeStream stream_simpleType = new RewriteRuleSubtreeStream(adaptor, "rule simpleType");
RewriteRuleSubtreeStream stream_unaryExpressionRest = new RewriteRuleSubtreeStream(adaptor, "rule unaryExpressionRest");
RewriteRuleSubtreeStream stream_objectType = new RewriteRuleSubtreeStream(adaptor, "rule objectType");
RewriteRuleSubtreeStream stream_unaryExpressionAll = new RewriteRuleSubtreeStream(adaptor, "rule unaryExpressionAll");
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 103)) {
return retval;
}
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1038:5: ( NOT unaryExpressionAll -> ^( NOT unaryExpressionAll ) | LOGICAL_NOT unaryExpressionAll -> ^( LOGICAL_NOT unaryExpressionAll ) | LPAREN simpleType RPAREN unaryExpressionAll -> ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] simpleType unaryExpressionAll ) | LPAREN objectType RPAREN unaryExpressionRest -> ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] objectType unaryExpressionRest ) | postfixedExpression )
int alt128 = 5;
alt128 = dfa128.predict(input);
switch(alt128) {
case 1:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1038:9: NOT unaryExpressionAll
{
NOT436 = (Token) match(input, NOT, FOLLOW_NOT_in_unaryExpressionRest11393);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_NOT.add(NOT436);
}
pushFollow(FOLLOW_unaryExpressionAll_in_unaryExpressionRest11395);
unaryExpressionAll437 = unaryExpressionAll();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_unaryExpressionAll.add(unaryExpressionAll437.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();
// 1038:57: -> ^( NOT unaryExpressionAll )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1038:61: ^( NOT unaryExpressionAll )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_NOT.nextNode(), root_1);
adaptor.addChild(root_1, stream_unaryExpressionAll.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1039:9: LOGICAL_NOT unaryExpressionAll
{
LOGICAL_NOT438 = (Token) match(input, LOGICAL_NOT, FOLLOW_LOGICAL_NOT_in_unaryExpressionRest11439);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_LOGICAL_NOT.add(LOGICAL_NOT438);
}
pushFollow(FOLLOW_unaryExpressionAll_in_unaryExpressionRest11441);
unaryExpressionAll439 = unaryExpressionAll();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_unaryExpressionAll.add(unaryExpressionAll439.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();
// 1039:57: -> ^( LOGICAL_NOT unaryExpressionAll )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1039:61: ^( LOGICAL_NOT unaryExpressionAll )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot(stream_LOGICAL_NOT.nextNode(), root_1);
adaptor.addChild(root_1, stream_unaryExpressionAll.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 3:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1040:9: LPAREN simpleType RPAREN unaryExpressionAll
{
LPAREN440 = (Token) match(input, LPAREN, FOLLOW_LPAREN_in_unaryExpressionRest11477);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_LPAREN.add(LPAREN440);
}
pushFollow(FOLLOW_simpleType_in_unaryExpressionRest11479);
simpleType441 = simpleType();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_simpleType.add(simpleType441.getTree());
}
RPAREN442 = (Token) match(input, RPAREN, FOLLOW_RPAREN_in_unaryExpressionRest11481);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_RPAREN.add(RPAREN442);
}
pushFollow(FOLLOW_unaryExpressionAll_in_unaryExpressionRest11483);
unaryExpressionAll443 = unaryExpressionAll();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_unaryExpressionAll.add(unaryExpressionAll443.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();
// 1040:57: -> ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] simpleType unaryExpressionAll )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1040:61: ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] simpleType unaryExpressionAll )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(CAST_EXPR, LPAREN440, "CAST_EXPR"), root_1);
adaptor.addChild(root_1, stream_simpleType.nextTree());
adaptor.addChild(root_1, stream_unaryExpressionAll.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 4:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1041:9: LPAREN objectType RPAREN unaryExpressionRest
{
LPAREN444 = (Token) match(input, LPAREN, FOLLOW_LPAREN_in_unaryExpressionRest11509);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_LPAREN.add(LPAREN444);
}
pushFollow(FOLLOW_objectType_in_unaryExpressionRest11511);
objectType445 = objectType();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_objectType.add(objectType445.getTree());
}
RPAREN446 = (Token) match(input, RPAREN, FOLLOW_RPAREN_in_unaryExpressionRest11513);
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_RPAREN.add(RPAREN446);
}
pushFollow(FOLLOW_unaryExpressionRest_in_unaryExpressionRest11515);
unaryExpressionRest447 = unaryExpressionRest();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
stream_unaryExpressionRest.add(unaryExpressionRest447.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();
// 1041:57: -> ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] objectType unaryExpressionRest )
{
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1041:61: ^( CAST_EXPR[$LPAREN, \"CAST_EXPR\"] objectType unaryExpressionRest )
{
CommonTree root_1 = (CommonTree) adaptor.nil();
root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(CAST_EXPR, LPAREN444, "CAST_EXPR"), root_1);
adaptor.addChild(root_1, stream_objectType.nextTree());
adaptor.addChild(root_1, stream_unaryExpressionRest.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 5:
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1042:9: postfixedExpression
{
root_0 = (CommonTree) adaptor.nil();
pushFollow(FOLLOW_postfixedExpression_in_unaryExpressionRest11540);
postfixedExpression448 = postfixedExpression();
state._fsp--;
if (state.failed) {
return retval;
}
if (state.backtracking == 0) {
adaptor.addChild(root_0, postfixedExpression448.getTree());
}
}
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, 103, unaryExpressionRest_StartIndex);
}
}
return retval;
}
Aggregations