You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(9) |
Sep
(60) |
Oct
(58) |
Nov
(70) |
Dec
(120) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(17) |
Feb
(35) |
Mar
(98) |
Apr
(121) |
May
(104) |
Jun
(223) |
Jul
(119) |
Aug
(75) |
Sep
(481) |
Oct
(156) |
Nov
(49) |
Dec
(240) |
2005 |
Jan
(129) |
Feb
(124) |
Mar
(33) |
Apr
(50) |
May
(170) |
Jun
(140) |
Jul
(70) |
Aug
(38) |
Sep
(28) |
Oct
(151) |
Nov
(49) |
Dec
(36) |
2006 |
Jan
(157) |
Feb
(41) |
Mar
(10) |
Apr
(34) |
May
|
Jun
(19) |
Jul
(1) |
Aug
(4) |
Sep
(4) |
Oct
(288) |
Nov
(36) |
Dec
|
2007 |
Jan
|
Feb
(18) |
Mar
(9) |
Apr
(11) |
May
(123) |
Jun
(72) |
Jul
(66) |
Aug
(105) |
Sep
(150) |
Oct
(94) |
Nov
(84) |
Dec
(63) |
2008 |
Jan
(14) |
Feb
(1) |
Mar
(4) |
Apr
(4) |
May
(2) |
Jun
(2) |
Jul
(7) |
Aug
(1) |
Sep
(22) |
Oct
(13) |
Nov
(6) |
Dec
(5) |
2009 |
Jan
(1) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(20) |
Oct
(59) |
Nov
|
Dec
(37) |
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
2012 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <kp...@us...> - 2003-08-26 15:05:20
|
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv3031/src/test Modified Files: PHPParser.java PHPParser.jj Log Message: a little bugfix in the variable parsing Index: PHPParser.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParser.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** PHPParser.java 26 Aug 2003 08:11:28 -0000 1.62 --- PHPParser.java 26 Aug 2003 15:05:08 -0000 1.63 *************** *** 926,935 **** final Token token; token = jj_consume_token(DOLLAR); ! variable = Var(token); ! {if (true) return new Variable(variable,token.sourceEnd,variable.sourceEnd);} throw new Error("Missing return statement in function"); } ! static final public Variable Var(final Token dollar) throws ParseException { Variable variable = null; final Token token,token2; --- 926,935 ---- final Token token; token = jj_consume_token(DOLLAR); ! variable = Var(); ! {if (true) return variable;} throw new Error("Missing return statement in function"); } ! static final public Variable Var() throws ParseException { Variable variable = null; final Token token,token2; *************** *** 939,944 **** case DOLLAR: token = jj_consume_token(DOLLAR); ! variable = Var(token); ! {if (true) return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} break; case LBRACE: --- 939,944 ---- case DOLLAR: token = jj_consume_token(DOLLAR); ! variable = Var(); ! {if (true) return new Variable(variable,variable.sourceStart,variable.sourceEnd);} break; case LBRACE: *************** *** 947,956 **** token2 = jj_consume_token(RBRACE); {if (true) return new Variable(expression, ! dollar.sourceStart, token2.sourceEnd);} break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); ! {if (true) return new Variable(token.image,dollar.sourceStart,token.sourceEnd);} break; default: --- 947,956 ---- token2 = jj_consume_token(RBRACE); {if (true) return new Variable(expression, ! token.sourceStart, token2.sourceEnd);} break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); ! {if (true) return new Variable(token.image,token.sourceStart,token.sourceEnd);} break; default: Index: PHPParser.jj =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParser.jj,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** PHPParser.jj 26 Aug 2003 08:11:28 -0000 1.62 --- PHPParser.jj 26 Aug 2003 15:05:09 -0000 1.63 *************** *** 1037,1047 **** } { ! token = <DOLLAR> variable = Var(token) { ! return new Variable(variable,token.sourceEnd,variable.sourceEnd); } } ! Variable Var(final Token dollar) : { Variable variable = null; --- 1037,1047 ---- } { ! token = <DOLLAR> variable = Var() { ! return variable; } } ! Variable Var() : { Variable variable = null; *************** *** 1051,1066 **** } { ! token = <DOLLAR> variable = Var(token) ! {return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} | token = <LBRACE> expression = Expression() token2 = <RBRACE> { return new Variable(expression, ! dollar.sourceStart, token2.sourceEnd); } | token = <IDENTIFIER> ! {return new Variable(token.image,dollar.sourceStart,token.sourceEnd);} } --- 1051,1066 ---- } { ! token = <DOLLAR> variable = Var() ! {return new Variable(variable,variable.sourceStart,variable.sourceEnd);} | token = <LBRACE> expression = Expression() token2 = <RBRACE> { return new Variable(expression, ! token.sourceStart, token2.sourceEnd); } | token = <IDENTIFIER> ! {return new Variable(token.image,token.sourceStart,token.sourceEnd);} } |
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast In directory sc8-pr-cvs1:/tmp/cvs-serv3150/src/net/sourceforge/phpdt/internal/compiler/ast Modified Files: AbstractCase.java AbstractPHPComment.java ArrayDeclarator.java ArrayInitializer.java ArrayVariableDeclaration.java AstNode.java BinaryExpression.java Block.java BranchStatement.java Case.java CastExpression.java ClassAccess.java ClassDeclaration.java ConditionalExpression.java ConstantIdentifier.java Define.java DoStatement.java EchoStatement.java Else.java ElseIf.java EmptyStatement.java FieldDeclaration.java ForStatement.java ForeachStatement.java FunctionCall.java GlobalStatement.java HTMLBlock.java HTMLCode.java IfStatement.java InclusionStatement.java LabeledStatement.java ListExpression.java Literal.java MethodDeclaration.java PHPEchoBlock.java PrintExpression.java ReturnStatement.java StaticStatement.java SwitchStatement.java UnaryExpression.java VarAssignation.java Variable.java VariableDeclaration.java WhileStatement.java Log Message: The methods to get variables do not instantiate ArrayList each time, only one is used now Index: AbstractCase.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AbstractCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractCase.java 3 Aug 2003 14:56:16 -0000 1.2 --- AbstractCase.java 26 Aug 2003 08:12:21 -0000 1.3 *************** *** 29,64 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getOutsideVariable()); } - return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getUsedVariable()); } - return list; } } --- 29,55 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getOutsideVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getUsedVariable(list); } } } Index: AbstractPHPComment.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AbstractPHPComment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractPHPComment.java 3 Aug 2003 14:56:38 -0000 1.2 --- AbstractPHPComment.java 26 Aug 2003 08:12:21 -0000 1.3 *************** *** 25,30 **** * @return an empty list */ ! public List getOutsideVariable() { ! return new ArrayList(); } --- 25,29 ---- * @return an empty list */ ! public void getOutsideVariable(final List list) { } *************** *** 33,38 **** * @return an empty list */ ! public List getModifiedVariable() { ! return new ArrayList(); } --- 32,36 ---- * @return an empty list */ ! public void getModifiedVariable(final List list) { } *************** *** 41,46 **** * @return an empty list */ ! public List getUsedVariable() { ! return new ArrayList(); } } --- 39,43 ---- * @return an empty list */ ! public void getUsedVariable(final List list) { } } Index: ArrayDeclarator.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayDeclarator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ArrayDeclarator.java 10 Aug 2003 15:46:27 -0000 1.5 --- ArrayDeclarator.java 26 Aug 2003 08:12:21 -0000 1.6 *************** *** 44,75 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final List list = prefix.getModifiedVariable(); if (var != null) { ! list.addAll(var.getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final List list = prefix.getUsedVariable(); if (var != null) { ! list.addAll(var.getUsedVariable()); } - return list; } } --- 44,69 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! prefix.getModifiedVariable(list); if (var != null) { ! var.getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! prefix.getUsedVariable(list); if (var != null) { ! var.getUsedVariable(list); } } } Index: ArrayInitializer.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayInitializer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ArrayInitializer.java 14 Aug 2003 00:29:01 -0000 1.8 --- ArrayInitializer.java 26 Aug 2003 08:12:21 -0000 1.9 *************** *** 42,77 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < vars.length; i++) { if (vars[i] != null) { ! list.addAll(vars[i].getModifiedVariable()); } } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < vars.length; i++) { if (vars[i] != null) { ! list.addAll(vars[i].getUsedVariable()); } } - return list; } } --- 42,69 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < vars.length; i++) { if (vars[i] != null) { ! vars[i].getModifiedVariable(list); } } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { for (int i = 0; i < vars.length; i++) { if (vars[i] != null) { ! vars[i].getUsedVariable(list); } } } } Index: ArrayVariableDeclaration.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArrayVariableDeclaration.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ArrayVariableDeclaration.java 9 Aug 2003 22:16:17 -0000 1.7 --- ArrayVariableDeclaration.java 26 Aug 2003 08:12:21 -0000 1.8 *************** *** 55,87 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(key.getModifiedVariable()); if (value != null) { ! list.addAll(value.getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); if (value != null) { ! list.addAll(value.getUsedVariable()); } - return list; } } --- 55,80 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! key.getModifiedVariable(list); if (value != null) { ! value.getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! key.getUsedVariable(list); if (value != null) { ! value.getUsedVariable(list); } } } Index: AstNode.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AstNode.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AstNode.java 11 Aug 2003 22:23:47 -0000 1.9 --- AstNode.java 26 Aug 2003 08:12:21 -0000 1.10 *************** *** 54,72 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public abstract List getOutsideVariable(); /** * get the modified variables. - * @return the variables modified */ ! public abstract List getModifiedVariable(); /** * Get the variables used. - * @return the variables used */ ! public abstract List getUsedVariable(); /** --- 54,69 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public abstract void getOutsideVariable(List list); /** * get the modified variables. */ ! public abstract void getModifiedVariable(List list); /** * Get the variables used. */ ! public abstract void getUsedVariable(List list); /** Index: BinaryExpression.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/BinaryExpression.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BinaryExpression.java 9 Aug 2003 22:16:17 -0000 1.8 --- BinaryExpression.java 26 Aug 2003 08:12:21 -0000 1.9 *************** *** 29,58 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(left.getModifiedVariable()); ! list.addAll(right.getModifiedVariable()); ! return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(left.getUsedVariable()); ! list.addAll(right.getUsedVariable()); ! return list; } --- 29,50 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! left.getModifiedVariable(list); ! right.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! left.getUsedVariable(list); ! right.getUsedVariable(list); } Index: Block.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Block.java 3 Aug 2003 14:56:38 -0000 1.9 --- Block.java 26 Aug 2003 08:12:21 -0000 1.10 *************** *** 57,92 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getOutsideVariable()); } - return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getUsedVariable()); } - return list; } } --- 57,83 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getOutsideVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getUsedVariable(list); } } } Index: BranchStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/BranchStatement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BranchStatement.java 3 Aug 2003 14:56:38 -0000 1.5 --- BranchStatement.java 26 Aug 2003 08:12:21 -0000 1.6 *************** *** 19,51 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! if (expression == null) { ! return new ArrayList(); } - return expression.getOutsideVariable(); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! if (expression == null) { ! return new ArrayList(); } - return expression.getModifiedVariable(); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! if (expression == null) { ! return new ArrayList(); } - return expression.getUsedVariable(); } } --- 19,45 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { ! if (expression != null) { ! expression.getOutsideVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! if (expression != null) { ! expression.getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! if (expression != null) { ! expression.getUsedVariable(list); } } } Index: Case.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Case.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Case.java 3 Aug 2003 14:56:38 -0000 1.6 --- Case.java 26 Aug 2003 08:12:21 -0000 1.7 *************** *** 40,59 **** /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final List list = super.getModifiedVariable(); ! list.addAll(value.getModifiedVariable()); ! return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final List list = super.getUsedVariable(); ! list.addAll(value.getUsedVariable()); ! return list; } } --- 40,55 ---- /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! super.getModifiedVariable(list); ! value.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! super.getUsedVariable(list); ! value.getUsedVariable(list); } } Index: CastExpression.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/CastExpression.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CastExpression.java 3 Aug 2003 14:56:38 -0000 1.6 --- CastExpression.java 26 Aug 2003 08:12:21 -0000 1.7 *************** *** 44,69 **** } ! /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! return expression.getModifiedVariable(); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return expression.getUsedVariable(); } } --- 44,65 ---- } ! /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! expression.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! expression.getUsedVariable(list); } } Index: ClassAccess.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ClassAccess.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ClassAccess.java 9 Aug 2003 22:16:17 -0000 1.5 --- ClassAccess.java 26 Aug 2003 08:12:21 -0000 1.6 *************** *** 72,97 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! return new ArrayList(1); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final List list = prefix.getUsedVariable(); ! list.addAll(suffix.getUsedVariable()); ! return list; } } --- 72,91 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! prefix.getUsedVariable(list); ! suffix.getUsedVariable(list); } } Index: ClassDeclaration.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ClassDeclaration.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ClassDeclaration.java 10 Aug 2003 15:46:27 -0000 1.10 --- ClassDeclaration.java 26 Aug 2003 08:12:21 -0000 1.11 *************** *** 190,213 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! return new ArrayList(1); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return new ArrayList(1); } } --- 190,207 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } } Index: ConditionalExpression.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ConditionalExpression.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ConditionalExpression.java 9 Aug 2003 22:16:17 -0000 1.8 --- ConditionalExpression.java 26 Aug 2003 08:12:21 -0000 1.9 *************** *** 33,64 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getModifiedVariable()); ! list.addAll(valueIfTrue.getModifiedVariable()); ! list.addAll(valueIfFalse.getModifiedVariable()); ! return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getUsedVariable()); ! list.addAll(valueIfTrue.getUsedVariable()); ! list.addAll(valueIfFalse.getUsedVariable()); ! return list; } } --- 33,56 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! condition.getModifiedVariable(list); ! valueIfTrue.getModifiedVariable(list); ! valueIfFalse.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! condition.getUsedVariable(list); ! valueIfTrue.getUsedVariable(list); ! valueIfFalse.getUsedVariable(list); } } Index: ConstantIdentifier.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ConstantIdentifier.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConstantIdentifier.java 9 Aug 2003 22:16:17 -0000 1.3 --- ConstantIdentifier.java 26 Aug 2003 08:12:21 -0000 1.4 *************** *** 33,58 **** } ! /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! return new ArrayList(1); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return new ArrayList(1); } } --- 33,52 ---- } ! /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } } Index: Define.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Define.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Define.java 9 Aug 2003 22:16:17 -0000 1.5 --- Define.java 26 Aug 2003 08:12:21 -0000 1.6 *************** *** 65,90 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(1); list.add(new VariableUsage(defineName.toStringExpression(),sourceStart));//todo: someday : evaluate the defineName - return list; } /** * get the modified variables. - * @return the variables modified */ ! public List getModifiedVariable() { ! return new ArrayList(1); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return new ArrayList(1); } } --- 65,83 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { list.add(new VariableUsage(defineName.toStringExpression(),sourceStart));//todo: someday : evaluate the defineName } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } } Index: DoStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/DoStatement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DoStatement.java 3 Aug 2003 14:56:38 -0000 1.5 --- DoStatement.java 26 Aug 2003 08:12:21 -0000 1.6 *************** *** 45,77 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getOutsideVariable()); // todo: check if unuseful ! list.addAll(action.getOutsideVariable()); ! return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getModifiedVariable()); ! list.addAll(action.getModifiedVariable()); ! return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getUsedVariable()); ! list.addAll(action.getUsedVariable()); ! return list; } } --- 45,68 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { ! condition.getOutsideVariable(list); // todo: check if unuseful ! action.getOutsideVariable(list); } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! condition.getModifiedVariable(list); ! action.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! condition.getUsedVariable(list); ! action.getUsedVariable(list); } } Index: EchoStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/EchoStatement.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EchoStatement.java 10 Aug 2003 15:46:27 -0000 1.7 --- EchoStatement.java 26 Aug 2003 08:12:21 -0000 1.8 *************** *** 44,79 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < expressions.length; i++) { ! list.addAll(expressions[i].getOutsideVariable()); } - return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < expressions.length; i++) { ! list.addAll(expressions[i].getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < expressions.length; i++) { ! list.addAll(expressions[i].getUsedVariable()); } - return list; } } --- 44,70 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { for (int i = 0; i < expressions.length; i++) { ! expressions[i].getOutsideVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < expressions.length; i++) { ! expressions[i].getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { for (int i = 0; i < expressions.length; i++) { ! expressions[i].getUsedVariable(list); } } } Index: Else.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Else.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Else.java 3 Aug 2003 14:56:38 -0000 1.2 --- Else.java 26 Aug 2003 08:12:21 -0000 1.3 *************** *** 59,94 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getOutsideVariable()); } - return list; } /** * get the modified variables. - * @return the variables from outside */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables from outside */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getUsedVariable()); } - return list; } } --- 59,85 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getOutsideVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getUsedVariable(list); } } } Index: ElseIf.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ElseIf.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ElseIf.java 3 Aug 2003 14:56:38 -0000 1.3 --- ElseIf.java 26 Aug 2003 08:12:21 -0000 1.4 *************** *** 43,80 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getModifiedVariable()); } - return list; } /** * get the modified variables. - * @return the variables modified */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getModifiedVariable()); } ! list.addAll(condition.getModifiedVariable()); ! return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < statements.length; i++) { ! list.addAll(statements[i].getUsedVariable()); } ! list.addAll(condition.getUsedVariable()); ! return list; } } --- 43,71 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getModifiedVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getModifiedVariable(list); } ! condition.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { for (int i = 0; i < statements.length; i++) { ! statements[i].getUsedVariable(list); } ! condition.getUsedVariable(list); } } Index: EmptyStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/EmptyStatement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EmptyStatement.java 3 Aug 2003 14:56:38 -0000 1.6 --- EmptyStatement.java 26 Aug 2003 08:12:21 -0000 1.7 *************** *** 20,43 **** /** * Get the variables from outside (parameters, globals ...) - * @return an empty list */ ! public List getOutsideVariable() { ! return new ArrayList(); } /** * get the modified variables. - * @return an empty list */ ! public List getModifiedVariable() { ! return new ArrayList(); } /** * Get the variables used. - * @return an empty list */ ! public List getUsedVariable() { ! return new ArrayList(); } } --- 20,37 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } } Index: FieldDeclaration.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FieldDeclaration.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FieldDeclaration.java 10 Aug 2003 15:46:27 -0000 1.11 --- FieldDeclaration.java 26 Aug 2003 08:12:21 -0000 1.12 *************** *** 24,27 **** --- 24,28 ---- private Object parent; private Position position; + /** * Create a new field. *************** *** 62,66 **** */ public ImageDescriptor getImage() { ! return PHPUiImages.DESC_VAR; } --- 63,67 ---- */ public ImageDescriptor getImage() { ! return PHPUiImages.DESC_VAR; } *************** *** 73,98 **** } ! /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! return new ArrayList(1); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return new ArrayList(1); } } --- 74,93 ---- } ! /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } } Index: ForStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ForStatement.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ForStatement.java 14 Aug 2003 00:29:01 -0000 1.7 --- ForStatement.java 26 Aug 2003 08:12:21 -0000 1.8 *************** *** 80,154 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); if (condition != null) { ! list.addAll(condition.getOutsideVariable()); } if (action != null) { ! list.addAll(action.getOutsideVariable()); } if (initializations != null) { for (int i = 0; i < initializations.length; i++) { ! list.addAll(initializations[i].getOutsideVariable()); } } if (increments != null) { for (int i = 0; i < increments.length; i++) { ! list.addAll(increments[i].getOutsideVariable()); } } - return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); if (condition != null) { ! list.addAll(condition.getModifiedVariable()); } if (action != null) { ! list.addAll(action.getModifiedVariable()); } if (initializations != null) { for (int i = 0; i < initializations.length; i++) { ! list.addAll(initializations[i].getModifiedVariable()); } } if (increments != null) { for (int i = 0; i < increments.length; i++) { ! list.addAll(increments[i].getModifiedVariable()); } } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); if (condition != null) { ! list.addAll(condition.getUsedVariable()); } if (action != null) { ! list.addAll(action.getUsedVariable()); } if (initializations != null) { for (int i = 0; i < initializations.length; i++) { ! list.addAll(initializations[i].getUsedVariable()); } } if (increments != null) { for (int i = 0; i < increments.length; i++) { ! list.addAll(increments[i].getUsedVariable()); } } - return list; } } --- 80,145 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { if (condition != null) { ! condition.getOutsideVariable(list); } if (action != null) { ! action.getOutsideVariable(list); } if (initializations != null) { for (int i = 0; i < initializations.length; i++) { ! initializations[i].getOutsideVariable(list); } } if (increments != null) { for (int i = 0; i < increments.length; i++) { ! increments[i].getOutsideVariable(list); } } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { if (condition != null) { ! condition.getModifiedVariable(list); } if (action != null) { ! action.getModifiedVariable(list); } if (initializations != null) { for (int i = 0; i < initializations.length; i++) { ! initializations[i].getModifiedVariable(list); } } if (increments != null) { for (int i = 0; i < increments.length; i++) { ! increments[i].getModifiedVariable(list); } } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { if (condition != null) { ! condition.getUsedVariable(list); } if (action != null) { ! action.getUsedVariable(list); } if (initializations != null) { for (int i = 0; i < initializations.length; i++) { ! initializations[i].getUsedVariable(list); } } if (increments != null) { for (int i = 0; i < increments.length; i++) { ! increments[i].getUsedVariable(list); } } } } Index: ForeachStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ForeachStatement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ForeachStatement.java 3 Aug 2003 14:56:38 -0000 1.2 --- ForeachStatement.java 26 Aug 2003 08:12:21 -0000 1.3 *************** *** 43,77 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(expression.getOutsideVariable()); ! list.addAll(variable.getOutsideVariable()); ! list.addAll(statement.getOutsideVariable()); ! return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(expression.getModifiedVariable()); ! list.addAll(variable.getModifiedVariable()); ! list.addAll(statement.getModifiedVariable()); ! return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(expression.getUsedVariable()); ! list.addAll(statement.getUsedVariable()); ! return list; } } --- 43,68 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { ! expression.getOutsideVariable(list); ! variable.getOutsideVariable(list); ! statement.getOutsideVariable(list); } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! expression.getModifiedVariable(list); ! variable.getUsedVariable(list); ! statement.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! expression.getUsedVariable(list); ! statement.getUsedVariable(list); } } Index: FunctionCall.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FunctionCall.java 10 Aug 2003 15:46:27 -0000 1.7 --- FunctionCall.java 26 Aug 2003 08:12:21 -0000 1.8 *************** *** 46,82 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! if (args == null) { ! return new ArrayList(1); ! } ! final ArrayList list = new ArrayList(); ! for (int i = 0; i < args.length; i++) { ! list.addAll(args[i].getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final List list = functionName.getUsedVariable(); if (args != null) { for (int i = 0; i < args.length; i++) { ! list.addAll(args[i].getUsedVariable()); } } - return list; } } --- 46,74 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! if (args != null) { ! for (int i = 0; i < args.length; i++) { ! args[i].getModifiedVariable(list); ! } } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! functionName.getUsedVariable(list); if (args != null) { for (int i = 0; i < args.length; i++) { ! args[i].getUsedVariable(list); } } } } Index: GlobalStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/GlobalStatement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GlobalStatement.java 11 Aug 2003 22:26:02 -0000 1.6 --- GlobalStatement.java 26 Aug 2003 08:12:21 -0000 1.7 *************** *** 70,97 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(variables.length); for (int i = 0; i < variables.length; i++) { ! list.addAll(variables[i].getUsedVariable()); } - return list; } /** * get the modified variables. - * @return the variables modified */ ! public List getModifiedVariable() { ! return new ArrayList(1); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return new ArrayList(1); } --- 70,90 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { for (int i = 0; i < variables.length; i++) { ! variables[i].getUsedVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } Index: HTMLBlock.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/HTMLBlock.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HTMLBlock.java 22 Aug 2003 20:40:00 -0000 1.5 --- HTMLBlock.java 26 Aug 2003 08:12:21 -0000 1.6 *************** *** 33,56 **** /** * Get the variables from outside (parameters, globals ...) - * @return an empty list */ ! public List getOutsideVariable() { ! return new ArrayList(); } /** * get the modified variables. - * @return an empty list */ ! public List getModifiedVariable() { ! return new ArrayList(); } /** * Get the variables used. - * @return an empty list */ ! public List getUsedVariable() { ! return new ArrayList(); } } --- 33,50 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { } } Index: HTMLCode.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/HTMLCode.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HTMLCode.java 3 Aug 2003 14:56:38 -0000 1.3 --- HTMLCode.java 26 Aug 2003 08:12:21 -0000 1.4 *************** *** 2,6 **** import java.util.List; - import java.util.ArrayList; --- 2,5 ---- *************** *** 49,54 **** * @return an empty list */ ! public List getOutsideVariable() { ! return new ArrayList(); } --- 48,52 ---- * @return an empty list */ ! public void getOutsideVariable(final List list) { } *************** *** 57,62 **** * @return an empty list */ ! public List getModifiedVariable() { ! return new ArrayList(); } --- 55,59 ---- * @return an empty list */ ! public void getModifiedVariable(final List list) { } *************** *** 65,70 **** * @return an empty list */ ! public List getUsedVariable() { ! return new ArrayList(); } } --- 62,66 ---- * @return an empty list */ ! public void getUsedVariable(final List list) { } } Index: IfStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/IfStatement.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IfStatement.java 22 Aug 2003 20:40:00 -0000 1.10 --- IfStatement.java 26 Aug 2003 08:12:21 -0000 1.11 *************** *** 66,122 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getOutsideVariable()); // todo: check if unuseful if (statement != null) { ! list.addAll(statement.getOutsideVariable()); } for (int i = 0; i < elseifs.length; i++) { ! list.addAll(elseifs[i].getOutsideVariable()); } if (els != null) { ! list.addAll(els.getOutsideVariable()); } - return list; } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getModifiedVariable()); if (statement != null) { ! list.addAll(statement.getModifiedVariable()); } for (int i = 0; i < elseifs.length; i++) { ! list.addAll(elseifs[i].getModifiedVariable()); } if (els != null) { ! list.addAll(els.getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! final ArrayList list = new ArrayList(); ! list.addAll(condition.getUsedVariable()); if (statement != null) { ! list.addAll(statement.getUsedVariable()); } for (int i = 0; i < elseifs.length; i++) { ! list.addAll(elseifs[i].getUsedVariable()); } if (els != null) { ! list.addAll(els.getUsedVariable()); } - return list; } } --- 66,113 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { ! condition.getOutsideVariable(list); // todo: check if unuseful if (statement != null) { ! statement.getOutsideVariable(list); } for (int i = 0; i < elseifs.length; i++) { ! elseifs[i].getOutsideVariable(list); } if (els != null) { ! els.getOutsideVariable(list); } } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! condition.getModifiedVariable(list); if (statement != null) { ! statement.getModifiedVariable(list); } for (int i = 0; i < elseifs.length; i++) { ! elseifs[i].getModifiedVariable(list); } if (els != null) { ! els.getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! condition.getUsedVariable(list); if (statement != null) { ! statement.getUsedVariable(list); } for (int i = 0; i < elseifs.length; i++) { ! elseifs[i].getUsedVariable(list); } if (els != null) { ! els.getUsedVariable(list); } } } Index: InclusionStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/InclusionStatement.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** InclusionStatement.java 22 Aug 2003 20:40:00 -0000 1.7 --- InclusionStatement.java 26 Aug 2003 08:12:21 -0000 1.8 *************** *** 93,116 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return expression.getOutsideVariable(); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! return expression.getModifiedVariable(); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return expression.getUsedVariable(); } } --- 93,113 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { ! expression.getOutsideVariable(list); } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! expression.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! expression.getUsedVariable(list); } } Index: LabeledStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/LabeledStatement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LabeledStatement.java 10 Aug 2003 15:46:27 -0000 1.6 --- LabeledStatement.java 26 Aug 2003 08:12:21 -0000 1.7 *************** *** 41,64 **** /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return statement.getOutsideVariable(); } /** * get the modified variables. - * @return the variables modified */ ! public List getModifiedVariable() { ! return statement.getModifiedVariable(); } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! return statement.getUsedVariable(); } } --- 41,61 ---- /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { ! statement.getOutsideVariable(list); } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { ! statement.getModifiedVariable(list); } /** * Get the variables used. */ ! public void getUsedVariable(final List list) { ! statement.getUsedVariable(list); } } Index: ListExpression.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ListExpression.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ListExpression.java 12 Aug 2003 09:46:49 -0000 1.7 --- ListExpression.java 26 Aug 2003 08:12:21 -0000 1.8 *************** *** 51,88 **** } ! /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside */ ! public List getOutsideVariable() { ! return new ArrayList(1); } /** * get the modified variables. - * @return the variables from we change value */ ! public List getModifiedVariable() { ! final ArrayList list = new ArrayList(); for (int i = 0; i < vars.length; i++) { if (vars[i] != null) { ! list.addAll(vars[i].getUsedVariable()); } } if (expression != null) { ! list.addAll(expression.getModifiedVariable()); } - return list; } /** * Get the variables used. - * @return the variables used */ ! public List getUsedVariable() { ! if (expression == null) { ! return new ArrayList(1); } - return expression.getUsedVariable(); } } --- 51,81 ---- } ! /** * Get the variables from outside (parameters, globals ...) */ ! public void getOutsideVariable(final List list) { } /** * get the modified variables. */ ! public void getModifiedVariable(final List list) { for (int i = 0; i < vars.length; i++) { if (vars[i] != null) { ! vars[i].getUsedVariable(list); } } if (expression != null) { ! expression.getModifiedVariable(list); } } /** * Get the variables used. */ ! public void getUsedVariable(final List ... [truncated message content] |
From: <kp...@us...> - 2003-08-26 08:17:32
|
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv3037/src/test Modified Files: PHPParser.java PHPParser.jj Log Message: a bugfix on variables Index: PHPParser.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParser.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** PHPParser.java 22 Aug 2003 20:39:29 -0000 1.61 --- PHPParser.java 26 Aug 2003 08:11:28 -0000 1.62 *************** *** 799,811 **** */ static final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException { ! final Token dollar, token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; Variable variable; ! dollar = jj_consume_token(DOLLAR); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: token = jj_consume_token(IDENTIFIER); ! variable = new Variable(token.image,dollar.sourceStart,token.sourceEnd); break; case LBRACE: --- 799,811 ---- */ static final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException { ! final Token token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; Variable variable; ! jj_consume_token(DOLLAR); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: token = jj_consume_token(IDENTIFIER); ! variable = new Variable(token.image,token.sourceStart,token.sourceEnd); break; case LBRACE: *************** *** 813,817 **** expr = Expression(); rbrace = jj_consume_token(RBRACE); ! variable = new Variable(expr,dollar.sourceStart,rbrace.sourceEnd); break; default: --- 813,817 ---- expr = Expression(); rbrace = jj_consume_token(RBRACE); ! variable = new Variable(expr,lbrace.sourceStart,rbrace.sourceEnd); break; default: *************** *** 927,931 **** token = jj_consume_token(DOLLAR); variable = Var(token); ! {if (true) return new Variable(variable,token.sourceStart,variable.sourceEnd);} throw new Error("Missing return statement in function"); } --- 927,931 ---- token = jj_consume_token(DOLLAR); variable = Var(token); ! {if (true) return new Variable(variable,token.sourceEnd,variable.sourceEnd);} throw new Error("Missing return statement in function"); } *************** *** 940,944 **** token = jj_consume_token(DOLLAR); variable = Var(token); ! {if (true) return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} break; case LBRACE: --- 940,944 ---- token = jj_consume_token(DOLLAR); variable = Var(token); ! {if (true) return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} break; case LBRACE: *************** *** 2401,2405 **** case IDENTIFIER: token = jj_consume_token(IDENTIFIER); ! expression = new Variable(token.image,token.sourceStart,token.sourceEnd); break; case DOLLAR: --- 2401,2405 ---- case IDENTIFIER: token = jj_consume_token(IDENTIFIER); ! expression = new ConstantIdentifier(token.image,token.sourceStart,token.sourceEnd); break; case DOLLAR: Index: PHPParser.jj =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParser.jj,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** PHPParser.jj 22 Aug 2003 20:39:29 -0000 1.61 --- PHPParser.jj 26 Aug 2003 08:11:28 -0000 1.62 *************** *** 921,925 **** VariableDeclaration VariableDeclaratorNoSuffix() : { ! final Token dollar, token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; --- 921,925 ---- VariableDeclaration VariableDeclaratorNoSuffix() : { ! final Token token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; *************** *** 927,937 **** } { ! dollar = <DOLLAR> ( token = <IDENTIFIER> ! {variable = new Variable(token.image,dollar.sourceStart,token.sourceEnd);} | lbrace = <LBRACE> expr = Expression() rbrace = <RBRACE> ! {variable = new Variable(expr,dollar.sourceStart,rbrace.sourceEnd);} ) [ --- 927,937 ---- } { ! <DOLLAR> ( token = <IDENTIFIER> ! {variable = new Variable(token.image,token.sourceStart,token.sourceEnd);} | lbrace = <LBRACE> expr = Expression() rbrace = <RBRACE> ! {variable = new Variable(expr,lbrace.sourceStart,rbrace.sourceEnd);} ) [ *************** *** 1039,1043 **** token = <DOLLAR> variable = Var(token) { ! return new Variable(variable,token.sourceStart,variable.sourceEnd); } } --- 1039,1043 ---- token = <DOLLAR> variable = Var(token) { ! return new Variable(variable,token.sourceEnd,variable.sourceEnd); } } *************** *** 1052,1056 **** { token = <DOLLAR> variable = Var(token) ! {return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} | token = <LBRACE> expression = Expression() token2 = <RBRACE> --- 1052,1056 ---- { token = <DOLLAR> variable = Var(token) ! {return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} | token = <LBRACE> expression = Expression() token2 = <RBRACE> *************** *** 1866,1870 **** | token = <IDENTIFIER> ! {expression = new Variable(token.image,token.sourceStart,token.sourceEnd);} | expression = Variable() --- 1866,1870 ---- | token = <IDENTIFIER> ! {expression = new ConstantIdentifier(token.image,token.sourceStart,token.sourceEnd);} | expression = Variable() |
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast In directory sc8-pr-cvs1:/tmp/cvs-serv10055/src/net/sourceforge/phpdt/internal/compiler/ast Modified Files: HTMLBlock.java IfStatement.java InclusionStatement.java Variable.java Log Message: a lot of fixes Index: HTMLBlock.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/HTMLBlock.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HTMLBlock.java 9 Aug 2003 22:16:17 -0000 1.4 --- HTMLBlock.java 22 Aug 2003 20:40:00 -0000 1.5 *************** *** 12,16 **** public HTMLBlock(final AstNode[] nodes) { ! super(nodes[0].sourceStart, nodes[nodes.length-1].sourceEnd); this.nodes = nodes; } --- 12,16 ---- public HTMLBlock(final AstNode[] nodes) { ! super(nodes[0].sourceStart, nodes[(nodes.length > 0) ? nodes.length - 1 : 0].sourceEnd); this.nodes = nodes; } *************** *** 25,29 **** buff.append("?>"); for (int i = 0; i < nodes.length; i++) { ! buff.append(nodes[i].toString(tab +1)); } buff.append("<?php\n"); --- 25,29 ---- buff.append("?>"); for (int i = 0; i < nodes.length; i++) { ! buff.append(nodes[i].toString(tab + 1)); } buff.append("<?php\n"); Index: IfStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/IfStatement.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** IfStatement.java 3 Aug 2003 14:56:38 -0000 1.9 --- IfStatement.java 22 Aug 2003 20:40:00 -0000 1.10 *************** *** 50,54 **** buff.append("if (");//$NON-NLS-1$ buff.append(condition.toStringExpression()).append(") ");//$NON-NLS-1$ ! buff.append(statement.toString(tab + 1)); for (int i = 0; i < elseifs.length; i++) { buff.append(elseifs[i].toString(tab + 1)); --- 50,56 ---- buff.append("if (");//$NON-NLS-1$ buff.append(condition.toStringExpression()).append(") ");//$NON-NLS-1$ ! if (statement != null) { ! buff.append(statement.toString(tab + 1)); ! } for (int i = 0; i < elseifs.length; i++) { buff.append(elseifs[i].toString(tab + 1)); *************** *** 69,73 **** final ArrayList list = new ArrayList(); list.addAll(condition.getOutsideVariable()); // todo: check if unuseful ! list.addAll(statement.getOutsideVariable()); for (int i = 0; i < elseifs.length; i++) { list.addAll(elseifs[i].getOutsideVariable()); --- 71,77 ---- final ArrayList list = new ArrayList(); list.addAll(condition.getOutsideVariable()); // todo: check if unuseful ! if (statement != null) { ! list.addAll(statement.getOutsideVariable()); ! } for (int i = 0; i < elseifs.length; i++) { list.addAll(elseifs[i].getOutsideVariable()); *************** *** 86,90 **** final ArrayList list = new ArrayList(); list.addAll(condition.getModifiedVariable()); ! list.addAll(statement.getModifiedVariable()); for (int i = 0; i < elseifs.length; i++) { list.addAll(elseifs[i].getModifiedVariable()); --- 90,96 ---- final ArrayList list = new ArrayList(); list.addAll(condition.getModifiedVariable()); ! if (statement != null) { ! list.addAll(statement.getModifiedVariable()); ! } for (int i = 0; i < elseifs.length; i++) { list.addAll(elseifs[i].getModifiedVariable()); *************** *** 103,107 **** final ArrayList list = new ArrayList(); list.addAll(condition.getUsedVariable()); ! list.addAll(statement.getUsedVariable()); for (int i = 0; i < elseifs.length; i++) { list.addAll(elseifs[i].getUsedVariable()); --- 109,115 ---- final ArrayList list = new ArrayList(); list.addAll(condition.getUsedVariable()); ! if (statement != null) { ! list.addAll(statement.getUsedVariable()); ! } for (int i = 0; i < elseifs.length; i++) { list.addAll(elseifs[i].getUsedVariable()); Index: InclusionStatement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/InclusionStatement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** InclusionStatement.java 9 Aug 2003 22:16:17 -0000 1.6 --- InclusionStatement.java 22 Aug 2003 20:40:00 -0000 1.7 *************** *** 30,35 **** final int keyword, final Expression expression, ! final int sourceStart) { ! super(sourceStart, expression.sourceEnd); this.keyword = keyword; this.expression = expression; --- 30,36 ---- final int keyword, final Expression expression, ! final int sourceStart, ! final int sourceEnd) { ! super(sourceStart, sourceEnd); this.keyword = keyword; this.expression = expression; Index: Variable.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Variable.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Variable.java 11 Aug 2003 22:24:37 -0000 1.6 --- Variable.java 22 Aug 2003 20:40:00 -0000 1.7 *************** *** 5,9 **** import java.util.List; import java.util.ArrayList; - import java.util.Arrays; /** --- 5,8 ---- *************** *** 20,23 **** --- 19,25 ---- private AbstractVariable variable; + /** the variable is defined like this ${expression} */ + private Expression expression; + public static final String _GET = "_GET"; public static final String _POST = "_POST"; *************** *** 70,73 **** --- 72,88 ---- /** + * Create a special variable ($$toto for example). + * @param expression the variable contained + * @param sourceStart the starting position + * @param sourceEnd the ending position + */ + public Variable(final Expression expression, + final int sourceStart, + final int sourceEnd) { + super(sourceStart, sourceEnd); + this.expression = expression; + } + + /** * Return the expression as String. * @return the expression *************** *** 78,85 **** public String getName() { ! if (variable == null) { return name; } ! return variable.toStringExpression(); } --- 93,103 ---- public String getName() { ! if (name != null) { return name; } ! if (variable != null) { ! return variable.toStringExpression(); ! } ! return "{" + expression.toStringExpression() + "}"; } *************** *** 106,113 **** public List getUsedVariable() { final String varName; ! if (name == null) { varName = variable.getName(); } else { ! varName = name; } if (arrayContains(SPECIAL_VARS, name)) { --- 124,133 ---- public List getUsedVariable() { final String varName; ! if (name != null) { ! varName = name; ! } else if (variable != null) { varName = variable.getName(); } else { ! varName = expression.toStringExpression();//todo : do a better thing like evaluate this ?? } if (arrayContains(SPECIAL_VARS, name)) { |
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv9983/src/test Modified Files: PHPParser.java PHPParser.jj PHPParserConstants.java PHPParserTokenManager.java Log Message: a lot of fixes Index: PHPParser.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParser.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** PHPParser.java 18 Aug 2003 17:42:30 -0000 1.60 --- PHPParser.java 22 Aug 2003 20:39:29 -0000 1.61 *************** *** 65,69 **** private static int nodePtr; ! public static final boolean PARSER_DEBUG = false; public final void setFileToParse(final IFile fileToParse) { --- 65,69 ---- private static int nodePtr; ! public static final boolean PARSER_DEBUG = true; [...6722 lines suppressed...] *** 7345,7349 **** static final private void jj_rescan_token() { jj_rescan = true; ! for (int i = 0; i < 6; i++) { JJCalls p = jj_2_rtns[i]; do { --- 7385,7389 ---- static final private void jj_rescan_token() { jj_rescan = true; ! for (int i = 0; i < 5; i++) { JJCalls p = jj_2_rtns[i]; do { *************** *** 7356,7360 **** case 3: jj_3_4(); break; case 4: jj_3_5(); break; - case 5: jj_3_6(); break; } } --- 7396,7399 ---- Index: PHPParser.jj =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParser.jj,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** PHPParser.jj 18 Aug 2003 17:42:30 -0000 1.60 --- PHPParser.jj 22 Aug 2003 20:39:29 -0000 1.61 *************** *** 88,92 **** private static int nodePtr; ! public static final boolean PARSER_DEBUG = false; public final void setFileToParse(final IFile fileToParse) { --- 88,92 ---- private static int nodePtr; ! public static final boolean PARSER_DEBUG = true; public final void setFileToParse(final IFile fileToParse) { *************** *** 332,348 **** final int currentPosition = token.sourceStart; if (currentPosition == htmlStart || currentPosition > SimpleCharStream.currentBuffer.length()) { return; } ! final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart,currentPosition+1).toCharArray(); pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition)); } /** Create a new task. */ ! public static final void createNewTask() { ! final int currentPosition = token.sourceStart; ! final String todo = SimpleCharStream.currentBuffer.substring(currentPosition-3, SimpleCharStream.currentBuffer.indexOf("\n", ! currentPosition)-1); if (!PARSER_DEBUG) { try { --- 332,349 ---- final int currentPosition = token.sourceStart; if (currentPosition == htmlStart || + currentPosition < htmlStart || currentPosition > SimpleCharStream.currentBuffer.length()) { return; } ! final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart, ! currentPosition).toCharArray(); pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition)); } /** Create a new task. */ ! public static final void createNewTask(final int todoStart) { ! final String todo = SimpleCharStream.currentBuffer.substring(todoStart, SimpleCharStream.currentBuffer.indexOf("\n", ! todoStart)-1); if (!PARSER_DEBUG) { try { *************** *** 379,390 **** <DEFAULT> TOKEN : { ! <PHPSTARTSHORT : "<?"> {PHPParser.createNewHTMLCode();} : PHPPARSING ! | <PHPSTARTLONG : "<?php"> {PHPParser.createNewHTMLCode();} : PHPPARSING ! | <PHPECHOSTART : "<?="> {PHPParser.createNewHTMLCode();} : PHPPARSING } ! <PHPPARSING, IN_SINGLE_LINE_COMMENT> TOKEN : { ! <PHPEND :"?>"> {PHPParser.htmlStart = PHPParser.token.sourceEnd;} : DEFAULT } --- 380,391 ---- <DEFAULT> TOKEN : { ! <PHPSTARTSHORT : "<?"> : PHPPARSING ! | <PHPSTARTLONG : "<?php"> : PHPPARSING ! | <PHPECHOSTART : "<?="> : PHPPARSING } ! <PHPPARSING, IN_SINGLE_LINE_COMMENT,IN_VARIABLE> TOKEN : { ! <PHPEND :"?>"> : DEFAULT } *************** *** 406,409 **** --- 407,418 ---- } + <IN_VARIABLE> SPECIAL_TOKEN : + { + " " : PHPPARSING + | "\t" : PHPPARSING + | "\n" : PHPPARSING + | "\r" : PHPPARSING + | "\f" : PHPPARSING + } /* COMMENTS */ <PHPPARSING> SPECIAL_TOKEN : *************** *** 423,429 **** <IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT> SPECIAL_TOKEN : { ! "todo" {PHPParser.createNewTask();} } <IN_FORMAL_COMMENT> SPECIAL_TOKEN : { --- 432,443 ---- <IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT> SPECIAL_TOKEN : { ! "todo" } + void todo() : + {Token todoToken;} + { + todoToken = "TODO" {createNewTask(todoToken.sourceStart);} + } <IN_FORMAL_COMMENT> SPECIAL_TOKEN : { *************** *** 468,474 **** | <DEFINE : "define"> | <STATIC : "static"> ! | <CLASSACCESS : "->"> ! | <STATICCLASSACCESS : "::"> ! | <ARRAYASSIGN : "=>"> } --- 482,492 ---- | <DEFINE : "define"> | <STATIC : "static"> ! } ! ! <PHPPARSING,IN_VARIABLE> TOKEN : ! { ! <CLASSACCESS : "->"> : PHPPARSING ! | <STATICCLASSACCESS : "::"> : PHPPARSING ! | <ARRAYASSIGN : "=>"> : PHPPARSING } *************** *** 517,550 **** //Misc token ! <PHPPARSING> TOKEN : { ! <AT : "@"> ! | <DOLLAR : "$"> ! | <BANG : "!"> ! | <TILDE : "~"> ! | <HOOK : "?"> ! | <COLON : ":"> } /* OPERATORS */ ! <PHPPARSING> TOKEN : { ! <OR_OR : "||"> ! | <AND_AND : "&&"> ! | <PLUS_PLUS : "++"> ! | <MINUS_MINUS : "--"> ! | <PLUS : "+"> ! | <MINUS : "-"> ! | <STAR : "*"> ! | <SLASH : "/"> ! | <BIT_AND : "&"> ! | <BIT_OR : "|"> ! | <XOR : "^"> ! | <REMAINDER : "%"> ! | <LSHIFT : "<<"> ! | <RSIGNEDSHIFT : ">>"> ! | <RUNSIGNEDSHIFT : ">>>"> ! | <_ORL : "OR"> ! | <_ANDL : "AND"> } --- 535,567 ---- //Misc token ! <PHPPARSING,IN_VARIABLE> TOKEN : { ! <AT : "@"> : PHPPARSING ! | <BANG : "!"> : PHPPARSING ! | <TILDE : "~"> : PHPPARSING ! | <HOOK : "?"> : PHPPARSING ! | <COLON : ":"> : PHPPARSING } /* OPERATORS */ ! <PHPPARSING,IN_VARIABLE> TOKEN : { ! <OR_OR : "||"> : PHPPARSING ! | <AND_AND : "&&"> : PHPPARSING ! | <PLUS_PLUS : "++"> : PHPPARSING ! | <MINUS_MINUS : "--"> : PHPPARSING ! | <PLUS : "+"> : PHPPARSING ! | <MINUS : "-"> : PHPPARSING ! | <STAR : "*"> : PHPPARSING ! | <SLASH : "/"> : PHPPARSING ! | <BIT_AND : "&"> : PHPPARSING ! | <BIT_OR : "|"> : PHPPARSING ! | <XOR : "^"> : PHPPARSING ! | <REMAINDER : "%"> : PHPPARSING ! | <LSHIFT : "<<"> : PHPPARSING ! | <RSIGNEDSHIFT : ">>"> : PHPPARSING ! | <RUNSIGNEDSHIFT : ">>>"> : PHPPARSING ! | <_ORL : "OR"> : PHPPARSING ! | <_ANDL : "AND"> : PHPPARSING } *************** *** 581,585 **** /* IDENTIFIERS */ ! <PHPPARSING> TOKEN : { <IDENTIFIER: (<LETTER>|<SPECIAL>) (<LETTER>|<DIGIT>|<SPECIAL>)* > --- 598,606 ---- /* IDENTIFIERS */ ! ! <PHPPARSING,IN_VARIABLE> TOKEN : {<DOLLAR : "$"> : IN_VARIABLE} ! ! ! <PHPPARSING, IN_VARIABLE> TOKEN : { <IDENTIFIER: (<LETTER>|<SPECIAL>) (<LETTER>|<DIGIT>|<SPECIAL>)* > *************** *** 600,652 **** /* SEPARATORS */ ! <PHPPARSING> TOKEN : { ! <LPAREN : "("> ! | <RPAREN : ")"> ! | <LBRACE : "{"> ! | <RBRACE : "}"> ! | <LBRACKET : "["> ! | <RBRACKET : "]"> ! | <SEMICOLON : ";"> ! | <COMMA : ","> ! | <DOT : "."> } /* COMPARATOR */ ! <PHPPARSING> TOKEN : { ! <GT : ">"> ! | <LT : "<"> ! | <EQUAL_EQUAL : "=="> ! | <LE : "<="> ! | <GE : ">="> ! | <NOT_EQUAL : "!="> ! | <DIF : "<>"> ! | <BANGDOUBLEEQUAL : "!=="> ! | <TRIPLEEQUAL : "==="> } /* ASSIGNATION */ ! <PHPPARSING> TOKEN : ! { ! <ASSIGN : "="> ! | <PLUSASSIGN : "+="> ! | <MINUSASSIGN : "-="> ! | <STARASSIGN : "*="> ! | <SLASHASSIGN : "/="> ! | <ANDASSIGN : "&="> ! | <ORASSIGN : "|="> ! | <XORASSIGN : "^="> ! | <DOTASSIGN : ".="> ! | <REMASSIGN : "%="> ! | <TILDEEQUAL : "~="> ! | <LSHIFTASSIGN : "<<="> ! | <RSIGNEDSHIFTASSIGN : ">>="> ! } ! ! <PHPPARSING> TOKEN : { ! <DOLLAR_ID: <DOLLAR> <IDENTIFIER>> } --- 621,668 ---- /* SEPARATORS */ ! <PHPPARSING,IN_VARIABLE> TOKEN : { ! <LPAREN : "("> : PHPPARSING ! | <RPAREN : ")"> : PHPPARSING ! | <LBRACE : "{"> : PHPPARSING ! | <RBRACE : "}"> : PHPPARSING ! | <LBRACKET : "["> : PHPPARSING ! | <RBRACKET : "]"> : PHPPARSING ! | <SEMICOLON : ";"> : PHPPARSING ! | <COMMA : ","> : PHPPARSING ! | <DOT : "."> : PHPPARSING } /* COMPARATOR */ ! <PHPPARSING,IN_VARIABLE> TOKEN : { ! <GT : ">"> : PHPPARSING ! | <LT : "<"> : PHPPARSING ! | <EQUAL_EQUAL : "=="> : PHPPARSING ! | <LE : "<="> : PHPPARSING ! | <GE : ">="> : PHPPARSING ! | <NOT_EQUAL : "!="> : PHPPARSING ! | <DIF : "<>"> : PHPPARSING ! | <BANGDOUBLEEQUAL : "!=="> : PHPPARSING ! | <TRIPLEEQUAL : "==="> : PHPPARSING } /* ASSIGNATION */ ! <PHPPARSING,IN_VARIABLE> TOKEN : { ! <ASSIGN : "="> : PHPPARSING ! | <PLUSASSIGN : "+="> : PHPPARSING ! | <MINUSASSIGN : "-="> : PHPPARSING ! | <STARASSIGN : "*="> : PHPPARSING ! | <SLASHASSIGN : "/="> : PHPPARSING ! | <ANDASSIGN : "&="> : PHPPARSING ! | <ORASSIGN : "|="> : PHPPARSING ! | <XORASSIGN : "^="> : PHPPARSING ! | <DOTASSIGN : ".="> : PHPPARSING ! | <REMASSIGN : "%="> : PHPPARSING ! | <TILDEEQUAL : "~="> : PHPPARSING ! | <LSHIFTASSIGN : "<<="> : PHPPARSING ! | <RSIGNEDSHIFTASSIGN : ">>="> : PHPPARSING } *************** *** 682,686 **** { final PHPEchoBlock phpEchoBlock; ! final Token token; } { --- 698,702 ---- { final PHPEchoBlock phpEchoBlock; ! final Token token,phpEnd; } { *************** *** 701,707 **** }} ] Php() try { ! <PHPEND> } catch (ParseException e) { errorMessage = "'?>' expected"; --- 717,725 ---- }} ] + {PHPParser.createNewHTMLCode();} Php() try { ! phpEnd = <PHPEND> ! {htmlStart = phpEnd.sourceEnd;} } catch (ParseException e) { errorMessage = "'?>' expected"; *************** *** 720,725 **** } { ! token = <PHPECHOSTART> expr = Expression() [ <SEMICOLON> ] token2 = <PHPEND> { echoBlock = new PHPEchoBlock(expr,token.sourceStart,token2.sourceEnd); pushOnAstNodes(echoBlock); --- 738,746 ---- } { ! token = <PHPECHOSTART> {PHPParser.createNewHTMLCode();} ! expr = Expression() [ <SEMICOLON> ] token2 = <PHPEND> { + htmlStart = token2.sourceEnd; + echoBlock = new PHPEchoBlock(expr,token.sourceStart,token2.sourceEnd); pushOnAstNodes(echoBlock); *************** *** 740,743 **** --- 761,765 ---- String classNameImage = SYNTAX_ERROR_CHAR; String superclassNameImage = null; + final int classEnd; } { *************** *** 792,804 **** currentSegment = classDeclaration; } ! ClassBody(classDeclaration) {currentSegment = (OutlineableWithChildren) currentSegment.getParent(); ! classDeclaration.sourceEnd = SimpleCharStream.getPosition(); pushOnAstNodes(classDeclaration); return classDeclaration;} } ! void ClassBody(final ClassDeclaration classDeclaration) : ! {} { try { --- 814,828 ---- currentSegment = classDeclaration; } ! classEnd = ClassBody(classDeclaration) {currentSegment = (OutlineableWithChildren) currentSegment.getParent(); ! classDeclaration.sourceEnd = classEnd; pushOnAstNodes(classDeclaration); return classDeclaration;} } ! int ClassBody(final ClassDeclaration classDeclaration) : ! { ! Token token; ! } { try { *************** *** 813,817 **** ( ClassBodyDeclaration(classDeclaration) )* try { ! <RBRACE> } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. 'var', 'function' or '}' expected"; --- 837,842 ---- ( ClassBodyDeclaration(classDeclaration) )* try { ! token = <RBRACE> ! {return token.sourceEnd;} } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. 'var', 'function' or '}' expected"; *************** *** 820,823 **** --- 845,849 ---- errorEnd = SimpleCharStream.getPosition() + 1; processParseExceptionDebug(e); + return PHPParser.token.sourceEnd; } } *************** *** 895,904 **** VariableDeclaration VariableDeclaratorNoSuffix() : { ! final Token varName; ! Expression initializer = null; Token assignToken; } { ! varName = <DOLLAR_ID> [ assignToken = <ASSIGN> --- 921,938 ---- VariableDeclaration VariableDeclaratorNoSuffix() : { ! final Token dollar, token, lbrace,rbrace; ! Expression expr, initializer = null; Token assignToken; + Variable variable; } { ! dollar = <DOLLAR> ! ( ! token = <IDENTIFIER> ! {variable = new Variable(token.image,dollar.sourceStart,token.sourceEnd);} ! | ! lbrace = <LBRACE> expr = Expression() rbrace = <RBRACE> ! {variable = new Variable(expr,dollar.sourceStart,rbrace.sourceEnd);} ! ) [ assignToken = <ASSIGN> *************** *** 916,932 **** if (initializer == null) { return new VariableDeclaration(currentSegment, ! new Variable(varName.image.substring(1), ! varName.sourceStart+1, ! varName.sourceEnd+1), ! varName.sourceStart+1, ! varName.sourceEnd+1); } return new VariableDeclaration(currentSegment, ! new Variable(varName.image.substring(1), ! varName.sourceStart+1, ! varName.sourceEnd+1), initializer, VariableDeclaration.EQUAL, ! varName.sourceStart+1); } } --- 950,962 ---- if (initializer == null) { return new VariableDeclaration(currentSegment, ! variable, ! variable.sourceStart, ! variable.sourceEnd); } return new VariableDeclaration(currentSegment, ! variable, initializer, VariableDeclaration.EQUAL, ! variable.sourceStart); } } *************** *** 1001,1040 **** } - /** - * Return a variablename without the $. - * @return a variable name - *//* - Variable Variable(): - { - final StringBuffer buff; - Expression expression = null; - final Token token; - Variable expr; - final int pos; - } - { - token = <DOLLAR_ID> - [<LBRACE> expression = Expression() <RBRACE>] - { - if (expression == null) { - return new Variable(token.image.substring(1), - token.sourceStart+1, - token.sourceEnd+1); - } - String s = expression.toStringExpression(); - buff = new StringBuffer(token.image.length()+s.length()+2); - buff.append(token.image); - buff.append("{"); - buff.append(s); - buff.append("}"); - s = buff.toString(); - return new Variable(s,token.sourceStart+1,token.sourceEnd+1); - } - | - token = <DOLLAR> - expr = VariableName() - {return new Variable(expr,token.sourceStart,expr.sourceEnd);} - } */ - Variable Variable() : { --- 1031,1034 ---- *************** *** 1043,1057 **** } { - token = <DOLLAR_ID> [variable = Var(token)] - { - if (variable == null) { - return new Variable(token.image.substring(1),token.sourceStart+1,token.sourceEnd+1); - } - final StringBuffer buff = new StringBuffer(); - buff.append(token.image.substring(1)); - buff.append(variable.toStringExpression()); - return new Variable(buff.toString(),token.sourceStart+1,variable.sourceEnd+1); - } - | token = <DOLLAR> variable = Var(token) { --- 1037,1040 ---- *************** *** 1063,1148 **** { Variable variable = null; ! final Token token; ConstantIdentifier constant; } { - token = <DOLLAR_ID> [variable = Var(token)] - {if (variable == null) { - return new Variable(token.image.substring(1),token.sourceStart+1,token.sourceEnd+1); - } - final StringBuffer buff = new StringBuffer(); - buff.append(token.image.substring(1)); - buff.append(variable.toStringExpression()); - return new Variable(buff.toString(),dollar.sourceStart,variable.sourceEnd); - } - | - LOOKAHEAD(<DOLLAR> <DOLLAR>) token = <DOLLAR> variable = Var(token) {return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} | - constant = VariableName() - {return new Variable(constant.name,dollar.sourceStart,constant.sourceEnd);} - } - - /** - * A Variable name (without the $) - * @return a variable name String - */ - ConstantIdentifier VariableName(): - { - final StringBuffer buff; - String expr; - Expression expression = null; - final Token token; - Token token2 = null; - } - { token = <LBRACE> expression = Expression() token2 = <RBRACE> - {expr = expression.toStringExpression(); - buff = new StringBuffer(expr.length()+2); - buff.append("{"); - buff.append(expr); - buff.append("}"); - expr = buff.toString(); - return new ConstantIdentifier(expr, - token.sourceStart, - token2.sourceEnd); - - } - | - token = <IDENTIFIER> - [<LBRACE> expression = Expression() token2 = <RBRACE>] { ! if (expression == null) { ! return new ConstantIdentifier(token.image, ! token.sourceStart, ! token.sourceEnd); ! } ! expr = expression.toStringExpression(); ! buff = new StringBuffer(token.image.length()+expr.length()+2); ! buff.append(token.image); ! buff.append("{"); ! buff.append(expr); ! buff.append("}"); ! expr = buff.toString(); ! return new ConstantIdentifier(expr, ! token.sourceStart, ! token2.sourceEnd); ! } ! /*| ! <DOLLAR> ! var = VariableName() ! { ! return new Variable(var, ! var.sourceStart-1, ! var.sourceEnd); } | ! token = <DOLLAR_ID> ! { ! return new Variable(token.image, ! token.sourceStart+1, ! token.sourceEnd+1); ! } */ } --- 1046,1066 ---- { Variable variable = null; ! final Token token,token2; ConstantIdentifier constant; + Expression expression; } { token = <DOLLAR> variable = Var(token) {return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} | token = <LBRACE> expression = Expression() token2 = <RBRACE> { ! return new Variable(expression, ! dollar.sourceStart, ! token2.sourceEnd); } | ! token = <IDENTIFIER> ! {return new Variable(token.image,dollar.sourceStart,token.sourceEnd);} } *************** *** 1686,1690 **** {return new PrefixedUnaryExpression(expr,OperatorIds.AND,pos);} | */ ! expr = AtNotUnaryExpression() {return expr;} } --- 1604,1630 ---- {return new PrefixedUnaryExpression(expr,OperatorIds.AND,pos);} | */ ! expr = AtNotTildeUnaryExpression() {return expr;} ! } ! ! Expression AtNotTildeUnaryExpression() : ! { ! final Expression expr; ! final Token token; ! } ! { ! token = <AT> ! expr = AtNotTildeUnaryExpression() ! {return new PrefixedUnaryExpression(expr,OperatorIds.AT,token.sourceStart);} ! | ! token = <TILDE> ! expr = AtNotTildeUnaryExpression() ! {return new PrefixedUnaryExpression(expr,OperatorIds.TWIDDLE,token.sourceStart);} ! | ! token = <BANG> ! expr = AtNotUnaryExpression() ! {return new PrefixedUnaryExpression(expr,OperatorIds.NOT,token.sourceStart);} ! | ! expr = UnaryExpressionNoPrefix() ! {return expr;} } *************** *** 1717,1725 **** } { ! token = <PLUS> expr = AtNotUnaryExpression() {return new PrefixedUnaryExpression(expr, OperatorIds.PLUS, token.sourceStart);} | ! token = <MINUS> expr = AtNotUnaryExpression() {return new PrefixedUnaryExpression(expr, OperatorIds.MINUS, token.sourceStart);} --- 1657,1665 ---- } { ! token = <PLUS> expr = AtNotTildeUnaryExpression() {return new PrefixedUnaryExpression(expr, OperatorIds.PLUS, token.sourceStart);} | ! token = <MINUS> expr = AtNotTildeUnaryExpression() {return new PrefixedUnaryExpression(expr, OperatorIds.MINUS, token.sourceStart);} *************** *** 1910,1914 **** { Expression expression = null; ! final Token classAccessToken; Token token; int pos; --- 1850,1854 ---- { Expression expression = null; ! final Token classAccessToken,lbrace,rbrace; Token token; int pos; *************** *** 1917,1921 **** classAccessToken = <CLASSACCESS> try { ! ( expression = VariableName() | expression = Variable() ) } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function call or field access expected"; --- 1857,1873 ---- classAccessToken = <CLASSACCESS> try { ! ( ! lbrace = <LBRACE> expression = Expression() rbrace = <RBRACE> ! { ! expression = new Variable(expression, ! lbrace.sourceStart, ! rbrace.sourceEnd); ! } ! | ! token = <IDENTIFIER> ! {expression = new Variable(token.image,token.sourceStart,token.sourceEnd);} ! | ! expression = Variable() ! ) } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function call or field access expected"; *************** *** 1943,1946 **** --- 1895,1913 ---- } {return new ArrayDeclarator(prefix,expression,pos);} + | + token = <LBRACE> {pos = token.sourceEnd+1;} + [ expression = Expression() {pos = expression.sourceEnd+1;} + | expression = Type() {pos = expression.sourceEnd+1;}] //Not good + try { + token = <RBRACE> + {pos = token.sourceEnd;} + } catch (ParseException e) { + errorMessage = "']' expected"; + errorLevel = ERROR; + errorStart = pos; + errorEnd = pos; + processParseExceptionDebug(e); + } + {return new ArrayDeclarator(prefix,expression,pos);}//todo : check braces here } *************** *** 2163,2171 **** final AstNode[] blockNodes; final int nbNodes; } { ! <PHPEND> (phpEchoBlock())* try { (<PHPSTARTLONG> | <PHPSTARTSHORT>) } catch (ParseException e) { errorMessage = "unexpected end of file , '<?php' expected"; --- 2130,2142 ---- final AstNode[] blockNodes; final int nbNodes; + final Token phpEnd; } { ! phpEnd = <PHPEND> ! {htmlStart = phpEnd.sourceEnd;} ! (phpEchoBlock())* try { (<PHPSTARTLONG> | <PHPSTARTSHORT>) + {PHPParser.createNewHTMLCode();} } catch (ParseException e) { errorMessage = "unexpected end of file , '<?php' expected"; *************** *** 2177,2182 **** { nbNodes = nodePtr - startIndex; blockNodes = new AstNode[nbNodes]; ! System.arraycopy(nodes,startIndex,blockNodes,0,nbNodes); nodePtr = startIndex; return new HTMLBlock(blockNodes);} --- 2148,2156 ---- { nbNodes = nodePtr - startIndex; + if (nbNodes == 0) { + return null; + } blockNodes = new AstNode[nbNodes]; ! System.arraycopy(nodes,startIndex+1,blockNodes,0,nbNodes); nodePtr = startIndex; return new HTMLBlock(blockNodes);} *************** *** 2201,2205 **** try { expr = Expression() ! {pos=expr.sourceEnd;} } catch (ParseException e) { if (errorMessage != null) { --- 2175,2179 ---- try { expr = Expression() ! {pos = expr.sourceEnd;} } catch (ParseException e) { if (errorMessage != null) { *************** *** 2208,2233 **** errorMessage = "unexpected token '"+ e.currentToken.next.image+"', expression expected"; errorLevel = ERROR; ! errorStart = pos+1; ! errorEnd = pos+1; expr = new ConstantIdentifier(SYNTAX_ERROR_CHAR,pos,pos); processParseExceptionDebug(e); } - {inclusionStatement = new InclusionStatement(currentSegment, - keyword, - expr, - token.sourceStart); - currentSegment.add(inclusionStatement); - } try { token2 = <SEMICOLON> } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected"; errorLevel = ERROR; ! errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; ! errorEnd = SimpleCharStream.getPosition() + 1; ! throw e; } - {inclusionStatement.sourceEnd = token2.sourceEnd; - return inclusionStatement;} } --- 2182,2209 ---- errorMessage = "unexpected token '"+ e.currentToken.next.image+"', expression expected"; errorLevel = ERROR; ! errorStart = e.currentToken.next.sourceStart; ! errorEnd = e.currentToken.next.sourceEnd; expr = new ConstantIdentifier(SYNTAX_ERROR_CHAR,pos,pos); processParseExceptionDebug(e); } try { token2 = <SEMICOLON> + {pos=token2.sourceEnd;} } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected"; errorLevel = ERROR; ! errorStart = e.currentToken.next.sourceStart; ! errorEnd = e.currentToken.next.sourceEnd; ! processParseExceptionDebug(e); ! } ! { ! inclusionStatement = new InclusionStatement(currentSegment, ! keyword, ! expr, ! token.sourceStart, ! pos); ! currentSegment.add(inclusionStatement); ! return inclusionStatement; } } *************** *** 2449,2453 **** } ( statement = BlockStatement() {list.add(statement);pos = statement.sourceEnd+1;} ! | statement = htmlBlock() {list.add(statement);pos = statement.sourceEnd+1;})* try { token2 = <RBRACE> --- 2425,2435 ---- } ( statement = BlockStatement() {list.add(statement);pos = statement.sourceEnd+1;} ! | statement = htmlBlock() {if (statement != null) { ! list.add(statement); ! pos = statement.sourceEnd+1; ! } ! pos = PHPParser.token.sourceEnd+1; ! } ! )* try { token2 = <RBRACE> *************** *** 2653,2656 **** --- 2635,2639 ---- } } + /** * A Switch statement with : ... endswitch; *************** *** 2713,2718 **** expr = SwitchLabel() ( statement = BlockStatementNoBreak() {stmts.add(statement);} ! | statement = htmlBlock() {stmts.add(statement);})* ! [ statement = BreakStatement() {stmts.add(statement);}] { final int listSize = stmts.size(); --- 2696,2702 ---- 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);}] { final int listSize = stmts.size(); *************** *** 2855,2859 **** {stmts = new ArrayList();} ( statement = Statement() {stmts.add(statement);} ! | statement = htmlBlock() {stmts.add(statement);})* {endStatements = SimpleCharStream.getPosition();} (elseifStatement = ElseIfStatementColon() {elseIfList.add(elseifStatement);})* --- 2839,2843 ---- {stmts = new ArrayList();} ( statement = Statement() {stmts.add(statement);} ! | statement = htmlBlock() {if (statement != null) {stmts.add(statement);}})* {endStatements = SimpleCharStream.getPosition();} (elseifStatement = ElseIfStatementColon() {elseIfList.add(elseifStatement);})* *************** *** 2951,2955 **** elseifToken = <ELSEIF> condition = Condition("elseif") <COLON> ( statement = Statement() {list.add(statement);} ! | statement = htmlBlock() {list.add(statement);})* { final int sizeList = list.size(); --- 2935,2939 ---- elseifToken = <ELSEIF> condition = Condition("elseif") <COLON> ( statement = Statement() {list.add(statement);} ! | statement = htmlBlock() {if (statement != null) {list.add(statement);}})* { final int sizeList = list.size(); *************** *** 2969,2973 **** { elseToken = <ELSE> <COLON> ( statement = Statement() {list.add(statement);} ! | statement = htmlBlock() {list.add(statement);})* { final int sizeList = list.size(); --- 2953,2957 ---- { elseToken = <ELSE> <COLON> ( statement = Statement() {list.add(statement);} ! | statement = htmlBlock() {if (statement != null) {list.add(statement);}})* { final int sizeList = list.size(); Index: PHPParserConstants.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParserConstants.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PHPParserConstants.java 11 Aug 2003 21:30:29 -0000 1.15 --- PHPParserConstants.java 22 Aug 2003 20:39:29 -0000 1.16 *************** *** 9,141 **** int PHPECHOSTART = 3; int PHPEND = 4; ! int SINGLE_LINE_COMMENT = 15; ! int CLASS = 21; ! int FUNCTION = 22; ! int VAR = 23; ! int IF = 24; ! int ELSEIF = 25; ! int ELSE = 26; ! int ARRAY = 27; ! int BREAK = 28; ! int LIST = 29; ! int PRINT = 30; ! int ECHO = 31; ! int INCLUDE = 32; ! int REQUIRE = 33; ! int INCLUDE_ONCE = 34; ! int REQUIRE_ONCE = 35; ! int GLOBAL = 36; ! int DEFINE = 37; ! int STATIC = 38; ! int CLASSACCESS = 39; ! int STATICCLASSACCESS = 40; ! int ARRAYASSIGN = 41; ! int CASE = 42; ! int CONST = 43; ! int CONTINUE = 44; ! int _DEFAULT = 45; ! int DO = 46; ! int EXTENDS = 47; ! int FOR = 48; ! int GOTO = 49; ! int NEW = 50; ! int NULL = 51; ! int RETURN = 52; ! int SUPER = 53; ! int SWITCH = 54; ! int THIS = 55; ! int TRUE = 56; ! int FALSE = 57; ! int WHILE = 58; ! int ENDWHILE = 59; ! int ENDSWITCH = 60; ! int ENDIF = 61; ! int ENDFOR = 62; ! int FOREACH = 63; ! int AS = 64; ! int STRING = 65; ! int OBJECT = 66; ! int BOOL = 67; ! int BOOLEAN = 68; ! int REAL = 69; ! int DOUBLE = 70; ! int FLOAT = 71; ! int INT = 72; ! int INTEGER = 73; ! int AT = 74; ! int DOLLAR = 75; ! int BANG = 76; ! int TILDE = 77; ! int HOOK = 78; ! int COLON = 79; ! int OR_OR = 80; ! int AND_AND = 81; ! int PLUS_PLUS = 82; ! int MINUS_MINUS = 83; ! int PLUS = 84; ! int MINUS = 85; ! int STAR = 86; ! int SLASH = 87; ! int BIT_AND = 88; ! int BIT_OR = 89; ! int XOR = 90; ! int REMAINDER = 91; ! int LSHIFT = 92; ! int RSIGNEDSHIFT = 93; ! int RUNSIGNEDSHIFT = 94; ! int _ORL = 95; ! int _ANDL = 96; ! int INTEGER_LITERAL = 97; ! int DECIMAL_LITERAL = 98; ! int HEX_LITERAL = 99; ! int OCTAL_LITERAL = 100; ! int FLOATING_POINT_LITERAL = 101; ! int EXPONENT = 102; ! int STRING_LITERAL = 103; ! int STRING_1 = 104; ! int STRING_2 = 105; ! int STRING_3 = 106; ! int IDENTIFIER = 107; ! int LETTER = 108; ! int DIGIT = 109; ! int SPECIAL = 110; ! int LPAREN = 111; ! int RPAREN = 112; ! int LBRACE = 113; ! int RBRACE = 114; ! int LBRACKET = 115; ! int RBRACKET = 116; ! int SEMICOLON = 117; ! int COMMA = 118; ! int DOT = 119; ! int GT = 120; ! int LT = 121; ! int EQUAL_EQUAL = 122; ! int LE = 123; ! int GE = 124; ! int NOT_EQUAL = 125; ! int DIF = 126; ! int BANGDOUBLEEQUAL = 127; ! int TRIPLEEQUAL = 128; ! int ASSIGN = 129; ! int PLUSASSIGN = 130; ! int MINUSASSIGN = 131; ! int STARASSIGN = 132; ! int SLASHASSIGN = 133; ! int ANDASSIGN = 134; ! int ORASSIGN = 135; ! int XORASSIGN = 136; ! int DOTASSIGN = 137; ! int REMASSIGN = 138; ! int TILDEEQUAL = 139; ! int LSHIFTASSIGN = 140; ! int RSIGNEDSHIFTASSIGN = 141; ! int DOLLAR_ID = 142; int DEFAULT = 0; int PHPPARSING = 1; int IN_SINGLE_LINE_COMMENT = 2; ! int IN_FORMAL_COMMENT = 3; ! int IN_MULTI_LINE_COMMENT = 4; String[] tokenImage = { --- 9,141 ---- int PHPECHOSTART = 3; int PHPEND = 4; ! int SINGLE_LINE_COMMENT = 20; ! int CLASS = 27; ! int FUNCTION = 28; ! int VAR = 29; ! int IF = 30; ! int ELSEIF = 31; ! int ELSE = 32; ! int ARRAY = 33; ! int BREAK = 34; ! int LIST = 35; ! int PRINT = 36; ! int ECHO = 37; ! int INCLUDE = 38; ! int REQUIRE = 39; ! int INCLUDE_ONCE = 40; ! int REQUIRE_ONCE = 41; ! int GLOBAL = 42; ! int DEFINE = 43; ! int STATIC = 44; ! int CLASSACCESS = 45; ! int STATICCLASSACCESS = 46; ! int ARRAYASSIGN = 47; ! int CASE = 48; ! int CONST = 49; ! int CONTINUE = 50; ! int _DEFAULT = 51; ! int DO = 52; ! int EXTENDS = 53; ! int FOR = 54; ! int GOTO = 55; ! int NEW = 56; ! int NULL = 57; ! int RETURN = 58; ! int SUPER = 59; ! int SWITCH = 60; ! int THIS = 61; ! int TRUE = 62; ! int FALSE = 63; ! int WHILE = 64; ! int ENDWHILE = 65; ! int ENDSWITCH = 66; ! int ENDIF = 67; ! int ENDFOR = 68; ! int FOREACH = 69; ! int AS = 70; ! int STRING = 71; ! int OBJECT = 72; ! int BOOL = 73; ! int BOOLEAN = 74; ! int REAL = 75; ! int DOUBLE = 76; ! int FLOAT = 77; ! int INT = 78; ! int INTEGER = 79; ! int AT = 80; ! int BANG = 81; ! int TILDE = 82; ! int HOOK = 83; ! int COLON = 84; ! int OR_OR = 85; ! int AND_AND = 86; ! int PLUS_PLUS = 87; ! int MINUS_MINUS = 88; ! int PLUS = 89; ! int MINUS = 90; ! int STAR = 91; ! int SLASH = 92; ! int BIT_AND = 93; ! int BIT_OR = 94; ! int XOR = 95; ! int REMAINDER = 96; ! int LSHIFT = 97; ! int RSIGNEDSHIFT = 98; ! int RUNSIGNEDSHIFT = 99; ! int _ORL = 100; ! int _ANDL = 101; ! int INTEGER_LITERAL = 102; ! int DECIMAL_LITERAL = 103; ! int HEX_LITERAL = 104; ! int OCTAL_LITERAL = 105; ! int FLOATING_POINT_LITERAL = 106; ! int EXPONENT = 107; ! int STRING_LITERAL = 108; ! int STRING_1 = 109; ! int STRING_2 = 110; ! int STRING_3 = 111; ! int DOLLAR = 112; ! int IDENTIFIER = 113; ! int LETTER = 114; ! int DIGIT = 115; ! int SPECIAL = 116; ! int LPAREN = 117; ! int RPAREN = 118; ! int LBRACE = 119; ! int RBRACE = 120; ! int LBRACKET = 121; ! int RBRACKET = 122; ! int SEMICOLON = 123; ! int COMMA = 124; ! int DOT = 125; ! int GT = 126; ! int LT = 127; ! int EQUAL_EQUAL = 128; ! int LE = 129; ! int GE = 130; ! int NOT_EQUAL = 131; ! int DIF = 132; ! int BANGDOUBLEEQUAL = 133; ! int TRIPLEEQUAL = 134; ! int ASSIGN = 135; ! int PLUSASSIGN = 136; ! int MINUSASSIGN = 137; ! int STARASSIGN = 138; ! int SLASHASSIGN = 139; ! int ANDASSIGN = 140; ! int ORASSIGN = 141; ! int XORASSIGN = 142; ! int DOTASSIGN = 143; ! int REMASSIGN = 144; ! int TILDEEQUAL = 145; ! int LSHIFTASSIGN = 146; ! int RSIGNEDSHIFTASSIGN = 147; int DEFAULT = 0; int PHPPARSING = 1; int IN_SINGLE_LINE_COMMENT = 2; ! int IN_VARIABLE = 3; ! int IN_FORMAL_COMMENT = 4; ! int IN_MULTI_LINE_COMMENT = 5; String[] tokenImage = { *************** *** 151,164 **** "\"\\r\"", "\"\\f\"", "\"//\"", "\"#\"", ! "<token of kind 13>", "\"/*\"", "<SINGLE_LINE_COMMENT>", ! "<token of kind 16>", "\"todo\"", "\"*/\"", "\"*/\"", ! "<token of kind 20>", "\"class\"", "\"function\"", --- 151,170 ---- "\"\\r\"", "\"\\f\"", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "\"\\f\"", "\"//\"", "\"#\"", ! "<token of kind 18>", "\"/*\"", "<SINGLE_LINE_COMMENT>", ! "<token of kind 21>", "\"todo\"", + "\"TODO\"", "\"*/\"", "\"*/\"", ! "<token of kind 26>", "\"class\"", "\"function\"", *************** *** 215,219 **** "\"integer\"", "\"@\"", - "\"$\"", "\"!\"", "\"~\"", --- 221,224 ---- *************** *** 247,250 **** --- 252,256 ---- "<STRING_2>", "<STRING_3>", + "\"$\"", "<IDENTIFIER>", "<LETTER>", *************** *** 282,286 **** "\"<<=\"", "\">>=\"", - "<DOLLAR_ID>", }; --- 288,291 ---- Index: PHPParserTokenManager.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/test/PHPParserTokenManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PHPParserTokenManager.java 14 Aug 2003 00:30:13 -0000 1.29 --- PHPParserTokenManager.java 22 Aug 2003 20:39:29 -0000 1.30 *************** *** 43,46 **** --- 43,49 ---- case 60: return jjMoveStringLiteralDfa1_0(0xeL); + case 84: + case 116: + return jjMoveStringLiteralDfa1_0(0x800000L); default : return 1; *************** *** 62,65 **** [...3382 lines suppressed...] - PHPParser.createNewHTMLCode(); - break; - case 3 : - if (image == null) - image = new StringBuffer(jjstrLiteralImages[3]); - else - image.append(jjstrLiteralImages[3]); - PHPParser.createNewHTMLCode(); - break; - case 4 : - if (image == null) - image = new StringBuffer(jjstrLiteralImages[4]); - else - image.append(jjstrLiteralImages[4]); - PHPParser.htmlStart = PHPParser.token.sourceEnd; - break; - default : break; } --- 2510,2514 ---- |
From: <kha...@us...> - 2003-08-18 19:28:16
|
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/codemanipulation In directory sc8-pr-cvs1:/tmp/cvs-serv30675/src/net/sourceforge/phpdt/internal/corext/codemanipulation Modified Files: StubUtility.java Log Message: Organized Imports Index: StubUtility.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/codemanipulation/StubUtility.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StubUtility.java 20 Mar 2003 20:38:50 -0000 1.1 --- StubUtility.java 18 Aug 2003 19:28:13 -0000 1.2 *************** *** 5,36 **** package net.sourceforge.phpdt.internal.corext.codemanipulation; - import java.util.ArrayList; - import java.util.Arrays; - import java.util.List; - - import org.eclipse.swt.SWT; - - import org.eclipse.jface.text.BadLocationException; - import org.eclipse.jface.text.IDocument; - - //import org.phpeclipse.phpdt.core.Flags; - //import org.phpeclipse.phpdt.core.IBuffer; import net.sourceforge.phpdt.core.ICodeFormatter; - //import org.phpeclipse.phpdt.core.ICompilationUnit; - //import org.phpeclipse.phpdt.core.IJavaElement; - //import org.phpeclipse.phpdt.core.IJavaProject; - //import org.phpeclipse.phpdt.core.IMethod; - //import org.phpeclipse.phpdt.core.IParent; - //import org.phpeclipse.phpdt.core.ISourceReference; - //import org.phpeclipse.phpdt.core.IType; - //import org.phpeclipse.phpdt.core.ITypeHierarchy; - import net.sourceforge.phpeclipse.PHPCore; - //import org.phpeclipse.phpdt.core.JavaModelException; - //import org.phpeclipse.phpdt.core.Signature; import net.sourceforge.phpdt.core.ToolFactory; ! //import net.sourceforge.phpdt.internal.corext.util.CodeFormatterUtil; ! //import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil; ! import net.sourceforge.phpdt.internal.corext.util.Strings; public class StubUtility { --- 5,13 ---- package net.sourceforge.phpdt.internal.corext.codemanipulation; import net.sourceforge.phpdt.core.ICodeFormatter; import net.sourceforge.phpdt.core.ToolFactory; ! import org.eclipse.jface.text.BadLocationException; ! import org.eclipse.jface.text.IDocument; public class StubUtility { |
From: <kha...@us...> - 2003-08-18 19:22:03
|
Update of /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core In directory sc8-pr-cvs1:/tmp/cvs-serv29635/src/net/sourceforge/phpdt/internal/core Modified Files: JavaElement.java Log Message: misc Index: JavaElement.java =================================================================== RCS file: /cvsroot/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/JavaElement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JavaElement.java 9 Aug 2003 17:32:27 -0000 1.1 --- JavaElement.java 18 Aug 2003 19:22:00 -0000 1.2 *************** *** 13,26 **** import net.sourceforge.phpdt.core.IJavaElement; import net.sourceforge.phpdt.core.IJavaModel; - import net.sourceforge.phpdt.core.IJavaModelStatusConstants; import net.sourceforge.phpdt.core.IOpenable; - import net.sourceforge.phpdt.core.IParent; import net.sourceforge.phpdt.core.JavaModelException; - import net.sourceforge.phpdt.internal.corext.Assert; - import org.eclipse.core.resources.IResourceStatus; - import org.eclipse.core.resources.ResourcesPlugin; - import org.eclipse.core.runtime.CoreException; - import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.PlatformObject; --- 13,19 ---- |