From 674009483ddeb2c08be752349985e07b080a0a2b Mon Sep 17 00:00:00 2001 From: kpouer Date: Fri, 5 Dec 2003 14:06:34 +0000 Subject: [PATCH] fixed a bug with the variable suffixes parsing --- net.sourceforge.phpeclipse/src/test/PHPParser.java | 122 ++++++++++---------- net.sourceforge.phpeclipse/src/test/PHPParser.jj | 10 +- 2 files changed, 62 insertions(+), 70 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index 15fd16e..c4cc3b5 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -900,8 +900,7 @@ Token token; * @return the variable name (with suffix) */ final public AbstractVariable VariableDeclaratorId() throws ParseException { - final Variable var; - AbstractVariable expression = null; + AbstractVariable var; try { var = Variable(); label_5: @@ -911,12 +910,9 @@ Token token; } else { break label_5; } - expression = VariableSuffix(var); + var = VariableSuffix(var); } - if (expression == null) { - {if (true) return var;} - } - {if (true) return expression;} + {if (true) return var;} } catch (ParseException e) { errorMessage = "'$' expected for variable identifier"; errorLevel = ERROR; @@ -5614,6 +5610,50 @@ final ArrayList list = new ArrayList(); return retval; } + final private boolean jj_3R_210() { + if (jj_3R_116()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + final private boolean jj_3R_209() { + if (jj_3R_50()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + final private boolean jj_3R_109() { + if (jj_3R_114()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_115()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + return false; + } + + final private boolean jj_3R_208() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + final private boolean jj_3R_203() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_208()) { + jj_scanpos = xsp; + if (jj_3R_209()) { + jj_scanpos = xsp; + if (jj_3R_210()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_110() { if (jj_scan_token(BIT_OR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5816,6 +5856,12 @@ final ArrayList list = new ArrayList(); return false; } + final private boolean jj_3_1() { + if (jj_3R_40()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + final private boolean jj_3R_201() { if (jj_3R_207()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5834,12 +5880,6 @@ final ArrayList list = new ArrayList(); return false; } - final private boolean jj_3_1() { - if (jj_3R_40()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - final private boolean jj_3R_51() { if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5856,25 +5896,25 @@ final ArrayList list = new ArrayList(); return false; } - final private boolean jj_3R_45() { - if (jj_3R_49()) return true; + final private boolean jj_3R_116() { + if (jj_3R_68()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_51()) { jj_scanpos = xsp; break; } + if (jj_3_1()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } return false; } - final private boolean jj_3R_116() { - if (jj_3R_68()) return true; + final private boolean jj_3R_45() { + if (jj_3R_49()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3_1()) { jj_scanpos = xsp; break; } + if (jj_3R_51()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } return false; @@ -7222,50 +7262,6 @@ final ArrayList list = new ArrayList(); return false; } - final private boolean jj_3R_210() { - if (jj_3R_116()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_209() { - if (jj_3R_50()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_109() { - if (jj_3R_114()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_115()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - return false; - } - - final private boolean jj_3R_208() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_203() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_208()) { - jj_scanpos = xsp; - if (jj_3R_209()) { - jj_scanpos = xsp; - if (jj_3R_210()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - public PHPParserTokenManager token_source; SimpleCharStream jj_input_stream; public Token token, jj_nt; diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index c1d2e52..b61df9a 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -1072,21 +1072,17 @@ VariableDeclaration VariableDeclarator() : */ AbstractVariable VariableDeclaratorId() : { - final Variable var; - AbstractVariable expression = null; + AbstractVariable var; } { try { var = Variable() ( LOOKAHEAD(2) - expression = VariableSuffix(var) + var = VariableSuffix(var) )* { - if (expression == null) { - return var; - } - return expression; + return var; } } catch (ParseException e) { errorMessage = "'$' expected for variable identifier"; -- 1.7.1