[parser] parses and dumps content (without expressions)

This commit is contained in:
dsac
2022-12-07 16:45:55 +01:00
parent 4d304d8e9a
commit e9e5cdcf4d
8 changed files with 245 additions and 0 deletions

25
src/ast.ml Normal file
View File

@@ -0,0 +1,25 @@
type ident = string
type location = Lexing.position * Lexing.position
type base_ty =
| Tbool
| Tint
type p_pattern = string
and p_expression = string
type p_equation =
{ peq_patt: p_pattern;
peq_expr: p_expression }
type p_node =
{ pn_name: ident;
pn_input: (ident * base_ty) list;
pn_output: (ident * base_ty) list;
pn_local_vars: (ident* base_ty) list;
pn_equations: p_equation list;
pn_loc: location; }
type p_prog = p_node list