소스 검색

Parser cleanup

Taddeus Kroes 12 년 전
부모
커밋
fcb75e6424
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  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: