Class DefaultParserHelper
- java.lang.Object
-
- jadex.rules.parser.conditions.javagrammar.DefaultParserHelper
-
- All Implemented Interfaces:
IParserHelper
public class DefaultParserHelper extends java.lang.Object implements IParserHelper
Basic handler for context specific parsing issues.
-
-
Field Summary
Fields Modifier and Type Field Description protected BuildContextcontextThe build context.
-
Constructor Summary
Constructors Constructor Description DefaultParserHelper(ICondition condition, OAVTypeModel tmodel)Create a BDI parser helper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVariable(Variable var)Add a variable.BuildContextgetBuildContext()Get the build context.java.util.ListgetConditions()Get the conditions after parsing.java.lang.Object[]getReplacementType(OAVObjectType type)Get the replacement type for an object type in an existential declaration E.g. when a flyweight should be replaced by the real state type (IGoal $g instead of goal $g)VariablegetVariable(java.lang.String name)Get a variable with a given name.booleanisPseudoVariable(java.lang.String name)Test, if a name refers to a pseudo variable (e.g.
-
-
-
Field Detail
-
context
protected BuildContext context
The build context.
-
-
Constructor Detail
-
DefaultParserHelper
public DefaultParserHelper(ICondition condition, OAVTypeModel tmodel)
Create a BDI parser helper.- Parameters:
condition- The predefined condition.state- The state.returnvar- The return value variable (if return value condition).
-
-
Method Detail
-
getVariable
public Variable getVariable(java.lang.String name)
Get a variable with a given name.- Specified by:
getVariablein interfaceIParserHelper- Parameters:
name- The variable name.- Returns:
- The variable.
-
addVariable
public void addVariable(Variable var)
Add a variable.- Specified by:
addVariablein interfaceIParserHelper- Parameters:
var- The variable.
-
isPseudoVariable
public boolean isPseudoVariable(java.lang.String name)
Test, if a name refers to a pseudo variable (e.g. $beliefbase).- Specified by:
isPseudoVariablein interfaceIParserHelper- Parameters:
name- The variable name.- Returns:
- True, if the name is a pseudo variable.
-
getConditions
public java.util.List getConditions()
Get the conditions after parsing.- Specified by:
getConditionsin interfaceIParserHelper
-
getBuildContext
public BuildContext getBuildContext()
Get the build context.- Specified by:
getBuildContextin interfaceIParserHelper
-
getReplacementType
public java.lang.Object[] getReplacementType(OAVObjectType type)
Get the replacement type for an object type in an existential declaration E.g. when a flyweight should be replaced by the real state type (IGoal $g instead of goal $g)- Specified by:
getReplacementTypein interfaceIParserHelper- Parameters:
type- The type to be replaced.- Returns:
- a tuple containing the replacement type and the replacement value source (e.g. a function call recreating the flyweight from the state object).
-
-