Ver Fonte

Parser cleanup

Taddeus Kroes há 12 anos atrás
pai
commit
fcb75e6424
1 ficheiros alterados com 6 adições e 6 exclusões
  1. 6 6
      parser.mly

+ 6 - 6
parser.mly

@@ -54,13 +54,13 @@
 %%
 
 (* Left-recursive list (use List.rev to obtain original list)  *)
-lreclist(x):
-    |               { [] }
-    | lreclist(x) x { $2 :: $1 }
+llist(x):
+    |            { [] }
+    | llist(x) x { $2 :: $1 }
 
 (* Shorthand for comma-separated list *)
 %inline clist(x):
-    lst=separated_list(COMMA, x)
+    | lst=separated_list(COMMA, x)
     { lst }
 
 basic_type:
@@ -69,7 +69,7 @@ basic_type:
     | BOOL  { Bool }
 
 program:
-    decl* EOF
+    | decl* EOF
     { Program ($1, loc $startpos $endpos) }
 
 decl:
@@ -127,7 +127,7 @@ dimlist:
     { Dim (name, loc $startpos(name) $endpos(name)) :: head }
 
 fun_body:
-    | lreclist(var_dec) local_fun_dec* statement* loption(return_statement)
+    | llist(var_dec) local_fun_dec* statement* loption(return_statement)
     { VarDecs (List.rev $1) :: (LocalFuns $2) :: $3 @ $4 }
 
 return_statement: