use of org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct in project titan.EclipsePlug-ins by eclipse.
the class Call_Statement method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
ExpressionStruct expression = new ExpressionStruct();
portReference.generateCode(aData, expression);
expression.expression.append(".call(");
parameter.generateCode(aData, expression, TemplateRestriction.Restriction_type.TR_NONE);
if (toClause != null) {
expression.expression.append(", ");
toClause.generateCodeExpression(aData, expression, true);
}
expression.expression.append(')');
expression.mergeExpression(source);
if (altGuards != null) {
source.append("{\n");
if (timerValue != null) {
timerValue.getLocation().update_location_object(aData, source);
source.append("TitanTimer call_timer = new TitanTimer(null);\n");
expression = new ExpressionStruct();
expression.expression.append("call_timer.start(");
timerValue.generateCodeExpression(aData, expression, false);
expression.expression.append(')');
expression.mergeExpression(source);
}
altGuards.generateCodeCallBody(aData, source, aData.getTemporaryVariableName(), false);
source.append("}\n");
}
}
use of org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct in project titan.EclipsePlug-ins by eclipse.
the class Check_Getreply_Statement method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
final ExpressionStruct expression = new ExpressionStruct();
generateCodeExpression(aData, expression);
PortGenerator.generateCodeStandalone(aData, source, expression.expression.toString(), getLocation());
}
use of org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct in project titan.EclipsePlug-ins by eclipse.
the class Check_Receive_Port_Statement method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
final ExpressionStruct expression = new ExpressionStruct();
generateCodeExpression(aData, expression);
PortGenerator.generateCodeStandalone(aData, source, expression.expression.toString(), getLocation());
}
use of org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct in project titan.EclipsePlug-ins by eclipse.
the class Connect_Statement method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
// FIXME this is actually more complex
final ExpressionStruct expression = new ExpressionStruct();
// FIXME generate code for translation
expression.expression.append("TTCN_Runtime.connect_port(");
componentReference1.generateCodeExpression(aData, expression, true);
expression.expression.append(", ");
// FIXME actually _portref and based on component type
portReference1.generateCode(aData, expression);
expression.expression.append(".get_name(), ");
componentReference2.generateCodeExpression(aData, expression, true);
expression.expression.append(", ");
// FIXME actually _portref and based on component type
portReference2.generateCode(aData, expression);
expression.expression.append(".get_name()");
expression.expression.append(")");
expression.mergeExpression(source);
}
use of org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct in project titan.EclipsePlug-ins by eclipse.
the class Activate_Statement method generateCode.
@Override
public /**
* {@inheritDoc}
*/
void generateCode(final JavaGenData aData, final StringBuilder source) {
final ExpressionStruct expression = new ExpressionStruct();
final Assignment assignment = reference.getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
expression.expression.append(assignment.getGenNameFromScope(aData, source, myStatementBlock, "activate_"));
expression.expression.append('(');
if (!reference.getSubreferences().isEmpty()) {
final ISubReference subReference = reference.getSubreferences().get(0);
if (Subreference_type.parameterisedSubReference.equals(subReference.getReferenceType())) {
((ParameterisedSubReference) subReference).getActualParameters().generateCodeNoAlias(aData, expression);
}
}
expression.expression.append(')');
expression.mergeExpression(source);
}
Aggregations