From: khartlage Date: Mon, 17 Feb 2003 21:42:58 +0000 (+0000) Subject: changed name of Scanner tokens to names similar in the JDT X-Git-Url: http://git.phpeclipse.com changed name of Scanner tokens to names similar in the JDT --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPKeywords.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPKeywords.java index bb6bd07..d01f8e8 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPKeywords.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPKeywords.java @@ -63,93 +63,93 @@ public class PHPKeywords { //"array", "object", "bool", "boolean", "real", "double", "float", "int", "integer", }; - public final static int TT_KEYWORD = 1000; - public final static int TT_if = 1001; - public final static int TT_elseif = 1002; - public final static int TT_else = 1003; - public final static int TT_endif = 1004; - public final static int TT_for = 1005; - public final static int TT_endfor = 1006; - public final static int TT_while = 1007; - public final static int TT_endwhile = 1008; - public final static int TT_switch = 1009; - public final static int TT_case = 10010; - public final static int TT_endswitch = 1011; - public final static int TT_break = 1012; - public final static int TT_continue = 1013; - public final static int TT_return = 1014; - public final static int TT_define = 1015; - public final static int TT_include = 1016; - public final static int TT_include_once = 1017; - public final static int TT_require = 1018; - public final static int TT_require_once = 1019; - public final static int TT_function = 1020; - public final static int TT_class = 1021; - public final static int TT_new = 1022; - public final static int TT_do = 1023; - public final static int TT_old_function = 1024; - public final static int TT_default = 1025; - public final static int TT_global = 1026; - public final static int TT_static = 1027; - public final static int TT_foreach = 1028; - public final static int TT_endforeach = 1029; - public final static int TT_extends = 1030; - // public final static int TT_empty = 1031; - // public final static int TT_array = 1032; - public final static int TT_echo = 1033; - public final static int TT_var = 1034; - public final static int TT_as = 1035; - public final static int TT_print = 1036; - // public final static int TT_unset = 1037; - // public final static int TT_exit = 1038; - // public final static int TT_die = 1039; - public final static int TT_and = 1040; - public final static int TT_or = 1041; - public final static int TT_xor = 1042; - public final static int TT_list = 1043; - public final static int TT_null = 1044; - public final static int TT_false = 1045; - public final static int TT_true = 1046; + public final static int TokenNameKEYWORD = 1000; + public final static int TokenNameif = 1001; + public final static int TokenNameelseif = 1002; + public final static int TokenNameelse = 1003; + public final static int TokenNameendif = 1004; + public final static int TokenNamefor = 1005; + public final static int TokenNameendfor = 1006; + public final static int TokenNamewhile = 1007; + public final static int TokenNameendwhile = 1008; + public final static int TokenNameswitch = 1009; + public final static int TokenNamecase = 10010; + public final static int TokenNameendswitch = 1011; + public final static int TokenNamebreak = 1012; + public final static int TokenNamecontinue = 1013; + public final static int TokenNamereturn = 1014; + public final static int TokenNamedefine = 1015; + public final static int TokenNameinclude = 1016; + public final static int TokenNameinclude_once = 1017; + public final static int TokenNamerequire = 1018; + public final static int TokenNamerequire_once = 1019; + public final static int TokenNamefunction = 1020; + public final static int TokenNameclass = 1021; + public final static int TokenNamenew = 1022; + public final static int TokenNamedo = 1023; + public final static int TokenNameold_function = 1024; + public final static int TokenNamedefault = 1025; + public final static int TokenNameglobal = 1026; + public final static int TokenNamestatic = 1027; + public final static int TokenNameforeach = 1028; + public final static int TokenNameendforeach = 1029; + public final static int TokenNameextends = 1030; + // public final static int TokenNameempty = 1031; + // public final static int TokenNamearray = 1032; + public final static int TokenNameecho = 1033; + public final static int TokenNamevar = 1034; + public final static int TokenNameas = 1035; + public final static int TokenNameprint = 1036; + // public final static int TokenNameunset = 1037; + // public final static int TokenNameexit = 1038; + // public final static int TokenNamedie = 1039; + public final static int TokenNameand = 1040; + public final static int TokenNameor = 1041; + public final static int TokenNamexor = 1042; + public final static int TokenNamelist = 1043; + public final static int TokenNamenull = 1044; + public final static int TokenNamefalse = 1045; + public final static int TokenNametrue = 1046; public final static int[] PHP_KEYWORD_TOKEN = { - TT_if, - TT_elseif, - TT_else, - TT_endif, - TT_for, - TT_endfor, - TT_while, - TT_endwhile, - TT_switch, - TT_case, - TT_endswitch, - TT_break, - TT_continue, - TT_return, - TT_define, - TT_include, - TT_include_once, - TT_require, - TT_require_once, - TT_function, - TT_class, - TT_new, - TT_do, - TT_old_function, - TT_default, - TT_global, - TT_static, - TT_foreach, - TT_endforeach, - TT_extends, - // TT_empty, - // TT_array, - // TT_isset, - TT_echo, TT_var, TT_as, - TT_print, - // TT_unset, - // TT_exit, TT_die, - TT_and, TT_or, TT_xor, TT_list, - TT_null, TT_false, TT_true }; + TokenNameif, + TokenNameelseif, + TokenNameelse, + TokenNameendif, + TokenNamefor, + TokenNameendfor, + TokenNamewhile, + TokenNameendwhile, + TokenNameswitch, + TokenNamecase, + TokenNameendswitch, + TokenNamebreak, + TokenNamecontinue, + TokenNamereturn, + TokenNamedefine, + TokenNameinclude, + TokenNameinclude_once, + TokenNamerequire, + TokenNamerequire_once, + TokenNamefunction, + TokenNameclass, + TokenNamenew, + TokenNamedo, + TokenNameold_function, + TokenNamedefault, + TokenNameglobal, + TokenNamestatic, + TokenNameforeach, + TokenNameendforeach, + TokenNameextends, + // TokenNameempty, + // TokenNamearray, + // TokenNameisset, + TokenNameecho, TokenNamevar, TokenNameas, + TokenNameprint, + // TokenNameunset, + // TokenNameexit, TokenNamedie, + TokenNameand, TokenNameor, TokenNamexor, TokenNamelist, + TokenNamenull, TokenNamefalse, TokenNametrue }; } diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java index c5a29c0..c6f4d3f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java @@ -70,80 +70,80 @@ public class PHPParser extends PHPKeywords { private boolean phpMode; - final static int TT_EOF = 0; - final static int TT_UNDEFINED = 1; - final static int TT_HTML = 2; - - final static int TT_MOD = 30; - final static int TT_NOT = 31; - final static int TT_DOT = 32; - final static int TT_POW = 33; - final static int TT_DIV = 34; - final static int TT_MULTIPLY = 35; - final static int TT_SUBTRACT = 36; - final static int TT_ADD = 37; - final static int TT_EQUAL = 38; - final static int TT_UNEQUAL = 39; - final static int TT_GREATER = 40; - final static int TT_GREATEREQUAL = 41; - final static int TT_LESS = 42; - final static int TT_LESSEQUAL = 43; - final static int TT_AND = 44; - final static int TT_OR = 45; - final static int TT_HASH = 46; - final static int TT_DDOT = 47; - final static int TT_DOTASSIGN = 48; - - final static int TT_ASSIGN = 49; - final static int TT_REF = 50; - final static int TT_FOREACH = 51; - final static int TT_AMPERSAND = 52; - final static int TT_DOLLARLISTOPEN = 53; - final static int TT_TILDE = 54; - final static int TT_TILDEASSIGN = 55; - final static int TT_MODASSIGN = 56; - final static int TT_POWASSIGN = 57; - final static int TT_RSHIFTASSIGN = 58; - final static int TT_LSHIFTASSIGN = 59; - final static int TT_ANDASSIGN = 60; - final static int TT_QUESTIONMARK = 61; - final static int TT_DDOT2 = 62; - final static int TT_AT = 63; - // final static int TT_HEREDOC = 64; - - final static int TT_DOLLAROPEN = 127; - final static int TT_ARGOPEN = 128; - final static int TT_ARGCLOSE = 129; - final static int TT_LISTOPEN = 130; - final static int TT_LISTCLOSE = 131; - final static int TT_PARTOPEN = 132; - final static int TT_PARTCLOSE = 133; - final static int TT_COMMA = 134; - - final static int TT_STRING = 136; - final static int TT_IDENTIFIER = 138; - final static int TT_DIGIT = 139; - final static int TT_SEMICOLON = 140; - final static int TT_SLOT = 141; - final static int TT_SLOTSEQUENCE = 142; - final static int TT_DECREMENT = 144; - final static int TT_INCREMENT = 145; - final static int TT_ADDTO = 146; - final static int TT_DIVIDEBY = 147; - final static int TT_SUBTRACTFROM = 148; - final static int TT_TIMESBY = 149; - final static int TT_VARIABLE = 150; - final static int TT_INT_NUMBER = 151; - final static int TT_DOUBLE_NUMBER = 152; - final static int TT_INTERPOLATED_STRING = 153; - final static int TT_STRING_CONSTANT = 154; - - final static int TT_LSHIFT = 155; - final static int TT_RSHIFT = 156; - final static int TT_EX_EQUAL = 157; - final static int TT_EX_UNEQUAL = 158; - final static int TT_LINE = 159; - // final static int TT_AT = 153; // @ + final static int TokenNameEOF = 0; + final static int TokenNameUNDEFINED = 1; + final static int TokenNameHTML = 2; + + final static int TokenNameREMAINDER = 30; + final static int TokenNameNOT = 31; + final static int TokenNameDOT = 32; + final static int TokenNameXOR = 33; + final static int TokenNameDIVIDE = 34; + final static int TokenNameMULTIPLY = 35; + final static int TokenNameSUBTRACT = 36; + final static int TokenNameADD = 37; + final static int TokenNameEQUAL = 38; + final static int TokenNameUNEQUAL = 39; + final static int TokenNameGREATER = 40; + final static int TokenNameGREATEREQUAL = 41; + final static int TokenNameLESS = 42; + final static int TokenNameLESSEQUAL = 43; + final static int TokenNameAND = 44; + final static int TokenNameOR = 45; + final static int TokenNameHASH = 46; + final static int TokenNameDDOT = 47; + final static int TokenNameDOTASSIGN = 48; + + final static int TokenNameASSIGN = 49; + final static int TokenNameREF = 50; + final static int TokenNameFOREACH = 51; + final static int TokenNameAMPERSAND = 52; + final static int TokenNameDOLLARLISTOPEN = 53; + final static int TokenNameTILDE = 54; + final static int TokenNameTILDEASSIGN = 55; + final static int TokenNameREMAINDER_EQUAL = 56; + final static int TokenNameXOR_EQUAL = 57; + final static int TokenNameRIGHT_SHIFT_EQUAL = 58; + final static int TokenNameLEFT_SHIFT_EQUAL = 59; + final static int TokenNameANDASSIGN = 60; + final static int TokenNameQUESTIONMARK = 61; + final static int TokenNameDDOT2 = 62; + final static int TokenNameAT = 63; + // final static int TokenNameHEREDOC = 64; + + final static int TokenNameDOLLAROPEN = 127; + final static int TokenNameARGOPEN = 128; + final static int TokenNameARGCLOSE = 129; + final static int TokenNameLISTOPEN = 130; + final static int TokenNameLISTCLOSE = 131; + final static int TokenNamePARTOPEN = 132; + final static int TokenNamePARTCLOSE = 133; + final static int TokenNameCOMMA = 134; + + final static int TokenNameSTRING = 136; + final static int TokenNameIDENTIFIER = 138; + final static int TokenNameDIGIT = 139; + final static int TokenNameSEMICOLON = 140; + final static int TokenNameSLOT = 141; + final static int TokenNameSLOTSEQUENCE = 142; + final static int TokenNameDECREMENT = 144; + final static int TokenNameINCREMENT = 145; + final static int TokenNameADDTO = 146; + final static int TokenNameDIVIDE_EQUAL = 147; + final static int TokenNameSUBTRACTFROM = 148; + final static int TokenNameTIMESBY = 149; + final static int TokenNameVARIABLE = 150; + final static int TokenNameINT_NUMBER = 151; + final static int TokenNameDOUBLE_NUMBER = 152; + final static int TokenNameINTERPOLATED_STRING = 153; + final static int TokenNameSTRING_CONSTANT = 154; + + final static int TokenNameLEFT_SHIFT = 155; + final static int TokenNameRSHIFT = 156; + final static int TokenNameEX_EQUAL = 157; + final static int TokenNameEX_UNEQUAL = 158; + final static int TokenNameLINE = 159; + // final static int TokenNameAT = 153; // @ /** * Class Constructor. * @@ -162,7 +162,7 @@ public class PHPParser extends PHPKeywords { this.fileToParse = fileToParse; this.phpList = null; this.str = ""; - this.token = TT_EOF; + this.token = TokenNameEOF; this.chIndx = 0; this.rowCount = 1; this.columnCount = 0; @@ -245,7 +245,7 @@ public class PHPParser extends PHPKeywords { chIndx = str.length() + 1; ch = ' '; - // token = TT_EOF; + // token = TokenNameEOF; phpEnd = true; } @@ -254,7 +254,7 @@ public class PHPParser extends PHPKeywords { while (str.length() > chIndx) { ch = str.charAt(chIndx++); - token = TT_UNDEFINED; + token = TokenNameUNDEFINED; if (ch == '\n') { rowCount++; columnCount = chIndx; @@ -268,7 +268,7 @@ public class PHPParser extends PHPKeywords { if (str.length() > chIndx) { if (str.charAt(chIndx) == '{') { chIndx++; - token = TT_DOLLAROPEN; + token = TokenNameDOLLAROPEN; return; } } @@ -335,7 +335,7 @@ public class PHPParser extends PHPKeywords { if (openString) { throwSyntaxError("Open string character '\"' at end of file."); } - token = TT_INTERPOLATED_STRING; + token = TokenNameINTERPOLATED_STRING; return; } else if (ch == '\'') { // read string until end @@ -358,7 +358,7 @@ public class PHPParser extends PHPKeywords { if (openString) { throwSyntaxError("Open string character \"'\" at end of file.", startRow); } - token = TT_STRING_CONSTANT; + token = TokenNameSTRING_CONSTANT; return; } else if (ch == '`') { // read string until end @@ -381,63 +381,63 @@ public class PHPParser extends PHPKeywords { if (openString) { throwSyntaxError("Open string character \"`\" at end of file.", startRow); } - token = TT_STRING_CONSTANT; + token = TokenNameSTRING_CONSTANT; return; } switch (ch) { case '(' : - token = TT_ARGOPEN; + token = TokenNameARGOPEN; break; case ')' : - token = TT_ARGCLOSE; + token = TokenNameARGCLOSE; break; case '{' : - token = TT_LISTOPEN; + token = TokenNameLISTOPEN; break; case '}' : - token = TT_LISTCLOSE; + token = TokenNameLISTCLOSE; break; case '[' : - token = TT_PARTOPEN; + token = TokenNamePARTOPEN; break; case ']' : - token = TT_PARTCLOSE; + token = TokenNamePARTCLOSE; break; case ',' : - token = TT_COMMA; + token = TokenNameCOMMA; break; case '?' : - token = TT_QUESTIONMARK; + token = TokenNameQUESTIONMARK; break; case '@' : - token = TT_AT; + token = TokenNameAT; break; case '~' : - token = TT_TILDE; + token = TokenNameTILDE; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_TILDEASSIGN; + token = TokenNameTILDEASSIGN; break; } } break; case '.' : - token = TT_DOT; + token = TokenNameDOT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_DOTASSIGN; + token = TokenNameDOTASSIGN; break; } @@ -445,42 +445,42 @@ public class PHPParser extends PHPKeywords { break; case '"' : - token = TT_STRING; + token = TokenNameSTRING; break; case '%' : - token = TT_MOD; + token = TokenNameREMAINDER; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_MODASSIGN; + token = TokenNameREMAINDER_EQUAL; break; } } break; case ';' : - token = TT_SEMICOLON; + token = TokenNameSEMICOLON; break; case '^' : - token = TT_POW; + token = TokenNameXOR; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_POWASSIGN; + token = TokenNameXOR_EQUAL; break; } } break; case '/' : - token = TT_DIV; + token = TokenNameDIVIDE; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_DIVIDEBY; + token = TokenNameDIVIDE_EQUAL; break; } @@ -488,17 +488,17 @@ public class PHPParser extends PHPKeywords { break; case '*' : - token = TT_MULTIPLY; + token = TokenNameMULTIPLY; if (str.length() > chIndx) { if (str.charAt(chIndx) == '*') { chIndx++; - token = TT_POW; + token = TokenNameXOR; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_TIMESBY; + token = TokenNameTIMESBY; break; } @@ -506,40 +506,40 @@ public class PHPParser extends PHPKeywords { break; case '+' : - token = TT_ADD; + token = TokenNameADD; if (str.length() > chIndx) { if (str.charAt(chIndx) == '+') { chIndx++; - token = TT_INCREMENT; + token = TokenNameINCREMENT; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_ADDTO; + token = TokenNameADDTO; break; } } break; case '-' : - token = TT_SUBTRACT; + token = TokenNameSUBTRACT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '-') { chIndx++; - token = TT_DECREMENT; + token = TokenNameDECREMENT; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_SUBTRACTFROM; + token = TokenNameSUBTRACTFROM; break; } if (str.charAt(chIndx) == '>') { chIndx++; - token = TT_REF; + token = TokenNameREF; break; } @@ -547,27 +547,27 @@ public class PHPParser extends PHPKeywords { break; case '=' : - token = TT_ASSIGN; + token = TokenNameASSIGN; if (str.length() > chIndx) { ch = str.charAt(chIndx); if (ch == '=') { chIndx++; - token = TT_EQUAL; + token = TokenNameEQUAL; if (str.length() > chIndx) { ch = str.charAt(chIndx); if (ch == '=') { chIndx++; - token = TT_EX_EQUAL; + token = TokenNameEX_EQUAL; } } break; } if (ch == '>') { chIndx++; - token = TT_FOREACH; + token = TokenNameFOREACH; break; } @@ -575,18 +575,18 @@ public class PHPParser extends PHPKeywords { break; case '!' : - token = TT_NOT; + token = TokenNameNOT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_UNEQUAL; + token = TokenNameUNEQUAL; if (str.length() > chIndx) { ch = str.charAt(chIndx); if (ch == '=') { chIndx++; - token = TT_EX_UNEQUAL; + token = TokenNameEX_UNEQUAL; } } break; @@ -595,21 +595,21 @@ public class PHPParser extends PHPKeywords { break; case '>' : - token = TT_GREATER; + token = TokenNameGREATER; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_GREATEREQUAL; + token = TokenNameGREATEREQUAL; break; } if (str.charAt(chIndx) == '>') { chIndx++; - token = TT_RSHIFT; + token = TokenNameRSHIFT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_RSHIFTASSIGN; + token = TokenNameRIGHT_SHIFT_EQUAL; break; } } @@ -619,18 +619,18 @@ public class PHPParser extends PHPKeywords { break; case '<' : - token = TT_LESS; + token = TokenNameLESS; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_LESSEQUAL; + token = TokenNameLESSEQUAL; break; } if (str.charAt(chIndx) == '<') { chIndx++; - token = TT_LSHIFT; + token = TokenNameLEFT_SHIFT; if (str.charAt(chIndx) == '<') { // heredoc int startRow = rowCount; @@ -640,7 +640,7 @@ public class PHPParser extends PHPKeywords { if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch == '_')) { chIndx++; getIdentifier(); - token = TT_STRING_CONSTANT; + token = TokenNameSTRING_CONSTANT; while (str.length() > chIndx) { ch = str.charAt(chIndx++); if (ch == '\n') { @@ -657,7 +657,7 @@ public class PHPParser extends PHPKeywords { throwSyntaxError("Open heredoc syntax after operator '<<<'.", startRow); } else if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_LSHIFTASSIGN; + token = TokenNameLEFT_SHIFT_EQUAL; break; } break; @@ -667,12 +667,12 @@ public class PHPParser extends PHPKeywords { break; case '|' : - token = TT_LINE; + token = TokenNameLINE; if (str.length() > chIndx) { if (str.charAt(chIndx) == '|') { chIndx++; - token = TT_OR; + token = TokenNameOR; break; } @@ -680,16 +680,16 @@ public class PHPParser extends PHPKeywords { break; case '&' : - token = TT_AMPERSAND; + token = TokenNameAMPERSAND; if (str.length() > chIndx) { if (str.charAt(chIndx) == '&') { chIndx++; - token = TT_AND; + token = TokenNameAND; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_ANDASSIGN; + token = TokenNameANDASSIGN; break; } break; @@ -697,27 +697,27 @@ public class PHPParser extends PHPKeywords { break; case ':' : - token = TT_DDOT; + token = TokenNameDDOT; if (str.length() > chIndx) { if (str.charAt(chIndx) == ':') { chIndx++; - token = TT_DDOT2; + token = TokenNameDDOT2; } } break; case '#' : - token = TT_HASH; + token = TokenNameHASH; break; // case '@' : - // token = TT_AT; + // token = TokenNameAT; // // break; default : throwSyntaxError("unexpected character: '" + ch + "'"); } - if (token == TT_UNDEFINED) { + if (token == TokenNameUNDEFINED) { throwSyntaxError("token not found"); } @@ -727,22 +727,22 @@ public class PHPParser extends PHPKeywords { chIndx = str.length() + 1; ch = ' '; - token = TT_EOF; + token = TokenNameEOF; phpEnd = true; PHPString temp; if (phpList != null) { if (currentPHPString < phpList.size()) { - token = TT_UNDEFINED; + token = TokenNameUNDEFINED; temp = (PHPString) phpList.get(currentPHPString++); this.str = temp.getPHPString(); - this.token = TT_EOF; + this.token = TokenNameEOF; this.chIndx = 0; this.rowCount = temp.getLineNumber(); this.columnCount = 0; getNextToken(); phpEnd = true; } else { - token = TT_UNDEFINED; + token = TokenNameUNDEFINED; return; } } @@ -759,7 +759,7 @@ public class PHPParser extends PHPKeywords { if (!phpMode) { while (str.length() > chIndx) { - token = TT_UNDEFINED; + token = TokenNameUNDEFINED; ch = str.charAt(chIndx++); if (ch == '\n') { @@ -798,7 +798,7 @@ public class PHPParser extends PHPKeywords { if (phpMode) { while (str.length() > chIndx) { ch = str.charAt(chIndx++); - token = TT_UNDEFINED; + token = TokenNameUNDEFINED; if (ch == '\n') { rowCount++; columnCount = chIndx; @@ -812,7 +812,7 @@ public class PHPParser extends PHPKeywords { if (str.length() > chIndx) { if (str.charAt(chIndx) == '{') { chIndx++; - token = TT_DOLLAROPEN; + token = TokenNameDOLLAROPEN; return; } } @@ -839,7 +839,7 @@ public class PHPParser extends PHPKeywords { ch2 = str.charAt(chIndx); if (ch2 == '>') { chIndx++; - token = TT_HTML; + token = TokenNameHTML; // php end phpMode = false; phpEnd = true; @@ -875,7 +875,7 @@ public class PHPParser extends PHPKeywords { ch2 = str.charAt(chIndx); if (ch2 == '>') { chIndx++; - token = TT_HTML; + token = TokenNameHTML; // php end phpMode = false; phpEnd = true; @@ -887,13 +887,13 @@ public class PHPParser extends PHPKeywords { continue; } else if (ch == '"') { - getString('"',TT_INTERPOLATED_STRING,"Open string character '\"' at end of file."); + getString('"',TokenNameINTERPOLATED_STRING,"Open string character '\"' at end of file."); return; } else if (ch == '\'') { - getString('\'',TT_STRING_CONSTANT,"Open string character \"'\" at end of file."); + getString('\'',TokenNameSTRING_CONSTANT,"Open string character \"'\" at end of file."); return; } else if (ch == '`') { - getString('`',TT_STRING_CONSTANT,"Open string character \"`\" at end of file."); + getString('`',TokenNameSTRING_CONSTANT,"Open string character \"`\" at end of file."); setMarker("Other string delimiters prefered (found \"`\").", rowCount, PHPParser.INFO); return; } @@ -901,39 +901,39 @@ public class PHPParser extends PHPKeywords { switch (ch) { case '(' : - token = TT_ARGOPEN; + token = TokenNameARGOPEN; break; case ')' : - token = TT_ARGCLOSE; + token = TokenNameARGCLOSE; break; case '{' : - token = TT_LISTOPEN; + token = TokenNameLISTOPEN; break; case '}' : - token = TT_LISTCLOSE; + token = TokenNameLISTCLOSE; break; case '[' : - token = TT_PARTOPEN; + token = TokenNamePARTOPEN; break; case ']' : - token = TT_PARTCLOSE; + token = TokenNamePARTCLOSE; break; case ',' : - token = TT_COMMA; + token = TokenNameCOMMA; break; case '?' : - token = TT_QUESTIONMARK; + token = TokenNameQUESTIONMARK; if (str.length() > chIndx) { if (str.charAt(chIndx) == '>') { chIndx++; - token = TT_HTML; + token = TokenNameHTML; // php end phpMode = false; phpEnd = true; @@ -943,25 +943,25 @@ public class PHPParser extends PHPKeywords { break; case '@' : - token = TT_AT; + token = TokenNameAT; break; case '~' : - token = TT_TILDE; + token = TokenNameTILDE; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_TILDEASSIGN; + token = TokenNameTILDEASSIGN; break; } } break; case '.' : - token = TT_DOT; + token = TokenNameDOT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_DOTASSIGN; + token = TokenNameDOTASSIGN; break; } @@ -969,42 +969,42 @@ public class PHPParser extends PHPKeywords { break; case '"' : - token = TT_STRING; + token = TokenNameSTRING; break; case '%' : - token = TT_MOD; + token = TokenNameREMAINDER; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_MODASSIGN; + token = TokenNameREMAINDER_EQUAL; break; } } break; case ';' : - token = TT_SEMICOLON; + token = TokenNameSEMICOLON; break; case '^' : - token = TT_POW; + token = TokenNameXOR; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_POWASSIGN; + token = TokenNameXOR_EQUAL; break; } } break; case '/' : - token = TT_DIV; + token = TokenNameDIVIDE; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_DIVIDEBY; + token = TokenNameDIVIDE_EQUAL; break; } @@ -1012,17 +1012,17 @@ public class PHPParser extends PHPKeywords { break; case '*' : - token = TT_MULTIPLY; + token = TokenNameMULTIPLY; if (str.length() > chIndx) { if (str.charAt(chIndx) == '*') { chIndx++; - token = TT_POW; + token = TokenNameXOR; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_TIMESBY; + token = TokenNameTIMESBY; break; } @@ -1030,40 +1030,40 @@ public class PHPParser extends PHPKeywords { break; case '+' : - token = TT_ADD; + token = TokenNameADD; if (str.length() > chIndx) { if (str.charAt(chIndx) == '+') { chIndx++; - token = TT_INCREMENT; + token = TokenNameINCREMENT; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_ADDTO; + token = TokenNameADDTO; break; } } break; case '-' : - token = TT_SUBTRACT; + token = TokenNameSUBTRACT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '-') { chIndx++; - token = TT_DECREMENT; + token = TokenNameDECREMENT; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_SUBTRACTFROM; + token = TokenNameSUBTRACTFROM; break; } if (str.charAt(chIndx) == '>') { chIndx++; - token = TT_REF; + token = TokenNameREF; break; } @@ -1071,27 +1071,27 @@ public class PHPParser extends PHPKeywords { break; case '=' : - token = TT_ASSIGN; + token = TokenNameASSIGN; if (str.length() > chIndx) { ch = str.charAt(chIndx); if (ch == '=') { chIndx++; - token = TT_EQUAL; + token = TokenNameEQUAL; if (str.length() > chIndx) { ch = str.charAt(chIndx); if (ch == '=') { chIndx++; - token = TT_EX_EQUAL; + token = TokenNameEX_EQUAL; } } break; } if (ch == '>') { chIndx++; - token = TT_FOREACH; + token = TokenNameFOREACH; break; } @@ -1099,18 +1099,18 @@ public class PHPParser extends PHPKeywords { break; case '!' : - token = TT_NOT; + token = TokenNameNOT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_UNEQUAL; + token = TokenNameUNEQUAL; if (str.length() > chIndx) { ch = str.charAt(chIndx); if (ch == '=') { chIndx++; - token = TT_EX_UNEQUAL; + token = TokenNameEX_UNEQUAL; } } break; @@ -1119,21 +1119,21 @@ public class PHPParser extends PHPKeywords { break; case '>' : - token = TT_GREATER; + token = TokenNameGREATER; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_GREATEREQUAL; + token = TokenNameGREATEREQUAL; break; } if (str.charAt(chIndx) == '>') { chIndx++; - token = TT_RSHIFT; + token = TokenNameRSHIFT; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_RSHIFTASSIGN; + token = TokenNameRIGHT_SHIFT_EQUAL; break; } } @@ -1143,18 +1143,18 @@ public class PHPParser extends PHPKeywords { break; case '<' : - token = TT_LESS; + token = TokenNameLESS; if (str.length() > chIndx) { if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_LESSEQUAL; + token = TokenNameLESSEQUAL; break; } if (str.charAt(chIndx) == '<') { chIndx++; - token = TT_LSHIFT; + token = TokenNameLEFT_SHIFT; if (str.charAt(chIndx) == '<') { // heredoc int startRow = rowCount; @@ -1164,7 +1164,7 @@ public class PHPParser extends PHPKeywords { if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch == '_')) { chIndx++; getIdentifier(); - token = TT_STRING_CONSTANT; + token = TokenNameSTRING_CONSTANT; while (str.length() > chIndx) { ch = str.charAt(chIndx++); if (ch == '\n') { @@ -1181,7 +1181,7 @@ public class PHPParser extends PHPKeywords { throwSyntaxError("Open heredoc syntax after operator '<<<'.", startRow); } else if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_LSHIFTASSIGN; + token = TokenNameLEFT_SHIFT_EQUAL; break; } break; @@ -1191,12 +1191,12 @@ public class PHPParser extends PHPKeywords { break; case '|' : - token = TT_LINE; + token = TokenNameLINE; if (str.length() > chIndx) { if (str.charAt(chIndx) == '|') { chIndx++; - token = TT_OR; + token = TokenNameOR; break; } @@ -1204,16 +1204,16 @@ public class PHPParser extends PHPKeywords { break; case '&' : - token = TT_AMPERSAND; + token = TokenNameAMPERSAND; if (str.length() > chIndx) { if (str.charAt(chIndx) == '&') { chIndx++; - token = TT_AND; + token = TokenNameAND; break; } if (str.charAt(chIndx) == '=') { chIndx++; - token = TT_ANDASSIGN; + token = TokenNameANDASSIGN; break; } break; @@ -1221,27 +1221,27 @@ public class PHPParser extends PHPKeywords { break; case ':' : - token = TT_DDOT; + token = TokenNameDDOT; if (str.length() > chIndx) { if (str.charAt(chIndx) == ':') { chIndx++; - token = TT_DDOT2; + token = TokenNameDDOT2; } } break; case '#' : - token = TT_HASH; + token = TokenNameHASH; break; // case '@' : - // token = TT_AT; + // token = TokenNameAT; // // break; default : throwSyntaxError("unexpected character: '" + ch + "'"); } - if (token == TT_UNDEFINED) { + if (token == TokenNameUNDEFINED) { throwSyntaxError("token not found"); } @@ -1255,22 +1255,22 @@ public class PHPParser extends PHPKeywords { chIndx = str.length() + 1; ch = ' '; - token = TT_EOF; + token = TokenNameEOF; phpEnd = true; //PHPString temp; // if (phpList != null) { // if (currentPHPString < phpList.size()) { - // token = TT_UNDEFINED; + // token = TokenNameUNDEFINED; // temp = (PHPString) phpList.get(currentPHPString++); // this.str = temp.getPHPString(); - // this.token = TT_EOF; + // this.token = TokenNameEOF; // this.chIndx = 0; // this.rowCount = temp.getLineNumber(); // this.columnCount = 0; // getNextToken(); // phpEnd = true; // } else { - // token = TT_UNDEFINED; + // token = TokenNameUNDEFINED; // return; // } // } @@ -1287,10 +1287,10 @@ public class PHPParser extends PHPKeywords { getChar(); // attention recursive call: getIdentifier(); - token = TT_VARIABLE; + token = TokenNameVARIABLE; return; } else { - token = TT_IDENTIFIER; + token = TokenNameIDENTIFIER; } getChar(); @@ -1317,9 +1317,9 @@ public class PHPParser extends PHPKeywords { /** * Get a number. * if it's a double the number will be stored in doubleNumber and the token will have the - * value {@link PHPParser#TT_DOUBLE_NUMBER}
+ * value {@link PHPParser#TokenNameDOUBLE_NUMBER}
* if it's a double the number will be stored in longNumber and the token will have the - * value {@link PHPParser#TT_INT_NUMBER} + * value {@link PHPParser#TokenNameINT_NUMBER} */ private void getNumber() { StringBuffer inum = new StringBuffer(); @@ -1393,11 +1393,11 @@ public class PHPParser extends PHPKeywords { try { if (dFlag != ' ') { doubleNumber = new Double(inum.toString()); - token = TT_DOUBLE_NUMBER; + token = TokenNameDOUBLE_NUMBER; return; } else { longNumber = Long.valueOf(inum.toString(), numFormat); - token = TT_INT_NUMBER; + token = TokenNameINT_NUMBER; return; } @@ -1409,7 +1409,7 @@ public class PHPParser extends PHPKeywords { /** * Get a String. * @param openChar the opening char ('\'', '"', '`') - * @param typeString the type of string {@link #TT_STRING_CONSTANT},{@link #TT_INTERPOLATED_STRING} + * @param typeString the type of string {@link #TokenNameSTRING_CONSTANT},{@link #TokenNameINTERPOLATED_STRING} * @param errorMsg the error message in case of parse error in the string */ private void getString(final char openChar, final int typeString, final String errorMsg) { @@ -1435,7 +1435,7 @@ public class PHPParser extends PHPKeywords { } } if (openString) { - if (typeString == TT_STRING_CONSTANT) { + if (typeString == TokenNameSTRING_CONSTANT) { throwSyntaxError(errorMsg, startRow); } else { throwSyntaxError(errorMsg); @@ -1640,7 +1640,7 @@ public class PHPParser extends PHPKeywords { this.str = ((PHPString) phpList.get(currentPHPString++)).getPHPString(); } } - this.token = TT_EOF; + this.token = TokenNameEOF; this.chIndx = 0; this.rowCount = rowCount; this.columnCount = 0; @@ -1649,27 +1649,27 @@ public class PHPParser extends PHPKeywords { getNextToken(); do { try { - if (token != TT_EOF && token != TT_UNDEFINED) { + if (token != TokenNameEOF && token != TokenNameUNDEFINED) { statementList(); } - if (token != TT_EOF && token != TT_UNDEFINED) { - if (token == TT_ARGCLOSE) { + if (token != TokenNameEOF && token != TokenNameUNDEFINED) { + if (token == TokenNameARGCLOSE) { throwSyntaxError("Too many closing ')'; end-of-file not reached."); } - if (token == TT_LISTCLOSE) { + if (token == TokenNameLISTCLOSE) { throwSyntaxError("Too many closing '}'; end-of-file not reached."); } - if (token == TT_PARTCLOSE) { + if (token == TokenNamePARTCLOSE) { throwSyntaxError("Too many closing ']'; end-of-file not reached."); } - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { throwSyntaxError("Read character '('; end-of-file not reached."); } - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { throwSyntaxError("Read character '{'; end-of-file not reached."); } - if (token == TT_PARTOPEN) { + if (token == TokenNamePARTOPEN) { throwSyntaxError("Read character '['; end-of-file not reached."); } @@ -1685,13 +1685,13 @@ public class PHPParser extends PHPKeywords { // if an error occured, // try to find keywords 'class' or 'function' // to parse the rest of the string - while (token != TT_EOF && token != TT_UNDEFINED) { - if (token == TT_class || token == TT_function) { + while (token != TokenNameEOF && token != TokenNameUNDEFINED) { + if (token == TokenNameclass || token == TokenNamefunction) { break; } getNextToken(); } - if (token == TT_EOF || token == TT_UNDEFINED) { + if (token == TokenNameEOF || token == TokenNameUNDEFINED) { return; } } @@ -1705,7 +1705,7 @@ public class PHPParser extends PHPKeywords { */ public void parse(String s) throws CoreException { this.str = s; - this.token = TT_EOF; + this.token = TokenNameEOF; this.chIndx = 0; this.rowCount = 1; this.columnCount = 0; @@ -1714,27 +1714,27 @@ public class PHPParser extends PHPKeywords { getNextToken(); do { try { - if (token != TT_EOF && token != TT_UNDEFINED) { + if (token != TokenNameEOF && token != TokenNameUNDEFINED) { statementList(); } - if (token != TT_EOF && token != TT_UNDEFINED) { - if (token == TT_ARGCLOSE) { + if (token != TokenNameEOF && token != TokenNameUNDEFINED) { + if (token == TokenNameARGCLOSE) { throwSyntaxError("Too many closing ')'; end-of-file not reached."); } - if (token == TT_LISTCLOSE) { + if (token == TokenNameLISTCLOSE) { throwSyntaxError("Too many closing '}'; end-of-file not reached."); } - if (token == TT_PARTCLOSE) { + if (token == TokenNamePARTCLOSE) { throwSyntaxError("Too many closing ']'; end-of-file not reached."); } - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { throwSyntaxError("Read character '('; end-of-file not reached."); } - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { throwSyntaxError("Read character '{'; end-of-file not reached."); } - if (token == TT_PARTOPEN) { + if (token == TokenNamePARTOPEN) { throwSyntaxError("Read character '['; end-of-file not reached."); } @@ -1747,13 +1747,13 @@ public class PHPParser extends PHPKeywords { // if an error occured, // try to find keywords 'class' or 'function' // to parse the rest of the string - while (token != TT_EOF && token != TT_UNDEFINED) { - if (token == TT_class || token == TT_function) { + while (token != TokenNameEOF && token != TokenNameUNDEFINED) { + if (token == TokenNameclass || token == TokenNamefunction) { break; } getNextToken(); } - if (token == TT_EOF || token == TT_UNDEFINED) { + if (token == TokenNameEOF || token == TokenNameUNDEFINED) { return; } } catch (SyntaxError sytaxErr2) { @@ -1771,7 +1771,7 @@ public class PHPParser extends PHPKeywords { // stack.push(outlineInfo.getDeclarations()); this.str = s; - this.token = TT_EOF; + this.token = TokenNameEOF; this.chIndx = 0; this.rowCount = 1; this.columnCount = 0; @@ -1793,30 +1793,30 @@ public class PHPParser extends PHPKeywords { String oldIdentifier; IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); try { - while (token != TT_EOF && token != TT_UNDEFINED) { - if (token == TT_VARIABLE) { + while (token != TokenNameEOF && token != TokenNameUNDEFINED) { + if (token == TokenNameVARIABLE) { outlineInfo.addVariable(identifier); getNextToken(); - } else if (token == TT_var) { + } else if (token == TokenNamevar) { getNextToken(); - if (token == TT_VARIABLE && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_VAR)) { + if (token == TokenNameVARIABLE && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_VAR)) { getNextToken(); outlineInfo.addVariable(identifier); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { oldIdentifier = identifier; getNextToken(); switch (token) { - case TT_VARIABLE : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),identifier)); + case TokenNameVARIABLE : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),identifier)); break; - case TT_IDENTIFIER : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),identifier)); + case TokenNameIDENTIFIER : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),identifier)); break; - case TT_DOUBLE_NUMBER : current.add(new PHPVarDeclaration(current, oldIdentifier + doubleNumber, chIndx - identifier.length(),doubleNumber.toString())); + case TokenNameDOUBLE_NUMBER : current.add(new PHPVarDeclaration(current, oldIdentifier + doubleNumber, chIndx - identifier.length(),doubleNumber.toString())); break; - case TT_INT_NUMBER : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),longNumber.toString())); + case TokenNameINT_NUMBER : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),longNumber.toString())); break; - case TT_INTERPOLATED_STRING : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),stringValue)); + case TokenNameINTERPOLATED_STRING : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),stringValue)); break; - case TT_STRING_CONSTANT : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),stringValue)); + case TokenNameSTRING_CONSTANT : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length(),stringValue)); break; default : current.add(new PHPVarDeclaration(current, oldIdentifier, chIndx - identifier.length())); break; @@ -1825,21 +1825,21 @@ public class PHPParser extends PHPKeywords { current.add(new PHPVarDeclaration(current, identifier, chIndx - identifier.length())); } } - } else if (token == TT_function) { + } else if (token == TokenNamefunction) { getNextToken(); - if (token == TT_AMPERSAND) { + if (token == TokenNameAMPERSAND) { getNextToken(); } - if (token == TT_IDENTIFIER && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_FUNC)) { + if (token == TokenNameIDENTIFIER && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_FUNC)) { outlineInfo.addVariable(identifier); temp = new PHPFunctionDeclaration(current, identifier, chIndx - identifier.length()); current.add(temp); getNextToken(); parseDeclarations(outlineInfo, temp, true); } - } else if (token == TT_class) { + } else if (token == TokenNameclass) { getNextToken(); - if (token == TT_IDENTIFIER && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_CLASS)) { + if (token == TokenNameIDENTIFIER && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_CLASS)) { outlineInfo.addVariable(identifier); temp = new PHPClassDeclaration(current, identifier, chIndx - identifier.length()); current.add(temp); @@ -1847,22 +1847,22 @@ public class PHPParser extends PHPKeywords { getNextToken(); //skip tokens for classname, extends and others until we have the opening '{' - while (token != TT_LISTOPEN && token != TT_EOF && token != TT_UNDEFINED) { + while (token != TokenNameLISTOPEN && token != TokenNameEOF && token != TokenNameUNDEFINED) { getNextToken(); } parseDeclarations(outlineInfo, temp, true); // stack.pop(); } - } else if (token == TT_LISTOPEN) { + } else if (token == TokenNameLISTOPEN) { getNextToken(); counter++; - } else if (token == TT_LISTCLOSE) { + } else if (token == TokenNameLISTCLOSE) { getNextToken(); --counter; if (counter == 0 && goBack) { return; } - } else if (token == TT_require || token == TT_require_once || token == TT_include || token == TT_include_once) { + } else if (token == TokenNamerequire || token == TokenNamerequire_once || token == TokenNameinclude || token == TokenNameinclude_once) { expression(); outlineInfo.addVariable(identifier); current.add(new PHPReqIncDeclaration(current, identifier, chIndx - identifier.length(),expression.toString())); @@ -1883,17 +1883,17 @@ public class PHPParser extends PHPKeywords { private void statementList() throws CoreException { do { statement(); - if ((token == TT_LISTCLOSE) - || (token == TT_case) - || (token == TT_default) - || (token == TT_elseif) - || (token == TT_endif) - || (token == TT_endfor) - || (token == TT_endforeach) - || (token == TT_endwhile) - || (token == TT_endswitch) - || (token == TT_EOF) - || (token == TT_UNDEFINED)) { + if ((token == TokenNameLISTCLOSE) + || (token == TokenNamecase) + || (token == TokenNamedefault) + || (token == TokenNameelseif) + || (token == TokenNameendif) + || (token == TokenNameendfor) + || (token == TokenNameendforeach) + || (token == TokenNameendwhile) + || (token == TokenNameendswitch) + || (token == TokenNameEOF) + || (token == TokenNameUNDEFINED)) { return; } } while (true); @@ -1901,15 +1901,15 @@ public class PHPParser extends PHPKeywords { private void compoundStatement() throws CoreException { // '{' [statement-list] '}' - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { getNextToken(); } else { throwSyntaxError("'{' expected in compound-statement."); } - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { statementList(); } - if (token == TT_LISTCLOSE) { + if (token == TokenNameLISTCLOSE) { getNextToken(); } else { throwSyntaxError("'}' expected in compound-statement."); @@ -1917,12 +1917,12 @@ public class PHPParser extends PHPKeywords { } private void statement() throws CoreException { - // if (token > TT_KEYWORD && token != TT_list && token != TT_new) { + // if (token > TokenNameKEYWORD && token != TokenNamelist && token != TokenNamenew) { String keyword = identifier; - if (token == TT_include || token == TT_include_once) { + if (token == TokenNameinclude || token == TokenNameinclude_once) { getNextToken(); expression(); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -1931,11 +1931,11 @@ public class PHPParser extends PHPKeywords { getNextToken(); } return; - } else if (token == TT_require || token == TT_require_once) { + } else if (token == TokenNamerequire || token == TokenNamerequire_once) { getNextToken(); //constant(); expression(); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -1944,15 +1944,15 @@ public class PHPParser extends PHPKeywords { getNextToken(); } return; - } else if (token == TT_if) { + } else if (token == TokenNameif) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'if' keyword."); } expression(); - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'if' condition."); @@ -1960,53 +1960,53 @@ public class PHPParser extends PHPKeywords { ifStatement(); return; - } else if (token == TT_switch) { + } else if (token == TokenNameswitch) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'switch' keyword."); } expression(); - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'switch' condition."); } switchStatement(); return; - } else if (token == TT_for) { + } else if (token == TokenNamefor) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'for' keyword."); } - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { expressionList(); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { throwSyntaxError("';' expected after 'for'."); } } - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { expressionList(); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { throwSyntaxError("';' expected after 'for'."); } } - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { expressionList(); - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'for'."); @@ -2014,45 +2014,45 @@ public class PHPParser extends PHPKeywords { } forStatement(); return; - } else if (token == TT_while) { + } else if (token == TokenNamewhile) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'while' keyword."); } expression(); - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'while' condition."); } whileStatement(); return; - } else if (token == TT_do) { + } else if (token == TokenNamedo) { getNextToken(); - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { getNextToken(); } else { throwSyntaxError("'{' expected after 'do' keyword."); } - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { statementList(); } - if (token == TT_LISTCLOSE) { + if (token == TokenNameLISTCLOSE) { getNextToken(); } else { throwSyntaxError("'}' expected after 'do' keyword."); } - if (token == TT_while) { + if (token == TokenNamewhile) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'while' keyword."); } expression(); - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'while' condition."); @@ -2060,7 +2060,7 @@ public class PHPParser extends PHPKeywords { } else { throwSyntaxError("'while' expected after 'do' keyword."); } - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -2069,25 +2069,25 @@ public class PHPParser extends PHPKeywords { getNextToken(); } return; - } else if (token == TT_foreach) { + } else if (token == TokenNameforeach) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'foreach' keyword."); } expression(); - if (token == TT_as) { + if (token == TokenNameas) { getNextToken(); } else { throwSyntaxError("'as' expected after 'foreach' exxpression."); } variable(); - if (token == TT_FOREACH) { + if (token == TokenNameFOREACH) { getNextToken(); variable(); } - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'foreach' expression."); @@ -2095,12 +2095,12 @@ public class PHPParser extends PHPKeywords { foreachStatement(); return; - } else if (token == TT_continue || token == TT_break || token == TT_return) { + } else if (token == TokenNamecontinue || token == TokenNamebreak || token == TokenNamereturn) { getNextToken(); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { expression(); } - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -2110,10 +2110,10 @@ public class PHPParser extends PHPKeywords { } return; - } else if (token == TT_echo) { + } else if (token == TokenNameecho) { getNextToken(); expressionList(); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -2122,10 +2122,10 @@ public class PHPParser extends PHPKeywords { getNextToken(); } return; - // } else if (token == TT_print) { + // } else if (token == TokenNameprint) { // getNextToken(); // expression(); - // if (token == TT_SEMICOLON) { + // if (token == TokenNameSEMICOLON) { // getNextToken(); // } else { // if (!phpEnd) { @@ -2135,10 +2135,10 @@ public class PHPParser extends PHPKeywords { // } // return; - } else if (token == TT_global || token == TT_static) { + } else if (token == TokenNameglobal || token == TokenNamestatic) { getNextToken(); variableList(); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -2148,20 +2148,20 @@ public class PHPParser extends PHPKeywords { } return; - // } else if (token == TT_unset) { + // } else if (token == TokenNameunset) { // getNextToken(); - // if (token == TT_ARGOPEN) { + // if (token == TokenNameARGOPEN) { // getNextToken(); // } else { // throwSyntaxError("'(' expected after 'unset' keyword."); // } // variableList(); - // if (token == TT_ARGCLOSE) { + // if (token == TokenNameARGCLOSE) { // getNextToken(); // } else { // throwSyntaxError("')' expected after 'unset' statement."); // } - // if (token == TT_SEMICOLON) { + // if (token == TokenNameSEMICOLON) { // getNextToken(); // } else { // if (!phpEnd) { @@ -2171,12 +2171,12 @@ public class PHPParser extends PHPKeywords { // } // return; - // } else if (token == TT_exit || token == TT_die) { + // } else if (token == TokenNameexit || token == TokenNamedie) { // getNextToken(); - // if (token != TT_SEMICOLON) { + // if (token != TokenNameSEMICOLON) { // exitStatus(); // } - // if (token == TT_SEMICOLON) { + // if (token == TokenNameSEMICOLON) { // getNextToken(); // } else { // if (!phpEnd) { @@ -2186,30 +2186,30 @@ public class PHPParser extends PHPKeywords { // } // return; - } else if (token == TT_define) { + } else if (token == TokenNamedefine) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'define' keyword."); } expression(); - if (token == TT_COMMA) { + if (token == TokenNameCOMMA) { getNextToken(); } else { throwSyntaxError("',' expected after first 'define' constant."); } expression(); - if (token == TT_COMMA) { + if (token == TokenNameCOMMA) { getNextToken(); expression(); } - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'define' statement."); } - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { if (!phpEnd) { @@ -2218,34 +2218,34 @@ public class PHPParser extends PHPKeywords { getNextToken(); } return; - } else if (token == TT_function) { + } else if (token == TokenNamefunction) { getNextToken(); functionDefinition(); return; - } else if (token == TT_class) { + } else if (token == TokenNameclass) { getNextToken(); classDeclarator(); classBody(); return; // } else { // throwSyntaxError("Unexpected keyword '" + keyword + "'"); - } else if (token == TT_LISTOPEN) { + } else if (token == TokenNameLISTOPEN) { // compoundStatement getNextToken(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { statementList(); } - if (token == TT_LISTCLOSE) { + if (token == TokenNameLISTCLOSE) { getNextToken(); return; } else { throwSyntaxError("'}' expected."); } } else { - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { expression(); } - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); return; } else { @@ -2260,11 +2260,11 @@ public class PHPParser extends PHPKeywords { private void classDeclarator() throws CoreException { //identifier //identifier 'extends' identifier - if (token == TT_IDENTIFIER) { + if (token == TokenNameIDENTIFIER) { getNextToken(); - if (token == TT_extends) { + if (token == TokenNameextends) { getNextToken(); - if (token == TT_IDENTIFIER) { + if (token == TokenNameIDENTIFIER) { getNextToken(); } else { throwSyntaxError("Class name expected after keyword 'extends'."); @@ -2277,12 +2277,12 @@ public class PHPParser extends PHPKeywords { private void classBody() throws CoreException { //'{' [class-element-list] '}' - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { getNextToken(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { classElementList(); } - if (token == TT_LISTCLOSE) { + if (token == TokenNameLISTCLOSE) { getNextToken(); } else { throwSyntaxError("'}' expected at end of class body."); @@ -2295,16 +2295,16 @@ public class PHPParser extends PHPKeywords { private void classElementList() throws CoreException { do { classElement(); - } while (token == TT_function || token == TT_var); + } while (token == TokenNamefunction || token == TokenNamevar); } private void classElement() throws CoreException { //class-property //function-definition - if (token == TT_function) { + if (token == TokenNamefunction) { getNextToken(); functionDefinition(); - } else if (token == TT_var) { + } else if (token == TokenNamevar) { getNextToken(); classProperty(); } else { @@ -2316,21 +2316,21 @@ public class PHPParser extends PHPKeywords { //'var' variable ';' //'var' variable '=' constant ';' do { - if (token == TT_VARIABLE) { + if (token == TokenNameVARIABLE) { getNextToken(); - if (token == TT_ASSIGN) { + if (token == TokenNameASSIGN) { getNextToken(); constant(); } } else { throwSyntaxError("Variable expected after keyword 'var'."); } - if (token != TT_COMMA) { + if (token != TokenNameCOMMA) { break; } getNextToken(); } while (true); - if (token == TT_SEMICOLON) { + if (token == TokenNameSEMICOLON) { getNextToken(); } else { throwSyntaxError("';' expected after variable declaration."); @@ -2344,20 +2344,20 @@ public class PHPParser extends PHPKeywords { private void functionDeclarator() throws CoreException { //identifier '(' [parameter-list] ')' - if (token == TT_AMPERSAND) { + if (token == TokenNameAMPERSAND) { getNextToken(); } - if (token == TT_IDENTIFIER) { + if (token == TokenNameIDENTIFIER) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected in function declaration."); } - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { parameterList(); } - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError("')' expected in function declaration."); } else { getNextToken(); @@ -2370,7 +2370,7 @@ public class PHPParser extends PHPKeywords { //parameter-list ',' parameter-declaration do { parameterDeclaration(); - if (token != TT_COMMA) { + if (token != TokenNameCOMMA) { break; } getNextToken(); @@ -2380,18 +2380,18 @@ public class PHPParser extends PHPKeywords { private void parameterDeclaration() throws CoreException { //variable //variable-reference - if (token == TT_AMPERSAND) { + if (token == TokenNameAMPERSAND) { getNextToken(); - if (token == TT_VARIABLE) { + if (token == TokenNameVARIABLE) { getNextToken(); } else { throwSyntaxError("Variable expected after reference operator '&'."); } } //variable '=' constant - if (token == TT_VARIABLE) { + if (token == TokenNameVARIABLE) { getNextToken(); - if (token == TT_ASSIGN) { + if (token == TokenNameASSIGN) { getNextToken(); constant(); } @@ -2400,55 +2400,55 @@ public class PHPParser extends PHPKeywords { } private void labeledStatementList() throws CoreException { - if (token != TT_case && token != TT_default) { + if (token != TokenNamecase && token != TokenNamedefault) { throwSyntaxError("'case' or 'default' expected."); } do { - if (token == TT_case) { + if (token == TokenNamecase) { getNextToken(); constant(); - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); - if (token == TT_case || token == TT_default) { // empty case statement ? + if (token == TokenNamecase || token == TokenNamedefault) { // empty case statement ? continue; } statementList(); - } else if (token == TT_SEMICOLON) { + } else if (token == TokenNameSEMICOLON) { setMarker("':' expected after 'case' keyword found ';'.", rowCount, PHPParser.INFO); getNextToken(); - if (token == TT_case) { // empty case statement ? + if (token == TokenNamecase) { // empty case statement ? continue; } statementList(); } else { throwSyntaxError("':' character after 'case' constant expected."); } - } else { // TT_default + } else { // TokenNamedefault getNextToken(); - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); } else { throwSyntaxError("':' character after 'default' expected."); } } - } while (token == TT_case || token == TT_default); + } while (token == TokenNamecase || token == TokenNamedefault); } // public void labeledStatement() { - // if (token == TT_case) { + // if (token == TokenNamecase) { // getNextToken(); // constant(); - // if (token == TT_DDOT) { + // if (token == TokenNameDDOT) { // getNextToken(); // statement(); // } else { // throwSyntaxError("':' character after 'case' constant expected."); // } // return; - // } else if (token == TT_default) { + // } else if (token == TokenNamedefault) { // getNextToken(); - // if (token == TT_DDOT) { + // if (token == TokenNameDDOT) { // getNextToken(); // statement(); // } else { @@ -2490,17 +2490,17 @@ public class PHPParser extends PHPKeywords { private void ifStatement() throws CoreException { // ':' statement-list [elseif-list] [else-colon-statement] 'endif' ';' - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); switch (token) { - case TT_else : + case TokenNameelse : getNextToken(); - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); } else { - if (token == TT_if) { //'else if' + if (token == TokenNameif) { //'else if' getNextToken(); elseifStatementList(); } else { @@ -2508,38 +2508,38 @@ public class PHPParser extends PHPKeywords { } } break; - case TT_elseif : + case TokenNameelseif : getNextToken(); elseifStatementList(); break; } - if (token != TT_endif) { + if (token != TokenNameendif) { throwSyntaxError("'endif' expected."); } getNextToken(); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { throwSyntaxError("';' expected after if-statement."); } getNextToken(); } else { // statement [else-statement] statement(); - if (token == TT_elseif) { + if (token == TokenNameelseif) { getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected after 'elseif' keyword."); } expression(); - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'elseif' condition."); } ifStatement(); - } else if (token == TT_else) { + } else if (token == TokenNameelse) { getNextToken(); statement(); } @@ -2550,21 +2550,21 @@ public class PHPParser extends PHPKeywords { do { elseifStatement(); switch (token) { - case TT_else : + case TokenNameelse : getNextToken(); - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); return; } else { - if (token == TT_if) { //'else if' + if (token == TokenNameif) { //'else if' getNextToken(); } else { throwSyntaxError("':' expected after 'else'."); } } break; - case TT_elseif : + case TokenNameelseif : getNextToken(); break; default : @@ -2574,14 +2574,14 @@ public class PHPParser extends PHPKeywords { } private void elseifStatement() throws CoreException { - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); expression(); - if (token != TT_ARGOPEN) { + if (token != TokenNameARGOPEN) { throwSyntaxError("')' expected in else-if-statement."); } getNextToken(); - if (token != TT_DDOT) { + if (token != TokenNameDDOT) { throwSyntaxError("':' expected in else-if-statement."); } getNextToken(); @@ -2590,28 +2590,28 @@ public class PHPParser extends PHPKeywords { } private void switchStatement() throws CoreException { - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { // ':' [labeled-statement-list] 'endswitch' ';' getNextToken(); labeledStatementList(); - if (token != TT_endswitch) { + if (token != TokenNameendswitch) { throwSyntaxError("'endswitch' expected."); } getNextToken(); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { throwSyntaxError("';' expected after switch-statement."); } getNextToken(); } else { // '{' [labeled-statement-list] '}' - if (token != TT_LISTOPEN) { + if (token != TokenNameLISTOPEN) { throwSyntaxError("'{' expected in switch statement."); } getNextToken(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { labeledStatementList(); } - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { throwSyntaxError("'}' expected in switch statement."); } getNextToken(); @@ -2620,14 +2620,14 @@ public class PHPParser extends PHPKeywords { } private void forStatement() throws CoreException { - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); - if (token != TT_endfor) { + if (token != TokenNameendfor) { throwSyntaxError("'endfor' expected."); } getNextToken(); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { throwSyntaxError("';' expected after for-statement."); } getNextToken(); @@ -2638,14 +2638,14 @@ public class PHPParser extends PHPKeywords { private void whileStatement() throws CoreException { // ':' statement-list 'endwhile' ';' - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); - if (token != TT_endwhile) { + if (token != TokenNameendwhile) { throwSyntaxError("'endwhile' expected."); } getNextToken(); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { throwSyntaxError("';' expected after while-statement."); } getNextToken(); @@ -2655,14 +2655,14 @@ public class PHPParser extends PHPKeywords { } private void foreachStatement() throws CoreException { - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); statementList(); - if (token != TT_endforeach) { + if (token != TokenNameendforeach) { throwSyntaxError("'endforeach' expected."); } getNextToken(); - if (token != TT_SEMICOLON) { + if (token != TokenNameSEMICOLON) { throwSyntaxError("';' expected after foreach-statement."); } getNextToken(); @@ -2672,15 +2672,15 @@ public class PHPParser extends PHPKeywords { } private void exitStatus() throws CoreException { - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); } else { throwSyntaxError("'(' expected in 'exit-status'."); } - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { expression(); } - if (token == TT_ARGCLOSE) { + if (token == TokenNameARGCLOSE) { getNextToken(); } else { throwSyntaxError("')' expected after 'exit-status'."); @@ -2690,7 +2690,7 @@ public class PHPParser extends PHPKeywords { private void expressionList() throws CoreException { do { expression(); - if (token == TT_COMMA) { + if (token == TokenNameCOMMA) { getNextToken(); } else { break; @@ -2707,11 +2707,11 @@ public class PHPParser extends PHPKeywords { } expression.append(str.charAt(i)); } - // if (token == TT_STRING_CONSTANT || token == TT_INTERPOLATED_STRING) { + // if (token == TokenNameSTRING_CONSTANT || token == TokenNameINTERPOLATED_STRING) { // getNextToken(); // } else { logicalinclusiveorExpression(); - // while (token != TT_SEMICOLON) { + // while (token != TokenNameSEMICOLON) { // getNextToken(); // // } // } @@ -2721,28 +2721,28 @@ public class PHPParser extends PHPKeywords { String ident; boolean castFlag = false; switch (token) { - case TT_new : + case TokenNamenew : getNextToken(); expression(); break; - case TT_null : + case TokenNamenull : getNextToken(); break; - case TT_false : + case TokenNamefalse : getNextToken(); break; - case TT_true : + case TokenNametrue : getNextToken(); break; - case TT_STRING_CONSTANT : + case TokenNameSTRING_CONSTANT : getNextToken(); break; - case TT_INTERPOLATED_STRING : + case TokenNameINTERPOLATED_STRING : getNextToken(); break; - case TT_ARGOPEN : + case TokenNameARGOPEN : getNextToken(); - if (token == TT_IDENTIFIER) { + if (token == TokenNameIDENTIFIER) { // check if identifier is a type: ident = identifier; String str = identifier.toLowerCase(); @@ -2754,7 +2754,7 @@ public class PHPParser extends PHPKeywords { } if (castFlag) { getNextToken(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError(") expected after cast-type '" + ident + "'."); } getNextToken(); @@ -2765,64 +2765,64 @@ public class PHPParser extends PHPKeywords { if (!castFlag) { expression(); } - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError(") expected in postfix-expression."); } getNextToken(); break; - case TT_DOUBLE_NUMBER : + case TokenNameDOUBLE_NUMBER : getNextToken(); break; - case TT_INT_NUMBER : + case TokenNameINT_NUMBER : getNextToken(); break; - case TT_DOLLAROPEN : + case TokenNameDOLLAROPEN : getNextToken(); expression(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { throwSyntaxError("'}' expected after indirect variable token '${'."); } getNextToken(); break; - case TT_VARIABLE : + case TokenNameVARIABLE : ident = identifier; getNextToken(); - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { getNextToken(); expression(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { throwSyntaxError("'}' expected after variable '" + ident + "' in variable-expression."); } getNextToken(); - } else if (token == TT_ARGOPEN) { + } else if (token == TokenNameARGOPEN) { getNextToken(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { expressionList(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError("')' expected after variable '" + ident + "' in postfix-expression."); } } getNextToken(); } break; - case TT_IDENTIFIER : + case TokenNameIDENTIFIER : ident = identifier; getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { expressionList(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError("')' expected after identifier '" + ident + "' in postfix-expression."); } } getNextToken(); } break; - case TT_print : + case TokenNameprint : getNextToken(); expression(); - // if (token == TT_SEMICOLON) { + // if (token == TokenNameSEMICOLON) { // getNextToken(); // } else { // if (!phpEnd) { @@ -2831,19 +2831,19 @@ public class PHPParser extends PHPKeywords { // getNextToken(); // } break; - case TT_list : + case TokenNamelist : getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); - if (token == TT_COMMA) { + if (token == TokenNameCOMMA) { getNextToken(); } expressionList(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError("')' expected after 'list' keyword."); } getNextToken(); - // if (token == TT_SET) { + // if (token == TokenNameSET) { // getNextToken(); // logicalinclusiveorExpression(); // } @@ -2851,12 +2851,12 @@ public class PHPParser extends PHPKeywords { throwSyntaxError("'(' expected after 'list' keyword."); } break; - // case TT_exit : + // case TokenNameexit : // getNextToken(); - // if (token != TT_SEMICOLON) { + // if (token != TokenNameSEMICOLON) { // exitStatus(); // } - // if (token == TT_SEMICOLON) { + // if (token == TokenNameSEMICOLON) { // getNextToken(); // } else { // if (!phpEnd) { @@ -2865,12 +2865,12 @@ public class PHPParser extends PHPKeywords { // getNextToken(); // } // break; - // case TT_die : + // case TokenNamedie : // getNextToken(); - // if (token != TT_SEMICOLON) { + // if (token != TokenNameSEMICOLON) { // exitStatus(); // } - // if (token == TT_SEMICOLON) { + // if (token == TokenNameSEMICOLON) { // getNextToken(); // } else { // if (!phpEnd) { @@ -2879,19 +2879,19 @@ public class PHPParser extends PHPKeywords { // } // break; - // case TT_array : + // case TokenNamearray : // getNextToken(); - // if (token == TT_ARGOPEN) { + // if (token == TokenNameARGOPEN) { // getNextToken(); - // if (token == TT_COMMA) { + // if (token == TokenNameCOMMA) { // getNextToken(); // } // expressionList(); - // if (token != TT_ARGCLOSE) { + // if (token != TokenNameARGCLOSE) { // throwSyntaxError("')' expected after 'list' keyword."); // } // getNextToken(); - // if (token == TT_SET) { + // if (token == TokenNameSET) { // getNextToken(); // logicalinclusiveorExpression(); // } @@ -2903,79 +2903,79 @@ public class PHPParser extends PHPKeywords { boolean while_flag = true; do { switch (token) { - case TT_PARTOPEN : + case TokenNamePARTOPEN : getNextToken(); expression(); - if (token != TT_PARTCLOSE) { + if (token != TokenNamePARTCLOSE) { throwSyntaxError("] expected in postfix-expression."); } getNextToken(); break; - case TT_DDOT2 : // :: - case TT_REF : // -> + case TokenNameDDOT2 : // :: + case TokenNameREF : // -> getNextToken(); - if (token > TT_KEYWORD) { + if (token > TokenNameKEYWORD) { ident = identifier; setMarker("Avoid using keyword '" + ident + "' as variable name.", rowCount, PHPParser.INFO); } switch (token) { - case TT_VARIABLE : + case TokenNameVARIABLE : ident = identifier; getNextToken(); - // if (token == TT_ARGOPEN) { + // if (token == TokenNameARGOPEN) { // getNextToken(); // expressionList(); - // if (token != TT_ARGCLOSE) { + // if (token != TokenNameARGCLOSE) { // throwSyntaxError(") expected after variable '" + ident + "'."); // } // getNextToken(); // } break; - case TT_IDENTIFIER : + case TokenNameIDENTIFIER : ident = identifier; getNextToken(); break; - case TT_LISTOPEN : + case TokenNameLISTOPEN : getNextToken(); expression(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { throwSyntaxError("} expected in postfix-expression."); } getNextToken(); break; default : throwSyntaxError("Syntax error after '->' token."); - } while (token == TT_PARTOPEN || token == TT_ARGOPEN || token == TT_LISTOPEN) { - if (token == TT_PARTOPEN) { + } while (token == TokenNamePARTOPEN || token == TokenNameARGOPEN || token == TokenNameLISTOPEN) { + if (token == TokenNamePARTOPEN) { getNextToken(); expressionList(); - if (token != TT_PARTCLOSE) { + if (token != TokenNamePARTCLOSE) { throwSyntaxError("] expected after '->'."); } getNextToken(); } - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); expressionList(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError(") expected after '->'."); } getNextToken(); } - if (token == TT_LISTOPEN) { + if (token == TokenNameLISTOPEN) { getNextToken(); expression(); - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { throwSyntaxError("} expected after '->'."); } getNextToken(); } } break; - case TT_INCREMENT : + case TokenNameINCREMENT : getNextToken(); break; - case TT_DECREMENT : + case TokenNameDECREMENT : getNextToken(); break; default : @@ -2988,40 +2988,40 @@ public class PHPParser extends PHPKeywords { private void unaryExpression() throws CoreException { switch (token) { - case TT_INCREMENT : + case TokenNameINCREMENT : getNextToken(); unaryExpression(); break; - case TT_DECREMENT : + case TokenNameDECREMENT : getNextToken(); unaryExpression(); break; // '@' '&' '*' '+' '-' '~' '!' - case TT_AT : + case TokenNameAT : getNextToken(); castExpression(); break; - case TT_AMPERSAND : + case TokenNameAMPERSAND : getNextToken(); castExpression(); break; - case TT_MULTIPLY : + case TokenNameMULTIPLY : getNextToken(); castExpression(); break; - case TT_ADD : + case TokenNameADD : getNextToken(); castExpression(); break; - case TT_SUBTRACT : + case TokenNameSUBTRACT : getNextToken(); castExpression(); break; - case TT_TILDE : + case TokenNameTILDE : getNextToken(); castExpression(); break; - case TT_NOT : + case TokenNameNOT : getNextToken(); castExpression(); break; @@ -3031,10 +3031,10 @@ public class PHPParser extends PHPKeywords { } private void castExpression() throws CoreException { - // if (token == TT_ARGOPEN) { + // if (token == TokenNameARGOPEN) { // getNextToken(); // typeName(); - // if (token != TT_ARGCLOSE) { + // if (token != TokenNameARGCLOSE) { // throwSyntaxError(") expected after cast-expression."); // } // getNextToken(); @@ -3048,7 +3048,7 @@ public class PHPParser extends PHPKeywords { //'real' 'double' 'float' //'int' 'integer' String ident = ""; - if (token == TT_IDENTIFIER) { + if (token == TokenNameIDENTIFIER) { ident = identifier; String str = identifier.toLowerCase(); getNextToken(); @@ -3063,43 +3063,43 @@ public class PHPParser extends PHPKeywords { private void assignExpression() throws CoreException { castExpression(); - if (token == TT_ASSIGN) { // = + if (token == TokenNameASSIGN) { // = getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_DOTASSIGN) { // .= + } else if (token == TokenNameDOTASSIGN) { // .= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_FOREACH) { // => + } else if (token == TokenNameFOREACH) { // => getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_ADDTO) { // += + } else if (token == TokenNameADDTO) { // += getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_SUBTRACTFROM) { // -= + } else if (token == TokenNameSUBTRACTFROM) { // -= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_TIMESBY) { // *= + } else if (token == TokenNameTIMESBY) { // *= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_DIVIDEBY) { // *= + } else if (token == TokenNameDIVIDE_EQUAL) { // *= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_MODASSIGN) { // %= + } else if (token == TokenNameREMAINDER_EQUAL) { // %= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_ANDASSIGN) { // &= + } else if (token == TokenNameANDASSIGN) { // &= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_POWASSIGN) { // ^= + } else if (token == TokenNameXOR_EQUAL) { // ^= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_LSHIFTASSIGN) { // <<= + } else if (token == TokenNameLEFT_SHIFT_EQUAL) { // <<= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_RSHIFTASSIGN) { // >>= + } else if (token == TokenNameRIGHT_SHIFT_EQUAL) { // >>= getNextToken(); logicalinclusiveorExpression(); - } else if (token == TT_TILDEASSIGN) { // ~= + } else if (token == TokenNameTILDEASSIGN) { // ~= getNextToken(); logicalinclusiveorExpression(); } @@ -3108,7 +3108,7 @@ public class PHPParser extends PHPKeywords { private void multiplicativeExpression() throws CoreException { do { assignExpression(); - if (token != TT_MULTIPLY && token != TT_DIV && token != TT_MOD) { + if (token != TokenNameMULTIPLY && token != TokenNameDIVIDE && token != TokenNameREMAINDER) { return; } getNextToken(); @@ -3118,7 +3118,7 @@ public class PHPParser extends PHPKeywords { private void concatenationExpression() throws CoreException { do { multiplicativeExpression(); - if (token != TT_DOT) { + if (token != TokenNameDOT) { return; } getNextToken(); @@ -3128,7 +3128,7 @@ public class PHPParser extends PHPKeywords { private void additiveExpression() throws CoreException { do { concatenationExpression(); - if (token != TT_ADD && token != TT_SUBTRACT) { + if (token != TokenNameADD && token != TokenNameSUBTRACT) { return; } getNextToken(); @@ -3138,7 +3138,7 @@ public class PHPParser extends PHPKeywords { private void shiftExpression() throws CoreException { do { additiveExpression(); - if (token != TT_LSHIFT && token != TT_RSHIFT) { + if (token != TokenNameLEFT_SHIFT && token != TokenNameRSHIFT) { return; } getNextToken(); @@ -3148,7 +3148,7 @@ public class PHPParser extends PHPKeywords { private void relationalExpression() throws CoreException { do { shiftExpression(); - if (token != TT_LESS && token != TT_GREATER && token != TT_LESSEQUAL && token != TT_GREATEREQUAL) { + if (token != TokenNameLESS && token != TokenNameGREATER && token != TokenNameLESSEQUAL && token != TokenNameGREATEREQUAL) { return; } getNextToken(); @@ -3158,7 +3158,7 @@ public class PHPParser extends PHPKeywords { private void identicalExpression() throws CoreException { do { relationalExpression(); - if (token != TT_EX_EQUAL && token != TT_EX_UNEQUAL) { + if (token != TokenNameEX_EQUAL && token != TokenNameEX_UNEQUAL) { return; } getNextToken(); @@ -3168,7 +3168,7 @@ public class PHPParser extends PHPKeywords { private void equalityExpression() throws CoreException { do { identicalExpression(); - if (token != TT_EQUAL && token != TT_UNEQUAL) { + if (token != TokenNameEQUAL && token != TokenNameUNEQUAL) { return; } getNextToken(); @@ -3177,10 +3177,10 @@ public class PHPParser extends PHPKeywords { private void ternaryExpression() throws CoreException { equalityExpression(); - if (token == TT_QUESTIONMARK) { + if (token == TokenNameQUESTIONMARK) { getNextToken(); expression(); - if (token == TT_DDOT) { + if (token == TokenNameDDOT) { getNextToken(); expression(); } else { @@ -3192,7 +3192,7 @@ public class PHPParser extends PHPKeywords { private void andExpression() throws CoreException { do { ternaryExpression(); - if (token != TT_AMPERSAND) { + if (token != TokenNameAMPERSAND) { return; } getNextToken(); @@ -3202,7 +3202,7 @@ public class PHPParser extends PHPKeywords { private void exclusiveorExpression() throws CoreException { do { andExpression(); - if (token != TT_POW) { + if (token != TokenNameXOR) { return; } getNextToken(); @@ -3212,7 +3212,7 @@ public class PHPParser extends PHPKeywords { private void inclusiveorExpression() throws CoreException { do { exclusiveorExpression(); - if (token != TT_LINE) { + if (token != TokenNameLINE) { return; } getNextToken(); @@ -3222,7 +3222,7 @@ public class PHPParser extends PHPKeywords { private void booleanandExpression() throws CoreException { do { inclusiveorExpression(); - if (token != TT_AND) { + if (token != TokenNameAND) { return; } getNextToken(); @@ -3232,7 +3232,7 @@ public class PHPParser extends PHPKeywords { private void booleanorExpression() throws CoreException { do { booleanandExpression(); - if (token != TT_OR) { + if (token != TokenNameOR) { return; } getNextToken(); @@ -3242,7 +3242,7 @@ public class PHPParser extends PHPKeywords { private void logicalandExpression() throws CoreException { do { booleanorExpression(); - if (token != TT_and) { + if (token != TokenNameand) { return; } getNextToken(); @@ -3252,7 +3252,7 @@ public class PHPParser extends PHPKeywords { private void logicalexclusiveorExpression() throws CoreException { do { logicalandExpression(); - if (token != TT_xor) { + if (token != TokenNamexor) { return; } getNextToken(); @@ -3262,7 +3262,7 @@ public class PHPParser extends PHPKeywords { private void logicalinclusiveorExpression() throws CoreException { do { logicalexclusiveorExpression(); - if (token != TT_or) { + if (token != TokenNameor) { return; } getNextToken(); @@ -3270,9 +3270,9 @@ public class PHPParser extends PHPKeywords { } // public void assignmentExpression() { - // if (token == TT_VARIABLE) { + // if (token == TokenNameVARIABLE) { // getNextToken(); - // if (token == TT_SET) { + // if (token == TokenNameSET) { // getNextToken(); // logicalinclusiveorExpression(); // } @@ -3284,7 +3284,7 @@ public class PHPParser extends PHPKeywords { private void variableList() throws CoreException { do { variable(); - if (token == TT_COMMA) { + if (token == TokenNameCOMMA) { getNextToken(); } else { break; @@ -3293,25 +3293,25 @@ public class PHPParser extends PHPKeywords { } private void variable() throws CoreException { - if (token == TT_DOLLAROPEN) { + if (token == TokenNameDOLLAROPEN) { getNextToken(); expression(); ; - if (token != TT_LISTCLOSE) { + if (token != TokenNameLISTCLOSE) { throwSyntaxError("'}' expected after indirect variable token '${'."); } getNextToken(); } else { - if (token == TT_VARIABLE) { + if (token == TokenNameVARIABLE) { getNextToken(); - if (token == TT_PARTOPEN) { + if (token == TokenNamePARTOPEN) { getNextToken(); expression(); - if (token != TT_PARTCLOSE) { + if (token != TokenNamePARTCLOSE) { throwSyntaxError("']' expected in variable-list."); } getNextToken(); - } else if (token == TT_ASSIGN) { + } else if (token == TokenNameASSIGN) { getNextToken(); constant(); } @@ -3328,65 +3328,65 @@ public class PHPParser extends PHPKeywords { private void constant() throws CoreException { String ident; switch (token) { - case TT_ADD : + case TokenNameADD : getNextToken(); switch (token) { - case TT_DOUBLE_NUMBER : + case TokenNameDOUBLE_NUMBER : getNextToken(); break; - case TT_INT_NUMBER : + case TokenNameINT_NUMBER : getNextToken(); break; default : throwSyntaxError("Constant expected after '+' presign."); } break; - case TT_SUBTRACT : + case TokenNameSUBTRACT : getNextToken(); switch (token) { - case TT_DOUBLE_NUMBER : + case TokenNameDOUBLE_NUMBER : getNextToken(); break; - case TT_INT_NUMBER : + case TokenNameINT_NUMBER : getNextToken(); break; default : throwSyntaxError("Constant expected after '-' presign."); } break; - case TT_null : + case TokenNamenull : getNextToken(); break; - case TT_false : + case TokenNamefalse : getNextToken(); break; - case TT_true : + case TokenNametrue : getNextToken(); break; - case TT_IDENTIFIER : + case TokenNameIDENTIFIER : ident = identifier; getNextToken(); - if (token == TT_ARGOPEN) { + if (token == TokenNameARGOPEN) { getNextToken(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { expressionList(); - if (token != TT_ARGCLOSE) { + if (token != TokenNameARGCLOSE) { throwSyntaxError("')' expected after identifier '" + ident + "' in postfix-expression."); } } getNextToken(); } break; - case TT_STRING_CONSTANT : + case TokenNameSTRING_CONSTANT : getNextToken(); break; - case TT_INTERPOLATED_STRING : + case TokenNameINTERPOLATED_STRING : getNextToken(); break; - case TT_DOUBLE_NUMBER : + case TokenNameDOUBLE_NUMBER : getNextToken(); break; - case TT_INT_NUMBER : + case TokenNameINT_NUMBER : getNextToken(); break; default :