*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / PHPParser.java
index 92e8360..b5b0024 100644 (file)
@@ -39,7 +39,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
   private static final String PARSE_WARNING_STRING = "Warning"; //$NON-NLS-1$
   static PHPOutlineInfo outlineInfo;
 
-  public static MethodDeclaration currentFunction;
   private static boolean assigning;
 
   /** The error level of the current ParseException. */
@@ -50,6 +49,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
   private static int errorStart = -1;
   private static int errorEnd = -1;
   private static PHPDocument phpDocument;
+
+  private static final char[] SYNTAX_ERROR_CHAR = {'s','y','n','t','a','x',' ','e','r','r','o','r'};
   /**
    * The point where html starts.
    * It will be used by the token manager to create HTMLCode objects
@@ -101,44 +102,10 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     }
   }
 
-  public static final void phpParserTester(final String strEval) throws CoreException, ParseException {
-    PHPParserTokenManager.SwitchTo(PHPParserTokenManager.PHPPARSING);
-    final StringReader stream = new StringReader(strEval);
-    if (jj_input_stream == null) {
-      jj_input_stream = new SimpleCharStream(stream, 1, 1);
-    }
-    ReInit(new StringReader(strEval));
-    init();
-    phpTest();
-  }
-
-  public static final void htmlParserTester(final File fileName) throws CoreException, ParseException {
-    try {
-      final Reader stream = new FileReader(fileName);
-      if (jj_input_stream == null) {
-        jj_input_stream = new SimpleCharStream(stream, 1, 1);
-      }
-      ReInit(stream);
-      init();
-      phpFile();
-    } catch (FileNotFoundException e) {
-      e.printStackTrace();  //To change body of catch statement use Options | File Templates.
-    }
-  }
-
-  public static final void htmlParserTester(final String strEval) throws CoreException, ParseException {
-    final StringReader stream = new StringReader(strEval);
-    if (jj_input_stream == null) {
-      jj_input_stream = new SimpleCharStream(stream, 1, 1);
-    }
-    ReInit(stream);
-    init();
-    phpFile();
-  }
-
   public final PHPOutlineInfo parseInfo(final Object parent, final String s) {
-    currentSegment = new PHPDocument(parent);
-    outlineInfo = new PHPOutlineInfo(parent);
+    phpDocument = new PHPDocument(parent,"_root".toCharArray());
+    currentSegment = phpDocument;
+    outlineInfo = new PHPOutlineInfo(parent, currentSegment);
     final StringReader stream = new StringReader(s);
     if (jj_input_stream == null) {
       jj_input_stream = new SimpleCharStream(stream, 1, 1);
@@ -147,9 +114,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     init();
     try {
       parse();
-      phpDocument = new PHPDocument(null);
-      phpDocument.nodes = nodes;
-      PHPeclipsePlugin.log(1,phpDocument.toString());
+      phpDocument.nodes = new AstNode[nodes.length];
+      System.arraycopy(nodes,0,phpDocument.nodes,0,nodes.length);
+      if (PHPeclipsePlugin.DEBUG) {
+        PHPeclipsePlugin.log(1,phpDocument.toString());
+      }
     } catch (ParseException e) {
       processParseException(e);
     }
@@ -165,7 +134,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     if (errorMessage == null) {
       PHPeclipsePlugin.log(e);
       errorMessage = "this exception wasn't handled by the parser please tell us how to reproduce it";
-      errorStart = jj_input_stream.getPosition();
+      errorStart = SimpleCharStream.getPosition();
       errorEnd   = errorStart + 1;
     }
     setMarker(e);
@@ -181,8 +150,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       if (errorStart == -1) {
         setMarker(fileToParse,
                   errorMessage,
-                  jj_input_stream.tokenBegin,
-                  jj_input_stream.tokenBegin + e.currentToken.image.length(),
+                  SimpleCharStream.tokenBegin,
+                  SimpleCharStream.tokenBegin + e.currentToken.image.length(),
                   errorLevel,
                   "Line " + e.currentToken.beginLine);
       } else {
@@ -310,7 +279,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     if (currentPosition == htmlStart) {
       return;
     }
-    final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart,currentPosition).toCharArray();
+    final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart,currentPosition+1).toCharArray();
     pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition));
   }
 
@@ -318,12 +287,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
           phpFile();
   }
 
-  static final public void phpTest() throws ParseException {
-    Php();
-    jj_consume_token(0);
-   PHPParser.createNewHTMLCode();
-  }
-
   static final public void phpFile() throws ParseException {
     try {
       label_1:
@@ -399,7 +362,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
  * or <? somephpcode ?>
  */
   static final public void PhpBlock() throws ParseException {
-  final int start = jj_input_stream.getPosition();
+  final int start = SimpleCharStream.getPosition();
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case PHPECHOSTART:
       phpEchoBlock();
@@ -461,7 +424,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       setMarker(fileToParse,
                 "You should use '<?php' instead of '<?' it will avoid some problems with XML",
                 start,
-                jj_input_stream.getPosition(),
+                SimpleCharStream.getPosition(),
                 INFO,
                 "Line " + token.beginLine);
     } catch (CoreException e) {
@@ -484,9 +447,9 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       } catch (ParseException e) {
     errorMessage = "'?>' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
-    {if (true) throw e;}
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
+    processParseException(e);
       }
       break;
     default:
