/*
 * Copyright 2015, Hridesh Rajan, Robert Dyer, Hoan Nguyen
 *                 and Iowa State University of Science and Technology
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package boa.datagen.util;

import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;

/**
 * @author rdyer
 */
public class JavaScriptErrorCheckVisitor extends ASTVisitor {
	public boolean hasError = false;

	public boolean preVisit2(ASTNode node) {
		if ((node.getFlags() & ASTNode.MALFORMED) != 0)
			hasError = true;
		return !hasError;
	}
}

@@ -731,83 +731,115 @@
 org.
-eclipse.wst.jsdt.core.dom.ASTNode;%0Aimport org.eclipse.wst.jsdt.core.dom.AST
+mozilla.javascript.Token;%0Aimport org.mozilla.javascript.ast.AstNode;%0Aimport org.mozilla.javascript.ast.Node
 Visi
@@ -914,19 +914,23 @@
 tor 
-extends AST
+implements Node
 Visi
@@ -970,16 +970,28 @@
 false;%0A%0A
+%0A%09@Override%0A
 %09public 
@@ -1002,21 +1002,17 @@
 ean 
-preV
+v
 isit
-2
 (A
-ST
+st
 Node
@@ -1025,17 +1025,16 @@
  %7B%0A%09%09if 
-(
 (node.ge
@@ -1038,41 +1038,29 @@
 .get
-Flags() & ASTNode.MALFORMED) != 0
+Type() == Token.ERROR
 )%0A%09%09

use rhino ast nodes