use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class MachineContext method visitBDefinition.
public void visitBDefinition(Node node, String name, List<PExpression> copy, Node rightSide) {
if (!this.definitions.containsValue(node)) {
return;
}
contextTable.add(new LinkedHashMap<String, Node>());
for (PExpression e : copy) {
putLocalVariableIntoCurrentScope((AIdentifierExpression) e);
}
rightSide.apply(this);
contextTable.remove(contextTable.size() - 1);
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class MachineContext method caseAAnySubstitution.
@Override
public void caseAAnySubstitution(AAnySubstitution node) {
contextTable.add(new LinkedHashMap<String, Node>());
List<PExpression> copy = new ArrayList<PExpression>(node.getIdentifiers());
for (PExpression e : copy) {
putLocalVariableIntoCurrentScope((AIdentifierExpression) e);
}
node.getWhere().apply(this);
node.getThen().apply(this);
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class MachineContext method caseAOpSubstitution.
@Override
public void caseAOpSubstitution(AOpSubstitution node) {
if (node.getName() != null) {
AIdentifierExpression op = (AIdentifierExpression) node.getName();
String name = Utils.getTIdentifierListAsString(op.getIdentifier());
Node o = operations.get(name);
if (o != null) {
this.referencesTable.put(op, o);
} else {
throw new ScopeException("Unknown operation '" + name + "'");
}
}
{
List<PExpression> copy = new ArrayList<PExpression>(node.getParameters());
for (PExpression e : copy) {
e.apply(this);
}
}
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class MachineContext method caseAVariablesMachineClause.
@Override
public void caseAVariablesMachineClause(AVariablesMachineClause 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);
}
}
use of de.be4.classicalb.core.parser.node.AIdentifierExpression in project probparsers by bendisposto.
the class EnumeratedSetElement method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
TIdentifierLiteral literal = new TIdentifierLiteral(name);
ArrayList<TIdentifierLiteral> idList = new ArrayList<TIdentifierLiteral>();
idList.add(literal);
AIdentifierExpression id = new AIdentifierExpression(idList);
typechecker.setType(id, new SetType(this));
return id;
}
Aggregations