improved/refactored php syntax parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPParserAction.java
index f4cc8a9..515f19f 100644 (file)
@@ -18,6 +18,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.phpeditor.phpparser.PHPParser;
+
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.runtime.CoreException;
@@ -141,9 +143,9 @@ public class PHPParserAction extends TextEditorAction {
 
   protected void parse(InputStream iStream) {
 
-    StringBuffer buf = new StringBuffer();
+    StringBuffer buf = new StringBuffer(); 
     int c0;
-    try {
+    try { 
       while ((c0 = iStream.read()) != (-1)) {
         buf.append((char) c0);
       }
@@ -153,6 +155,9 @@ public class PHPParserAction extends TextEditorAction {
     String input = buf.toString();
 
     PHPParser parser = new PHPParser(fileToParse);
-    parser.htmlParse(input);
+    try {
+      parser.parse(input);
+    } catch (CoreException e) {
+    }
   }
 }
\ No newline at end of file