Browse Source

improve the parser, get rid of parsing NL NL

main
zseri 2 years ago
parent
commit
3178e32511
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      parser.mly

+ 1
- 3
parser.mly View File

@ -8,12 +8,10 @@
%start <Ast.ent list> prog
%%
prog: NL?; es = separated_list(NL?, tent); EOF { es };
prog: NL?; es = list(x = ent; NL { x }); EOF { es };
rtablename: x = ID { Ast.parse_rtabnam x };
tent: x = ent; NL { x };
ent:
| TABLE; t = ID; pks = list(ID); DCOLON; attrs = list(ID) { Ast.Table (t, { tprimkeys = pks; tattrs = attrs }) }
| RELAT; r = ID; rts = list(rtablename); DCOLON; attrs = list(ID) { Ast.Relation { rname = r; relates = rts; rattrs = attrs } }