use of de.be4.classicalb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class MachineContext method caseAMachineHeader.
@Override
public void caseAMachineHeader(AMachineHeader node) {
this.header = node;
if (machineName == null) {
List<TIdentifierLiteral> nameList = new ArrayList<TIdentifierLiteral>(node.getName());
this.machineName = Utils.getTIdentifierListAsString(nameList);
}
List<PExpression> copy = new ArrayList<PExpression>(node.getParameters());
for (PExpression e : copy) {
AIdentifierExpression p = (AIdentifierExpression) e;
String name = Utils.getTIdentifierListAsString(p.getIdentifier());
exist(p.getIdentifier());
if (Character.isUpperCase(name.charAt(0))) {
this.machineSetParameter.put(name, p);
} else {
this.machineScalarParameter.put(name, p);
}
}
}
use of de.be4.classicalb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class MachineContext method caseAEnumeratedSetSet.
@Override
public void caseAEnumeratedSetSet(AEnumeratedSetSet node) {
{
List<TIdentifierLiteral> copy = new ArrayList<TIdentifierLiteral>(node.getIdentifier());
String name = Utils.getTIdentifierListAsString(copy);
exist(node.getIdentifier());
enumeratedSets.put(name, node);
}
List<PExpression> copy = new ArrayList<PExpression>(node.getElements());
for (PExpression e : copy) {
AIdentifierExpression v = (AIdentifierExpression) e;
String name = Utils.getTIdentifierListAsString(v.getIdentifier());
exist(v.getIdentifier());
enumValues.put(name, v);
}
}
use of de.be4.classicalb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class LTLFormulaVisitor method handleQuantification.
private void handleQuantification(de.be4.ltl.core.parser.node.Node node, String parameterName, String bPredicateString, PLtl ltl) {
// create an identifier (b ast node) for the parameter of the
// quantification
List<TIdentifierLiteral> list = new ArrayList<TIdentifierLiteral>();
list.add(new TIdentifierLiteral(parameterName));
AIdentifierExpression parameterNode = new AIdentifierExpression(list);
// add the created identifier to the current context
Hashtable<String, AIdentifierExpression> currentContext = new Hashtable<String, AIdentifierExpression>();
currentContext.put(parameterName, parameterNode);
this.contextTable.add(currentContext);
// collection the all parameters in
ltlIdentifierTable.put(parameterName, parameterNode);
// parse the b predicate and create a reference to the b ast node
de.be4.classicalb.core.parser.node.Start start = parseBPredicate(bPredicateString);
ltlNodeToBNodeTable.put(node, start);
// collect all identifiers which can be used in the bPredicate and
// verify the bPredicate
LTLBPredicate ltlBPredicate = new LTLBPredicate(getUnifiedContext(), start);
this.bPredicates.add(ltlBPredicate);
machineContext.checkLTLBPredicate(ltlBPredicate);
// remaining LTL formula
ltl.apply(this);
// remove currentContext from contextTable
contextTable.remove(contextTable.size() - 1);
}
use of de.be4.classicalb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class StructType method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
ArrayList<PRecEntry> list = new ArrayList<PRecEntry>();
Set<Entry<String, BType>> entrySet = this.types.entrySet();
for (Entry<String, BType> entry : entrySet) {
String name = entry.getKey();
BType type = entry.getValue();
TIdentifierLiteral literal = new TIdentifierLiteral(name);
ArrayList<TIdentifierLiteral> idList = new ArrayList<TIdentifierLiteral>();
idList.add(literal);
AIdentifierExpression id = new AIdentifierExpression(idList);
ARecEntry recEntry = new ARecEntry(id, type.createASTNode(typechecker));
list.add(recEntry);
}
AStructExpression node = new AStructExpression(list);
typechecker.setType(node, new SetType(this));
return node;
}
use of de.be4.classicalb.core.parser.node.TIdentifierLiteral in project probparsers by bendisposto.
the class AbstractOperation method getImplicitDependenciesToComputations.
public List<TIdentifierLiteral> getImplicitDependenciesToComputations() {
List<TIdentifierLiteral> result = new ArrayList<>();
for (ComputationOperation comp : implicitDependenciesToComputations) {
TIdentifierLiteral nameLiteral = comp.getNameLiteral();
result.add(nameLiteral);
}
return result;
}
Aggregations