Commit d8f3e931 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+added support for value assignment



Change-Id: I07fd906ed0299bdee859010feb07bd5777e3e9ad
Signed-off-by: default avatarmakedonski <makedonski@informatik.uni-goettingen.de>
parent 53ae15b3
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1373,6 +1373,16 @@ operation TDL!Interaction executeTarget(t : TDL!Target) : TTCN!FunctionStatement
    tfs.communication.receive.receive.template = new TTCN!InLineTemplate();
    tfs.communication.receive.receive.template.template = self.argument.getTemplateBody();
    
    if (not t.valueAssignment.isEmpty()) {
        var pr = new TTCN!PortRedirect();
        tfs.communication.receive.receive.redirect = pr;
        pr.value = new TTCN!ValueSpec();
        pr.value.variable = new TTCN!VariableRef();
        pr.value.variable.ref = new TTCN!ReferencedValue();
        pr.value.variable.ref.head = new TTCN!Head();
        pr.value.variable.ref.head.target = t.valueAssignment.get(0).variable.equivalent();
    }
    
    tsl.statements.add(tfs);
    tsl.sc.add(";");
    return tsl;
@@ -1581,6 +1591,18 @@ operation TDL!Interaction getGuardOp() : TTCN!GuardOp {
    op.receive.receive = new TTCN!PortReceiveOp();
    op.receive.receive.template = new TTCN!InLineTemplate();
    op.receive.receive.template.template = self.argument.getTemplateBody();

    var t = self.target.first();    
    if (not t.valueAssignment.isEmpty()) {
        var pr = new TTCN!PortRedirect();
        op.receive.receive.redirect = pr;
        pr.value = new TTCN!ValueSpec();
        pr.value.variable = new TTCN!VariableRef();
        pr.value.variable.ref = new TTCN!ReferencedValue();
        pr.value.variable.ref.head = new TTCN!Head();
        pr.value.variable.ref.head.target = t.valueAssignment.get(0).variable.equivalent();
    }
    
    return op;
}