org.eclipse.palamedes.kif.core.ast.visitor
Class GroundChecker

java.lang.Object
  extended by org.eclipse.palamedes.kif.core.ast.ASTVisitor
      extended by org.eclipse.palamedes.kif.core.ast.visitor.DefaultVisitor
          extended by org.eclipse.palamedes.kif.core.ast.visitor.GroundChecker

public class GroundChecker
extends DefaultVisitor

The GroundChecker recursively checks whether a given ASTNode contains a variable. This class serves the purpose nevertheless its quite inefficient since it keeps checking even after a variable was found. The next implementation should create an exception and stop searching after a variable was found. To be even more efficient an static exception should be thrown to avoid creating a stack report for the exceptions every time.

Author:
Ingo Keller

Field Summary
 
Fields inherited from class org.eclipse.palamedes.kif.core.ast.visitor.DefaultVisitor
currentTopLevelNode, IMP_HEAD_FIRST, IMP_HEAD_LAST, insideBody, insideHead, insideImplication
 
Constructor Summary
GroundChecker()
           
 
Method Summary
 boolean isGround(ASTNode node)
          This method checks the given ASTNode whether it contains a KIFIndVar or not.
 void visit(KIFIndVar node)
           
 
Methods inherited from class org.eclipse.palamedes.kif.core.ast.visitor.DefaultVisitor
isHeadFirst, postVisitComplexNode, postVisitFormNode, preVisitComplexNode, preVisitFormNode, setHeadFirst, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitBasicNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroundChecker

public GroundChecker()
Method Detail

visit

public void visit(KIFIndVar node)
Overrides:
visit in class DefaultVisitor

isGround

public boolean isGround(ASTNode node)
This method checks the given ASTNode whether it contains a KIFIndVar or not.

Parameters:
node -
Returns:
Returns true if a KIFIndVar was found, otherwise false;