Skip to content

Commit

Permalink
#505 have to be fixed. I moved new tokens to the end of tokens list.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Dubinin authored and romani committed Dec 24, 2014
1 parent f0c6c6a commit ca89807
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/main/resources/com/puppycrawl/tools/checkstyle/grammars/java.g
Expand Up @@ -39,13 +39,14 @@ options {
buildAST = true;
}
//Please add new tokens only in the end of list! Otherwise you break compatibility!
tokens {
//Pre-1.4 tokens
BLOCK; MODIFIERS; OBJBLOCK; SLIST; CTOR_DEF; METHOD_DEF; VARIABLE_DEF;
INSTANCE_INIT; STATIC_INIT; TYPE; CLASS_DEF; INTERFACE_DEF;
PACKAGE_DEF; ARRAY_DECLARATOR; EXTENDS_CLAUSE; IMPLEMENTS_CLAUSE;
PARAMETERS; PARAMETER_DEF; LABELED_STAT; TYPECAST; INDEX_OP;
POST_INC; POST_DEC; METHOD_CALL; METHOD_REF; EXPR; ARRAY_INIT;
POST_INC; POST_DEC; METHOD_CALL; EXPR; ARRAY_INIT;
IMPORT; UNARY_MINUS; UNARY_PLUS; CASE_GROUP; ELIST; FOR_INIT; FOR_CONDITION;
FOR_ITERATOR; EMPTY_STAT; FINAL="final"; ABSTRACT="abstract";
STRICTFP="strictfp"; SUPER_CTOR_CALL; CTOR_CALL;
Expand All @@ -60,29 +61,29 @@ tokens {
LITERAL_protected="protected";LITERAL_static="static";
LITERAL_transient="transient";LITERAL_native="native";
LITERAL_synchronized="synchronized";LITERAL_volatile="volatile";
//Please add new tokens only in the end of list! Otherwise you break compatibility!
LITERAL_class="class";LITERAL_extends="extends";
LITERAL_interface="interface";LCURLY;RCURLY;COMMA;
LITERAL_implements="implements";LPAREN;RPAREN;LITERAL_this="this";
LITERAL_super="super";ASSIGN;LITERAL_throws="throws";COLON;DOUBLE_COLON;
LITERAL_super="super";ASSIGN;LITERAL_throws="throws";COLON;
LITERAL_if="if";LITERAL_while="while";LITERAL_do="do";
LITERAL_break="break";LITERAL_continue="continue";LITERAL_return="return";
LITERAL_switch="switch";LITERAL_throw="throw";LITERAL_for="for";
LITERAL_else="else";LITERAL_case="case";LITERAL_default="default";
//Please add new tokens only in the end of list! Otherwise you break compatibility!
LITERAL_try="try";LITERAL_catch="catch";LITERAL_finally="finally";
PLUS_ASSIGN;MINUS_ASSIGN;STAR_ASSIGN;DIV_ASSIGN;MOD_ASSIGN;SR_ASSIGN;
BSR_ASSIGN;SL_ASSIGN;BAND_ASSIGN;BXOR_ASSIGN;BOR_ASSIGN;QUESTION;
LOR;LAND;BOR;BXOR;BAND;NOT_EQUAL;EQUAL;LT;GT;LE;GE;
LITERAL_instanceof="instanceof";SL;SR;BSR;PLUS;MINUS;DIV;MOD;
INC;DEC;BNOT;LNOT;LITERAL_true="true";LITERAL_false="false";
LITERAL_null="null";LITERAL_new="new";NUM_INT;CHAR_LITERAL;
STRING_LITERAL;NUM_FLOAT;NUM_LONG;NUM_DOUBLE;WS;
ESC;HEX_DIGIT;VOCAB;EXPONENT;FLOAT_SUFFIX;
SINGLE_LINE_COMMENT;
BLOCK_COMMENT_BEGIN;
BLOCK_COMMENT_END;
COMMENT_CONTENT;
STRING_LITERAL;NUM_FLOAT;NUM_LONG;NUM_DOUBLE;WS;SINGLE_LINE_COMMENT;
BLOCK_COMMENT_BEGIN;ESC;HEX_DIGIT;VOCAB;EXPONENT;FLOAT_SUFFIX;
//Please add new tokens only in the end of list! Otherwise you break compatibility!
//Token for Java 1.4 language enhancements
ASSERT;
Expand All @@ -93,6 +94,8 @@ tokens {
TYPE_PARAMETER; WILDCARD_TYPE; TYPE_UPPER_BOUNDS; TYPE_LOWER_BOUNDS; AT; ELLIPSIS;
GENERIC_START; GENERIC_END; TYPE_EXTENSION_AND;
//Please add new tokens only in the end of list! Otherwise you break compatibility!
// token which was not included to grammar initially
// we need to put it to the end to maintain binary compatibility
// with previous versions
Expand All @@ -101,8 +104,11 @@ tokens {
//Tokens for Java 1.7 language enhancements
RESOURCE_SPECIFICATION; RESOURCES; RESOURCE;
//TOkens for 1.8
LAMBDA;
//Tokens for Java 1.8
DOUBLE_COLON; METHOD_REF; LAMBDA;
//Support of java comments has been extended
BLOCK_COMMENT_END;COMMENT_CONTENT;
}
{
Expand Down

0 comments on commit ca89807

Please sign in to comment.