use of org.eclipse.titan.designer.AST.ParameterisedSubReference in project titan.EclipsePlug-ins by eclipse.
the class Testcase_Instance_Statement method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
source.append("\t\t");
final ExpressionStruct expression = new ExpressionStruct();
final Assignment testcase = testcaseReference.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
expression.expression.append(MessageFormat.format("{0}(", testcase.getGenNameFromScope(aData, source, myScope, "testcase_")));
final List<ISubReference> subReferences = testcaseReference.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 {
aData.addBuiltinTypeImport("TitanFloat");
aData.addBuiltinTypeImport("Ttcn3Float");
expression.expression.append("false, new TitanFloat( new Ttcn3Float( 0.0 ) ))");
}
expression.mergeExpression(source);
}
use of org.eclipse.titan.designer.AST.ParameterisedSubReference in project titan.EclipsePlug-ins by eclipse.
the class Template_ActualParameter method checkRecursions.
@Override
public /**
* {@inheritDoc}
*/
void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
if (template == null) {
return;
}
final Reference derivedReference = template.getDerivedReference();
if (derivedReference != null) {
final ISubReference subReference = derivedReference.getSubreferences().get(0);
if (subReference instanceof ParameterisedSubReference) {
final ActualParameterList parameterList = ((ParameterisedSubReference) subReference).getActualParameters();
if (parameterList != null) {
parameterList.checkRecursions(timestamp, referenceChain);
}
}
}
referenceChain.markState();
template.getTemplateBody().checkRecursions(timestamp, referenceChain);
referenceChain.previousState();
}
use of org.eclipse.titan.designer.AST.ParameterisedSubReference 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 ) ))");
}
}
use of org.eclipse.titan.designer.AST.ParameterisedSubReference 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);
}
}
}
Aggregations