Search in sources :

Example 1 with PMachineReference

use of de.be4.classicalb.core.parser.node.PMachineReference 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);
}
Also used : PMachineReference(de.be4.classicalb.core.parser.node.PMachineReference) ArrayList(java.util.ArrayList) AMachineReference(de.be4.classicalb.core.parser.node.AMachineReference) AIncludesMachineClause(de.be4.classicalb.core.parser.node.AIncludesMachineClause) TIdentifierLiteral(de.be4.classicalb.core.parser.node.TIdentifierLiteral)

Example 2 with PMachineReference

use of de.be4.classicalb.core.parser.node.PMachineReference in project probparsers by bendisposto.

the class RulesReferencesFinder method registerMachineNames.

private void registerMachineNames(final PMachineReference machineReference) {
    if (machineReference instanceof AFileMachineReference) {
        registerMachineByFilePragma((AFileMachineReference) machineReference);
    } else {
        AMachineReference mchRef = (AMachineReference) machineReference;
        registerMachineReference(mchRef);
    }
}
Also used : AFileMachineReference(de.be4.classicalb.core.parser.node.AFileMachineReference) AMachineReference(de.be4.classicalb.core.parser.node.AMachineReference)

Example 3 with PMachineReference

use of de.be4.classicalb.core.parser.node.PMachineReference in project prob2 by bendisposto.

the class DependencyWalker method caseAImportsMachineClause.

@Override
public void caseAImportsMachineClause(final AImportsMachineClause node) {
    for (final PMachineReference r : node.getMachineReferences()) {
        final String dest = extractMachineName(((AMachineReference) r).getMachineName());
        addMachine(dest, prefix, ERefType.IMPORTS);
    }
}
Also used : PMachineReference(de.be4.classicalb.core.parser.node.PMachineReference)

Aggregations

AMachineReference (de.be4.classicalb.core.parser.node.AMachineReference)2 PMachineReference (de.be4.classicalb.core.parser.node.PMachineReference)2 AFileMachineReference (de.be4.classicalb.core.parser.node.AFileMachineReference)1 AIncludesMachineClause (de.be4.classicalb.core.parser.node.AIncludesMachineClause)1 TIdentifierLiteral (de.be4.classicalb.core.parser.node.TIdentifierLiteral)1 ArrayList (java.util.ArrayList)1