Class ASTWeight

java.lang.Object
org.tweetyproject.lp.asp.parser.SimpleNode
org.tweetyproject.lp.asp.parser.ASTWeight
All Implemented Interfaces:
Node

public class ASTWeight extends SimpleNode
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 Details

    • ASTWeight

      public ASTWeight(int id)
      Constructs a new ASTWeight with the specified node ID.
      Parameters:
      id - The node ID.
    • ASTWeight

      public ASTWeight(ASPParser p, int id)
      Constructs a new ASTWeight with the specified parser and node ID.
      Parameters:
      p - The parser instance used to create this node.
      id - The node ID.
  • Method Details

    • jjtAccept

      public Object jjtAccept(ASPParserVisitor visitor, Object data)
      Accepts a visitor and allows it to visit this node.
      Specified by:
      jjtAccept in interface Node
      Overrides:
      jjtAccept in class SimpleNode
      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.