From 054f39a6cbedfcf4b1ba5c4d060a6d367a1ce106 Mon Sep 17 00:00:00 2001 From: kpouer Date: Tue, 13 May 2003 16:06:28 +0000 Subject: [PATCH] *** empty log message *** --- .../internal/compiler/ast/ArgumentDeclaration.java | 1 + .../internal/compiler/ast/MethodDeclaration.java | 4 ++ net.sourceforge.phpeclipse/src/test/PHPParser.jj | 43 ++++++++++--------- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArgumentDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArgumentDeclaration.java index b6c6a7c..2d6f723 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArgumentDeclaration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/ArgumentDeclaration.java @@ -7,6 +7,7 @@ package net.sourceforge.phpdt.internal.compiler.ast; */ public class ArgumentDeclaration extends VariableDeclaration { + /** The argument is a reference or not. */ public boolean reference; /** diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java index 1ee9990..93097f0 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java @@ -17,11 +17,15 @@ import java.util.ArrayList; */ public class MethodDeclaration extends Statement implements OutlineableWithChildren { + /** The name of the method. */ public char[] name; public Hashtable arguments; + + public Statement[] statements; public int bodyStart; public int bodyEnd = -1; + /** Tell if the method is a class constructor. */ public boolean isConstructor; private Object parent; /** The outlineable children (those will be in the node array too. */ diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index 0eb3056..628b52a 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -569,29 +569,29 @@ MORE : /* LITERALS */ TOKEN : { - < INTEGER_LITERAL: + (["l","L"])? | (["l","L"])? | (["l","L"])? > | - < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > + <#DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > | - < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > + <#HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > | - < #OCTAL_LITERAL: "0" (["0"-"7"])* > + <#OCTAL_LITERAL: "0" (["0"-"7"])* > | - < FLOATING_POINT_LITERAL: + )? (["f","F","d","D"])? | "." (["0"-"9"])+ ()? (["f","F","d","D"])? | (["0"-"9"])+ (["f","F","d","D"])? | (["0"-"9"])+ ()? ["f","F","d","D"] > | - < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > + <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > | - < STRING_LITERAL: ( | | )> -| < STRING_1: + | | )> +| -| < STRING_2: +| -| < STRING_3: +| ] - identifier = + [reference = ] identifier = formalParameters = FormalParameters() {return new MethodDeclaration(currentSegment, identifier.image.toCharArray(), @@ -1504,9 +1501,7 @@ Expression MultiplicativeExpression() : try { expr = UnaryExpression() } catch (ParseException e) { - if (errorMessage != null) { - throw e; - } + if (errorMessage != null) throw e; errorMessage = "unexpected token '"+e.currentToken.next.image+"'"; errorLevel = ERROR; errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; @@ -1535,8 +1530,7 @@ Expression UnaryExpression() : expr = UnaryExpressionNoPrefix() {return new PrefixedUnaryExpression(expr,OperatorIds.AND,pos);} | - expr = AtUnaryExpression() - {return expr;} + expr = AtUnaryExpression() {return expr;} } Expression AtUnaryExpression() : @@ -1815,6 +1809,11 @@ ArgumentDeclaration[] args = null; {return new FunctionCall(func,args,SimpleCharStream.getPosition());} } +/** + * An argument list is a list of arguments separated by comma : + * argumentDeclaration() (, argumentDeclaration)* + * @return an array of arguments + */ ArgumentDeclaration[] ArgumentList() : { ArgumentDeclaration arg; @@ -1842,6 +1841,10 @@ ArgumentDeclaration argument; return args;} } +/** + * Here is an argument declaration. + * It's [&]$variablename[=variableInitializer] + */ ArgumentDeclaration argumentDeclaration() : { boolean reference = false; -- 1.7.1