Search in sources :

Example 1 with ValueHolder

use of org.eclipse.titan.codegenerator.template.ValueHolder in project titan.EclipsePlug-ins by eclipse.

the class ConstantParser method process.

@Override
public Scope process(IVisitableNode node) {
    if (node instanceof Identifier) {
        name = node.toString();
    }
    if (node instanceof Type) {
        type = Util.getTypeName((Type) node);
        value = new Value(type, Writable.NULL);
        return Action.skip(Type.class, this);
    }
    if (node instanceof org.eclipse.titan.designer.AST.Value) {
        ValueHolder holder = v -> value = v;
        return dispatch(this, type, holder, node);
    }
    return this;
}
Also used : IVisitableNode(org.eclipse.titan.designer.AST.IVisitableNode) Writable(org.eclipse.titan.codegenerator.Writable) Iterator(java.util.Iterator) ValueHolder(org.eclipse.titan.codegenerator.template.ValueHolder) Identifier(org.eclipse.titan.designer.AST.Identifier) Util(org.eclipse.titan.codegenerator.template.Util) NamedValue(org.eclipse.titan.designer.AST.TTCN3.values.NamedValue) SequenceOf_Value(org.eclipse.titan.designer.AST.TTCN3.values.SequenceOf_Value) HashMap(java.util.HashMap) Def_Const(org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Const) ArrayList(java.util.ArrayList) SourceCode(org.eclipse.titan.codegenerator.SourceCode) List(java.util.List) Sequence_Value(org.eclipse.titan.designer.AST.TTCN3.values.Sequence_Value) Type(org.eclipse.titan.designer.AST.Type) Scope(org.eclipse.titan.codegenerator.Scope) org.eclipse.titan.codegenerator.myASTVisitor(org.eclipse.titan.codegenerator.myASTVisitor) Action(org.eclipse.titan.codegenerator.template.Action) Value(org.eclipse.titan.codegenerator.template.Value) Type(org.eclipse.titan.designer.AST.Type) Identifier(org.eclipse.titan.designer.AST.Identifier) NamedValue(org.eclipse.titan.designer.AST.TTCN3.values.NamedValue) SequenceOf_Value(org.eclipse.titan.designer.AST.TTCN3.values.SequenceOf_Value) Sequence_Value(org.eclipse.titan.designer.AST.TTCN3.values.Sequence_Value) Value(org.eclipse.titan.codegenerator.template.Value) ValueHolder(org.eclipse.titan.codegenerator.template.ValueHolder)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Scope (org.eclipse.titan.codegenerator.Scope)1 SourceCode (org.eclipse.titan.codegenerator.SourceCode)1 Writable (org.eclipse.titan.codegenerator.Writable)1 org.eclipse.titan.codegenerator.myASTVisitor (org.eclipse.titan.codegenerator.myASTVisitor)1 Action (org.eclipse.titan.codegenerator.template.Action)1 Util (org.eclipse.titan.codegenerator.template.Util)1 Value (org.eclipse.titan.codegenerator.template.Value)1 ValueHolder (org.eclipse.titan.codegenerator.template.ValueHolder)1 IVisitableNode (org.eclipse.titan.designer.AST.IVisitableNode)1 Identifier (org.eclipse.titan.designer.AST.Identifier)1 Def_Const (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Const)1 NamedValue (org.eclipse.titan.designer.AST.TTCN3.values.NamedValue)1 SequenceOf_Value (org.eclipse.titan.designer.AST.TTCN3.values.SequenceOf_Value)1 Sequence_Value (org.eclipse.titan.designer.AST.TTCN3.values.Sequence_Value)1 Type (org.eclipse.titan.designer.AST.Type)1