@@ -577,43 +540,48 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
   final Token className;
   Token superclassName = null;
   final int pos;
+  char[] classNameImage = SYNTAX_ERROR_CHAR;
+  char[] superclassNameImage = null;
     jj_consume_token(CLASS);
+   pos = SimpleCharStream.getPosition();
     try {
-     pos = jj_input_stream.getPosition();
       className = jj_consume_token(IDENTIFIER);
+     classNameImage = className.image.toCharArray();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd     = jj_input_stream.getPosition() + 1;
-    {if (true) throw e;}
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
+    processParseException(e);
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case EXTENDS:
       jj_consume_token(EXTENDS);
       try {
         superclassName = jj_consume_token(IDENTIFIER);
+       superclassNameImage = superclassName .image.toCharArray();
       } catch (ParseException e) {
       errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected";
       errorLevel   = ERROR;
-      errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd   = jj_input_stream.getPosition() + 1;
-      {if (true) throw e;}
+      errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd   = SimpleCharStream.getPosition() + 1;
+      processParseException(e);
+      superclassNameImage = SYNTAX_ERROR_CHAR;
       }
       break;
     default:
       jj_la1[6] = jj_gen;
       ;
     }
-    if (superclassName == null) {
+    if (superclassNameImage == null) {
       classDeclaration = new ClassDeclaration(currentSegment,
-                                              className.image.toCharArray(),
+                                              classNameImage,
                                               pos,
                                               0);
     } else {
       classDeclaration = new ClassDeclaration(currentSegment,
-                                              className.image.toCharArray(),
-                                              superclassName.image.toCharArray(),
+                                              classNameImage,
+                                              superclassNameImage,
                                               pos,
                                               0);
     }
@@ -633,8 +601,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image + "', '{' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     label_3:
@@ -655,8 +623,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', 'var', 'function' or '}' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
   }
@@ -670,11 +638,10 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case FUNCTION:
       method = MethodDeclaration();
-                                classDeclaration.addMethod(method);
+                                method.setParent(classDeclaration);
       break;
     case VAR:
       field = FieldDeclaration();
-                                classDeclaration.addVariable(field);
       break;
     default:
       jj_la1[8] = jj_gen;
@@ -717,22 +684,23 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected after variable declaration";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
-    {if (true) throw e;}
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
+    processParseException(e);
     }
    list = new VariableDeclaration[arrayList.size()];
    arrayList.toArray(list);
    {if (true) return new FieldDeclaration(list,
                                pos,
-                               SimpleCharStream.getPosition());}
+                               SimpleCharStream.getPosition(),
+                               currentSegment);}
     throw new Error("Missing return statement in function");
   }
 
   static final public VariableDeclaration VariableDeclarator() throws ParseException {
   final String varName;
   Expression initializer = null;
-  final int pos = jj_input_stream.getPosition();
+  final int pos = SimpleCharStream.getPosition();
     varName = VariableDeclaratorId();
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case ASSIGN:
@@ -742,8 +710,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       } 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;
+      errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd   = SimpleCharStream.getPosition() + 1;
       {if (true) throw e;}
       }
       break;
