*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / PHPParser.jj
index e9930a3..a28acb9 100644 (file)
@@ -135,7 +135,7 @@ public final class PHPParser extends PHPParserSuperclass {
       parse();
       phpDocument.nodes = new AstNode[nodes.length];
       System.arraycopy(nodes,0,phpDocument.nodes,0,nodes.length);
-      phpDocument.toString();
+      PHPeclipsePlugin.log(1,phpDocument.toString());
     } catch (ParseException e) {
       processParseException(e);
     }
@@ -635,7 +635,7 @@ void PhpBlock() :
 {
   phpEchoBlock()
 |
-  [ <PHPSTARTLONG>
+  [   <PHPSTARTLONG>
     | <PHPSTARTSHORT>
     {try {
       setMarker(fileToParse,
@@ -798,7 +798,7 @@ FieldDeclaration FieldDeclaration() :
     errorLevel   = ERROR;
     errorStart   = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
     errorEnd     = SimpleCharStream.getPosition() + 1;
-    throw e;
+    processParseException(e);
   }
 
   {list = new VariableDeclaration[arrayList.size()];
@@ -889,9 +889,9 @@ String Variable():
       return token.image.substring(1);
     }
     buff = new StringBuffer(token.image);
-    buff.append('{');
+    buff.append("{");
     buff.append(expression.toStringExpression());
-    buff.append('}');
+    buff.append("}");
     return buff.toString();
   }
 |
@@ -919,15 +919,15 @@ String VariableName():
       return token.image;
     }
     buff = new StringBuffer(token.image);
-    buff.append('{');
+    buff.append("{");
     buff.append(expression.toStringExpression());
-    buff.append('}');
+    buff.append("}");
     return buff.toString();
   }
 |
   <DOLLAR> expr = VariableName()
   {
-    buff = new StringBuffer('$');
+    buff = new StringBuffer("$");
     buff.append(expr);
     return buff.toString();
   }
@@ -1831,10 +1831,11 @@ HTMLBlock htmlBlock() :
     throw e;
   }
   {
-  nbNodes = nodePtr-startIndex - 1;
+  nbNodes    = nodePtr - startIndex;
   blockNodes = new AstNode[nbNodes];
   System.arraycopy(nodes,startIndex,blockNodes,0,nbNodes);
-  return new HTMLBlock(nodes);}
+  nodePtr = startIndex;
+  return new HTMLBlock(blockNodes);}
 }
 
 /**
@@ -2102,9 +2103,11 @@ Statement BlockStatement() :
   final Statement statement;
 }
 {
-  statement = Statement()         {return statement;}
+  statement = Statement()         {if (phpDocument == currentSegment) pushOnAstNodes(statement);
+                                   return statement;}
 | statement = ClassDeclaration()  {return statement;}
-| statement = MethodDeclaration() {return statement;}
+| statement = MethodDeclaration() {if (phpDocument == currentSegment) pushOnAstNodes(statement);
+                                   return statement;}
 }
 
 /**