Search in sources :

Example 1 with CharString_Type

use of org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type in project titan.EclipsePlug-ins by eclipse.

the class Def_Type_Visit_Handler method visitDefTypeNodes.

public void visitDefTypeNodes(IVisitableNode node) {
    Def_Type typeNode = (Def_Type) node;
    String nodeName = typeNode.getIdentifier().toString();
    myASTVisitor.currentFileName = nodeName;
    myASTVisitor.visualizeNodeToJava(myASTVisitor.importListStrings);
    Type type = typeNode.getType(compilationCounter);
    if (type.getTypetype().equals(TYPE_TTCN3_SEQUENCE)) {
        // record
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "record");
        parentName = nodeName;
    } else if (type.getTypetype().equals(TYPE_TTCN3_SET)) {
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "set");
        parentName = nodeName;
    } else if (type.getTypetype().equals(TYPE_TTCN3_CHOICE)) {
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "union");
        parentName = nodeName;
    } else if (type instanceof Integer_Type) {
        Def_Type_Integer_Writer.getInstance(typeNode);
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "INTEGER");
        parentName = nodeName;
        isInteger = true;
    } else if (type instanceof CharString_Type) {
        Def_Type_Charstring_Writer.getInstance(typeNode);
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "CHARSTRING");
        parentName = nodeName;
    } else if (type instanceof TTCN3_Enumerated_Type) {
        Def_Type_Enum_Writer.getInstance(typeNode);
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "enum");
        parentName = nodeName;
    } else if (type.getTypetype().equals(TYPE_SET_OF)) {
        waitForSetOfFieldType = true;
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "setof");
        parentName = nodeName;
    } else if (type.getTypetype().equals(TYPE_SEQUENCE_OF)) {
        waitForRecordOfFieldType = true;
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "recordof");
        parentName = nodeName;
    } else if (type.getTypetype().equals(TYPE_PORT)) {
        Def_Type_Port_Writer.getInstance(typeNode);
        waitingForPortAttriburtes = true;
        currentPortName = nodeName;
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "port");
        parentName = nodeName;
    } else if (type.getTypetype().equals(TYPE_COMPONENT)) {
        Def_Type_Component_Writer.getInstance(typeNode);
        waitForCompReference = true;
        AstWalkerJava.componentList.add(nodeName);
        myASTVisitor.nodeNameNodeTypeHashMap.put(nodeName, "component");
        parentName = nodeName;
    }
}
Also used : Def_Type(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type) Range_ParsedSubType(org.eclipse.titan.designer.AST.TTCN3.types.subtypes.Range_ParsedSubType) SequenceOf_Type(org.eclipse.titan.designer.AST.TTCN3.types.SequenceOf_Type) Integer_Type(org.eclipse.titan.designer.AST.TTCN3.types.Integer_Type) TTCN3_Enumerated_Type(org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Enumerated_Type) SetOf_Type(org.eclipse.titan.designer.AST.TTCN3.types.SetOf_Type) Referenced_Type(org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type) Type(org.eclipse.titan.designer.AST.Type) Def_Type(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type) CharString_Type(org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type) Integer_Type(org.eclipse.titan.designer.AST.TTCN3.types.Integer_Type) TTCN3_Enumerated_Type(org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Enumerated_Type) CharString_Type(org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type)

Example 2 with CharString_Type

use of org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type in project titan.EclipsePlug-ins by eclipse.

the class Def_Type_Visit_Handler method handleDefTypeNodes.

public void handleDefTypeNodes(IVisitableNode node) {
    Def_Type typeNode = (Def_Type) node;
    CompilationTimeStamp compilationCounter = CompilationTimeStamp.getNewCompilationCounter();
    myASTVisitor.currentFileName = typeNode.getIdentifier().toString();
    Type type = typeNode.getType(compilationCounter);
    if (type.getTypetype().equals(TYPE_TTCN3_SEQUENCE)) {
        // record
        Def_Type_Record_Writer recordNode = new Def_Type_Record_Writer(typeNode);
        // add component fields
        recordNode.add(compFieldTypes, compFieldNames);
        String[] typeArray = (String[]) compFieldTypes.toArray(new String[compFieldTypes.size()]);
        String[] nameArray = (String[]) compFieldNames.toArray(new String[compFieldNames.size()]);
        myASTVisitor.nodeNameChildrenTypesHashMap.put(parentName, typeArray);
        myASTVisitor.nodeNameChildrenNamesHashMap.put(parentName, nameArray);
        compFieldTypes.clear();
        compFieldNames.clear();
        myASTVisitor.visualizeNodeToJava(recordNode.getJavaSource());
    } else if (type.getTypetype().equals(TYPE_TTCN3_SET)) {
        // set
        Def_Type_Set_Writer setNode = new Def_Type_Set_Writer(typeNode);
        // add component fields
        setNode.add(compFieldTypes, compFieldNames);
        String[] typeArray = (String[]) compFieldTypes.toArray(new String[compFieldTypes.size()]);
        String[] nameArray = (String[]) compFieldNames.toArray(new String[compFieldNames.size()]);
        myASTVisitor.nodeNameChildrenTypesHashMap.put(parentName, typeArray);
        myASTVisitor.nodeNameChildrenNamesHashMap.put(parentName, nameArray);
        compFieldTypes.clear();
        compFieldNames.clear();
        myASTVisitor.visualizeNodeToJava(setNode.getJavaSource());
    } else if (type.getTypetype().equals(TYPE_TTCN3_CHOICE)) {
        // union
        Def_Type_Union_Writer union_writer = new Def_Type_Union_Writer(typeNode);
        // add component fields
        union_writer.add(compFieldTypes, compFieldNames);
        String[] typeArray = compFieldTypes.toArray(new String[compFieldTypes.size()]);
        String[] nameArray = compFieldNames.toArray(new String[compFieldNames.size()]);
        myASTVisitor.nodeNameChildrenTypesHashMap.put(parentName, typeArray);
        myASTVisitor.nodeNameChildrenNamesHashMap.put(parentName, nameArray);
        compFieldTypes.clear();
        compFieldNames.clear();
        myASTVisitor.visualizeNodeToJava(union_writer.getJavaSource());
    } else if (type instanceof Integer_Type) {
        Def_Type_Integer_Writer integerNode = Def_Type_Integer_Writer.getInstance(typeNode);
        integerNode.clearLists();
        myASTVisitor.visualizeNodeToJava(integerNode.getJavaSource());
    } else if (type instanceof CharString_Type) {
        Def_Type_Charstring_Writer charstringNode = Def_Type_Charstring_Writer.getInstance(typeNode);
        charstringNode.clearLists();
        charstringNode.addCharStringValue(charstringValue);
        charstringValue = null;
        myASTVisitor.visualizeNodeToJava(charstringNode.getJavaSource());
    } else if (type instanceof TTCN3_Enumerated_Type) {
        Def_Type_Enum_Writer enumTypeNode = Def_Type_Enum_Writer.getInstance(typeNode);
        enumTypeNode.clearLists();
        enumTypeNode.enumItems.addAll(enumItems);
        enumTypeNode.enumItemValues.addAll(enumItemValues);
        enumItemValues.clear();
        enumItems.clear();
        myASTVisitor.visualizeNodeToJava(enumTypeNode.getJavaSource());
    } else if (type.getTypetype().equals(TYPE_SET_OF)) {
        Def_Type_Set_Of_Writer setOfNode = new Def_Type_Set_Of_Writer(typeNode);
        setOfNode.setFieldType(setOfFieldType);
        setOfFieldType = null;
        myASTVisitor.visualizeNodeToJava(setOfNode.getJavaSource());
    } else if (type.getTypetype().equals(TYPE_SEQUENCE_OF)) {
        Def_Type_Record_Of_Writer writer = new Def_Type_Record_Of_Writer(typeNode);
        writer.setFieldType(recordOfFieldType);
        myASTVisitor.visualizeNodeToJava(writer.getJavaSource());
    } else if (type.getTypetype().equals(TYPE_PORT)) {
        Def_Type_Port_Writer portNode = Def_Type_Port_Writer.getInstance(typeNode);
        portNode.clearLists();
        portNode.inMessageName.addAll(inMessageName);
        portNode.outMessageName.addAll(outMessageName);
        portNode.inOutMessageName.addAll(inOutMessageName);
        portNode.setPortTypeAReferencedType(isPortTypeAReferencedType);
        waitingForPortAttriburtes = false;
        isPortTypeAReferencedType = false;
        inMessageName.clear();
        outMessageName.clear();
        inOutMessageName.clear();
        myASTVisitor.visualizeNodeToJava(portNode.getJavaSource());
    } else if (type.getTypetype().equals(TYPE_COMPONENT)) {
        Def_Type_Component_Writer compNode = Def_Type_Component_Writer.getInstance(typeNode);
        compNode.clearLists();
        // add component fields
        compNode.compFieldPortTypes.addAll(componentPortTypes);
        compNode.compFieldPortNames.addAll(componentPortNames);
        compNode.compFieldVarTypes.addAll(componentVarTypes);
        compNode.compFieldVarNames.addAll(componentVarNames);
        componentPortTypes.clear();
        componentPortNames.clear();
        componentVarTypes.clear();
        componentVarNames.clear();
        waitForCompReference = false;
        myASTVisitor.visualizeNodeToJava(compNode.getJavaSource());
    }
    parentName = null;
}
Also used : Def_Type(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type) TTCN3_Enumerated_Type(org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Enumerated_Type) CharString_Type(org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type) Range_ParsedSubType(org.eclipse.titan.designer.AST.TTCN3.types.subtypes.Range_ParsedSubType) SequenceOf_Type(org.eclipse.titan.designer.AST.TTCN3.types.SequenceOf_Type) Integer_Type(org.eclipse.titan.designer.AST.TTCN3.types.Integer_Type) TTCN3_Enumerated_Type(org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Enumerated_Type) SetOf_Type(org.eclipse.titan.designer.AST.TTCN3.types.SetOf_Type) Referenced_Type(org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type) Type(org.eclipse.titan.designer.AST.Type) Def_Type(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type) CharString_Type(org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type) Integer_Type(org.eclipse.titan.designer.AST.TTCN3.types.Integer_Type) CompilationTimeStamp(org.eclipse.titan.designer.parsers.CompilationTimeStamp)

Aggregations

Def_Type (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type)2 CharString_Type (org.eclipse.titan.designer.AST.TTCN3.types.CharString_Type)2 Integer_Type (org.eclipse.titan.designer.AST.TTCN3.types.Integer_Type)2 Referenced_Type (org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type)2 SequenceOf_Type (org.eclipse.titan.designer.AST.TTCN3.types.SequenceOf_Type)2 SetOf_Type (org.eclipse.titan.designer.AST.TTCN3.types.SetOf_Type)2 TTCN3_Enumerated_Type (org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Enumerated_Type)2 Range_ParsedSubType (org.eclipse.titan.designer.AST.TTCN3.types.subtypes.Range_ParsedSubType)2 Type (org.eclipse.titan.designer.AST.Type)2 CompilationTimeStamp (org.eclipse.titan.designer.parsers.CompilationTimeStamp)1