@@ -755,7 +723,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     {if (true) return new VariableDeclaration(currentSegment,
                                   varName.toCharArray(),
                                   pos,
-                                  jj_input_stream.getPosition());}
+                                  SimpleCharStream.getPosition());}
   }
     {if (true) return new VariableDeclaration(currentSegment,
                                     varName.toCharArray(),
@@ -794,8 +762,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
     } catch (ParseException e) {
     errorMessage = "'$' expected for variable identifier";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -823,15 +791,15 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       {if (true) return token.image.substring(1);}
     }
     buff = new StringBuffer(token.image);
-    buff.append('{');
+    buff.append("{");
     buff.append(expression.toStringExpression());
-    buff.append('}');
+    buff.append("}");
     {if (true) return buff.toString();}
       break;
     case DOLLAR:
       jj_consume_token(DOLLAR);
       expr = VariableName();
-   {if (true) return expr;}
+   {if (true) return "$" + expr;}
       break;
     default:
       jj_la1[12] = jj_gen;
@@ -851,9 +819,9 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       jj_consume_token(LBRACE);
       expression = Expression();
       jj_consume_token(RBRACE);
-   buff = new StringBuffer('{');
+   buff = new StringBuffer("{");
    buff.append(expression.toStringExpression());
-   buff.append('}');
+   buff.append("}");
    {if (true) return buff.toString();}
       break;
     case IDENTIFIER:
@@ -872,15 +840,15 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
       {if (true) return token.image;}
     }
     buff = new StringBuffer(token.image);
-    buff.append('{');
+    buff.append("{");
     buff.append(expression.toStringExpression());
-    buff.append('}');
+    buff.append("}");
     {if (true) return buff.toString();}
       break;
     case DOLLAR:
       jj_consume_token(DOLLAR);
       expr = VariableName();
-    buff = new StringBuffer('$');
+    buff = new StringBuffer("$");
     buff.append(expr);
     {if (true) return buff.toString();}
       break;
@@ -1049,9 +1017,8 @@ Expression expr,expr2;
  */
   static final public MethodDeclaration MethodDeclaration() throws ParseException {
   final MethodDeclaration functionDeclaration;
-  Token functionToken;
   final Block block;
-    functionToken = jj_consume_token(FUNCTION);
+    jj_consume_token(FUNCTION);
     try {
       functionDeclaration = MethodDeclarator();
      outlineInfo.addVariable(new String(functionDeclaration.name));
@@ -1059,18 +1026,16 @@ Expression expr,expr2;
     if (errorMessage != null)  {if (true) throw e;}
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function identifier expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     if (currentSegment != null) {
       currentSegment.add(functionDeclaration);
       currentSegment = functionDeclaration;
     }
-    currentFunction = functionDeclaration;
     block = Block();
     functionDeclaration.statements = block.statements;
-    currentFunction = null;
     if (currentSegment != null) {
       currentSegment = (OutlineableWithChildren) currentSegment.getParent();
     }
@@ -1088,6 +1053,7 @@ Expression expr,expr2;
   Token reference = null;
   final Hashtable formalParameters;
   final int pos = SimpleCharStream.getPosition();
+  char[] identifierChar = SYNTAX_ERROR_CHAR;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case BIT_AND:
       reference = jj_consume_token(BIT_AND);
@@ -1096,10 +1062,19 @@ Expression expr,expr2;
       jj_la1[21] = jj_gen;
       ;
     }
-    identifier = jj_consume_token(IDENTIFIER);
+    try {
+      identifier = jj_consume_token(IDENTIFIER);
+     identifierChar = identifier.image.toCharArray();
+    } catch (ParseException e) {
+    errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function identifier expected";
+    errorLevel   = ERROR;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
+    processParseException(e);
+    }
     formalParameters = FormalParameters();
    {if (true) return new MethodDeclaration(currentSegment,
-                                 identifier.image.toCharArray(),
+                                 identifierChar,
                                  formalParameters,
                                  reference != null,
                                  pos,
@@ -1119,8 +1094,8 @@ Expression expr,expr2;
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected after function identifier";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1153,8 +1128,8 @@ Expression expr,expr2;
     } catch (ParseException e) {
     errorMessage = "')' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
   {if (true) return parameters;}
@@ -1190,56 +1165,47 @@ Expression expr,expr2;
     case STRING:
       jj_consume_token(STRING);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.STRING,
-                                        pos,pos-6);}
+                        {if (true) return new ConstantIdentifier(Types.STRING,pos,pos-6);}
       break;
     case BOOL:
       jj_consume_token(BOOL);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.BOOL,
-                                        pos,pos-4);}
+                        {if (true) return new ConstantIdentifier(Types.BOOL,pos,pos-4);}
       break;
     case BOOLEAN:
       jj_consume_token(BOOLEAN);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.BOOLEAN,
-                                        pos,pos-7);}
+                        {if (true) return new ConstantIdentifier(Types.BOOLEAN,pos,pos-7);}
       break;
     case REAL:
       jj_consume_token(REAL);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.REAL,
-                                        pos,pos-4);}
+                        {if (true) return new ConstantIdentifier(Types.REAL,pos,pos-4);}
       break;
     case DOUBLE:
       jj_consume_token(DOUBLE);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.DOUBLE,
