inria.meije.rc.sugarcubes
Class SC

java.lang.Object
  |
  +--inria.meije.rc.sugarcubes.SC

public class SC
extends java.lang.Object

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:

Which means a term t executed in an environment of event E and a Java environment J is rewritten in a term t' in a rewritten environment E', returning the status of execution a where :

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

INTERNAL_STRING_IDENTIFIERS

public static final InternalIdentifiers INTERNAL_STRING_IDENTIFIERS
The field INTERNAL_STRING_IDENTIFIERS is a standard implementation of InternalIdentifiers used by default by reactive machines. This object provides Identifiers based on strings and especially StringIdentifier. User can implement its own type of event identifiers for example based on numbers and then don't use that static object but then has to provide its own implementation of InternalIdentifiers.

NO_ACTION

public static final JavaAction NO_ACTION
The NO_ACTION field is an atomic action, which does nothing.

NO_CALLBACK

public static final JavaCallback NO_CALLBACK
The NO_CALLBACK field is an atomic callback action, which does nothing.

NOTHING

public static final Program NOTHING
The reactive instruction Nothing is statically defined as the field NOTHING. Users should use the SC.nothing() call and not use this field in their program to ensure compatibility.

PURE_EVENT

public static final Argument[] PURE_EVENT
Array of values used to generate non-valuated occurrence of event in the system. If you generate an event with an array of argument of size 0, the event will be considered as a pure event (No value associated to this generation).
Method Detail

action

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:


add

public static Program add(JavaStringExpression nameExp,
                          JavaProgramExpression programExp)

add

public static Program add(JavaStringExpression nameExp,
                          Program program)

add

public static Program add(java.lang.String name,
                          JavaProgramExpression programExp)

add

public static Program add(java.lang.String name,
                          Program program)

addToBehavior

public static Program addToBehavior(java.lang.String name,
                                    Program body)

and

public static Configuration and(Configuration c1,
                                Configuration c2)

await

public static Program await(Configuration config)

await

public static Program await(Identifier anIdentifier)

await

public static Program await(JavaIdentifierExpression evtExp)

await

public static Program await(java.lang.String evt)

behavior

public static Program behavior(java.lang.String name,
                               Program body)

behavior

public static Program behavior(java.lang.String name,
                               java.util.Vector parameters,
                               Program body)

callback

public static Program callback(Identifier identifier,
                               JavaCallback action)

callback

public static Program callback(JavaIdentifierExpression identifierExp,
                               JavaCallback action)

callback

public static Program callback(java.lang.String event,
                               JavaCallback action)

close

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:


control

public static Program control(Identifier anIdentifier,
                              Program body)

control

public static Program control(JavaIdentifierExpression evtExp,
                              Program body)

control

public static Program control(java.lang.String evt,
                              Program body)

cube

public static Program cube(JavaStringExpression nameExp,
                           JavaObjectExpression objectExp,
                           Program body)

cube

public static Program cube(JavaStringExpression nameExp,
                           JavaObjectExpression objectExp,
                           Program body,
                           JavaAction onTerminate,
                           JavaAction onFreeze,
                           JavaAction onWarmup)

cube

public static Program cube(JavaStringExpression nameExp,
                           java.lang.Object object,
                           Program body)

cube

public static Program cube(JavaStringExpression nameExp,
                           java.lang.Object object,
                           Program body,
                           JavaAction onTerminate,
                           JavaAction onFreeze,
                           JavaAction onWarmup)

cube

public static Program cube(java.lang.String name,
                           JavaObjectExpression objectExp,
                           Program body)

cube

public static Program cube(java.lang.String name,
                           JavaObjectExpression objectExp,
                           Program body,
                           JavaAction onTerminate,
                           JavaAction onFreeze,
                           JavaAction onWarmup)

cube

public static Program cube(java.lang.String name,
                           java.lang.Object object,
                           Program body)

cube

