Search in sources :

Example 21 with ActualParameterList

use of org.eclipse.titan.designer.AST.TTCN3.definitions.ActualParameterList in project titan.EclipsePlug-ins by eclipse.

the class ExecuteExpression method generateCodeExpressionExpression.

@Override
public /**
 * {@inheritDoc}
 */
void generateCodeExpressionExpression(final JavaGenData aData, final ExpressionStruct expression) {
    final Assignment testcase = reference.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
    expression.expression.append(MessageFormat.format("{0}(", testcase.getGenNameFromScope(aData, expression.expression, myScope, "testcase_")));
    final List<ISubReference> subReferences = reference.getSubreferences();
    if (!subReferences.isEmpty() && subReferences.get(0) instanceof ParameterisedSubReference) {
        final ActualParameterList actualParList = ((ParameterisedSubReference) subReferences.get(0)).getActualParameters();
        if (actualParList.getNofParameters() > 0) {
            actualParList.generateCodeAlias(aData, expression);
            expression.expression.append(", ");
        }
    }
    if (timerValue != null) {
        expression.expression.append("true, ");
        timerValue.generateCodeExpression(aData, expression, true);
        expression.expression.append(')');
    } else {
        expression.expression.append("false, new TitanFloat( new Ttcn3Float( 0.0 ) ))");
    }
}
Also used : Assignment(org.eclipse.titan.designer.AST.Assignment) ISubReference(org.eclipse.titan.designer.AST.ISubReference) ParameterisedSubReference(org.eclipse.titan.designer.AST.ParameterisedSubReference) ActualParameterList(org.eclipse.titan.designer.AST.TTCN3.definitions.ActualParameterList)

Example 22 with ActualParameterList

use of org.eclipse.titan.designer.AST.TTCN3.definitions.ActualParameterList in project titan.EclipsePlug-ins by eclipse.

the class Referenced_Template method checkRecursions.

@Override
public /**
 * {@inheritDoc}
 */
void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
    if (referenceChain.add(this) && reference != null) {
        final ISubReference subReference = reference.getSubreferences().get(0);
        if (subReference instanceof ParameterisedSubReference) {
            final ActualParameterList parameterList = ((ParameterisedSubReference) subReference).getActualParameters();
            if (parameterList != null) {
                parameterList.checkRecursions(timestamp, referenceChain);
            }
        }
        final IReferenceChain tempReferenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
        final ITTCN3Template template = getTemplateReferenced(timestamp, tempReferenceChain);
        tempReferenceChain.release();
        if (template != null && !template.getIsErroneous(timestamp) && !this.equals(template)) {
            template.checkRecursions(timestamp, referenceChain);
        }
    }
}
Also used : ISubReference(org.eclipse.titan.designer.AST.ISubReference) ParameterisedSubReference(org.eclipse.titan.designer.AST.ParameterisedSubReference) IReferenceChain(org.eclipse.titan.designer.AST.IReferenceChain) ActualParameterList(org.eclipse.titan.designer.AST.TTCN3.definitions.ActualParameterList)

Aggregations

ActualParameterList (org.eclipse.titan.designer.AST.TTCN3.definitions.ActualParameterList)18 FormalParameterList (org.eclipse.titan.designer.AST.TTCN3.definitions.FormalParameterList)13 IType (org.eclipse.titan.designer.AST.IType)9 ISubReference (org.eclipse.titan.designer.AST.ISubReference)6 ParameterisedSubReference (org.eclipse.titan.designer.AST.ParameterisedSubReference)6 Assignment (org.eclipse.titan.designer.AST.Assignment)5 IValue (org.eclipse.titan.designer.AST.IValue)4 IReferenceChain (org.eclipse.titan.designer.AST.IReferenceChain)3 Type_type (org.eclipse.titan.designer.AST.IType.Type_type)3 TemplateInstance (org.eclipse.titan.designer.AST.TTCN3.templates.TemplateInstance)3 Altstep_Type (org.eclipse.titan.designer.AST.TTCN3.types.Altstep_Type)3 Function_Type (org.eclipse.titan.designer.AST.TTCN3.types.Function_Type)3 HashMap (java.util.HashMap)2 Def_Template (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Template)2 NamedParameter (org.eclipse.titan.designer.AST.TTCN3.templates.NamedParameter)2 NamedParameters (org.eclipse.titan.designer.AST.TTCN3.templates.NamedParameters)2 NotUsed_Template (org.eclipse.titan.designer.AST.TTCN3.templates.NotUsed_Template)2 TemplateInstances (org.eclipse.titan.designer.AST.TTCN3.templates.TemplateInstances)2 Real_Value (org.eclipse.titan.designer.AST.TTCN3.values.Real_Value)2 ASN1Assignment (org.eclipse.titan.designer.AST.ASN1.ASN1Assignment)1