Commit a4d594cc authored by Kristof Szabados's avatar Kristof Szabados
Browse files

add support for index redirection to timers ... but only syntax and storing...


add support for index redirection to timers ... but only syntax and storing for now, now analysis or code generation.
Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent c40f79aa
......@@ -30,14 +30,33 @@ public final class Timeout_Statement extends Statement {
private final Reference timerReference;
//FIXME any from with/without index redirection is only stored, not yet checked
private final boolean any_from;
private final Reference index_redirect;
public Timeout_Statement(final Reference timerReference) {
this.timerReference = timerReference;
this.any_from = false;
this.index_redirect = null;
if (timerReference != null) {
timerReference.setFullNameParent(this);
}
}
public Timeout_Statement(final Reference timerReference, final boolean any_from, final Reference index_redirect) {
this.timerReference = timerReference;
this.any_from = any_from;
this.index_redirect = index_redirect;
if (timerReference != null) {
timerReference.setFullNameParent(this);
}
if (index_redirect != null) {
index_redirect.setFullNameParent(this);
}
}
@Override
/** {@inheritDoc} */
public Statement_type getType() {
......
......@@ -10,6 +10,7 @@ package org.eclipse.titan.designer.AST.TTCN3.values.expressions;
import org.eclipse.titan.designer.AST.ASTVisitor;
import org.eclipse.titan.designer.AST.Assignment;
import org.eclipse.titan.designer.AST.IReferenceChain;
import org.eclipse.titan.designer.AST.Reference;
import org.eclipse.titan.designer.AST.IType.Type_type;
import org.eclipse.titan.designer.AST.IValue;
import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type;
......@@ -25,6 +26,30 @@ import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater;
public final class AnyTimerRunningExpression extends Expression_Value {
private static final String OPERATIONNAME = "any timer.running";
//FIXME any from with/without index redirection is only stored, not yet checked
private final Reference timerReference;
private final boolean any_from;
private final Reference index_redirect;
public AnyTimerRunningExpression() {
this.timerReference = null;
this.any_from = false;
this.index_redirect = null;
}
public AnyTimerRunningExpression(final Reference timerReference, final boolean any_from, final Reference index_redirect) {
this.timerReference = timerReference;
this.any_from = any_from;
this.index_redirect = index_redirect;
if (timerReference != null) {
timerReference.setFullNameParent(this);
}
if (index_redirect != null) {
index_redirect.setFullNameParent(this);
}
}
@Override
/** {@inheritDoc} */
public Operation_type getOperationType() {
......
......@@ -5706,10 +5706,20 @@ pr_TimerStatements returns[Statement statement]
STOP
{ $statement = new Stop_Timer_Statement(null); } //pr_StopTimerStatement
| pr_AnyKeyword
pr_TimerKeyword
pr_Dot
pr_TimeoutKeyword
{ $statement = new Timeout_Statement(null); } //pr_TimeoutStatement
( pr_TimerKeyword
pr_Dot
pr_TimeoutKeyword
{ $statement = new Timeout_Statement(null); } //pr_TimeoutStatement
| pr_FromKeyword
r = pr_TimerRef
pr_Dot
pr_TimeoutKeyword
( pr_PortRedirectSymbol
index = pr_IndexSpec
{ $statement = new Timeout_Statement($r.reference, true, $index.reference); } //pr_TimeoutStatement
| { $statement = new Timeout_Statement($r.reference, true, null); } //pr_TimeoutStatement
)
)
)
{
if($statement != null) {
......@@ -5722,13 +5732,24 @@ pr_TimerOps returns[AnyTimerRunningExpression value]
$value = null;
}:
( col = pr_AnyKeyword
pr_TimerKeyword
pr_Dot
endcol = RUNNING
( pr_TimerKeyword
pr_Dot
RUNNING
{ $value = new AnyTimerRunningExpression(); }
| pr_FromKeyword
r = pr_TimerRef
pr_Dot
RUNNING
( pr_PortRedirectSymbol
index = pr_IndexSpec
{ $value = new AnyTimerRunningExpression($r.reference, true, $index.reference); } //pr_TimeoutStatement
| { $value = new AnyTimerRunningExpression($r.reference, true, null); } //pr_TimeoutStatement
)
)
)
{
$value = new AnyTimerRunningExpression();
$value.setLocation(getLocation( $col.start, $endcol));
$value.setLocation(getLocation( $col.start, getStopToken()));
};
pr_TimeoutKeyword:
......@@ -6606,7 +6627,17 @@ pr_GuardOp returns[Statement statement]
{ $statement = new Done_Statement($v.value, doneMatch, reference, false); } //Done_Statement
)
| pr_AnyKeyword
pr_TimerKeyword pr_Dot pr_TimeoutKeyword { $statement = new Timeout_Statement(null); }
( pr_TimerKeyword pr_Dot pr_TimeoutKeyword { $statement = new Timeout_Statement(null); }
| pr_FromKeyword
tr = pr_TimerRef
pr_Dot
pr_TimeoutKeyword
( pr_PortRedirectSymbol
index = pr_IndexSpec
{ $statement = new Timeout_Statement($tr.reference, true, $index.reference); } //pr_TimeoutStatement
| { $statement = new Timeout_Statement($tr.reference, true, null); } //pr_TimeoutStatement
)
)
| pr_AnyKeyword
pr_PortKeyword
pr_Dot
......@@ -8035,11 +8066,12 @@ pr_DeterministicModifier:
reportWarning( "Modifier `@deterministic' is not yet supported.", $start, getStopToken() );
};
pr_IndexSpec:
pr_IndexSpec returns[Reference reference]:
i = INDEXKEYWORD
pr_ValueStoreSpec
vss = pr_ValueStoreSpec
{
reportWarning( "Modifier `@index' is not yet supported.", $i );
$reference = $vss.reference;
};
//------------------------------------------------------
......
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