|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--inria.meije.rc.sugarcubes.SC
The class SC allows one to build reactive programs, instanciating reactive instructions. It provides many static methods allowing one to build easily reactive primitives without having to take care about actual implementation of those primitives. In addition, it offers some syntactic facilities to build your reactive programs. Each static method, which describes a SugarCubes primitive, has:
Warning: This documentation is still under construction and is at an early stage! Don't hesitate to send any comment to Jean-Ferdy Susini.
Rules of semantics are given using Structural Operating Semantics formalism [Plotkin] and more precisely using the following format:Conditionnal rules are of the form:
Pre-conditions are placed in the numerator and rewritting is given at the denominator.
Atomic operations are described as follow:
where a is an atomic operation which is executed in an event environment E and a Java Environment J and returns a value rho (many types of value can be used including: integers, booleans, Strings, Identifiers, Programs, Objects) or void (meaning that no value is returned by the execution of this atomic operation).
Field Summary | |
static InternalIdentifiers |
INTERNAL_STRING_IDENTIFIERS
The field INTERNAL_STRING_IDENTIFIERS is a standard implementation of InternalIdentifiers used by default by reactive machines. |
static JavaAction |
NO_ACTION
The NO_ACTION field is an atomic action, which does nothing. |
static JavaCallback |
NO_CALLBACK
The NO_CALLBACK field is an atomic callback action, which does nothing. |
static Program |
NOTHING
The reactive instruction Nothing is statically defined as the field NOTHING. |
static Argument[] |
PURE_EVENT
Array of values used to generate non-valuated occurrence of event in the system. |
Method Summary | |
static Program |
action(JavaAction action)
Action implements an atomic action, that is to say some standard Java code implemented in a JavaAction by the programmer. |
static Program |
add(JavaStringExpression nameExp,
JavaProgramExpression programExp)
|
static Program |
add(JavaStringExpression nameExp,
Program program)
|
static Program |
add(java.lang.String name,
JavaProgramExpression programExp)
|
static Program |
add(java.lang.String name,
Program program)
|
static Program |
addToBehavior(java.lang.String name,
Program body)
|
static Configuration |
and(Configuration c1,
Configuration c2)
|
static Program |
await(Configuration config)
|
static Program |
await(Identifier anIdentifier)
|
static Program |
await(JavaIdentifierExpression evtExp)
|
static Program |
await(java.lang.String evt)
|
static Program |
behavior(java.lang.String name,
Program body)
|
static Program |
behavior(java.lang.String name,
java.util.Vector parameters,
Program body)
|
static Program |
callback(Identifier identifier,
JavaCallback action)
|
static Program |
callback(JavaIdentifierExpression identifierExp,
JavaCallback action)
|
static Program |
callback(java.lang.String event,
JavaCallback action)
|
static Program |
close(Program program)
Close activates a reactive program while it returns the SUSP status. |
static Program |
control(Identifier anIdentifier,
Program body)
|
static Program |
control(JavaIdentifierExpression evtExp,
Program body)
|
static Program |
control(java.lang.String evt,
Program body)
|
static Program |
cube(JavaStringExpression nameExp,
JavaObjectExpression objectExp,
Program body)
|
static Program |
cube(JavaStringExpression nameExp,
JavaObjectExpression objectExp,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
cube(JavaStringExpression nameExp,
java.lang.Object object,
Program body)
|
static Program |
cube(JavaStringExpression nameExp,
java.lang.Object object,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
cube(java.lang.String name,
JavaObjectExpression objectExp,
Program body)
|
static Program |
cube(java.lang.String name,
JavaObjectExpression objectExp,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
cube(java.lang.String name,
java.lang.Object object,
Program body)
|
static Program |
cube(java.lang.String name,
java.lang.Object object,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
destroy(JavaStringExpression targetNameExp)
|
static Program |
destroy(java.lang.String targetName)
|
static Program |
freezable(JavaStringExpression nameExp,
Program body)
|
static Program |
freezable(java.lang.String name,
Program body)
|
static Program |
freeze(JavaStringExpression nameExp)
|
static Program |
freeze(java.lang.String name)
|
static Program |
generate(Identifier anIdentifier)
|
static Program |
generate(JavaIdentifierExpression evtExp)
|
static Program |
generate(JavaIdentifierExpression evtExp,
Argument[] args)
|
static Program |
generate(JavaIdentifierExpression evtExp,
JavaArgumentsExpression argExp)
|
static Program |
generate(java.lang.String evt)
|
static Program |
generate(java.lang.String evt,
Argument[] args)
|
static Program |
generate(java.lang.String evt,
JavaArgumentsExpression argExp)
|
static Program |
halt()
Pauses the execution of a sequence for ever. |
static Program |
If(JavaBooleanExpression condition,
Program thenBranch)
|
static Program |
If(JavaBooleanExpression condition,
Program thenBranch,
Program elseBranch)
|
static Program |
inputLocalEvent(java.lang.String localName,
JavaIdentifierExpression actualNameExp,
Program body)
|
static Program |
inputLocalEvent(java.lang.String localName,
java.lang.String actualName,
Program body)
|
static Program |
IOLocalEvent(java.lang.String localName,
JavaIdentifierExpression actualNameExp,
Program body)
|
static Program |
IOLocalEvent(java.lang.String localName,
java.lang.String actualName,
Program body)
|
static Program |
link(JavaObjectExpression objectExp,
Program body)
|
static Program |
link(JavaObjectExpression objectExp,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
link(java.lang.Object object,
Program body)
|
static Program |
link(java.lang.Object object,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
localEvent(Identifier aLocalEventIdentifier,
Program body)
|
static Program |
localEvent(java.lang.String localName,
Program body)
|
static Program |
localVariable(java.lang.String varName,
java.lang.Class varType,
JavaObjectExpression initialValue,
Program body)
|
static Program |
localVariable(java.lang.String varName,
java.lang.Class varType,
JavaObjectExpression initialValue,
Program body,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Program |
localVariable(java.lang.String varName,
java.lang.Class varType,
Program body)
|
static Program |
loop(Program body)
|
static Machine |
machine()
|
static Machine |
machine(InternalIdentifiers anIdentifierGenerator)
|
static Machine |
machine(InternalIdentifiers anIdentifierGenerator,
Program program)
|
static Machine |
machine(Program program)
|
static Program |
merge(Program p1,
Program p2)
|
static Program |
merge(Program p1,
Program p2,
Program p3)
|
static Program |
merge(Program p1,
Program p2,
Program p3,
Program p4)
|
static Configuration |
not(Configuration c)
|
static Configuration |
not(JavaIdentifierExpression evtExp)
|
static Configuration |
not(java.lang.String evt)
|
static Program |
nothing()
The nothing instruction does... |
static void |
optimize(Program p)
|
static Configuration |
or(Configuration c1,
Configuration c2)
|
static Program |
outputLocalEvent(java.lang.String localName,
JavaIdentifierExpression actualNameExp,
Program body)
|
static Program |
outputLocalEvent(java.lang.String localName,
java.lang.String actualName,
Program body)
|
static Program |
pause(int pauseLength)
Pauses the execution of a sequence for a finite number of instants. |
static Program |
pause(JavaIntegerExpression pauseLengthExp)
Pauses the execution of a sequence for a finite number of instants (determined at run-time by evaluating the integer expression). |
static Configuration |
presence(Identifier anIdentifer)
|
static Configuration |
presence(JavaIdentifierExpression evtExp)
|
static Configuration |
presence(java.lang.String evt)
|
static Program |
print(JavaStringExpression messageExp)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard output stream. |
static Program |
print(java.lang.String message)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard output stream. |
static Program |
printError(JavaStringExpression errorExp)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard error stream. |
static Program |
printError(java.lang.String error)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard error stream. |
static Program |
printTime(java.lang.String message,
java.lang.Object timer)
|
static Program |
reactiveThread(Program aProgramBody,
Identifier aStartEvent,
Identifier aStopEvent,
Identifier aSuspendEvent,
Identifier aResumeEvent,
int aPriority,
InternalIdentifiers anIternalIdentifierGenerator)
|
static Program |
repeat(int counter,
Program body)
|
static Program |
repeat(JavaIntegerExpression counterExp,
Program body)
|
static Program |
Rif(JavaBooleanExpression condition,
Program thenBranch,
Program elseBranch)
|
static Program |
run(JavaStringExpression nameExp,
java.util.Vector parameters)
|
static Program |
run(java.lang.String name,
java.util.Vector parameters)
|
static Program |
seq(Program p1,
Program p2)
|
static Program |
seq(Program p1,
Program p2,
Program p3)
|
static Program |
seq(Program p1,
Program p2,
Program p3,
Program p4)
|
static Program |
seq(Program p1,
Program p2,
Program p3,
Program p4,
Program p5)
|
static Program |
seq(Program p1,
Program p2,
Program p3,
Program p4,
Program p5,
Program p6)
|
static Program |
seq(Program p1,
Program p2,
Program p3,
Program p4,
Program p5,
Program p6,
Program p7)
|
static Program |
seq(Program p1,
Program p2,
Program p3,
Program p4,
Program p5,
Program p6,
Program p7,
Program p8)
|
static Program |
shell(JavaStringExpression nameExp,
Program body)
|
static Program |
shell(java.lang.String name,
Program body)
|
static Program |
startTimer(java.lang.Object timer)
|
static Program |
stop()
The stop instruction allows one to indicate explicitly the end of the current instant in a sequence. |
static Program |
suspend()
Suspends the execution of a sequence during an instant for one microstep of execution. |
static java.lang.Object |
timer()
|
static Program |
until(Configuration config,
Program body)
|
static Program |
until(Configuration config,
Program body,
Program handler)
|
static Program |
until(JavaIdentifierExpression evtExp,
Program body)
|
static Program |
until(JavaIdentifierExpression evtExp,
Program body,
Program handler)
|
static Program |
until(java.lang.String evt,
Program body)
|
static Program |
until(java.lang.String evt,
Program body,
Program handler)
|
static Machine |
voidMachine()
|
static Machine |
voidMachine(InternalIdentifiers anIdentifierGenerator)
|
static Machine |
voidMachine(InternalIdentifiers anIdentifierGenerator,
JavaStringExpression nameExp,
JavaObjectExpression objExp,
Program program,
JavaAction onTerminate,
JavaAction onFreeze,
JavaAction onWarmup)
|
static Machine |
voidMachine(InternalIdentifiers anIdentifierGenerator,
Program program)
|
static Machine |
voidMachine(Program program)
|
static Program |
when(Configuration config,
Program thenBranch,
Program elseBranch)
|
static Program |
when(JavaIdentifierExpression evtExp,
Program thenBranch,
Program elseBranch)
|
static Program |
when(java.lang.String evt,
Program thenBranch,
Program elseBranch)
|
static Program |
whileRepeat(JavaBooleanExpression condition,
Program body)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final InternalIdentifiers INTERNAL_STRING_IDENTIFIERS
public static final JavaAction NO_ACTION
public static final JavaCallback NO_CALLBACK
public static final Program NOTHING
public static final Argument[] PURE_EVENT
Method Detail |
public static Program action(JavaAction action)
Action implements an atomic action, that is to say some standard Java code implemented in a JavaAction by the programmer. When the control flow falls to an action instruction, it calls the execute method of the JavaAction that is implemented by the programmer and given as parameter at the construction.
Syntax: SC.action(anAtomicJavaAction)
Example: SC.seq(SC.action(A),SC.print("Hello World!")))
.
This program executes the java action A in an atomic way. That means that the reactive mechanism ensures that no other reactive concurrent process can be interleave during execution of the action. That way, no locks are needed if only reactive concurrency can occur (that means no use of Java thread). Then the print instruction takes place in sequence. The print instruction itself is an atomic action implemented using an action instruction: SC.action(new ThePrintJavaAction("Hello World!"))
. Where the execute method of ThePrintJavaAction simply execute the System.out.print
call, with the appropriate string.
Semantics:
public static Program add(JavaStringExpression nameExp, JavaProgramExpression programExp)
public static Program add(JavaStringExpression nameExp, Program program)
public static Program add(java.lang.String name, JavaProgramExpression programExp)
public static Program add(java.lang.String name, Program program)
public static Program addToBehavior(java.lang.String name, Program body)
public static Configuration and(Configuration c1, Configuration c2)
public static Program await(Configuration config)
public static Program await(Identifier anIdentifier)
public static Program await(JavaIdentifierExpression evtExp)
public static Program await(java.lang.String evt)
public static Program behavior(java.lang.String name, Program body)
public static Program behavior(java.lang.String name, java.util.Vector parameters, Program body)
public static Program callback(Identifier identifier, JavaCallback action)
public static Program callback(JavaIdentifierExpression identifierExp, JavaCallback action)
public static Program callback(java.lang.String event, JavaCallback action)
public static Program close(Program program)
Close activates a reactive program while it returns the SUSP status. So while SUSP is returned by its body, Close doesn't allow other parallel components to be executed.
Syntax: SC.close(aProgram)
Example: SC.close(SC.seq(SC.print("instant 1\n"),SC.suspend(),SC.print("still in instant 1")))
.
This program prints the messages 'instant 1'
and 'still in instant 1'
exactly in the same microstep because of the close operator. It is strictly equivalent to write : SC.seq(SC.print("instant 1\n"),SC.print("still in instant 1"))
.
Semantics:
public static Program control(Identifier anIdentifier, Program body)
public static Program control(JavaIdentifierExpression evtExp, Program body)
public static Program control(java.lang.String evt, Program body)
public static Program cube(JavaStringExpression nameExp, JavaObjectExpression objectExp, Program body)
public static Program cube(JavaStringExpression nameExp, JavaObjectExpression objectExp, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program cube(JavaStringExpression nameExp, java.lang.Object object, Program body)
public static Program cube(JavaStringExpression nameExp, java.lang.Object object, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program cube(java.lang.String name, JavaObjectExpression objectExp, Program body)
public static Program cube(java.lang.String name, JavaObjectExpression objectExp, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program cube(java.lang.String name, java.lang.Object object, Program body)
public static Program cube(java.lang.String name, java.lang.Object object, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program destroy(JavaStringExpression targetNameExp)
public static Program destroy(java.lang.String targetName)
public static Program freezable(JavaStringExpression nameExp, Program body)
public static Program freezable(java.lang.String name, Program body)
public static Program freeze(JavaStringExpression nameExp)
public static Program freeze(java.lang.String name)
public static Program generate(Identifier anIdentifier)
public static Program generate(JavaIdentifierExpression evtExp)
public static Program generate(JavaIdentifierExpression evtExp, Argument[] args)
public static Program generate(JavaIdentifierExpression evtExp, JavaArgumentsExpression argExp)
public static Program generate(java.lang.String evt)
public static Program generate(java.lang.String evt, Argument[] args)
public static Program generate(java.lang.String evt, JavaArgumentsExpression argExp)
public static Program halt()
Pauses the execution of a sequence for ever. This construction is equivalent to write the following program: SC.loop(SC.stop())
.
Syntax: SC.halt()
Example: SC.seq(SC.print("instant 1\n"),SC.halt())
.
This program prints the message 'instant 1'
at the first instant of its execution and will stop at each subsequent instant of execution, never ending.
Semantics:
public static Program If(JavaBooleanExpression condition, Program thenBranch)
public static Program If(JavaBooleanExpression condition, Program thenBranch, Program elseBranch)
public static Program inputLocalEvent(java.lang.String localName, JavaIdentifierExpression actualNameExp, Program body)
public static Program inputLocalEvent(java.lang.String localName, java.lang.String actualName, Program body)
public static Program IOLocalEvent(java.lang.String localName, JavaIdentifierExpression actualNameExp, Program body)
public static Program IOLocalEvent(java.lang.String localName, java.lang.String actualName, Program body)
public static Program link(JavaObjectExpression objectExp, Program body)
public static Program link(JavaObjectExpression objectExp, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program link(java.lang.Object object, Program body)
public static Program link(java.lang.Object object, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program localEvent(Identifier aLocalEventIdentifier, Program body)
public static Program localEvent(java.lang.String localName, Program body)
public static Program localVariable(java.lang.String varName, java.lang.Class varType, JavaObjectExpression initialValue, Program body)
public static Program localVariable(java.lang.String varName, java.lang.Class varType, JavaObjectExpression initialValue, Program body, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Program localVariable(java.lang.String varName, java.lang.Class varType, Program body)
public static Program loop(Program body)
public static Machine machine()
public static Machine machine(InternalIdentifiers anIdentifierGenerator)
public static Machine machine(InternalIdentifiers anIdentifierGenerator, Program program)
public static Machine machine(Program program)
public static Program merge(Program p1, Program p2)
public static Program merge(Program p1, Program p2, Program p3)
public static Program merge(Program p1, Program p2, Program p3, Program p4)
public static Configuration not(Configuration c)
public static Configuration not(JavaIdentifierExpression evtExp)
public static Configuration not(java.lang.String evt)
public static Program nothing()
The nothing instruction does... nothing.
Syntax: SC.nothing()
Example: This instruction is rarely used as in general programmers want to program something to do something, which unfortunately is not a single instruction in SugarCubes ;-).
It can be used for example when one want to specify a handler that does nothing in an Until operator.
Semantics:
public static void optimize(Program p)
public static Configuration or(Configuration c1, Configuration c2)
public static Program outputLocalEvent(java.lang.String localName, JavaIdentifierExpression actualNameExp, Program body)
public static Program outputLocalEvent(java.lang.String localName, java.lang.String actualName, Program body)
public static Program pause(int pauseLength)
Pauses the execution of a sequence for a finite number of instants. This construction is equivalent to write the following program: SC.repeat(new JavaIntegerValue(pauseLength),SC.stop())
.
Syntax: SC.pause(anInt)
Example: SC.seq(SC.print("instant 1\n"),SC.pause(5),SC.print("instant 6"))
The program displays the message 'instant 1'
at the first instant of its execution then stop for the 5 (here the value is fixed when the program is built: no evaluation at run-time) subsquent instants and then at the sixth instant displays 'instant 6'
and terminates.
Semantics:
Given by the translation.
public static Program pause(JavaIntegerExpression pauseLengthExp)
Pauses the execution of a sequence for a finite number of instants (determined at run-time by evaluating the integer expression). This construction is equivalent to write the following program: SC.repeat(pauseLengthExp,SC.stop())
.
Syntax: SC.pause(aJavaIntegerExpression)
Example:
SC.seq(
SC.print("instant 1\n")
,SC.pause(new JavaIntegerValue(5))
,SC.print("instant 6"))
The program displays the message 'instant 1'
at the first instant of its execution then stop for the 5 (this vale is eveluated at run-time when the control ends for the first time to the pause instruction. But in this case, the integer expression is only a constant value: 5) subsquent instants and then at the sixth instant displays 'instant 6'
and terminates.
Semantics:
Given by the translation.
public static Configuration presence(Identifier anIdentifer)
public static Configuration presence(JavaIdentifierExpression evtExp)
public static Configuration presence(java.lang.String evt)
public static Program print(JavaStringExpression messageExp)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard output stream. The string that contains the message is computed at runtime by evaluation of the JavaStringExpression.
Syntax: SC.print(aJavaStringExpression)
Example: SC.print(new MyJavaStringExpression())
.
The evaluate
method of the class MyJavaStringExpression (which is implemented by the programmer) computes the string containing the message to display, when the execution control falls on the print instruction. Using this string the print instruction performs a System.out.print
call, to display the message on the standard output stream.
Semantics: (See semantics of atomic actions)
public static Program print(java.lang.String message)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard output stream.
Syntax: SC.print(aStringMessage)
Example: SC.print("Hello World!")
.
The print instruction itself is an atomic action implemented using an action instruction: SC.action(new ThePrintJavaAction("Hello World!"))
. Where the execute
method of ThePrintJavaAction
simply execute the System.out.print
call, with the appropriate string.
Semantics: (See semantics of atomic actions)
public static Program printError(JavaStringExpression errorExp)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard error stream. The string that contains the message is computed at runtime by evaluation of the JavaStringExpression.
Syntax: SC.printError(aJavaStringExpression)
Example: SC.printError(new MyJavaStringExpression())
.
The evaluate
method of the class MyJavaStringExpression
(which is implemented by the programmer) computes the string containing the message to display, when the execution control falls on the printError
instruction. Using this string the print instruction performs a System.err.print
call, to display the message on the standard error stream.
Semantics: (See semantics of atomic actions)
public static Program printError(java.lang.String error)
Print is a syntaxic facility to execute an atomic action, that prints a message (a string) on the standard error stream.
Syntax: SC.printError(aStringMessage)
Example: SC.printError("Error!")
.
The printError
instruction itself is an atomic action implemented using an action instruction: SC.action(new ThePrintErrorJavaAction("Error!"))
. Where the execute
method of ThePrintErrorJavaAction
simply execute the System.err.print
call, with the appropriate string.
Semantics: (See semantics of atomic actions)
public static Program printTime(java.lang.String message, java.lang.Object timer)
public static Program reactiveThread(Program aProgramBody, Identifier aStartEvent, Identifier aStopEvent, Identifier aSuspendEvent, Identifier aResumeEvent, int aPriority, InternalIdentifiers anIternalIdentifierGenerator)
public static Program repeat(int counter, Program body)
public static Program repeat(JavaIntegerExpression counterExp, Program body)
public static Program Rif(JavaBooleanExpression condition, Program thenBranch, Program elseBranch)
public static Program run(JavaStringExpression nameExp, java.util.Vector parameters)
public static Program run(java.lang.String name, java.util.Vector parameters)
public static Program seq(Program p1, Program p2)
public static Program seq(Program p1, Program p2, Program p3)
public static Program seq(Program p1, Program p2, Program p3, Program p4)
public static Program seq(Program p1, Program p2, Program p3, Program p4, Program p5)
public static Program seq(Program p1, Program p2, Program p3, Program p4, Program p5, Program p6)
public static Program seq(Program p1, Program p2, Program p3, Program p4, Program p5, Program p6, Program p7)
public static Program seq(Program p1, Program p2, Program p3, Program p4, Program p5, Program p6, Program p7, Program p8)
public static Program shell(JavaStringExpression nameExp, Program body)
public static Program shell(java.lang.String name, Program body)
public static Program startTimer(java.lang.Object timer)
public static Program stop()
The stop instruction allows one to indicate explicitly the end of the current instant in a sequence.
Syntax: SC.stop()
Example: SC.seq(SC.print("instant 1\n"),SC.stop(),SC.print("instant 2"))
.
The stop instruction stops the execution of the program, so the message 'instant 2'
is displayed at the next instant.
Semantics:
public static Program suspend()
Suspends the execution of a sequence during an instant for one microstep of execution. The execution of the suspended branch must continue during the same instant at the next microstep.
Syntax: SC.suspend()
Example: SC.seq(SC.print("instant 1\n"),SC.suspend(),SC.print("still in instant 1"))
.
This program prints the message 'instant 1'
at the first activation, then it suspends itself to allow other parallel components to be executed, then at the next microstep it will print the message 'still in instant 1'
before the end of the first instant.
Semantics:
public static java.lang.Object timer()
public static Program until(Configuration config, Program body)
public static Program until(Configuration config, Program body, Program handler)
public static Program until(JavaIdentifierExpression evtExp, Program body)
public static Program until(JavaIdentifierExpression evtExp, Program body, Program handler)
public static Program until(java.lang.String evt, Program body)
public static Program until(java.lang.String evt, Program body, Program handler)
public static Machine voidMachine()
public static Machine voidMachine(InternalIdentifiers anIdentifierGenerator)
public static Machine voidMachine(InternalIdentifiers anIdentifierGenerator, JavaStringExpression nameExp, JavaObjectExpression objExp, Program program, JavaAction onTerminate, JavaAction onFreeze, JavaAction onWarmup)
public static Machine voidMachine(InternalIdentifiers anIdentifierGenerator, Program program)
public static Machine voidMachine(Program program)
public static Program when(Configuration config, Program thenBranch, Program elseBranch)
public static Program when(JavaIdentifierExpression evtExp, Program thenBranch, Program elseBranch)
public static Program when(java.lang.String evt, Program thenBranch, Program elseBranch)
public static Program whileRepeat(JavaBooleanExpression condition, Program body)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |