From: <kp...@us...> - 2011-11-03 17:54:48
|
Revision: 20197 http://jedit.svn.sourceforge.net/jedit/?rev=20197&view=rev Author: kpouer Date: 2011-11-03 17:54:42 +0000 (Thu, 03 Nov 2011) Log Message: ----------- removed a variable that do not exist anymore Modified Paths: -------------- plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.java plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.jj Modified: plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.java =================================================================== --- plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.java 2011-11-03 16:55:44 UTC (rev 20196) +++ plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.java 2011-11-03 17:54:42 UTC (rev 20197) @@ -1195,9 +1195,6 @@ endColumn = namespaceNameToken.endColumn; } catch (ParseException e) { fireParseError("namespace expected",";",e.currentToken.next); - { - namespaceName = SYNTAX_ERROR_CHAR; - } } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: @@ -1210,9 +1207,6 @@ endColumn = namespaceNameToken.endColumn; } catch (ParseException e) { fireParseError("namespace expected",";",e.currentToken.next); - { - namespaceName = SYNTAX_ERROR_CHAR; - } } break; default: @@ -10118,6 +10112,41 @@ finally { jj_save(8, xla); } } + private boolean jj_3R_284() { + if (jj_scan_token(DO)) return true; + if (jj_3R_219()) return true; + if (jj_scan_token(WHILE)) return true; + if (jj_3R_306()) return true; + if (jj_scan_token(SEMICOLON)) return true; + return false; + } + + private boolean jj_3R_302() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_332()) { + jj_scanpos = xsp; + if (jj_3R_333()) { + jj_scanpos = xsp; + if (jj_3R_334()) { + jj_scanpos = xsp; + if (jj_3R_335()) return true; + } + } + } + return false; + } + + private boolean jj_3R_123() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_136()) { + jj_scanpos = xsp; + if (jj_3R_137()) return true; + } + return false; + } + private boolean jj_3R_338() { if (jj_3R_302()) return true; return false; @@ -12596,12 +12625,6 @@ return false; } - private boolean jj_3R_146() { - if (jj_scan_token(ARRAYASSIGN)) return true; - if (jj_3R_68()) return true; - return false; - } - private boolean jj_3R_223() { if (jj_scan_token(PHPECHOSTART)) return true; if (jj_3R_68()) return true; @@ -12612,6 +12635,12 @@ return false; } + private boolean jj_3R_146() { + if (jj_scan_token(ARRAYASSIGN)) return true; + if (jj_3R_68()) return true; + return false; + } + private boolean jj_3R_245() { if (jj_scan_token(LBRACE)) return true; Token xsp; @@ -13190,41 +13219,6 @@ return false; } - private boolean jj_3R_284() { - if (jj_scan_token(DO)) return true; - if (jj_3R_219()) return true; - if (jj_scan_token(WHILE)) return true; - if (jj_3R_306()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_302() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_332()) { - jj_scanpos = xsp; - if (jj_3R_333()) { - jj_scanpos = xsp; - if (jj_3R_334()) { - jj_scanpos = xsp; - if (jj_3R_335()) return true; - } - } - } - return false; - } - - private boolean jj_3R_123() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) return true; - } - return false; - } - /** Generated Token Manager. */ public PHPParserTokenManager token_source; SimpleCharStream jj_input_stream; Modified: plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.jj =================================================================== --- plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.jj 2011-11-03 16:55:44 UTC (rev 20196) +++ plugins/PHPParser/trunk/src/gatchan/phpparser/parser/PHPParser.jj 2011-11-03 17:54:42 UTC (rev 20197) @@ -172,7 +172,7 @@ //{{{ fireParseError(PHPParseErrorEvent e) public void fireParseError(PHPParseErrorEvent e) { - for (PHPParserListener listener : parserListeners) + for (PHPParserListener listener : parserListeners) listener.parseError(e); } //}}} @@ -202,7 +202,7 @@ //{{{ fireParseMessage(PHPParseMessageEvent e) public void fireParseMessage(PHPParseMessageEvent e) { - for (PHPParserListener listener: parserListeners) + for (PHPParserListener listener: parserListeners) listener.parseMessage(e); } //}}} @@ -690,7 +690,7 @@ <HEREDOC, PHPPARSING, IN_VARIABLE, IN_STRING> TOKEN: { <IDENTIFIER: (<LETTER>|<SPECIAL>) (<LETTER>|<DIGIT>|<SPECIAL>)* ("\\" (<LETTER>|<SPECIAL>) (<LETTER>|<DIGIT>|<SPECIAL>)*)*> -| +| < #LETTER: ["a"-"z"] | ["A"-"Z"] > | < #DIGIT: ["0"-"9"] > @@ -1063,9 +1063,6 @@ catch (ParseException e) { fireParseError("namespace expected",";",e.currentToken.next); - { - namespaceName = SYNTAX_ERROR_CHAR; - } } //}}} [ @@ -1084,11 +1081,8 @@ catch (ParseException e) { fireParseError("namespace expected",";",e.currentToken.next); - { - namespaceName = SYNTAX_ERROR_CHAR; - } } //}}} - + ] try { @@ -1230,7 +1224,7 @@ for (ClassConstant classConstant : classConstants) { interfaceDeclaration.addConstant(classConstant); - } + } } )* try @@ -1586,7 +1580,7 @@ } } } - + return new ClassHeader(namespace, path, className == null ? null : new ClassIdentifier(className), @@ -1724,7 +1718,7 @@ } )* //}}} //{{{ fields or method - try + try { ( fields = fieldDeclarationPHP5(modifiers) @@ -1751,8 +1745,8 @@ classDeclaration.addMethod(method); } ) - } - catch (ParseException e) + } + catch (ParseException e) { fireParseError("unexpected token " + e.currentToken.image, "", e.currentToken); } //}}} @@ -1762,7 +1756,7 @@ { if (fieldList != null) { - for (FieldDeclaration field:fieldList) + for (FieldDeclaration field:fieldList) classDeclaration.addField(field); } } @@ -1782,7 +1776,7 @@ token = <STATIC> | token = <PUBLIC> - | + | token = <PROTECTED> | token = <PRIVATE> @@ -1864,7 +1858,7 @@ classDeclaration.addMethod(method); } ) - } + } catch (ParseException e) { fireParseError("unexpected token " + e.currentToken.image, "", e.currentToken); @@ -1872,7 +1866,7 @@ | fieldList = fieldDeclaration() { - if (fieldList != null) + if (fieldList != null) { for (FieldDeclaration field:fieldList) { @@ -2200,11 +2194,11 @@ variable = VariableDeclaratorId() [ assignToken = <ASSIGN> - try + try { initializer = VariableInitializer() - } - catch (ParseException e) + } + catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, path, @@ -2220,12 +2214,12 @@ } ] { - if (assignToken == null) + if (assignToken == null) { return new VariableDeclaration(currentSegment, variable); } - if (initializer == null) + if (initializer == null) { return new VariableDeclaration(currentSegment, variable, @@ -2278,7 +2272,7 @@ } { dollarToken = <DOLLAR> - try + try { variable = Var() } @@ -2552,7 +2546,7 @@ error_skipto(LBRACE); } ] - + { methodHeader = new MethodHeader(namespace, path, @@ -2934,7 +2928,7 @@ startColumn = bitAndToken.beginColumn; } } - ] + ] variableDeclaration = VariableDeclaratorNoSuffix() { if (bitAndToken != null) @@ -4171,7 +4165,7 @@ { fireParseError(") expected",")",e.currentToken.next); } - + ) { return variable; @@ -4287,14 +4281,14 @@ { expr2 = new ConstantIdentifier(methodIdentifier); } - [ + [ LOOKAHEAD(<LPAREN>) { ArgumentList args; } args = arguments() { - arguments = new FunctionCall(expr2, args); + arguments = new FunctionCall(expr2, args); } ] { @@ -4340,7 +4334,7 @@ ClassAccess classAccess(Expression prefix) : { Token lbrace, rbrace, listToken; - Token classAccess; + Token classAccess; Expression expression; } { @@ -4373,14 +4367,14 @@ { expression = new ConstantIdentifier(methodIdentifier); } - [ + [ LOOKAHEAD(<LPAREN>) { ArgumentList args; } args = arguments() { - expression = new FunctionCall(expression, args); + expression = new FunctionCall(expression, args); } ] { @@ -4574,7 +4568,7 @@ fireParseError("unexpected token","identifier",endToken); continue; } - if (endToken.beginColumn != 1) + if (endToken.beginColumn != 1) continue; endImage = (endToken.image.charAt(endToken.image.length()-1) == ';') ? endToken.image.substring(0,endToken.image.length()-2) : endToken.image; if (endImage.equals(startImage)) @@ -4613,7 +4607,7 @@ hasDollar = false; expr = new Variable(identifier); list.add(expr); - } + } } | <DOLLARBRACE> @@ -4669,7 +4663,7 @@ lparen.beginColumn, rparen.endColumn); } - } + } catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, @@ -4698,7 +4692,7 @@ line = args[args.length-1].getBeginLine(); column = args[args.length-1].getBeginColumn(); } - + return new ArgumentList(args, lparen.sourceStart, sourceEnd, @@ -5099,7 +5093,7 @@ { fireParseError("const expected", "const", e.currentToken); } - + )* try { @@ -5113,7 +5107,7 @@ { return constList; } - + } //}}} //{{{ _const() @@ -5641,7 +5635,7 @@ //{{{ missing ; if (semicolonToken == null) { - + int end,endLine,endColumn; if (exprs.length != 0) { @@ -5744,7 +5738,7 @@ int pos,line,column; } { - token = <STATIC> expr = VariableDeclarator() + token = <STATIC> expr = VariableDeclarator() { vars.add(expr); pos = expr.getSourceEnd()+1; @@ -5752,7 +5746,7 @@ column=expr.getEndColumn(); } ( - <COMMA> expr = VariableDeclarator() + <COMMA> expr = VariableDeclarator() { vars.add(expr); pos = expr.getSourceEnd()+1; @@ -5764,7 +5758,7 @@ { token2 = <SEMICOLON> {pos = token2.sourceEnd+1;line=token2.endLine;column=token2.endColumn;} - } + } catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, @@ -6035,7 +6029,7 @@ { list.add(var); } - ( + ( <COMMA> var = Expression() {list.add(var);} )* { @@ -6090,7 +6084,7 @@ } { switchToken = <SWITCH> {pos = switchToken.sourceEnd+1;} - try + try { lparenToken = <LPAREN> { @@ -6111,18 +6105,18 @@ e.currentToken.endColumn, e.currentToken.endColumn+1)); } - try + try { variable = Expression() { pos = variable.getSourceEnd()+1; } - } + } catch (ParseException e) { - if (errorMessage != null) + if (errorMessage != null) throw e; - + fireParseError(new PHPParseErrorEvent(ERROR, path, "expression expected", @@ -6190,19 +6184,19 @@ { pos = token.sourceEnd; } - ( + ( cas = switchLabel0() { cases.add(cas); pos = cas.getSourceEnd(); } )* - try + try { token = <RBRACE> {pos = token.sourceEnd;} } - catch (ParseException e) + catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, path, @@ -6233,7 +6227,7 @@ { AbstractCase cas; List<AbstractCase> cases = new ArrayList<AbstractCase>(); - Token token; + Token token; int pos; } { @@ -6261,7 +6255,7 @@ { token = <ENDSWITCH> {pos = token.sourceEnd;} } - catch (ParseException e) + catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, path, @@ -6275,11 +6269,11 @@ e.currentToken.endColumn, e.currentToken.endColumn+1)); } - try + try { token = <SEMICOLON> {pos = token.sourceEnd;} } - catch (ParseException e) + catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, path, @@ -6310,11 +6304,11 @@ } { expr = SwitchLabel() - ( + ( statement = BlockStatementNoBreak() {stmts.add(statement);} | statement = htmlBlock() {if (statement != null) {stmts.add(statement);}} - | + | statement = BreakStatement() {stmts.add(statement);} )* //[ statement = BreakStatement() {stmts.add(statement);}] @@ -6333,7 +6327,7 @@ this.token.next.beginColumn, this.token.next.endColumn); } - if (listSize == 0) + if (listSize == 0) { return new Case(expr, stmtsArray, @@ -6344,7 +6338,7 @@ expr.getBeginColumn(), expr.getEndColumn()); } - else + else { return new Case(expr, stmtsArray, @@ -6372,10 +6366,10 @@ } { token = <CASE> - try + try { expr = Expression() - } + } catch (ParseException e) { //todo ameliorer ca @@ -6385,11 +6379,11 @@ errorEnd = token.sourceEnd +1; throw e; } - try + try { ( <COLON> - | + | token = <SEMICOLON> { fireParseMessage(new PHPParseMessageEvent(INFO, @@ -6399,8 +6393,8 @@ token)); } ) - } - catch (ParseException e) + } + catch (ParseException e) { //{{{ fireParseError fireParseError(new PHPParseErrorEvent(ERROR, @@ -6420,10 +6414,10 @@ } | token = <_DEFAULT> - try + try { <COLON> - } + } catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, @@ -6454,7 +6448,7 @@ } { token = <BREAK> {pos = token.sourceEnd+1;} - [ + [ expression = Expression() { pos = expression.getSourceEnd()+1; @@ -6464,8 +6458,8 @@ { token2 = <SEMICOLON> {pos = token2.sourceEnd;} - } - catch (ParseException e) + } + catch (ParseException e) { fireParseError(new PHPParseErrorEvent(ERROR, path, @@ -6564,7 +6558,7 @@ | statement = htmlBlock() { - if (statement != null) + if (statement != null) list.add(statement); } )* @@ -6595,13 +6589,13 @@ colonToken = <COLON> stmts = statementList() ( - elseifStatement = ElseIfStatementColon() + elseifStatement = ElseIfStatementColon() { elseIfList.add(elseifStatement); } )* [ elseStatement = elseStatementColon() ] - + { fireParseMessage(new PHPParseMessageEvent(INFO, PHPParseMessageEvent.MESSAGE_IF_ENDIF_TAG, @@ -6628,7 +6622,7 @@ endLine = semiColonToken.beginLine; endColumn = semiColonToken.beginColumn; } - } + } catch (ParseException e) { errorMessage = "';' expected after 'endif' keyword"; @@ -6652,7 +6646,7 @@ ifToken.beginColumn, endColumn); } - else + else { statementsArray = new Statement[stmts.size()]; stmts.toArray(statementsArray); @@ -6674,7 +6668,7 @@ endColumn); } } - + | (stmt = Statement() | stmt = htmlBlock()) ( LOOKAHEAD(1) elseifStatement = ElseIfStatement() {elseIfList.add(elseifStatement);})* @@ -6690,7 +6684,7 @@ statement.getEndLine(), elseToken.beginColumn, statement.getEndColumn());} - } + } catch (ParseException e) { if (errorMessage != null) @@ -6766,7 +6760,7 @@ elseToken.beginColumn, colonToken.endColumn); } - + list.toArray(stmtsArray); return new Else(stmtsArray, elseToken.sourceStart, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |