Skip to content

csun-comp430-s20/act

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Act

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

Grammar

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

Assumptions

~ 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.

Requirements

~ g++ version 7+
~ gcov & lcov for coverage report.

Build & Run

In the project directory:

mkdir build
cd build
cmake ..
make
./act <--debug, --info> <input filename: *.act> <log filename: *.txt>
./tests <--debug, --info>

Generate Coverage Report

Run bash gen-coverage.sh from the project root.
Produces a report at coverage/report/index.html.

Resources

~ catch2
~ logging

Acknowledgements

Big thank you to the following github project: dflat

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published