Package org.tweetyproject.lp.asp.parser
Class ASTWeight
java.lang.Object
org.tweetyproject.lp.asp.parser.SimpleNode
org.tweetyproject.lp.asp.parser.ASTWeight
- All Implemented Interfaces:
Node
Represents a node in the abstract syntax tree (AST) for a weight in the ASP (Answer Set Programming) parser.
This class extends
SimpleNode and provides methods to accept a visitor and manage the weight's level status.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhasLevel(boolean b) Sets whether this weight has a level.jjtAccept(ASPParserVisitor visitor, Object data) Accepts a visitor and allows it to visit this node.Methods inherited from class org.tweetyproject.lp.asp.parser.SimpleNode
childrenAccept, dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetParent, jjtSetValue, toString, toString
-
Constructor Details
-
ASTWeight
public ASTWeight(int id) Constructs a newASTWeightwith the specified node ID.- Parameters:
id- The node ID.
-
ASTWeight
Constructs a newASTWeightwith the specified parser and node ID.- Parameters:
p- The parser instance used to create this node.id- The node ID.
-
-
Method Details
-
jjtAccept
Accepts a visitor and allows it to visit this node.- Specified by:
jjtAcceptin interfaceNode- Overrides:
jjtAcceptin classSimpleNode- Parameters:
visitor- The visitor to accept.data- Optional data to pass to the visitor.- Returns:
- The result of the visitor's visit method.
-
hasLevel
public void hasLevel(boolean b) Sets whether this weight has a level.- Parameters:
b-trueif the weight has a level;falseotherwise.
-