/carl

Term Rewriting System (TRS) to transform expression trees based on user-defined rewrite rules

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Development moved

Project moved to gitlab under the name 'openbirch': https://gitlab.com/Sveske-Juice/openbirch

Build

make to build main carl executable

make tests for unit tests

make docs for Doxygen documentation

BNF of language

<program>               ::= <command>* EOF

<command>               ::= <showStatement> | <applyStatement> | <defineStatement> | <statement>
<showStatement>         ::= "show" <expression> ";"
<applyStatement>        ::= "apply" IDENTIFIER ":" <expression> ";"
<defineStatement>       ::= "define" IDENTIFIER "->" <expression> "=" <expression> ";"

<statement>             ::= <expressionStatement> ";"
<expressionStatement>   ::= <expression>

<expression>            ::= <equality>
<equality>              ::= <comparison> ( ("!=" | "==") <comparison> )*
<comparison>            ::= <term> ( ( ">" | ">=" | "<" | "<=" ) <term> )*
<term>                  ::= <factor> ( ( "+" | "-" ) <factor> )*
<factor>                ::= ( "!" | "-" ) <unary> | <primary>
<primary>               ::= NUMBER | STRING | IDENTIFIER | false | true