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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
hasLevel
(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 newASTWeight
with the specified node ID.- Parameters:
id
- The node ID.
-
ASTWeight
Constructs a newASTWeight
with 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:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in 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
-true
if the weight has a level;false
otherwise.
-