Package net.sf.tweety.lp.asp.parser
Class InstantiateVisitor
- java.lang.Object
-
- net.sf.tweety.lp.asp.parser.InstantiateVisitor
-
- All Implemented Interfaces:
ASPCore2ParserVisitor
public class InstantiateVisitor extends java.lang.Object implements ASPCore2ParserVisitor
This visitor iterates over the AST generated by ASPCore2Parser and allocates classes representing the different parts of an ASP program or source file, meaning rules, literals, terms, answer sets, etc.- Author:
- Anna Gessler
- See Also:
ASPCore2Parser
-
-
Constructor Summary
Constructors Constructor Description InstantiateVisitor()
-
Method Summary
Modifier and Type Method Description static ASPOperator.AggregateFunction
evaluateAggrFunc(java.lang.String func)
static ASPOperator.ArithmeticOperator
evaluateArithop(java.lang.String sop)
ASPOperator.BinaryOperator
evaluateBinop(java.lang.String op)
AggregateAtom
visit(ASTAggregate node, java.lang.Object data)
java.util.List<AggregateElement>
visit(ASTAggrElementList node, java.lang.Object data)
AggregateElement
visit(ASTAggrElement node, java.lang.Object data)
java.lang.String
visit(ASTAggrFunc node, java.lang.Object data)
AnswerSet
visit(ASTAnswerSet node, java.lang.Object data)
Term<?>
visit(ASTAriTerm node, java.lang.Object data)
java.lang.String
visit(ASTArithop node, java.lang.Object data)
java.lang.String
visit(ASTBinop node, java.lang.Object data)
java.util.List<ASPBodyElement>
visit(ASTBodyList node, java.lang.Object data)
java.util.List<ASPBodyElement>
visit(ASTBody node, java.lang.Object data)
ComparativeAtom
visit(ASTBuiltInAtom node, java.lang.Object data)
java.util.List<ASPRule>
visit(ASTChoiceElementList node, java.lang.Object data)
ASPRule
visit(ASTChoiceElement node, java.lang.Object data)
java.lang.Object
visit(ASTChoice node, java.lang.Object data)
java.lang.String
visit(ASTClingoMeta node, java.lang.Object data)
java.util.List<ASPLiteral>
visit(ASTHeadElementsList node, java.lang.Object data)
ASPHead
visit(ASTHead node, java.lang.Object data)
java.lang.String
visit(ASTID node, java.lang.Object data)
ASPLiteral
visit(ASTLiteral node, java.lang.Object data)
java.util.List<ASPBodyElement>
visit(ASTNAFLiteralList node, java.lang.Object data)
ASPBodyElement
visit(ASTNAFLiteral node, java.lang.Object data)
java.lang.Integer
visit(ASTNumber node, java.lang.Object data)
java.util.List<ASPRule>
visit(ASTOptElementList node, java.lang.Object data)
ASPRule
visit(ASTOptElement node, java.lang.Object data)
java.lang.String
visit(ASTOptFunc node, java.lang.Object data)
java.util.List<ASPRule>
visit(ASTOpt node, java.lang.Object data)
Program
visit(ASTProgram node, java.lang.Object data)
ASPLiteral
visit(ASTQuery node, java.lang.Object data)
java.util.List<ASPRule>
visit(ASTRuleList node, java.lang.Object data)
ASPRule
visit(ASTRule node, java.lang.Object data)
java.lang.String
visit(ASTString node, java.lang.Object data)
java.util.List<Term<?>>
visit(ASTTermList node, java.lang.Object data)
Term<?>
visit(ASTTerm node, java.lang.Object data)
java.lang.String
visit(ASTVar node, java.lang.Object data)
java.util.List<Term<?>>
visit(ASTWeight node, java.lang.Object data)
java.lang.Object
visit(SimpleNode node, java.lang.Object data)
-
-
-
Method Detail
-
visit
public java.lang.Object visit(SimpleNode node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public AnswerSet visit(ASTAnswerSet node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public Program visit(ASTProgram node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPLiteral visit(ASTQuery node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPRule> visit(ASTRuleList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPRule visit(ASTRule node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPHead visit(ASTHead node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPLiteral> visit(ASTHeadElementsList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPBodyElement> visit(ASTBodyList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPBodyElement> visit(ASTBody node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.Object visit(ASTChoice node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPRule> visit(ASTChoiceElementList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPRule visit(ASTChoiceElement node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public AggregateAtom visit(ASTAggregate node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
evaluateAggrFunc
public static ASPOperator.AggregateFunction evaluateAggrFunc(java.lang.String func)
-
visit
public java.util.List<AggregateElement> visit(ASTAggrElementList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public AggregateElement visit(ASTAggrElement node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPRule> visit(ASTOpt node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPRule> visit(ASTOptElementList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPRule visit(ASTOptElement node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<Term<?>> visit(ASTWeight node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.util.List<ASPBodyElement> visit(ASTNAFLiteralList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPBodyElement visit(ASTNAFLiteral node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ASPLiteral visit(ASTLiteral node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public ComparativeAtom visit(ASTBuiltInAtom node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
evaluateBinop
public ASPOperator.BinaryOperator evaluateBinop(java.lang.String op)
-
visit
public java.util.List<Term<?>> visit(ASTTermList node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public Term<?> visit(ASTTerm node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
evaluateArithop
public static ASPOperator.ArithmeticOperator evaluateArithop(java.lang.String sop)
-
visit
public Term<?> visit(ASTAriTerm node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTBinop node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTArithop node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTAggrFunc node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTOptFunc node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.Integer visit(ASTNumber node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTVar node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTID node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTString node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
visit
public java.lang.String visit(ASTClingoMeta node, java.lang.Object data)
- Specified by:
visit
in interfaceASPCore2ParserVisitor
-
-