The CastLookahead production can be #void, too

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4832 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2006-11-27 04:21:37 +00:00
parent fba6f4c2eb
commit a042a3ca33
6 changed files with 99 additions and 151 deletions

View File

@ -1605,7 +1605,7 @@ void UnaryExpressionNotPlusMinus() #UnaryExpressionNotPlusMinus((jjtn000.getImag
// This production is to determine lookahead only. The LOOKAHEAD specifications // This production is to determine lookahead only. The LOOKAHEAD specifications
// below are not used, but they are there just to indicate that we know about // below are not used, but they are there just to indicate that we know about
// this. // this.
void CastLookahead() : void CastLookahead() #void :
{} {}
{ LOOKAHEAD(2) "(" PrimitiveType() { LOOKAHEAD(2) "(" PrimitiveType()
| LOOKAHEAD("(" Type() "[") "(" Type() "[" "]" | LOOKAHEAD("(" Type() "[") "(" Type() "[" "]"

View File

@ -1,21 +0,0 @@
/* Generated By:JJTree: Do not edit this line. ASTCastLookahead.java */
package net.sourceforge.pmd.ast;
public class ASTCastLookahead extends SimpleJavaNode {
public ASTCastLookahead(int id) {
super(id);
}
public ASTCastLookahead(JavaParser p, int id) {
super(p, id);
}
/**
* Accept the visitor. *
*/
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
return visitor.visit(this, data);
}
}

View File

@ -3220,87 +3220,63 @@ Token t;
// below are not used, but they are there just to indicate that we know about // below are not used, but they are there just to indicate that we know about
// this. // this.
final public void CastLookahead() throws ParseException { final public void CastLookahead() throws ParseException {
/*@bgen(jjtree) CastLookahead */ if (jj_2_25(2)) {
ASTCastLookahead jjtn000 = new ASTCastLookahead(this, JJTCASTLOOKAHEAD); jj_consume_token(LPAREN);
boolean jjtc000 = true; PrimitiveType();
jjtree.openNodeScope(jjtn000); } else if (jj_2_26(2147483647)) {
try { jj_consume_token(LPAREN);
if (jj_2_25(2)) { Type();
jj_consume_token(LPAREN); jj_consume_token(LBRACKET);
PrimitiveType(); jj_consume_token(RBRACKET);
} else if (jj_2_26(2147483647)) { } else {
switch (jj_nt.kind) {
case LPAREN:
jj_consume_token(LPAREN); jj_consume_token(LPAREN);
Type(); Type();
jj_consume_token(LBRACKET); jj_consume_token(RPAREN);
jj_consume_token(RBRACKET);
} else {
switch (jj_nt.kind) { switch (jj_nt.kind) {
case TILDE:
jj_consume_token(TILDE);
break;
case BANG:
jj_consume_token(BANG);
break;
case LPAREN: case LPAREN:
jj_consume_token(LPAREN); jj_consume_token(LPAREN);
Type(); break;
jj_consume_token(RPAREN); case IDENTIFIER:
switch (jj_nt.kind) { jj_consume_token(IDENTIFIER);
case TILDE: break;
jj_consume_token(TILDE); case THIS:
break; jj_consume_token(THIS);
case BANG: break;
jj_consume_token(BANG); case SUPER:
break; jj_consume_token(SUPER);
case LPAREN: break;
jj_consume_token(LPAREN); case NEW:
break; jj_consume_token(NEW);
case IDENTIFIER: break;
jj_consume_token(IDENTIFIER); case FALSE:
break; case NULL:
case THIS: case TRUE:
jj_consume_token(THIS); case INTEGER_LITERAL:
break; case FLOATING_POINT_LITERAL:
case SUPER: case HEX_FLOATING_POINT_LITERAL:
jj_consume_token(SUPER); case CHARACTER_LITERAL:
break; case STRING_LITERAL:
case NEW: Literal();
jj_consume_token(NEW);
break;
case FALSE:
case NULL:
case TRUE:
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case HEX_FLOATING_POINT_LITERAL:
case CHARACTER_LITERAL:
case STRING_LITERAL:
Literal();
break;
default:
jj_la1[85] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break; break;
default: default:
jj_la1[86] = jj_gen; jj_la1[85] = jj_gen;
jj_consume_token(-1); jj_consume_token(-1);
throw new ParseException(); throw new ParseException();
} }
break;
default:
jj_la1[86] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
} }
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
} }
} }

View File

@ -60,59 +60,58 @@ public interface JavaParserTreeConstants
public int JJTPREINCREMENTEXPRESSION = 53; public int JJTPREINCREMENTEXPRESSION = 53;
public int JJTPREDECREMENTEXPRESSION = 54; public int JJTPREDECREMENTEXPRESSION = 54;
public int JJTUNARYEXPRESSIONNOTPLUSMINUS = 55; public int JJTUNARYEXPRESSIONNOTPLUSMINUS = 55;
public int JJTCASTLOOKAHEAD = 56; public int JJTPOSTFIXEXPRESSION = 56;
public int JJTPOSTFIXEXPRESSION = 57; public int JJTCASTEXPRESSION = 57;
public int JJTCASTEXPRESSION = 58; public int JJTPRIMARYEXPRESSION = 58;
public int JJTPRIMARYEXPRESSION = 59; public int JJTMEMBERSELECTOR = 59;
public int JJTMEMBERSELECTOR = 60; public int JJTPRIMARYPREFIX = 60;
public int JJTPRIMARYPREFIX = 61; public int JJTPRIMARYSUFFIX = 61;
public int JJTPRIMARYSUFFIX = 62; public int JJTLITERAL = 62;
public int JJTLITERAL = 63; public int JJTBOOLEANLITERAL = 63;
public int JJTBOOLEANLITERAL = 64; public int JJTNULLLITERAL = 64;
public int JJTNULLLITERAL = 65; public int JJTARGUMENTS = 65;
public int JJTARGUMENTS = 66; public int JJTARGUMENTLIST = 66;
public int JJTARGUMENTLIST = 67; public int JJTALLOCATIONEXPRESSION = 67;
public int JJTALLOCATIONEXPRESSION = 68; public int JJTARRAYDIMSANDINITS = 68;
public int JJTARRAYDIMSANDINITS = 69; public int JJTSTATEMENT = 69;
public int JJTSTATEMENT = 70; public int JJTLABELEDSTATEMENT = 70;
public int JJTLABELEDSTATEMENT = 71; public int JJTBLOCK = 71;
public int JJTBLOCK = 72; public int JJTBLOCKSTATEMENT = 72;
public int JJTBLOCKSTATEMENT = 73; public int JJTLOCALVARIABLEDECLARATION = 73;
public int JJTLOCALVARIABLEDECLARATION = 74; public int JJTEMPTYSTATEMENT = 74;
public int JJTEMPTYSTATEMENT = 75; public int JJTSTATEMENTEXPRESSION = 75;
public int JJTSTATEMENTEXPRESSION = 76; public int JJTSWITCHSTATEMENT = 76;
public int JJTSWITCHSTATEMENT = 77; public int JJTSWITCHLABEL = 77;
public int JJTSWITCHLABEL = 78; public int JJTIFSTATEMENT = 78;
public int JJTIFSTATEMENT = 79; public int JJTWHILESTATEMENT = 79;
public int JJTWHILESTATEMENT = 80; public int JJTDOSTATEMENT = 80;
public int JJTDOSTATEMENT = 81; public int JJTFORSTATEMENT = 81;
public int JJTFORSTATEMENT = 82; public int JJTFORINIT = 82;
public int JJTFORINIT = 83; public int JJTSTATEMENTEXPRESSIONLIST = 83;
public int JJTSTATEMENTEXPRESSIONLIST = 84; public int JJTFORUPDATE = 84;
public int JJTFORUPDATE = 85; public int JJTBREAKSTATEMENT = 85;
public int JJTBREAKSTATEMENT = 86; public int JJTCONTINUESTATEMENT = 86;
public int JJTCONTINUESTATEMENT = 87; public int JJTRETURNSTATEMENT = 87;
public int JJTRETURNSTATEMENT = 88; public int JJTTHROWSTATEMENT = 88;
public int JJTTHROWSTATEMENT = 89; public int JJTSYNCHRONIZEDSTATEMENT = 89;
public int JJTSYNCHRONIZEDSTATEMENT = 90; public int JJTTRYSTATEMENT = 90;
public int JJTTRYSTATEMENT = 91; public int JJTCATCHSTATEMENT = 91;
public int JJTCATCHSTATEMENT = 92; public int JJTFINALLYSTATEMENT = 92;
public int JJTFINALLYSTATEMENT = 93; public int JJTASSERTSTATEMENT = 93;
public int JJTASSERTSTATEMENT = 94; public int JJTRUNSIGNEDSHIFT = 94;
public int JJTRUNSIGNEDSHIFT = 95; public int JJTRSIGNEDSHIFT = 95;
public int JJTRSIGNEDSHIFT = 96; public int JJTANNOTATION = 96;
public int JJTANNOTATION = 97; public int JJTNORMALANNOTATION = 97;
public int JJTNORMALANNOTATION = 98; public int JJTMARKERANNOTATION = 98;
public int JJTMARKERANNOTATION = 99; public int JJTSINGLEMEMBERANNOTATION = 99;
public int JJTSINGLEMEMBERANNOTATION = 100; public int JJTMEMBERVALUEPAIRS = 100;
public int JJTMEMBERVALUEPAIRS = 101; public int JJTMEMBERVALUEPAIR = 101;
public int JJTMEMBERVALUEPAIR = 102; public int JJTMEMBERVALUE = 102;
public int JJTMEMBERVALUE = 103; public int JJTMEMBERVALUEARRAYINITIALIZER = 103;
public int JJTMEMBERVALUEARRAYINITIALIZER = 104; public int JJTANNOTATIONTYPEDECLARATION = 104;
public int JJTANNOTATIONTYPEDECLARATION = 105; public int JJTANNOTATIONTYPEBODY = 105;
public int JJTANNOTATIONTYPEBODY = 106; public int JJTANNOTATIONTYPEMEMBERDECLARATION = 106;
public int JJTANNOTATIONTYPEMEMBERDECLARATION = 107; public int JJTDEFAULTVALUE = 107;
public int JJTDEFAULTVALUE = 108;
public String[] jjtNodeName = { public String[] jjtNodeName = {
@ -172,7 +171,6 @@ public interface JavaParserTreeConstants
"PreIncrementExpression", "PreIncrementExpression",
"PreDecrementExpression", "PreDecrementExpression",
"UnaryExpressionNotPlusMinus", "UnaryExpressionNotPlusMinus",
"CastLookahead",
"PostfixExpression", "PostfixExpression",
"CastExpression", "CastExpression",
"PrimaryExpression", "PrimaryExpression",

View File

@ -60,7 +60,6 @@ public interface JavaParserVisitor
public Object visit(ASTPreIncrementExpression node, Object data); public Object visit(ASTPreIncrementExpression node, Object data);
public Object visit(ASTPreDecrementExpression node, Object data); public Object visit(ASTPreDecrementExpression node, Object data);
public Object visit(ASTUnaryExpressionNotPlusMinus node, Object data); public Object visit(ASTUnaryExpressionNotPlusMinus node, Object data);
public Object visit(ASTCastLookahead node, Object data);
public Object visit(ASTPostfixExpression node, Object data); public Object visit(ASTPostfixExpression node, Object data);
public Object visit(ASTCastExpression node, Object data); public Object visit(ASTCastExpression node, Object data);
public Object visit(ASTPrimaryExpression node, Object data); public Object visit(ASTPrimaryExpression node, Object data);

View File

@ -295,10 +295,6 @@ public class JavaParserVisitorAdapter implements JavaParserVisitor {
return visit((SimpleJavaNode) node, data); return visit((SimpleJavaNode) node, data);
} }
public Object visit(ASTCastLookahead node, Object data) {
return visit((SimpleJavaNode) node, data);
}
public Object visit(ASTPostfixExpression node, Object data) { public Object visit(ASTPostfixExpression node, Object data) {
return visit((SimpleJavaNode) node, data); return visit((SimpleJavaNode) node, data);
} }