The Act Language in the future will utilize the concept of an Actor Model paradigm.
Currently it is only planned to support a single actor that supports the creation of an HSM.
For Comp430 Docs refer to docs folder
Program: DefEvent* State+
State: state NAME '{' Stmt* OnStmt* State* '}'
OnStmt: on NAME '{' GoIfStmt* '}'
Stmt: IfStmt | WhileStmt | DecStmt | AssignStmt
DefEvent: defevent NAME '{' DecStmt* '}' ';'
DecStmt: type NAME '=' Expr ';'
type: 'int' | 'string' | 'bool'
GoIfStmt: GoIf GoElIf* | GoIf GoElIf* GoElse
GoIf: 'goif' '(' Expr ')' NAME '{' Stmt* '}'
GoElIf: 'goelif' '(' Expr ')' NAME '{' Stmt* '}'
GoElse: 'goelse' NAME '{' Stmt* '}'
IfStmt: If ElIf* | If ElIf* Else
If: 'if' '(' Expr ')' '{' Stmt* '}'
ElIf: 'elif' '(' Expr ')' '{' Stmt* '}'
Else: 'else' '{' Stmt* '}'
WhileStmt: 'while' '(' Expr ')' '{' Stmt* '}'
Expr: VarExpr | BinOpExpr | IntExpr | StrExpr | BoolExpr | ParenExpr
BinOpExpr: ValExpr op Expr
op: '+' | '<' | '>' | '==' | '&&'
ParenExpr: '(' Expr ')'
ValExpr: VarExpr | IntExpr | StrExpr | BoolExpr
VarExpr: NAME
IntExpr: NUMBER
StrExpr: STRING
BoolExpr: BOOL
~ Every state has a unique name.
~ Variable names are unique.
~ States are considered static objects and variables are considered globally static.
~ Every state must have exactly one on statement.
~ Since this is not using the actor model yet events are ignored.
~ Needs word mangling in future so unforseen errors do not occur.
~ No declarations in on event statements.
~ g++ version 7+
~ gcov & lcov for coverage report.
In the project directory:
mkdir build
cd build
cmake ..
make
./act <--debug, --info> <input filename: *.act> <log filename: *.txt>
./tests <--debug, --info>
Run bash gen-coverage.sh
from the project root.
Produces a report at coverage/report/index.html.
Big thank you to the following github project: dflat