-                                        pos,pos-5);}
+                        {if (true) return new ConstantIdentifier(Types.DOUBLE,pos,pos-5);}
       break;
     case FLOAT:
       jj_consume_token(FLOAT);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.FLOAT,
-                                        pos,pos-5);}
+                        {if (true) return new ConstantIdentifier(Types.FLOAT,pos,pos-5);}
       break;
     case INT:
       jj_consume_token(INT);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.INT,
-                                        pos,pos-3);}
+                        {if (true) return new ConstantIdentifier(Types.INT,pos,pos-3);}
       break;
     case INTEGER:
       jj_consume_token(INTEGER);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.INTEGER,
-                                        pos,pos-7);}
+                        {if (true) return new ConstantIdentifier(Types.INTEGER,pos,pos-7);}
       break;
     case OBJECT:
       jj_consume_token(OBJECT);
                         pos = SimpleCharStream.getPosition();
-                        {if (true) return new ConstantIdentifier(Types.OBJECT,
-                                        pos,pos-6);}
+                        {if (true) return new ConstantIdentifier(Types.OBJECT,pos,pos-6);}
       break;
     default:
       jj_la1[25] = jj_gen;
@@ -1318,8 +1284,8 @@ Expression expr,expr2;
       }
       errorMessage = "expression expected";
       errorLevel   = ERROR;
-      errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd   = jj_input_stream.getPosition() + 1;
+      errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd   = SimpleCharStream.getPosition() + 1;
       {if (true) throw e;}
     }
      {if (true) return new VarAssignation(varName.toCharArray(),
@@ -1623,8 +1589,8 @@ Expression expr,expr2;
     }
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
     expr = new BinaryExpression(expr,expr2,operator);
@@ -1765,8 +1731,8 @@ Expression expr,expr2;
     if (errorMessage != null) {if (true) throw e;}
     errorMessage = "unexpected token '"+e.currentToken.next.image+"'";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     label_18:
@@ -2001,8 +1967,8 @@ final int operator;
           } catch (ParseException e) {
     errorMessage = "')' expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd     = jj_input_stream.getPosition() + 1;
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
           }
    {if (true) return expr;}
@@ -2277,8 +2243,8 @@ final int pos = SimpleCharStream.getPosition();
       } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function call or field access expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
    {if (true) return new ClassAccess(prefix,
@@ -2368,8 +2334,8 @@ final int pos = SimpleCharStream.getPosition();
       } catch (ParseException e) {
     errorMessage = "']' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
    {if (true) return new ArrayDeclarator(prefix,expression,SimpleCharStream.getPosition());}
@@ -2460,8 +2426,8 @@ Expression[] args = null;
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected to close the argument list";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
    {if (true) return new FunctionCall(func,args,SimpleCharStream.getPosition());}
@@ -2495,8 +2461,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
         errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. An expression expected after a comma in argument list";
         errorLevel   = ERROR;
-        errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-        errorEnd     = jj_input_stream.getPosition() + 1;
+        errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+        errorEnd     = SimpleCharStream.getPosition() + 1;
         {if (true) throw e;}
       }
     }
@@ -2517,11 +2483,11 @@ final ArrayList list = new ArrayList();
       try {
         jj_consume_token(SEMICOLON);
       } catch (ParseException e) {
-    if (e.currentToken.next.kind != 4) {
+    if (e.currentToken.next.kind != PHPParserConstants.PHPEND) {
       errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
       errorLevel   = ERROR;
-      errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd   = jj_input_stream.getPosition() + 1;
+      errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd   = SimpleCharStream.getPosition() + 1;
       {if (true) throw e;}
     }
       }
@@ -2552,8 +2518,8 @@ final ArrayList list = new ArrayList();
         } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd     = jj_input_stream.getPosition() + 1;
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
         }
    {if (true) return statement;}
@@ -2725,14 +2691,15 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "End of file unexpected, '<?php' expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition();
-    errorEnd     = jj_input_stream.getPosition();
+    errorStart   = SimpleCharStream.getPosition();
+    errorEnd     = SimpleCharStream.getPosition();
     {if (true) throw e;}
     }
-  nbNodes = nodePtr-startIndex - 1;
+  nbNodes    = nodePtr - startIndex;
   blockNodes = new AstNode[nbNodes];
   System.arraycopy(nodes,startIndex,blockNodes,0,nbNodes);
-  {if (true) return new HTMLBlock(nodes);}
+  nodePtr = startIndex;
+  {if (true) return new HTMLBlock(blockNodes);}
     throw new Error("Missing return statement in function");
   }
 
