Skip to content
Snippets Groups Projects
Commit 2d4d5e50 authored by pm3g19's avatar pm3g19
Browse files

Added AST rules

parent 644e8fda
No related branches found
No related tags found
No related merge requests found
Prog : .in SetNames .out SetFuncCalls
SetNames : SetName
| SetName, SetNames Prog : .in SetNames .out SetFuncCalls {($2, $4)}
SetNames : SetName {[$1]}
| SetNames, SetName
VarNames : VarName VarNames : VarName
| VarName, VarNames | VarName',' VarNames
SetSetFuncCalls : SetFuncCall {[SetFuncCall]} SetSetFuncCalls : SetFuncCall {[SetFuncCall]}
| SetFuncCall; SetFuncCalls {SetFuncCall:SetFuncCalls} | SetFuncCall; SetFuncCalls {SetFuncCall:SetFuncCalls}
SetFuncCall : filter '['SetName']' (Func) SetFuncCall : filter '['SetName']' '('Func')' {FuncCall (PredefFunc Filter) [$3] [$6]}
--filter[A](\r -> r[2] /= "") --filter[A](\r -> r[2] /= "")
Func : \'('VarNames')' -> Expr Func : \'('VarNames')' -> Expr {FuncDef [] $3 $6}
\(r) -> r[1] == "hello" --\(r) -> r[1] == "hello"
Expr : Expr == Expr
| Expr'['Nat']'
| String
| VarName
| Record
| true
| false
Expr : Expr == Expr {FuncCall (PredefFunc IsEqual) [] [$1, $3]}
| Expr'['Nat']' {FuncCall (PredefFunc RecordIndex) [] [$3]}
| String {String $1}
| VarName {Var $1}
| Record {$1}
| true {Boolean True}
| false {Boolean False}
Record : '['Exprs']' {Record $2}
Exprs : Expr {[$1]}
| Expr','Exprs {$1:$2}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment