Package org.tweetyproject.lp.asp.parser
Class InstantiateVisitor
java.lang.Object
org.tweetyproject.lp.asp.parser.InstantiateVisitor
- All Implemented Interfaces:
ASPParserVisitor
This visitor iterates over the AST generated by ASPParser 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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionevaluateAggrFunc
(String func) Evaluates the given aggregate function string and returns the correspondingASPOperator.AggregateFunction
.evaluateArithop
(String sop) Evaluates the given arithmetic operator string and returns the correspondingstatic ASPOperator.BinaryOperator
evaluateBinop
(String op) evaluateBinopvisit
(ASTAggregate node, Object data) Constructorvisit
(ASTAggrElementList node, Object data) Constructorvisit
(ASTAggrElement node, Object data) Constructorvisit
(ASTAggrFunc node, Object data) Constructorvisit
(ASTAnswerSet node, Object data) ConstructorTerm
<?> visit
(ASTAriTerm node, Object data) Constructorvisit
(ASTArithop node, Object data) ConstructorConstructorvisit
(ASTBodyList node, Object data) ConstructorConstructorvisit
(ASTBuiltInAtom node, Object data) Constructorvisit
(ASTChoiceElementList node, Object data) Constructorvisit
(ASTChoiceElement node, Object data) ConstructorConstructorvisit
(ASTClingoID node, Object data) Constructorvisit
(ASTClingoMeta node, Object data) Constructorvisit
(ASTDlvArithmeticID node, Object data) ConstructorConstructorvisit
(ASTHeadElementsList node, Object data) ConstructorConstructorConstructorvisit
(ASTLiteral node, Object data) Constructorvisit
(ASTNAFLiteralList node, Object data) Constructorvisit
(ASTNAFLiteral node, Object data) ConstructorConstructorvisit
(ASTOptElementList node, Object data) Constructorvisit
(ASTOptElement node, Object data) Constructorvisit
(ASTOptFunc node, Object data) ConstructorConstructorvisit
(ASTProgram node, Object data) ConstructorConstructorvisit
(ASTRuleList node, Object data) ConstructorConstructorConstructorvisit
(ASTTermList node, Object data) ConstructorTerm
<?> ConstructorConstructorConstructorvisit
(SimpleNode node, Object data) Constructor
-
Constructor Details
-
InstantiateVisitor
public InstantiateVisitor()
-
-
Method Details
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
evaluateAggrFunc
Evaluates the given aggregate function string and returns the correspondingASPOperator.AggregateFunction
.- Parameters:
func
- The string representation of the aggregate function.- Returns:
- The
ASPOperator.AggregateFunction
corresponding to the provided string. - Throws:
ParseException
- If the provided string does not match any known aggregate function.
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
evaluateBinop
evaluateBinop- Parameters:
op
- op string- Returns:
- binary operator
- Throws:
ParseException
- error
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
evaluateArithop
Evaluates the given arithmetic operator string and returns the corresponding- Parameters:
sop
- The string representation of the arithmetic operator.- Returns:
- The operator corresponding to the
provided string, or
null
if the string is empty. - Throws:
ParseException
- If the provided string does not match any known arithmetic operator.
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-
visit
Description copied from interface:ASPParserVisitor
Constructor- Specified by:
visit
in interfaceASPParserVisitor
- Parameters:
node
- nodedata
- data- Returns:
- object
-