function writeAction<"duration">(theAction : node, sLanguage : value) {
localref theEntry = theAction.crossroad_entry;
@ {
@
switch(sLanguage) {
case "C++":
{
@ int durations[] = {@
}
case "Java":
{
@ int[] durations = {@
}
}
foreach i in theAction.durations {
if !i.first() {
@, @
}
@@i@@
}
@, -1};
setDuration("@theEntry.street@", "@theEntry.crossroad@", "@theEntry.direction@", durations);
}
@
}
function writeAction<"activate">(theAction : node, sLanguage : value) {
@ activateStrategy("@theAction.strategy@");
@
}
function writeAction<"desactivate">(theAction : node, sLanguage : value) {
@ bActive_ = false;
@
}
function convertAntecedent2Cpp(sAntecedent : value) {
return translateString({
#implicitCopy
antecedent ::=
[
#readCString
|
#readIdentifier:sId
[
#check(sId == "vehicles_hour")
#continue
'('
#explicitCopy
=> local theSegment;
street_segment(theSegment)
')'
=> {
@"@theSegment.street@", "@theSegment.crossroad@", "@theSegment.direction@")@
}
]?
|
~#empty
]*
;
street_segment(theSegment : node) ::=
#readIdentifier:theSegment.crossroad
#continue "->"
=> insert theSegment.direction = "c->s";
#readCString:theSegment.street
|
#readCString:theSegment.street
#continue "->"
=> insert theSegment.direction = "s->c";
#readIdentifier:theSegment.crossroad
;
}, this, sAntecedent)
;
}

Generated by CodeWorker v3.10.3 from CWscript2HTML.cwp.