@@ -2742,7 +2709,7 @@ final ArrayList list = new ArrayList();
   static final public InclusionStatement IncludeStatement() throws ParseException {
   final Expression expr;
   final int keyword;
-  final int pos = jj_input_stream.getPosition();
+  final int pos = SimpleCharStream.getPosition();
   final InclusionStatement inclusionStatement;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case REQUIRE:
@@ -2774,8 +2741,8 @@ final ArrayList list = new ArrayList();
     }
     errorMessage = "unexpected token '"+ e.currentToken.next.image+"', expression expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd     = jj_input_stream.getPosition() + 1;
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
    inclusionStatement = new InclusionStatement(currentSegment,
@@ -2788,8 +2755,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd     = jj_input_stream.getPosition() + 1;
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
    {if (true) return inclusionStatement;}
@@ -2816,8 +2783,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected";
     errorLevel   = ERROR;
-    errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd     = jj_input_stream.getPosition() + 1;
+    errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd     = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2846,8 +2813,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
       errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ',' expected";
       errorLevel   = ERROR;
-      errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd     = jj_input_stream.getPosition() + 1;
+      errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd     = SimpleCharStream.getPosition() + 1;
       {if (true) throw e;}
       }
       expr = VariableDeclaratorId();
@@ -2858,8 +2825,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -2910,23 +2877,23 @@ final ArrayList list = new ArrayList();
     }
     try {
       jj_consume_token(SEMICOLON);
-    Expression[] exprs = new Expression[expressions.size()];
-    expressions.toArray(exprs);
-    {if (true) return new EchoStatement(exprs,pos);}
     } catch (ParseException e) {
     if (e.currentToken.next.kind != 4) {
       errorMessage = "';' expected after 'echo' statement";
       errorLevel   = ERROR;
-      errorStart   = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd     = jj_input_stream.getPosition() + 1;
+      errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd     = SimpleCharStream.getPosition() + 1;
       {if (true) throw e;}
     }
     }
+   Expression[] exprs = new Expression[expressions.size()];
+   expressions.toArray(exprs);
+   {if (true) return new EchoStatement(exprs,pos);}
     throw new Error("Missing return statement in function");
   }
 
   static final public GlobalStatement GlobalStatement() throws ParseException {
-   final int pos = jj_input_stream.getPosition();
+   final int pos = SimpleCharStream.getPosition();
    String expr;
    ArrayList vars = new ArrayList();
    GlobalStatement global;
@@ -2960,8 +2927,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. a ';' was expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -2998,8 +2965,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. a ';' was expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -3032,8 +2999,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'{' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     label_27:
@@ -3147,8 +3114,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.image +"', '}' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
   Statement[] statements = new Statement[list.size()];
@@ -3199,8 +3166,17 @@ final ArrayList list = new ArrayList();
     case LBRACE:
     case SEMICOLON:
     case DOLLAR_ID:
-      statement = Statement();
+      try {
+        statement = Statement();
+                                   if (phpDocument == currentSegment) pushOnAstNodes(statement);
                                    {if (true) return statement;}
+      } catch (ParseException e) {
+    errorMessage = "statement expected";
+    errorLevel   = ERROR;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
+    {if (true) throw e;}
+      }
       break;
     case CLASS:
       statement = ClassDeclaration();
@@ -3208,6 +3184,7 @@ final ArrayList list = new ArrayList();
       break;
     case FUNCTION:
       statement = MethodDeclaration();
+                                   if (phpDocument == currentSegment) pushOnAstNodes(statement);
                                    {if (true) return statement;}
       break;
     default:
@@ -3324,7 +3301,7 @@ final ArrayList list = new ArrayList();
     {if (true) return new VariableDeclaration(currentSegment,
                                   varName.toCharArray(),
                                   pos,
-                                  jj_input_stream.getPosition());}
+                                  SimpleCharStream.getPosition());}
    }
     {if (true) return new VariableDeclaration(currentSegment,
                                     varName.toCharArray(),
@@ -3432,8 +3409,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'(' expected after 'switch'";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -3444,8 +3421,8 @@ final ArrayList list = new ArrayList();
     }
     errorMessage = "expression expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -3453,8 +3430,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "')' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -3499,8 +3476,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'}' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -3544,8 +3521,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'endswitch' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -3556,8 +3533,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "';' expected after 'endswitch' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -3708,8 +3685,8 @@ final ArrayList list = new ArrayList();
     if (errorMessage != null) {if (true) throw e;}
     errorMessage = "expression expected after 'case' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
       try {
@@ -3718,8 +3695,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
     errorMessage = "':' expected after case expression";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
       break;
@@ -3731,8 +3708,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
     errorMessage = "':' expected after 'default' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
       break;
@@ -3781,8 +3758,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "';' expected after 'break' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
    {if (true) return new Break(expression, start, SimpleCharStream.getPosition());}
@@ -3790,7 +3767,7 @@ final ArrayList list = new ArrayList();
   }
 
   static final public IfStatement IfStatement() throws ParseException {
-  final int pos = jj_input_stream.getPosition();
+  final int pos = SimpleCharStream.getPosition();
   Expression condition;
   IfStatement ifStatement;
     jj_consume_token(IF);
@@ -3807,21 +3784,21 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'(' expected after " + keyword + " keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length();
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length();
     errorEnd   = errorStart +1;
     processParseException(e);
     }
     condition = Expression();
     try {
       jj_consume_token(RPAREN);
-      {if (true) return condition;}
     } catch (ParseException e) {
     errorMessage = "')' expected after " + keyword + " keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
-    {if (true) throw e;}
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
+    processParseException(e);
     }
+   {if (true) return condition;}
     throw new Error("Missing return statement in function");
   }
 