public static Program cube(java.lang.String name,
                           java.lang.Object object,
                           Program body,
                           JavaAction onTerminate,
                           JavaAction onFreeze,
                           JavaAction onWarmup)

destroy

public static Program destroy(JavaStringExpression targetNameExp)

destroy

public static Program destroy(java.lang.String targetName)

freezable

public static Program freezable(JavaStringExpression nameExp,
                                Program body)

freezable

public static Program freezable(java.lang.String name,
                                Program body)

freeze

public static Program freeze(JavaStringExpression nameExp)

freeze

public static Program freeze(java.lang.String name)

generate

public static Program generate(Identifier anIdentifier)

generate

public static Program generate(JavaIdentifierExpression evtExp)

generate

public static Program generate(JavaIdentifierExpression evtExp,
                               Argument[] args)

generate

public static Program generate(JavaIdentifierExpression evtExp,
                               JavaArgumentsExpression argExp)

generate

public static Program generate(java.lang.String evt)

generate

public static Program generate(java.lang.String evt,
                               Argument[] args)

generate

public static Program generate(java.lang.String evt,
                               JavaArgumentsExpression argExp)

halt

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:


If

public static Program If(JavaBooleanExpression condition,
                         Program thenBranch)

If

public static Program If(JavaBooleanExpression condition,
                         Program thenBranch,
                         Program elseBranch)

inputLocalEvent

public static Program inputLocalEvent(java.lang.String localName,
                                      JavaIdentifierExpression actualNameExp,
                                      Program body)

inputLocalEvent

public static Program inputLocalEvent(java.lang.String localName,
                                      java.lang.String actualName,
                                      Program body)

IOLocalEvent

public static Program IOLocalEvent(java.lang.String localName,
                                   JavaIdentifierExpression actualNameExp,
                                   Program body)

IOLocalEvent

public static Program IOLocalEvent(java.lang.String localName,
                                   java.lang.String actualName,
                                   Program body)

link

public static Program link(JavaObjectExpression objectExp,
                           Program body)

link

public static Program link(JavaObjectExpression objectExp,
                           Program body,
                           JavaAction onTerminate,
                           JavaAction onFreeze,
                           JavaAction onWarmup)

link

public static Program link(java.lang.Object object,
                           Program body)

link

public static Program link(java.lang.Object object,
                           Program body,
                           JavaAction onTerminate,
                           JavaAction onFreeze,
                           JavaAction onWarmup)

localEvent

public static Program localEvent(Identifier aLocalEventIdentifier,
                                 Program body)

localEvent

public static Program localEvent(java.lang.String localName,
                                 Program body)

localVariable

public static Program localVariable(java.lang.String varName,
                                    java.lang.Class varType,
                                    JavaObjectExpression initialValue,
                                    Program body)

localVariable

public static Program localVariable(java.lang.String varName,
                                    java.lang.Class varType,
                                    JavaObjectExpression initialValue,
                                    Program body,
                                    JavaAction onTerminate,
                                    JavaAction onFreeze,
                                    JavaAction onWarmup)

localVariable

public static Program localVariable(java.lang.String varName,
                                    java.lang.Class varType,
                                    Program body)

loop

public static Program loop(Program body)

machine

public static Machine machine()

machine

public static Machine machine(InternalIdentifiers anIdentifierGenerator)

machine

public static Machine machine(InternalIdentifiers anIdentifierGenerator,
                              Program program)

machine

public static Machine machine(Program program)

merge

public static Program merge(Program p1,
                            Program p2)

merge

public static Program merge(Program p1,
                            Program p2,
                            Program p3)

merge

public static Program merge(Program p1,
                            Program p2,
                            Program p3,
                            Program p4)

not

public static Configuration not(Configuration c)

not

public static Configuration not(JavaIdentifierExpression evtExp)

not

public static Configuration not(java.lang.String evt)

nothing

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:


optimize

public static void optimize(Program p)

or

public static Configuration or(Configuration c1,
                               Configuration c2)

outputLocalEvent

