Table of Contents

Formal Syntax

<Expression>  ... | <HHExprStatement>

<HHExprStatement>  hiphop <HHStatement>

<HHStatement>  <HHHop>
  | <HHMachine>
  | <HHModule>
  | <HHInterface>
  | <HHBlock>
  | <HHLet>
  | <HHSignal>
  | <HHHalt>
  | <HHFork>
  | <HHEmit>
  | <HHSustain>
  | <HHAbort>
  | <HHWeakabort>
  | <HHSuspend>
  | <HHLoop>
  | <HHAsync>
  | <HHRun>
  | <HHEvery>
  | <HHDo>
  | <HHIf>
  | <HHTrap>
  | <HHBreak>
  | <HHYield>
  | <HHAwait>
  | <HHDollarExpression>
  | <HHExpression> ; 

<HHHop>  hop <HHStatement>

<HHBlock>  {}
  | { <HHStatement> }
  | { <HHStatement> ... <HHStatement> }

<HHMachine>  machine <HHMachineModule>

<HHModule>  module <HHMachineModule>

<HHMachineModule>  [ <Identifier> ] [implements <MirrorIntfList>] ( <FormalSignalVarList> ) <HHBlock>

<HHInterface>  interface [ <Identifier> ] [extends <IntfList>]

<MirrorIntfList>  [mirror] <Intf>, ... [mirror] <Intf>

<IntfList>  <Intf>, ... <Intf>

<Intf>  <HHDollarIdent>

<FormalSignalValList>  | <GlobalSignalorVar>, ... <GlobalSignalorVar>

<GlobalSignalorVar>  <Direction> <Signal> | var <Identifier>

<GlobalSignal>  <Direction> <Signal>

<Signal>  <Identifier> <Combine>
  | <Direction> <Identifier> = <HHExpression> <Combine>

<Direction>  | in | out | inout

<Combine>  | combine <Expression>

<HHAwait>  await <HHDelay>

<HHExpression>  <Expression>
  | <Identifier>.now
  | <Identifier>.pre
  | <Identifier>.nowval
  | <Identifier>.preval
  | <Identifier>.signame

<HHDelay>  ( <HHExpression> )
  | count( <HHExpression>, <HHExpression> )
  | immediate( <HHExpression> )

<HHLet>  let <Declaration> ... <Declaration>

<Declaration>  <Identifier> | <Identifier> = <HHExpression>

<HHSignal>  signal <Signal> | signal [mirror] <Intf>

<HHalt>  halt

<HHFork>  fork <HHBlock> [ par <HHBlock> ... par <HHBlock> ]

<HHEmit>  emit <Identifier>()
  | emit <Identifier>( <HHExpression> )

<HHSustain>  sustain <Identifier>()
  | sustain <Identifier>( <HHExpression> )

<HHAbort>  abort <HHDelay <HHBlock>

<HHWeakabort>  weakabort <HHDelay <HHBlock>

<HHSuspend>  suspend <HHDelay> <HHBlock>
  | suspend from <HHDelay> to <HHDelay> <HHBlock>
  | suspend from <HHDelay> to <HHDelay> emit <Identifier>() <HHBlock>
  | suspend toggle <HHDelay> <HHBlock>
  | suspend toggle <HHDelay> emit <Identifier>() <HHBlock>

<HHLoop>  loop <HHBlock>

<HHAsync>  async [ <Identifier> ] HHBLock <HHAsyncKill> <HHAsyncSuspend> <HHAsyncResume>

<HHAsyncKill>  | kill <HHBlock>

<HHAsyncSuspend>  | suspend <HHBlock>

<HHAsyncResume>  | resume <HHBlock>

<HHRun>  <HHDollarIdent>( <HHSigRun )

<HHSigRun>  <Identifier>
  | <Identifier> as <Identifier>
  | <Identifer> = <HHExpression> 

<HHEvery>  every <HHDelay> <HHBlock>

<HHDo>  do <HHBlock> every <HHDelay>

<HHIf>  if( <HHExpression> ) <HHStatement>
  | if( <HHExpression> ) <HHStatement> else <HHStatement>

<HHTrap>  <HHLabel> : <HHStatement>

<HHbreak>  break <HHLabel>

<HHYield>  yield

<HHDollarExpression>  ${ <Expression> }

<HHDollarIdent>  <HHDollarExpression> | <Identifier>