@@ -3979,8 +3956,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
     errorMessage = "'endif' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
       try {
@@ -3988,8 +3965,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
     errorMessage = "';' expected after 'endif' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
     elseIfs = new ElseIf[elseIfList.size()];
@@ -4128,8 +4105,8 @@ final ArrayList list = new ArrayList();
       }
       errorMessage = "unexpected token '"+e.currentToken.next.image+"', a statement was expected";
       errorLevel   = ERROR;
-      errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-      errorEnd   = jj_input_stream.getPosition() + 1;
+      errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+      errorEnd   = SimpleCharStream.getPosition() + 1;
       {if (true) throw e;}
         }
         break;
@@ -4483,8 +4460,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
     errorMessage = "'endwhile' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
       try {
@@ -4495,8 +4472,8 @@ final ArrayList list = new ArrayList();
       } catch (ParseException e) {
     errorMessage = "';' expected after 'endwhile' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
       }
       break;
@@ -4564,8 +4541,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -4582,8 +4559,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'(' expected after 'foreach' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -4591,8 +4568,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "variable expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -4600,8 +4577,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "'as' expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -4609,8 +4586,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "variable expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -4618,8 +4595,8 @@ final ArrayList list = new ArrayList();
     } catch (ParseException e) {
     errorMessage = "')' expected after 'foreach' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     try {
@@ -4628,8 +4605,8 @@ final ArrayList list = new ArrayList();
     if (errorMessage != null) {if (true) throw e;}
     errorMessage = "statement expected";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
    {if (true) return new ForeachStatement(expression,
@@ -4655,8 +4632,8 @@ final int startBlock, endBlock;
     } catch (ParseException e) {
     errorMessage = "'(' expected after 'for' keyword";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -4831,8 +4808,8 @@ final int startBlock, endBlock;
       } catch (ParseException e) {
         errorMessage = "'endfor' expected";
         errorLevel   = ERROR;
-        errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-        errorEnd   = jj_input_stream.getPosition() + 1;
+        errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+        errorEnd   = SimpleCharStream.getPosition() + 1;
         {if (true) throw e;}
       }
       try {
@@ -4843,8 +4820,8 @@ final int startBlock, endBlock;
       } catch (ParseException e) {
         errorMessage = "';' expected after 'endfor' keyword";
         errorLevel   = ERROR;
-        errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-        errorEnd   = jj_input_stream.getPosition() + 1;
+        errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+        errorEnd   = SimpleCharStream.getPosition() + 1;
         {if (true) throw e;}
       }
       break;
@@ -4945,8 +4922,8 @@ final int startBlock, endBlock;
     } catch (ParseException e) {
     errorMessage = "';' expected after 'continue' statement";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -4990,8 +4967,8 @@ final int startBlock, endBlock;
     } catch (ParseException e) {
     errorMessage = "';' expected after 'return' statement";
     errorLevel   = ERROR;
-    errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1;
-    errorEnd   = jj_input_stream.getPosition() + 1;
+    errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
+    errorEnd   = SimpleCharStream.getPosition() + 1;
     {if (true) throw e;}
     }
     throw new Error("Missing return statement in function");
@@ -5053,6 +5030,153 @@ final int startBlock, endBlock;
     return retval;
   }
 
