use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class MachineContext method caseALetSubstitution.
@Override
public void caseALetSubstitution(ALetSubstitution node) {
contextTable.add(new LinkedHashMap<String, Node>());
List<PExpression> copy = new ArrayList<PExpression>(node.getIdentifiers());
for (PExpression e : copy) {
putLocalVariableIntoCurrentScope((AIdentifierExpression) e);
}
node.getPredicate().apply(this);
node.getSubstitution().apply(this);
}
use of de.be4.classicalb.core.parser.node.PExpression 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.PExpression in project probparsers by bendisposto.
the class MachineContext method caseAAbstractConstantsMachineClause.
@Override
public void caseAAbstractConstantsMachineClause(AAbstractConstantsMachineClause node) {
hasConstants = true;
List<PExpression> copy = new ArrayList<PExpression>(node.getIdentifiers());
for (PExpression e : copy) {
AIdentifierExpression c = (AIdentifierExpression) e;
String name = Utils.getTIdentifierListAsString(c.getIdentifier());
exist(c.getIdentifier());
constants.put(name, c);
}
}
use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class MachineContext method caseASeesMachineClause.
@Override
public void caseASeesMachineClause(ASeesMachineClause node) {
this.seesMachineClause = node;
List<PExpression> copy = new ArrayList<PExpression>(node.getMachineNames());
for (PExpression e : copy) {
AIdentifierExpression p = (AIdentifierExpression) e;
String name = Utils.getTIdentifierListAsString(p.getIdentifier());
try {
exist(p.getIdentifier());
} catch (ScopeException e2) {
throw new ScopeException("Machine '" + name + "' is seen twice.");
}
seenMachines.put(name, p);
}
}
use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class MachineContext method caseAConcreteVariablesMachineClause.
@Override
public void caseAConcreteVariablesMachineClause(AConcreteVariablesMachineClause node) {
List<PExpression> copy = new ArrayList<PExpression>(node.getIdentifiers());
for (PExpression e : copy) {
AIdentifierExpression v = (AIdentifierExpression) e;
String name = Utils.getTIdentifierListAsString(v.getIdentifier());
exist(v.getIdentifier());
variables.put(name, v);
}
}
Aggregations