Search in sources :

Example 1 with ASN1Assignments

use of org.eclipse.titan.designer.AST.ASN1.ASN1Assignments in project titan.EclipsePlug-ins by eclipse.

the class SpecialASN1Module method createSpecAsss.

/**
 * Creates the special assignments by parsing the strings as if they
 * were coming from an internal file and creating a module around them.
 *
 * @return the module of the special assignments created.
 */
private static ASN1Module createSpecAsss() {
    if (null != specialAssignmentsModule) {
        return specialAssignmentsModule;
    }
    final ASN1Assignments parsedAssignments = new ASN1Assignments();
    ASN1Assignment actualAssignment;
    for (String[] assignment : INTERNAL_ASSIGNMENTS) {
        actualAssignment = SpecialASN1Module.parseSpecialInternalAssignment(assignment[1], new Identifier(Identifier_type.ID_ASN, assignment[0]));
        parsedAssignments.addAssignment(actualAssignment);
    }
    // null as a project might not be a good idea
    specialAssignmentsModule = new ASN1Module(new Identifier(Identifier_type.ID_ASN, INTERNAL_MODULE), null, Tag_types.AUTOMATIC_TAGS, false);
    specialAssignmentsModule.setExports(new Exports(true));
    specialAssignmentsModule.setImports(new Imports());
    specialAssignmentsModule.setAssignments(parsedAssignments);
    specialAssignmentsModule.setLocation(NULL_Location.INSTANCE);
    specialAssignmentsModule.setScopeName(INTERNAL_MODULE);
    final CompilationTimeStamp timestamp = CompilationTimeStamp.getBaseTimestamp();
    final ModuleImportationChain referenceChain = new ModuleImportationChain(ModuleImportationChain.CIRCULARREFERENCE, false);
    specialAssignmentsModule.checkImports(timestamp, referenceChain, new ArrayList<Module>());
    specialAssignmentsModule.check(timestamp);
    return specialAssignmentsModule;
}
Also used : Identifier(org.eclipse.titan.designer.AST.Identifier) CompilationTimeStamp(org.eclipse.titan.designer.parsers.CompilationTimeStamp) ASN1Assignments(org.eclipse.titan.designer.AST.ASN1.ASN1Assignments) ModuleImportationChain(org.eclipse.titan.designer.AST.ModuleImportationChain) Module(org.eclipse.titan.designer.AST.Module) ASN1Assignment(org.eclipse.titan.designer.AST.ASN1.ASN1Assignment)

Aggregations

ASN1Assignment (org.eclipse.titan.designer.AST.ASN1.ASN1Assignment)1 ASN1Assignments (org.eclipse.titan.designer.AST.ASN1.ASN1Assignments)1 Identifier (org.eclipse.titan.designer.AST.Identifier)1 Module (org.eclipse.titan.designer.AST.Module)1 ModuleImportationChain (org.eclipse.titan.designer.AST.ModuleImportationChain)1 CompilationTimeStamp (org.eclipse.titan.designer.parsers.CompilationTimeStamp)1