use of de.be4.classicalb.core.parser.node.AFileExpression in project probparsers by bendisposto.
the class ReferencedMachines method registerMachineNames.
private void registerMachineNames(List<PExpression> referencedMachineList) {
for (PExpression machineExpression : referencedMachineList) {
if (machineExpression instanceof AIdentifierExpression) {
AIdentifierExpression identifier = (AIdentifierExpression) machineExpression;
String name = getIdentifier(identifier.getIdentifier());
final MachineReference machineReference = new MachineReference(name, identifier);
if (this.filePathTable.containsKey(name)) {
machineReference.setDirectoryPath(filePathTable.get(name));
}
referncesTable.put(name, machineReference);
} else if (machineExpression instanceof AFileExpression) {
final AFileExpression fileNode = (AFileExpression) machineExpression;
final AIdentifierExpression identifier = (AIdentifierExpression) fileNode.getIdentifier();
String file = fileNode.getContent().getText().replaceAll("\"", "");
String name = getIdentifier(identifier.getIdentifier());
MachineReference machineReference;
try {
machineReference = new MachineReference(name, identifier, file);
referncesTable.put(name, machineReference);
} catch (CheckException e) {
throw new VisitorException(e);
}
} else {
throw new AssertionError("Not supported class: " + machineExpression.getClass());
}
}
}
Aggregations