public static Program outputLocalEvent(java.lang.String localName,
                                       JavaIdentifierExpression actualNameExp,
                                       Program body)

outputLocalEvent

public static Program outputLocalEvent(java.lang.String localName,
                                       java.lang.String actualName,
                                       Program body)

pause

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.


pause

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.


presence

public static Configuration presence(Identifier anIdentifer)

presence

public static Configuration presence(JavaIdentifierExpression evtExp)

presence

public static Configuration presence(java.lang.String evt)

print

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)


print

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)


printError

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)


printError

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)


printTime

public static Program printTime(java.lang.String message,
                                java.lang.Object timer)

reactiveThread

public static Program reactiveThread(Program aProgramBody,
                                     Identifier aStartEvent,
                                     Identifier aStopEvent,
                                     Identifier aSuspendEvent,
                                     Identifier aResumeEvent,
                                     int aPriority,
                                     InternalIdentifiers anIternalIdentifierGenerator)

repeat

public static Program repeat(int counter,
                             Program body)

repeat

public static Program repeat(JavaIntegerExpression counterExp,
                             Program body)

Rif

public static Program Rif(JavaBooleanExpression condition,
                          Program thenBranch,
                          Program elseBranch)

run

public static Program run(JavaStringExpression nameExp,
                          java.util.Vector parameters)

run

public static Program run(java.lang.String name,
                          java.util.Vector parameters)

seq

public static Program seq(Program p1,
                          Program p2)

seq

public static Program seq(Program p1,
                          Program p2,
                          Program p3)

seq

public static Program seq(Program p1,
                          Program p2,
                          Program p3,
                          Program p4)

seq

public static Program seq(Program p1,
                          Program p2,
                          Program p3,
                          Program p4,
                          Program p5)

seq

public static Program seq(Program p1,
                          Program p2,
                          Program p3,
                          Program p4,
                          Program p5,
                          Program p6)

seq

public static Program seq(Program p1,
                          Program p2,
                          Program p3,
                          Program p4,
                          Program p5,
                          Program p6,
                          Program p7)

seq

public static Program seq(Program p1,
                          Program p2,
                          Program p3,
                          Program p4,
                          Program p5,
                          Program p6,
                          Program p7,
                          Program p8)

shell

public static Program shell(JavaStringExpression nameExp,
                            Program body)

shell

public static Program shell(java.lang.String name,
                            Program body)

startTimer

public static Program startTimer(java.lang.Object timer)

stop

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:


suspend

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:


timer

public static java.lang.Object timer()

until

public static Program until(Configuration config,
                            Program body)

until

public static Program until(Configuration config,
                            Program body,
                            Program handler)

until

public static Program until(JavaIdentifierExpression evtExp,
                            Program body)

until

public static Program until(JavaIdentifierExpression evtExp,
                            Program body,
                            Program handler)

until

public static Program until(java.lang.String evt,
                            Program body)

until

public static Program until(java.lang.String evt,
                            Program body,
                            Program handler)

voidMachine

public static Machine voidMachine()

voidMachine

public static Machine voidMachine(InternalIdentifiers anIdentifierGenerator)

voidMachine

public static Machine voidMachine(InternalIdentifiers anIdentifierGenerator,
                                  JavaStringExpression nameExp,
                                  JavaObjectExpression objExp,
                                  Program program,
                                  JavaAction onTerminate,
                                  JavaAction onFreeze,
                                  JavaAction onWarmup)

voidMachine

public static Machine voidMachine(InternalIdentifiers anIdentifierGenerator,
                                  Program program)

voidMachine

public static Machine voidMachine(Program program)

when

public static Program when(Configuration config,
                           Program thenBranch,
                           Program elseBranch)

when

public static Program when(JavaIdentifierExpression evtExp,
                           Program thenBranch,
                           Program elseBranch)

when

public static Program when(java.lang.String evt,
                           Program thenBranch,
                           Program elseBranch)

whileRepeat

public static Program whileRepeat(JavaBooleanExpression condition,
                                  Program body)