use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class RulesMachineChecker method checkDependsOnRuleAttribute.
private void checkDependsOnRuleAttribute(POperationAttribute pOperationAttribute, LinkedList<PExpression> arguments) {
final List<AIdentifierExpression> list = new ArrayList<>();
for (final PExpression pExpression : arguments) {
if (pExpression instanceof AIdentifierExpression) {
list.add((AIdentifierExpression) pExpression);
} else {
errorList.add(new CheckException("Expected a list of identifiers after DEPENDS_ON_RULE.", pOperationAttribute));
}
}
currentOperation.addAllRuleDependencies(list);
return;
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class ASTBuilder method createEqualPredicate.
public static AEqualPredicate createEqualPredicate(TIdentifierLiteral old, final String value) {
TIdentifierLiteral e = NodeCloner.cloneNode(old);
AIdentifierExpression aIdentifier = createAIdentifierExpression(e);
final AEqualPredicate equal = new AEqualPredicate(aIdentifier, new AStringExpression(new TStringLiteral(value)));
equal.setStartPos(e.getStartPos());
equal.setEndPos(e.getEndPos());
return equal;
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class ASTBuilder method createIdentifier.
public static AIdentifierExpression createIdentifier(String name) {
ArrayList<TIdentifierLiteral> list = new ArrayList<>();
list.add(new TIdentifierLiteral(name));
return new AIdentifierExpression(list);
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class ASTBuilder method createIdentifier.
public static AIdentifierExpression createIdentifier(String name, PositionedNode positionNode) {
ArrayList<TIdentifierLiteral> list = new ArrayList<>();
TIdentifierLiteral literal = new TIdentifierLiteral(name);
// literal.setStartPos(positionNode.getStartPos());
// literal.setEndPos(positionNode.getEndPos());
list.add(literal);
AIdentifierExpression result = new AIdentifierExpression(list);
result.setStartPos(positionNode.getStartPos());
result.setEndPos(positionNode.getEndPos());
return result;
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class BMachine method addPropertiesPredicates.
public void addPropertiesPredicates(Map<String, String> constantStringValues) {
if (constantStringValues.size() == 0) {
return;
}
APropertiesMachineClause clause = new APropertiesMachineClause();
this.parseUnit.getMachineClauses().add(clause);
List<PPredicate> predList = new ArrayList<>();
for (Entry<String, String> entry : constantStringValues.entrySet()) {
AIdentifierExpression identifier = createIdentifier(entry.getKey());
AStringExpression value = new AStringExpression(new TStringLiteral(entry.getValue()));
AEqualPredicate equal = new AEqualPredicate(identifier, value);
predList.add(equal);
}
clause.setPredicates(createConjunction(predList));
}
Aggregations