Table of Contents

Conventions
  • JSValue is a reference to any JavaScript value.
  • JSFunction is a reference to any JavaScript function.
  • JSObject is a reference to a JavaScript object.
  • HHModule is a JavaScript object containing an Hiphop.js program code.
  • Hiphop.js symbols are in bold.
  • Non terminal symbols have the following typo: non-terminal.
  • [ ] contains optional term.
  • { } contains repeatable term.
  • ( ) disambiguate priority.
  • ::= represents an expansion term.
Module
<Module [ signal-decl ] >
stmt
</Module>
  • Entry point of a reactive program.
  • Can defines global signals.
Statements stmt ::=
{ stmt }
<Nothing />
  • Empty statement.
  • Terminates instantaneously.
<Pause />
  • Pause for one instant.
<Halt />
  • Never terminates.
  • Can be aborted.
<Atom apply=JSFunction />
  • Instantaneous execution of given JavaScript function.
<Exec
signal
apply=JSFunction
[ kill=JSFunction ]
[ susp=JSFunction ]
[ res=JSFunction ]
/>
  • Execution of JavaScript function referenced by apply, and wait for terminaison of the routine by the call to this.notify() or this.notifyAndReact() in apply function.
<Emit { signal } [ js-expr ]
[ ifValue=JSValue | ifApply=JSFunction ]
/>
  • Terminates instantaneously.
  • Can emit several signals.
<Sustain { signal } [ js-expr ]
[ ifValue=JSValue | ifApply=JSFunction ]
/>
  • Never terminates.
  • Can be aborted.
  • Can emit several signals.
<Loop> stmt </Loop>
  • Instantaneously start its body.
  • Instantaneously restarts its body when it has terminated.
  • Never terminates, can be aborted or exited.
  • stmt must not be instantaneous.
<If [ not ] delay-expr >
stmt
[ stmt ]
</If>
  • Instantaneously evaluated the delay expression.
  • Takes the then branch if the delay elapses, the else branch otherwise.
<Await delay-expr [ count-expr ] />
  • Terminates when the delay elapses.
  • Instantaneous is immediate keyword is present.
<Abort delay-expr [ count-expr ] >
stmt
</Abort>
  • Absortion; kills the statement when the delay elapses.
<WeakAbort delay-expr [ count-expr ] >
stmt
</WeakAbort>
  • Weak variant of absortion; restarts the statement in the instant where de delay elapses, and kills it at the end of the instant.
<LoopEach delay-expr [ count-expr ] >
stmt
</LoopEach>
  • Temporal loop which is initialy started.
<Every delay-expr [ count-expr ] >
stmt
</Every>
  • Tempooral loop which initially wait the delay expression elapses.
<Suspend delay-expr >
stmt
</Suspend>
  • Keeps the state of its body and pauses for the current instant.
<Trap trap > stmt </Trap>
  • Defines a scope that can be exited by a trap.
<Exit trap />
  • Exit point of a trap.
<Local [ signal-decl ] > stmt </Local>
  • Defines a scope with local signals.
<Run
module=HHModule
[ { signal = signal } ]
/>
  • Inline a module in the current module.
  • By default, signals on the inlined module are binded to signals of the current module, if they have the same name.
  • Can explicitly bind a signal of the inlined module to a signal of the current module.
Signal Declaration signal-decl ::=
{ signal [ =JSObject ] }
  • Defines a signal.
  • The optional given object defines signal properties.
Signal expression signal-expr ::=
[ pre ] [ immediate ] signal
  • Signal expression. Return true if the signal is present.
  • If pre keyword is present, return true if the signal was present on the previous instant.
JavaScript expression js-expr ::=
value=JSValue | apply=JSFunction
  • Defines a JavaScript expression.
  • Signal value and status can be read into the given JSFunction.
Delay expression delay-expr ::=
signal-expr | js-expr
  • Defines a delay expression.
Counter expression count-expr ::=
countValue=JSValue | applyValue=JSFunction
  • Define a counter expression.
Signal name signal ::=
  • Name of a signal.
  • Must be a valid JavaScript identifier.
Trap name trap ::=
  • Name of a trap.
  • Must be a valid JavaScript identifier.