*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / PHPParser.jj
index 628b52a..95618cb 100644 (file)
@@ -1782,7 +1782,7 @@ Literal Literal() :
 | token = <FLOATING_POINT_LITERAL> {pos = SimpleCharStream.getPosition();
                                     return new NumberLiteral(token.image.toCharArray(),pos-token.image.length(),pos);}
 | token = <STRING_LITERAL>         {pos = SimpleCharStream.getPosition();
-                                    return new StringLiteral(token.image.toCharArray(),pos-token.image.length(),pos);}
+                                    return new StringLiteral(token.image.toCharArray(),pos-token.image.length());}
 | <TRUE>                           {pos = SimpleCharStream.getPosition();
                                     return new TrueLiteral(pos-4,pos);}
 | <FALSE>                          {pos = SimpleCharStream.getPosition();
@@ -1793,7 +1793,7 @@ Literal Literal() :
 
 FunctionCall Arguments(Expression func) :
 {
-ArgumentDeclaration[] args = null;
+Expression[] args = null;
 }
 {
   <LPAREN> [ args = ArgumentList() ]
@@ -1814,18 +1814,17 @@ ArgumentDeclaration[] args = null;
  * argumentDeclaration() (, argumentDeclaration)*
  * @return an array of arguments
  */
-ArgumentDeclaration[] ArgumentList() :
+Expression[] ArgumentList() :
 {
-ArgumentDeclaration arg;
+Expression arg;
 final ArrayList list = new ArrayList();
-ArgumentDeclaration argument;
 }
 {
-  arg = argumentDeclaration()
+  arg = Expression()
   {list.add(arg);}
   ( <COMMA>
       try {
-        arg = argumentDeclaration()
+        arg = Expression()
         {list.add(arg);}
       } catch (ParseException e) {
         errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. An expression expected after a comma in argument list";
@@ -1836,50 +1835,12 @@ ArgumentDeclaration argument;
       }
    )*
    {
-   ArgumentDeclaration[] args = new ArgumentDeclaration[list.size()];
-   list.toArray(args);
-   return args;}
+   Expression[] arguments = new Expression[list.size()];
+   list.toArray(arguments);
+   return arguments;}
 }
 
 /**
- * Here is an argument declaration.
- * It's [&]$variablename[=variableInitializer]
- */
-ArgumentDeclaration argumentDeclaration() :
-{
-  boolean reference = false;
-  String varName;
-  Expression initializer = null;
-  final int pos = SimpleCharStream.getPosition();
-}
-{
-  [<BIT_AND> {reference = true;}]
-  varName = VariableDeclaratorId()
- [
-    <ASSIGN>
-    try {
-      initializer = VariableInitializer()
-    } catch (ParseException e) {
-      errorMessage = "Literal expression expected in variable initializer";
-      errorLevel   = ERROR;
-      errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd   = jj_input_stream.getPosition() + 1;
-      throw e;
-    }
-  ]
-  {
-  if (initializer == null) {
-    return new ArgumentDeclaration(varName.toCharArray(),
-                                   reference,
-                                   pos);
-  }
-  return new ArgumentDeclaration(varName.toCharArray(),
-                                 reference,
-                                 initializer,
-                                 pos);
-  }
-}
-/**
  * A Statement without break.
  */
 Statement StatementNoBreak() :