use of de.be4.eventb.core.parser.node.TIdentifierLiteral 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.eventb.core.parser.node.TIdentifierLiteral 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.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class ASTBuilder method addSortDefinition.
public static void addSortDefinition(IDefinitions iDefinitions) {
if (iDefinitions.containsDefinition(SORT)) {
return;
}
/*- SORT
* SORT(X) == [];
* EXTERNAL_FUNCTION_SORT(T) == POW(T)-->seq(T);
*/
AExpressionDefinitionDefinition sortDef = new AExpressionDefinitionDefinition();
sortDef.setName(new TIdentifierLiteral(SORT));
sortDef.setParameters(createExpressionList("X"));
sortDef.setRhs(new AEmptySequenceExpression());
iDefinitions.addDefinition(sortDef, IDefinitions.Type.Expression);
AExpressionDefinitionDefinition sortType = new AExpressionDefinitionDefinition();
sortType.setName(new TIdentifierLiteral("EXTERNAL_FUNCTION_SORT"));
sortType.setParameters(createExpressionList("T"));
sortType.setRhs(new ATotalFunctionExpression(new APowSubsetExpression(createIdentifier("T")), new ASeqExpression(createIdentifier("T"))));
iDefinitions.addDefinition(sortType, IDefinitions.Type.Expression);
}
use of de.be4.eventb.core.parser.node.TIdentifierLiteral 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.eventb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class BMachine method addIncludesClause.
public void addIncludesClause(String machineName) {
AIncludesMachineClause includes = new AIncludesMachineClause();
List<PMachineReference> referencesList = new ArrayList<>();
List<TIdentifierLiteral> idList = new ArrayList<>();
idList.add(new TIdentifierLiteral(machineName));
referencesList.add(new AMachineReference(idList, new ArrayList<PExpression>()));
includes.setMachineReferences(referencesList);
this.parseUnit.getMachineClauses().add(includes);
}
Aggregations