+  static final private boolean jj_3R_77() {
+    if (jj_scan_token(BOOLEAN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_76() {
+    if (jj_scan_token(BOOL)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_43() {
+    if (jj_3R_52()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_75() {
+    if (jj_scan_token(STRING)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_52() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_75()) {
+    jj_scanpos = xsp;
+    if (jj_3R_76()) {
+    jj_scanpos = xsp;
+    if (jj_3R_77()) {
+    jj_scanpos = xsp;
+    if (jj_3R_78()) {
+    jj_scanpos = xsp;
+    if (jj_3R_79()) {
+    jj_scanpos = xsp;
+    if (jj_3R_80()) {
+    jj_scanpos = xsp;
+    if (jj_3R_81()) {
+    jj_scanpos = xsp;
+    if (jj_3R_82()) {
+    jj_scanpos = xsp;
+    if (jj_3R_83()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_84() {
+    if (jj_scan_token(PRINT)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_45()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3_4() {
+    if (jj_scan_token(LPAREN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_43()) {
+    jj_scanpos = xsp;
+    if (jj_3R_44()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_scan_token(RPAREN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_165() {
+    if (jj_scan_token(LPAREN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_45()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_scan_token(RPAREN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_164() {
+    if (jj_3R_169()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_163() {
+    if (jj_3R_168()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_162() {
+    if (jj_3R_167()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_158() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_161()) {
+    jj_scanpos = xsp;
+    if (jj_3R_162()) {
+    jj_scanpos = xsp;
+    if (jj_3R_163()) {
+    jj_scanpos = xsp;
+    if (jj_3R_164()) {
+    jj_scanpos = xsp;
+    if (jj_3R_165()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_161() {
+    if (jj_scan_token(BANG)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_139()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_160() {
+    if (jj_scan_token(DECR)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
+  static final private boolean jj_3R_159() {
+    if (jj_scan_token(INCR)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_157() {
     Token xsp;
     xsp = jj_scanpos;
@@ -5167,6 +5291,14 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_87() {
+    if (jj_scan_token(ASSIGN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_45()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_147() {
     if (jj_scan_token(REMAINDER)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5201,14 +5333,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_87() {
-    if (jj_scan_token(ASSIGN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_45()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_134() {
     if (jj_3R_139()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5246,6 +5370,16 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_57() {
+    if (jj_3R_50()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_87()) jj_scanpos = xsp;
+    else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_128() {
     if (jj_3R_134()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5278,16 +5412,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_57() {
-    if (jj_3R_50()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_87()) jj_scanpos = xsp;
-    else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_197() {
     if (jj_3R_41()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5306,6 +5430,14 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_58() {
+    if (jj_scan_token(COMMA)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_57()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_137() {
     if (jj_scan_token(RSIGNEDSHIFT)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5334,6 +5466,18 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_47() {
+    if (jj_3R_57()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_58()) { jj_scanpos = xsp; break; }
+      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    }
+    return false;
+  }
+
   static final private boolean jj_3R_121() {
     if (jj_3R_128()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5369,26 +5513,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_58() {
-    if (jj_scan_token(COMMA)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_57()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_47() {
-    if (jj_3R_57()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    Token xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_58()) { jj_scanpos = xsp; break; }
-      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    }
-    return false;
-  }
-
   static final private boolean jj_3R_133() {
     if (jj_scan_token(GE)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5407,17 +5531,27 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_201() {
+    if (jj_scan_token(ARRAYASSIGN)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_45()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_130() {
     if (jj_scan_token(LT)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_201() {
-    if (jj_scan_token(ARRAYASSIGN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+  static final private boolean jj_3R_41() {
     if (jj_3R_45()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_201()) jj_scanpos = xsp;
+    else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
@@ -5440,16 +5574,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_41() {
-    if (jj_3R_45()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_201()) jj_scanpos = xsp;
-    else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_119() {
     if (jj_3R_121()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5558,6 +5682,16 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_108() {
+    if (jj_scan_token(LBRACE)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_45()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_scan_token(RBRACE)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_199() {
     if (jj_scan_token(LPAREN)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5570,16 +5704,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_108() {
-    if (jj_scan_token(LBRACE)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_45()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(RBRACE)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_91() {
     if (jj_scan_token(DOLLAR_ID)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5673,14 +5797,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_116() {
-    if (jj_scan_token(XOR)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_115()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_89() {
     if (jj_scan_token(IDENTIFIER)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5691,6 +5807,14 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_116() {
+    if (jj_scan_token(XOR)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    if (jj_3R_115()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_113() {
     if (jj_3R_115()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5755,6 +5879,12 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3_8() {
+    if (jj_3R_47()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_98() {
     if (jj_scan_token(LBRACE)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5797,12 +5927,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3_8() {
-    if (jj_3R_47()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_95() {
     if (jj_scan_token(DOLLAR)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -5943,14 +6067,14 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_187() {
-    if (jj_3R_50()) return true;
+  static final private boolean jj_3_1() {
+    if (jj_3R_40()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3_1() {
-    if (jj_3R_40()) return true;
+  static final private boolean jj_3R_187() {
+    if (jj_3R_50()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
@@ -6219,12 +6343,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_179() {
-    if (jj_3R_188()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_101() {
     if (jj_scan_token(ASSIGN)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -6233,6 +6351,12 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_179() {
+    if (jj_3R_188()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_42() {
     if (jj_3R_50()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -6351,6 +6475,12 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_99() {
+    if (jj_3R_50()) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_168() {
     if (jj_3R_166()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -6361,12 +6491,6 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_99() {
-    if (jj_3R_50()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_83() {
     if (jj_scan_token(OBJECT)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
@@ -6379,32 +6503,38 @@ final int startBlock, endBlock;
     return false;
   }
 
+  static final private boolean jj_3R_81() {
+    if (jj_scan_token(INT)) return true;
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+    return false;
+  }
+
   static final private boolean jj_3R_44() {
     if (jj_scan_token(ARRAY)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_184() {
-    if (jj_scan_token(ARRAY)) return true;
+  static final private boolean jj_3R_80() {
+    if (jj_scan_token(FLOAT)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_81() {
-    if (jj_scan_token(INT)) return true;
+  static final private boolean jj_3R_184() {
+    if (jj_scan_token(ARRAY)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_183() {
-    if (jj_3R_52()) return true;
+  static final private boolean jj_3R_79() {
+    if (jj_scan_token(DOUBLE)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_80() {
-    if (jj_scan_token(FLOAT)) return true;
+  static final private boolean jj_3R_183() {
+    if (jj_3R_52()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
@@ -6431,182 +6561,29 @@ final int startBlock, endBlock;
     return false;
   }
 
-  static final private boolean jj_3R_167() {
-    if (jj_scan_token(LPAREN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_183()) {
-    jj_scanpos = xsp;
-    if (jj_3R_184()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(RPAREN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_139()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_79() {
-    if (jj_scan_token(DOUBLE)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_43() {
-    if (jj_3R_52()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static final private boolean jj_3R_78() {
     if (jj_scan_token(REAL)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_77() {
-    if (jj_scan_token(BOOLEAN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_84() {
-    if (jj_scan_token(PRINT)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_45()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_76() {
-    if (jj_scan_token(BOOL)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3_4() {
+  static final private boolean jj_3R_167() {
     if (jj_scan_token(LPAREN)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_43()) {
+    if (jj_3R_183()) {
     jj_scanpos = xsp;
-    if (jj_3R_44()) return true;
+    if (jj_3R_184()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     if (jj_scan_token(RPAREN)) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_75() {
-    if (jj_scan_token(STRING)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_52() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_75()) {
-    jj_scanpos = xsp;
-    if (jj_3R_76()) {
-    jj_scanpos = xsp;
-    if (jj_3R_77()) {
-    jj_scanpos = xsp;
-    if (jj_3R_78()) {
-    jj_scanpos = xsp;
-    if (jj_3R_79()) {
-    jj_scanpos = xsp;
-    if (jj_3R_80()) {
-    jj_scanpos = xsp;
-    if (jj_3R_81()) {
-    jj_scanpos = xsp;
-    if (jj_3R_82()) {
-    jj_scanpos = xsp;
-    if (jj_3R_83()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_165() {
-    if (jj_scan_token(LPAREN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_3R_45()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(RPAREN)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_164() {
-    if (jj_3R_169()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_163() {
-    if (jj_3R_168()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_162() {
-    if (jj_3R_167()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_158() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_161()) {
-    jj_scanpos = xsp;
-    if (jj_3R_162()) {
-    jj_scanpos = xsp;
-    if (jj_3R_163()) {
-    jj_scanpos = xsp;
-    if (jj_3R_164()) {
-    jj_scanpos = xsp;
-    if (jj_3R_165()) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_161() {
-    if (jj_scan_token(BANG)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     if (jj_3R_139()) return true;
     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
     return false;
   }
 
-  static final private boolean jj_3R_160() {
-    if (jj_scan_token(DECR)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  static final private boolean jj_3R_159() {
-    if (jj_scan_token(INCR)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
   static private boolean jj_initialized_once = false;
   static public PHPParserTokenManager token_source;
   static SimpleCharStream jj_input_stream;