Commit 93318409 authored by Kristof Szabados's avatar Kristof Szabados Committed by GitHub
Browse files

Merge pull request #254 from GergoUjhelyi/master

array_type fix and port method
parents 4f1bbac5 7ad6f0ba
......@@ -7,6 +7,7 @@
******************************************************************************/
package org.eclipse.titan.designer.AST.TTCN3.statements;
import java.text.MessageFormat;
import java.util.List;
import org.eclipse.titan.designer.AST.ASTVisitor;
......@@ -15,6 +16,7 @@ import org.eclipse.titan.designer.AST.Reference;
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.compiler.JavaGenData;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException;
import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater;
......@@ -110,4 +112,10 @@ public final class Stop_Port_Statement extends Statement {
}
return true;
}
@Override
/** {@inheritDoc} */
public void generateCode( final JavaGenData aData, final StringBuilder source ) {
source.append(MessageFormat.format("{0}.stop();\n", portReference.getRefdAssignment(getLastTimeChecked(), false).getGenName()));
}
}
......@@ -962,7 +962,7 @@ public final class Array_Type extends Type implements IReferenceableElement {
source.append(MessageFormat.format("public static class {0} extends {1} '{' \n", ownName, valueName));
source.append(MessageFormat.format("public {0}() '{'\n", ownName));
source.append(MessageFormat.format("super({0}.class);\n",elementName));
source.append(MessageFormat.format("super({0}.class, {1},{2});\n",elementName,dimension.getSize(), dimension.getOffset()));
source.append("}\n");
source.append(MessageFormat.format("public {0}({0} otherValue) '{'\n", ownName));
source.append("super(otherValue);\n");
......
......@@ -163,9 +163,19 @@ public class TitanPort {
if (!is_active) {
throw new TtcnError(MessageFormat.format("Internal error: Inactive port {0} cannot be stopped.", portName));
}
//FIXME implement
is_started = false;
userStop();
if(is_started) {
is_started = false;
is_halted = false;
userStop();
// dropping all messages from the queue because they cannot be extracted by receiving operations anymore
clearQueue();
} else if(is_halted) {
is_halted = false;
clearQueue();
} else {
TtcnError.TtcnWarning(MessageFormat.format("Performing stop operation on port {0}, which is already stopped. The operation has no effect.", portName));
}
//TODO: TTCN_Logger::log_port_state
}
public TitanAlt_Status receive(final TitanComponent_template sender_template, final TitanComponent sender_pointer) {
......@@ -641,7 +651,7 @@ public class TitanPort {
}
portName = name;
}
public void log() {
TtcnLogger.log_event("port %s", portName);
}
......
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