Commit 41412428 authored by balaskoa's avatar balaskoa
Browse files
parents c8d73887 90f24f08
......@@ -959,6 +959,7 @@ public final class Def_Function extends Definition implements IParameterisedAssi
if (isStartable) {
aData.addBuiltinTypeImport("TitanComponent");
aData.addBuiltinTypeImport("Text_Buf");
aData.addBuiltinTypeImport("TtcnLogger.Severity");
aData.addCommonLibraryImport("TTCN_Runtime");
source.append(MessageFormat.format("public static final void start_{0}(final TitanComponent component_reference", genName));
......
......@@ -18,6 +18,7 @@ import org.eclipse.titan.designer.AST.ReferenceFinder;
import org.eclipse.titan.designer.AST.ReferenceFinder.Hit;
import org.eclipse.titan.designer.AST.Scope;
import org.eclipse.titan.designer.AST.Value;
import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type;
import org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody;
import org.eclipse.titan.designer.AST.TTCN3.types.Port_Type;
import org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct;
......@@ -220,22 +221,27 @@ public final class Connect_Statement extends Statement {
@Override
/** {@inheritDoc} */
public 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(), ");
if (componentReference1.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference1);
} else {
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()");
if (componentReference2.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference2);
} else {
portReference2.generateCode(aData, expression);
expression.expression.append(".get_name()");
}
expression.expression.append(")");
expression.mergeExpression(source);
......
......@@ -100,11 +100,11 @@ public final class Continue_Statement extends Statement {
// source.append("break;\n");
//} else
if (loop_stmt instanceof For_Statement) {
For_Statement forStatment = (For_Statement) loop_stmt;
final For_Statement forStatment = (For_Statement) loop_stmt;
forStatment.generateCodeStepAssigment(aData, source);
source.append("continue;\n");
} else if (loop_stmt instanceof DoWhile_Statement) {
DoWhile_Statement doWhileStatement = (DoWhile_Statement) loop_stmt;
final DoWhile_Statement doWhileStatement = (DoWhile_Statement) loop_stmt;
doWhileStatement.generateCodeConditional(aData, source);
source.append("continue;\n");
} else {
......
......@@ -18,6 +18,7 @@ import org.eclipse.titan.designer.AST.ReferenceFinder;
import org.eclipse.titan.designer.AST.ReferenceFinder.Hit;
import org.eclipse.titan.designer.AST.Scope;
import org.eclipse.titan.designer.AST.Value;
import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type;
import org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody;
import org.eclipse.titan.designer.AST.TTCN3.types.Port_Type;
import org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct;
......@@ -213,22 +214,27 @@ public final class Disconnect_Statement extends Statement {
@Override
/** {@inheritDoc} */
public 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.disconnect_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(), ");
if (componentReference1.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference1);
} else {
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()");
if (componentReference2.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference2);
} else {
portReference2.generateCode(aData, expression);
expression.expression.append(".get_name()");
}
expression.expression.append(")");
expression.mergeExpression(source);
......
......@@ -101,7 +101,7 @@ public final class If_Clauses extends ASTNode implements IIncrementallyUpdateabl
* @param pLoopStmt the loop statement, set only within loops.
* */
public void setMyLaicStmt(final AltGuards pAgs, final Statement pLoopStmt) {
for (If_Clause ifClause : ifclauses) {
for (final If_Clause ifClause : ifclauses) {
ifClause.getStatementBlock().setMyLaicStmt(pAgs, pLoopStmt);
}
}
......
......@@ -336,7 +336,8 @@ public final class Invoke_Altguard extends AltGuard {
referenceChain.release();
if (last.getValuetype() == Value_type.ALTSTEP_REFERENCE_VALUE) {
Def_Altstep altstep = ((Altstep_Reference_Value)last).getReferredAltstep();
final Def_Altstep altstep = ((Altstep_Reference_Value)last).getReferredAltstep();
expression.expression.append(MessageFormat.format("{0}_instance(", altstep.getGenNameFromScope(aData, expression.expression, myScope, "")));
actualParameterList.generateCodeAlias(aData, expression);
} else {
......
......@@ -167,7 +167,8 @@ public final class Kill_Statement extends Statement {
// the argument is a special component reference (mtc, self, etc.)
switch(((Expression_Value)last).getOperationType()) {
case MTC_COMPONENT_OPERATION: {
Definition myDefinition = myStatementBlock.getMyDefinition();
final Definition myDefinition = myStatementBlock.getMyDefinition();
if (myDefinition != null && myDefinition.getAssignmentType() == Assignment_type.A_TESTCASE) {
refers_to_self = true;
}
......
......@@ -308,15 +308,21 @@ public final class Map_Statement extends Statement {
expression.expression.append("TTCN_Runtime.map_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(), ");
if (componentReference1.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference1);
} else {
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()");
if (componentReference2.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference2);
} else {
portReference2.generateCode(aData, expression);
expression.expression.append(".get_name()");
}
expression.expression.append(", false)");
expression.mergeExpression(source);
......
......@@ -48,7 +48,9 @@ import org.eclipse.titan.designer.AST.TTCN3.types.TypeFactory;
import org.eclipse.titan.designer.AST.TTCN3.values.ArrayDimensions;
import org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value;
import org.eclipse.titan.designer.AST.TTCN3.values.Integer_Value;
import org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct;
import org.eclipse.titan.designer.AST.TTCN3.values.expressions.ValueofExpression;
import org.eclipse.titan.designer.compiler.JavaGenData;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
/**
......@@ -766,4 +768,32 @@ public final class Port_Utility {
return template.getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_TEMPLATE);
}
static void generate_code_portref(final JavaGenData aData, final ExpressionStruct expression, final Reference reference) {
final StringBuilder backup = expression.expression;
expression.expression = new StringBuilder();
expression.expression.append(MessageFormat.format("\"{0}\"", reference.getId().getDisplayName()));
final List<ISubReference> subreferences = reference.getSubreferences();
if (subreferences.size() > 0) {
for (int i = 0; i < subreferences.size(); i++) {
final ISubReference subreference = subreferences.get(i);
if (subreference instanceof ArraySubReference) {
// transform expr->expr: XXXX -> get_port_name(XXXX, index)
aData.addCommonLibraryImport("AdditionalFunctions");
final StringBuilder temp = expression.expression;
expression.expression = new StringBuilder("AdditionalFunctions.get_port_name(");
expression.expression.append(temp);
expression.expression.append(", ");
((ArraySubReference) subreference).getValue().generateCodeExpression(aData, expression, false);
expression.expression.append(')');
}
}
}
backup.append(expression.expression);
expression.expression = backup;
}
}
......@@ -90,7 +90,8 @@ public final class Repeat_Statement extends Statement {
@Override
/** {@inheritDoc} */
public void generateCode(final JavaGenData aData, final StringBuilder source) {
String label = myAltGuards.getLabel();
final String label = myAltGuards.getLabel();
if (label == null) {
source.append("return TitanAlt_Status.ALT_REPEAT;\n");
} else {
......
......@@ -275,8 +275,8 @@ public final class SelectCase extends ASTNode implements ILocateableNode, IIncre
* @param unReachable tells whether this branch is already unreachable because of previous conditions
*/
public void generateCode(final JavaGenData aData, final StringBuilder source, final String name, final AtomicBoolean unreach) {
ExpressionStruct expression = new ExpressionStruct();
StringBuilder condition = new StringBuilder();
final ExpressionStruct expression = new ExpressionStruct();
final StringBuilder condition = new StringBuilder();
if(templateInstances != null) {
for (int i = 0; i < templateInstances.getNofTis(); i++) {
......@@ -292,7 +292,8 @@ public final class SelectCase extends ASTNode implements ILocateableNode, IIncre
if(isValue) {
final String genName = last.getGenNameValue(aData, expression.expression,last.getMyScope());
expression.expression.append(MessageFormat.format("{0} {1} = new {0} (", genName, tmp));
IValue value = templateBody.getValue();
final IValue value = templateBody.getValue();
value.getValueRefdLast(CompilationTimeStamp.getBaseTimestamp(), null);
value.generateCodeExpressionMandatory(aData, expression, true);
......
......@@ -109,7 +109,7 @@ public final class SelectCases extends ASTNode implements IIncrementallyUpdateab
* @param pLoopStmt the loop statement, set only within loops.
* */
public void setMyLaicStmt(final AltGuards pAltGuards, final Statement pLoopStmt) {
for (SelectCase selectCase : select_cases) {
for (final SelectCase selectCase : select_cases) {
selectCase.getStatementBlock().setMyLaicStmt(pAltGuards, pLoopStmt);
}
}
......
......@@ -268,7 +268,7 @@ public final class SelectUnionCase extends ASTNode implements ILocateableNode, I
* If case else is found, all the filed names are removed from the list, because all the cases are covered.
*/
public void check( final TTCN3_Choice_Type aUnionType, final List<String> aFieldNames ) {
for ( Identifier identifier : items ) {
for (final Identifier identifier : items ) {
// name of the union component
final String name = identifier.getName();
if ( aUnionType.hasComponentWithName( name ) ) {
......@@ -338,7 +338,7 @@ public final class SelectUnionCase extends ASTNode implements ILocateableNode, I
}
if ( items != null ) {
for ( Identifier item : items ) {
for (final Identifier item : items ) {
if ( item instanceof Identifier ) {
final Identifier identifier = item;
reparser.updateLocation( identifier.getLocation() );
......@@ -367,7 +367,7 @@ public final class SelectUnionCase extends ASTNode implements ILocateableNode, I
/** {@inheritDoc} */
protected boolean memberAccept(final ASTVisitor v) {
if ( items != null) {
for ( Identifier item : items ) {
for (final Identifier item : items ) {
if ( !item.accept( v ) ) {
return false;
}
......
......@@ -245,10 +245,11 @@ public final class Start_Component_Statement extends Statement {
expression.expression.append(MessageFormat.format("{0}(", func.getGenNameFromScope(aData, source, myScope, "start_")));
componentReference.generateCodeExpression(aData, expression, false);
FormalParameterList formalParameterList = function.getFormalParameterList();
final FormalParameterList formalParameterList = function.getFormalParameterList();
if (formalParameterList.getNofParameters() > 0) {
expression.expression.append(',');
ISubReference subReference = functionInstanceReference.getSubreferences().get(0);
final ISubReference subReference = functionInstanceReference.getSubreferences().get(0);
((ParameterisedSubReference) subReference).getActualParameters().generateCodeNoAlias(aData, expression);
}
expression.expression.append(')');
......
......@@ -299,7 +299,7 @@ public final class Start_Referenced_Component_Statement extends Statement {
final IValue last = dereferredValue.getValueRefdLast(CompilationTimeStamp.getBaseTimestamp(), referenceChain);
referenceChain.release();
if (last.getValuetype() == Value_type.FUNCTION_REFERENCE_VALUE) {
Definition definition = ((Function_Reference_Value)last).getReferredFunction();
final Definition definition = ((Function_Reference_Value)last).getReferredFunction();
expression.expression.append(MessageFormat.format("{0}(", definition.getGenNameFromScope(aData, source, myScope, "start_")));
} else {
dereferredValue.generateCodeExpressionMandatory(aData, expression, true);
......
......@@ -425,7 +425,7 @@ public final class StatementBlock extends TTCN3Scope implements ILocateableNode,
* @param pLoopStmt the loop statement, set only within loops.
* */
protected void setMyLaicStmt(final AltGuards pAltGuards, final Statement pLoopStmt) {
for(Statement statment : statements) {
for(final Statement statment : statements) {
statment.setMyLaicStmt(pAltGuards, pLoopStmt);
}
}
......
......@@ -167,7 +167,8 @@ public final class Stop_Component_Statement extends Statement {
// the argument is a special component reference (mtc, self, etc.)
switch(((Expression_Value)last).getOperationType()) {
case MTC_COMPONENT_OPERATION: {
Definition myDefinition = myStatementBlock.getMyDefinition();
final Definition myDefinition = myStatementBlock.getMyDefinition();
if (myDefinition != null && myDefinition.getAssignmentType() == Assignment_type.A_TESTCASE) {
refers_to_self = true;
}
......
......@@ -288,22 +288,27 @@ public final class Unmap_Statement extends Statement {
@Override
/** {@inheritDoc} */
public 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.unmap_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(), ");
if (componentReference1.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference1);
} else {
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()");
if (componentReference2.getExpressionGovernor(CompilationTimeStamp.getBaseTimestamp(), Expected_Value_type.EXPECTED_DYNAMIC_VALUE) == null) {
Port_Utility.generate_code_portref(aData, expression, portReference2);
} else {
portReference2.generateCode(aData, expression);
expression.expression.append(".get_name()");
}
expression.expression.append(", false)");
expression.mergeExpression(source);
......
......@@ -197,8 +197,6 @@ public class EnumeratedGenerator {
generateTemplateLogMatch(source, e_defs.name, e_defs.displayName);
generateTemplateEncodeDecodeText(source, e_defs.name, e_defs.displayName);
//FIXME implement encode
//FIXME implement decode
//FIXME implement set_param
//FIXME implement check_restriction
source.append("}\n");
......
......@@ -6,6 +6,7 @@ import java.util.ArrayList;
import org.eclipse.titan.designer.AST.Location;
import org.eclipse.titan.designer.compiler.JavaGenData;
// FIXME translation ports are not yet supported
public class PortGenerator {
// The kind of the testport
......@@ -64,6 +65,7 @@ public class PortGenerator {
*
* originally port_def
* */
//FIXME add support for sliding
public static class PortDefinition {
/** Java type name of the port */
public String javaName;
......@@ -327,8 +329,6 @@ public class PortGenerator {
generateProcessException(source, portDefinition);
}
source.append( "//TODO: port code generation is not yet fully implemented!\n" );
source.append("}\n\n");
}
......@@ -539,8 +539,9 @@ public class PortGenerator {
source.append("}\n");
source.append("if (TtcnLogger.log_this_event(TtcnLogger.Severity.PORTEVENT_DUALSEND)) {\n");
source.append("TtcnLogger.begin_event(TtcnLogger.Severity.PORTEVENT_DUALSEND);\n");
source.append("send_par.log;\n");
source.append(MessageFormat.format("TtcnLogger.log_dualport_map(0,\"{0}\", TtcnLogger.end_event_log2str(), 0);\n ",outType.mDisplayName));
source.append("send_par.log();\n");
source.append(MessageFormat.format("TtcnLogger.log_dualport_map(false,\"{0}\", TtcnLogger.end_event_log2str(), 0);\n ",outType.mDisplayName));
source.append("}\n\n");
source.append("get_default_destination();\n");
source.append("outgoing_send(send_par, destination_address);\n");
source.append("}\n\n");
......@@ -615,14 +616,16 @@ public class PortGenerator {
source.append("TtcnLogger.log_str(TtcnLogger.Severity.MATCHING_MMUNSUCC, MessageFormat.format(\"Matching on port {0} failed: Sender of the first message in the queue is not the system.\" ,get_name()));\n");
source.append("return TitanAlt_Status.ALT_NO;\n");
source.append("} else if (my_head.sender_address == null) {\n");
source.append(MessageFormat.format("throw new TtcnError(MessageFormat.format(\"{0} operation on port '{'0'}' requires the address of the sender, which was not given by the test port.\", get_name());\n", functionName));
source.append(MessageFormat.format("throw new TtcnError(MessageFormat.format(\"{0} operation on port '{'0'}' requires the address of the sender, which was not given by the test port.\", get_name()));\n", functionName));
source.append("} else if (!sender_template.match(my_head.sender_address, false)) {\n");
source.append("if(TtcnLogger.log_this_event(TtcnLogger.Severity.MATCHING_MMUNSUCC)) {\n");
source.append("TtcnLogger.begin_event(TtcnLogger.Severity.MATCHING_MMUNSUCC);");
source.append("TtcnLogger.log_event(\"Matching on port {0}: Sender address of the first message in the queue does not match the from clause: \", get_name());\n");
source.append("sender_template.log_match(new TitanComponent(my_head.sender_adress), false);\n");
source.append("TtcnLogger.end_event()");
source.append("//FIXME: TTCN_Logger::log_matching_failure() missing\n");
source.append("sender_template.log_match(my_head.sender_address, false);\n");
source.append("TtcnLogger.end_event();\n");
source.append("TtcnLogger.begin_event_log2str();\n");
source.append("sender_template.log_match(my_head.sender_address);\n");
source.append("TtcnLogger.log_matching_failure(TitanLoggerApi.PortType.enum_type.message__, port_name, my_head.sender_component, TitanLoggerApi.MatchingFailureType_reason.enum_type.message__does__not__match__template, TtcnLogger.end_event_log2str());\n");
source.append("}\n");
source.append("return TitanAlt_Status.ALT_NO;\n");
source.append('}');
......@@ -650,9 +653,10 @@ public class PortGenerator {
if(isAddress) {
source.append("TtcnLogger.log(TtcnLogger.Severity.MATCHING_MMSUCCESS, MessageFormat.format(\"Matching on port {0} succeeded.\", get_name()));\n");
source.append("if (TtcnLogger.log_this_event(TtcnLogger.Severity.PORTEVENT_MMRECV)) {\n");
source.append("TtcnLogger.begin_event_log2str();\n");
source.append("my_head.sender_address.log();\n");
source.append(MessageFormat.format("TtcnLogger.log_msgport_recv(get_name(), TitanLoggerApi.Msg__port__recv_operation.enum_type.{0} , TitanComponent.SYSTEM_COMPREF, new TitanCharString(\"\") ,", logger_operation));
source.append("(TtcnLogger.begin_event(TtcnLogger.Severity.PORTEVENT_MMRECV), my_head.sender_adress.log(), TtcnLogger.end_event_log2str()), ");
source.append("msg_head_count+1);\n");
source.append("TtcnLogger.end_event_log2str(), msg_head_count+1);\n");
source.append("}\n");
} else {
source.append("TtcnLogger.log(my_head.sender_component == TitanComponent.SYSTEM_COMPREF ? TtcnLogger.Severity.MATCHING_MMSUCCESS : TtcnLogger.Severity.MATCHING_MCSUCCESS, ");
......@@ -727,7 +731,9 @@ public class PortGenerator {
source.append("TtcnLogger.log_event(\"Matching on port {0}: Sender address of the first message in the queue does not match the from clause: \", port_name);\n");
source.append("sender_template.log_match(new TitanComponent(my_head.sender_component), false);\n");
source.append("TtcnLogger.end_event();\n");
source.append("//FIXME: TTCN_Logger::log_matching_failure() missing\n");
source.append("TtcnLogger.begin_event_log2str();\n");
source.append("sender_template.log_match(my_head.sender_address);\n");
source.append("TtcnLogger.log_matching_failure(TitanLoggerApi.PortType.enum_type.message__, port_name, my_head.sender_component, TitanLoggerApi.MatchingFailureType_reason.enum_type.message__does__not__match__template, TtcnLogger.end_event_log2str());\n");
source.append("remove_msg_queue_head();\n");
source.append("return TitanAlt_Status.ALT_REPEAT;\n");
source.append("}\n");
......@@ -759,7 +765,7 @@ public class PortGenerator {
source.append("if (TtcnLogger.log_this_event(TtcnLogger.Severity.PORTEVENT_MMRECV)) {\n");
source.append("TtcnLogger.begin_event(TtcnLogger.Severity.PORTEVENT_MMRECV);\n");
source.append("my_head.sender_address.log();\n");
source.append("TtcnLogger.log_msgport_recv(get_name(), TitanLoggerApi.Msg__port__recv_operation.enum_type.trigger__op, TitanComponent.SYSTEM_COMPREF, new TitanCharString(\"\")), TtcnLogger.end_event_log2str(), msg_head_count+1);\n");
source.append("TtcnLogger.log_msgport_recv(get_name(), TitanLoggerApi.Msg__port__recv_operation.enum_type.trigger__op, TitanComponent.SYSTEM_COMPREF, new TitanCharString(\"\"), TtcnLogger.end_event_log2str(), msg_head_count+1);\n");
} else {
source.append("TtcnLogger.log(my_head.sender_component == TitanComponent.SYSTEM_COMPREF ? TtcnLogger.Severity.MATCHING_MMSUCCESS : TtcnLogger.Severity.MATCHING_MCSUCCESS, ");
source.append(" MessageFormat.format(\"Matching on port {0} succeeded.\", get_name()));\n");
......@@ -780,8 +786,8 @@ public class PortGenerator {
source.append("default:\n");
source.append("throw new TtcnError(\"Internal error: unknown message\");\n");
source.append("}\n");
source.append("}\n");
}
source.append("}\n");
source.append("remove_msg_queue_head();\n");
source.append("return TitanAlt_Status.ALT_YES;\n");
source.append("}\n");
......@@ -979,6 +985,8 @@ public class PortGenerator {
if (portDefinition.testportType == TestportType.ADDRESS) {
source.append("if (sender_address != null) {\n");
source.append(MessageFormat.format("new_item.sender_address = new {0}(sender_address);\n", portDefinition.addressName));
source.append("} else {\n");
source.append("new_item.sender_address = null;\n");
source.append("}\n");
}
source.append("message_queue.addLast(new_item);\n");
......@@ -1015,7 +1023,12 @@ public class PortGenerator {
source.append(MessageFormat.format("if (\"{0}\".equals(message_type)) '{'\n", inType.mDisplayName));
source.append(MessageFormat.format("final {0} incoming_par = new {0}();\n", inType.mJavaTypeName));
source.append("incoming_par.decode_text(incoming_buf);\n");
source.append("incoming_message(incoming_par, sender_component);\n");
source.append("incoming_message(incoming_par, sender_component");
//FIXME add support for sliding
if (portDefinition.testportType == TestportType.ADDRESS) {
source.append(", null");
}
source.append(");\n");
source.append("return true;\n");
source.append("} else ");
}
......@@ -1714,7 +1727,7 @@ public class PortGenerator {
source.append("}\n");
source.append("return TitanAlt_Status.ALT_NO;\n");
source.append("} else {\n");
source.append("//FIXME set param_ref\n");
source.append(MessageFormat.format("catch_template.set_value(head.exception_{0});\n", index));
source.append("if (sender_pointer != null) {\n");
if (isAddress) {
source.append("sender_pointer.assign(head.sender_address);\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment