remove unnessary files
This commit is contained in:
parent
dc89f114ae
commit
a788ad3675
13 changed files with 3 additions and 626 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -2,4 +2,6 @@ node_modules
|
||||||
/src/*.js
|
/src/*.js
|
||||||
/tests/*.js
|
/tests/*.js
|
||||||
.vscode
|
.vscode
|
||||||
activate.sh
|
activate.sh
|
||||||
|
*.cmo
|
||||||
|
*.mli
|
||||||
|
|
Binary file not shown.
Binary file not shown.
BIN
ocaml_yacc/calc
BIN
ocaml_yacc/calc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,281 +0,0 @@
|
||||||
# 2 "lexer.mll"
|
|
||||||
|
|
||||||
open Parser(* The type token is defined in parser.mli *)
|
|
||||||
exception Eof
|
|
||||||
|
|
||||||
# 7 "lexer.ml"
|
|
||||||
let __ocaml_lex_tables = {
|
|
||||||
Lexing.lex_base =
|
|
||||||
"\000\000\240\255\000\000\244\255\245\255\246\255\247\255\001\000\
|
|
||||||
\249\255\075\000\085\000\160\000\254\255\255\255\235\000\054\001\
|
|
||||||
\243\255\242\255";
|
|
||||||
Lexing.lex_backtrk =
|
|
||||||
"\255\255\255\255\014\000\255\255\255\255\255\255\255\255\007\000\
|
|
||||||
\255\255\005\000\003\000\003\000\255\255\255\255\004\000\002\000\
|
|
||||||
\255\255\255\255";
|
|
||||||
Lexing.lex_default =
|
|
||||||
"\255\255\000\000\255\255\000\000\000\000\000\000\000\000\255\255\
|
|
||||||
\000\000\255\255\255\255\255\255\000\000\000\000\255\255\255\255\
|
|
||||||
\000\000\000\000";
|
|
||||||
Lexing.lex_trans =
|
|
||||||
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\013\000\012\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\013\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\004\000\003\000\006\000\008\000\000\000\007\000\000\000\005\000\
|
|
||||||
\009\000\009\000\009\000\009\000\009\000\009\000\009\000\009\000\
|
|
||||||
\009\000\009\000\000\000\000\000\000\000\002\000\017\000\016\000\
|
|
||||||
\000\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\000\000\000\000\000\000\000\000\010\000\
|
|
||||||
\000\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\011\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\009\000\009\000\009\000\009\000\009\000\
|
|
||||||
\009\000\009\000\009\000\009\000\009\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\000\000\000\000\000\000\000\000\014\000\000\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\000\000\000\000\000\000\000\000\014\000\
|
|
||||||
\001\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\015\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\000\000\000\000\
|
|
||||||
\000\000\000\000\014\000\000\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\000\000\000\000\000\000\000\000\014\000\000\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000";
|
|
||||||
Lexing.lex_check =
|
|
||||||
"\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\000\000\000\000\000\000\000\000\255\255\000\000\255\255\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\255\255\255\255\255\255\000\000\002\000\007\000\
|
|
||||||
\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\255\255\255\255\255\255\255\255\000\000\
|
|
||||||
\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\009\000\009\000\009\000\009\000\009\000\
|
|
||||||
\009\000\009\000\009\000\009\000\009\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\255\255\255\255\255\255\255\255\010\000\255\255\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\
|
|
||||||
\011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\011\000\255\255\255\255\255\255\255\255\011\000\
|
|
||||||
\000\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\011\000\011\000\011\000\011\000\011\000\011\000\
|
|
||||||
\011\000\011\000\011\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\255\255\255\255\
|
|
||||||
\255\255\255\255\014\000\255\255\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
|
|
||||||
\014\000\014\000\014\000\014\000\014\000\014\000\015\000\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\015\000\255\255\255\255\255\255\255\255\015\000\255\255\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
|
|
||||||
\015\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
|
|
||||||
\255\255\255\255\255\255\255\255\255\255\255\255\255\255";
|
|
||||||
Lexing.lex_base_code =
|
|
||||||
"";
|
|
||||||
Lexing.lex_backtrk_code =
|
|
||||||
"";
|
|
||||||
Lexing.lex_default_code =
|
|
||||||
"";
|
|
||||||
Lexing.lex_trans_code =
|
|
||||||
"";
|
|
||||||
Lexing.lex_check_code =
|
|
||||||
"";
|
|
||||||
Lexing.lex_code =
|
|
||||||
"";
|
|
||||||
}
|
|
||||||
|
|
||||||
let rec token lexbuf =
|
|
||||||
__ocaml_lex_token_rec lexbuf 0
|
|
||||||
and __ocaml_lex_token_rec lexbuf __ocaml_lex_state =
|
|
||||||
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
|
|
||||||
| 0 ->
|
|
||||||
# 7 "lexer.mll"
|
|
||||||
( token lexbuf )
|
|
||||||
# 186 "lexer.ml"
|
|
||||||
|
|
||||||
| 1 ->
|
|
||||||
# 8 "lexer.mll"
|
|
||||||
( EOL )
|
|
||||||
# 191 "lexer.ml"
|
|
||||||
|
|
||||||
| 2 ->
|
|
||||||
# 9 "lexer.mll"
|
|
||||||
( IN )
|
|
||||||
# 196 "lexer.ml"
|
|
||||||
|
|
||||||
| 3 ->
|
|
||||||
let
|
|
||||||
# 10 "lexer.mll"
|
|
||||||
lxm
|
|
||||||
# 202 "lexer.ml"
|
|
||||||
= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
|
|
||||||
# 10 "lexer.mll"
|
|
||||||
( ID((String.make 1 lxm)) )
|
|
||||||
# 206 "lexer.ml"
|
|
||||||
|
|
||||||
| 4 ->
|
|
||||||
let
|
|
||||||
# 11 "lexer.mll"
|
|
||||||
lxm
|
|
||||||
# 212 "lexer.ml"
|
|
||||||
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
|
|
||||||
# 11 "lexer.mll"
|
|
||||||
( ID(lxm) )
|
|
||||||
# 216 "lexer.ml"
|
|
||||||
|
|
||||||
| 5 ->
|
|
||||||
let
|
|
||||||
# 12 "lexer.mll"
|
|
||||||
lxm
|
|
||||||
# 222 "lexer.ml"
|
|
||||||
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
|
|
||||||
# 12 "lexer.mll"
|
|
||||||
( INT(lxm) )
|
|
||||||
# 226 "lexer.ml"
|
|
||||||
|
|
||||||
| 6 ->
|
|
||||||
# 13 "lexer.mll"
|
|
||||||
( PLUS )
|
|
||||||
# 231 "lexer.ml"
|
|
||||||
|
|
||||||
| 7 ->
|
|
||||||
# 14 "lexer.mll"
|
|
||||||
( MINUS )
|
|
||||||
# 236 "lexer.ml"
|
|
||||||
|
|
||||||
| 8 ->
|
|
||||||
# 15 "lexer.mll"
|
|
||||||
( TIMES )
|
|
||||||
# 241 "lexer.ml"
|
|
||||||
|
|
||||||
| 9 ->
|
|
||||||
# 16 "lexer.mll"
|
|
||||||
( DIV )
|
|
||||||
# 246 "lexer.ml"
|
|
||||||
|
|
||||||
| 10 ->
|
|
||||||
# 17 "lexer.mll"
|
|
||||||
( LPAREN )
|
|
||||||
# 251 "lexer.ml"
|
|
||||||
|
|
||||||
| 11 ->
|
|
||||||
# 18 "lexer.mll"
|
|
||||||
( RPAREN )
|
|
||||||
# 256 "lexer.ml"
|
|
||||||
|
|
||||||
| 12 ->
|
|
||||||
# 19 "lexer.mll"
|
|
||||||
( IMPLY )
|
|
||||||
# 261 "lexer.ml"
|
|
||||||
|
|
||||||
| 13 ->
|
|
||||||
# 20 "lexer.mll"
|
|
||||||
( FUNC )
|
|
||||||
# 266 "lexer.ml"
|
|
||||||
|
|
||||||
| 14 ->
|
|
||||||
# 21 "lexer.mll"
|
|
||||||
( ASSIGN )
|
|
||||||
# 271 "lexer.ml"
|
|
||||||
|
|
||||||
| 15 ->
|
|
||||||
# 22 "lexer.mll"
|
|
||||||
( raise Eof )
|
|
||||||
# 276 "lexer.ml"
|
|
||||||
|
|
||||||
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
|
|
||||||
__ocaml_lex_token_rec lexbuf __ocaml_lex_state
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,327 +0,0 @@
|
||||||
type token =
|
|
||||||
| INT of (string)
|
|
||||||
| ID of (string)
|
|
||||||
| PLUS
|
|
||||||
| MINUS
|
|
||||||
| TIMES
|
|
||||||
| DIV
|
|
||||||
| LPAREN
|
|
||||||
| RPAREN
|
|
||||||
| ASSIGN
|
|
||||||
| IN
|
|
||||||
| IMPLY
|
|
||||||
| FUNC
|
|
||||||
| EOL
|
|
||||||
|
|
||||||
open Parsing;;
|
|
||||||
let _ = parse_error;;
|
|
||||||
let yytransl_const = [|
|
|
||||||
259 (* PLUS *);
|
|
||||||
260 (* MINUS *);
|
|
||||||
261 (* TIMES *);
|
|
||||||
262 (* DIV *);
|
|
||||||
263 (* LPAREN *);
|
|
||||||
264 (* RPAREN *);
|
|
||||||
265 (* ASSIGN *);
|
|
||||||
266 (* IN *);
|
|
||||||
267 (* IMPLY *);
|
|
||||||
268 (* FUNC *);
|
|
||||||
269 (* EOL *);
|
|
||||||
0|]
|
|
||||||
|
|
||||||
let yytransl_block = [|
|
|
||||||
257 (* INT *);
|
|
||||||
258 (* ID *);
|
|
||||||
0|]
|
|
||||||
|
|
||||||
let yylhs = "\255\255\
|
|
||||||
\001\000\002\000\002\000\003\000\003\000\005\000\006\000\006\000\
|
|
||||||
\004\000\004\000\004\000\009\000\010\000\007\000\008\000\008\000\
|
|
||||||
\008\000\008\000\008\000\008\000\008\000\008\000\000\000"
|
|
||||||
|
|
||||||
let yylen = "\002\000\
|
|
||||||
\002\000\001\000\002\000\001\000\001\000\006\000\001\000\003\000\
|
|
||||||
\001\000\001\000\001\000\003\000\002\000\002\000\001\000\001\000\
|
|
||||||
\003\000\003\000\003\000\003\000\003\000\002\000\002\000"
|
|
||||||
|
|
||||||
let yydefred = "\000\000\
|
|
||||||
\000\000\000\000\015\000\000\000\000\000\000\000\023\000\000\000\
|
|
||||||
\002\000\000\000\005\000\000\000\009\000\010\000\011\000\000\000\
|
|
||||||
\000\000\000\000\000\000\001\000\003\000\000\000\000\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\000\000\013\000\017\000\000\000\
|
|
||||||
\000\000\000\000\000\000\000\000\007\000\000\000\012\000\000\000\
|
|
||||||
\000\000\006\000"
|
|
||||||
|
|
||||||
let yydgoto = "\002\000\
|
|
||||||
\007\000\008\000\009\000\026\000\011\000\018\000\013\000\014\000\
|
|
||||||
\015\000\016\000"
|
|
||||||
|
|
||||||
let yysindex = "\007\000\
|
|
||||||
\120\255\000\000\000\000\000\000\120\255\120\255\000\000\012\255\
|
|
||||||
\000\000\106\255\000\000\001\255\000\000\000\000\000\000\245\254\
|
|
||||||
\124\255\049\255\098\255\000\000\000\000\120\255\120\255\120\255\
|
|
||||||
\120\255\106\255\009\255\024\255\120\255\000\000\000\000\113\255\
|
|
||||||
\124\255\124\255\124\255\120\255\000\000\026\255\000\000\088\255\
|
|
||||||
\120\255\000\000"
|
|
||||||
|
|
||||||
let yyrindex = "\000\000\
|
|
||||||
\000\000\000\000\000\000\042\255\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\063\255\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\028\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
|
|
||||||
\000\000\074\255\050\255\000\000\000\000\000\000\000\000\007\255\
|
|
||||||
\053\255\064\255\075\255\000\000\000\000\052\255\000\000\000\000\
|
|
||||||
\000\000\000\000"
|
|
||||||
|
|
||||||
let yygindex = "\000\000\
|
|
||||||
\000\000\000\000\254\255\255\255\000\000\001\000\000\000\000\000\
|
|
||||||
\000\000\000\000"
|
|
||||||
|
|
||||||
let yytablesize = 131
|
|
||||||
let yytable = "\010\000\
|
|
||||||
\029\000\012\000\027\000\017\000\019\000\021\000\010\000\001\000\
|
|
||||||
\012\000\018\000\018\000\028\000\003\000\004\000\018\000\005\000\
|
|
||||||
\018\000\036\000\006\000\018\000\032\000\033\000\034\000\035\000\
|
|
||||||
\020\000\037\000\039\000\010\000\038\000\012\000\022\000\022\000\
|
|
||||||
\022\000\022\000\040\000\022\000\028\000\022\000\042\000\010\000\
|
|
||||||
\022\000\012\000\016\000\007\000\016\000\016\000\016\000\016\000\
|
|
||||||
\016\000\016\000\030\000\016\000\007\000\008\000\016\000\019\000\
|
|
||||||
\019\000\022\000\022\000\028\000\019\000\013\000\019\000\000\000\
|
|
||||||
\000\000\019\000\020\000\020\000\020\000\020\000\004\000\020\000\
|
|
||||||
\004\000\020\000\000\000\004\000\020\000\021\000\021\000\021\000\
|
|
||||||
\021\000\014\000\021\000\014\000\021\000\000\000\014\000\021\000\
|
|
||||||
\003\000\004\000\022\000\023\000\024\000\025\000\006\000\000\000\
|
|
||||||
\000\000\041\000\003\000\004\000\022\000\023\000\024\000\025\000\
|
|
||||||
\006\000\031\000\003\000\004\000\022\000\023\000\024\000\025\000\
|
|
||||||
\006\000\003\000\004\000\000\000\000\000\024\000\025\000\006\000\
|
|
||||||
\003\000\004\000\000\000\005\000\003\000\004\000\006\000\000\000\
|
|
||||||
\000\000\000\000\006\000"
|
|
||||||
|
|
||||||
let yycheck = "\001\000\
|
|
||||||
\012\001\001\000\002\001\005\000\006\000\008\000\008\000\001\000\
|
|
||||||
\008\000\003\001\004\001\011\001\001\001\002\001\008\001\004\001\
|
|
||||||
\010\001\009\001\007\001\013\001\022\000\023\000\024\000\025\000\
|
|
||||||
\013\001\002\001\029\000\029\000\028\000\029\000\003\001\004\001\
|
|
||||||
\005\001\006\001\036\000\008\001\011\001\010\001\041\000\041\000\
|
|
||||||
\013\001\041\000\001\001\002\001\003\001\004\001\005\001\006\001\
|
|
||||||
\007\001\008\001\002\001\010\001\011\001\002\001\013\001\003\001\
|
|
||||||
\004\001\005\001\006\001\011\001\008\001\012\001\010\001\255\255\
|
|
||||||
\255\255\013\001\003\001\004\001\005\001\006\001\008\001\008\001\
|
|
||||||
\010\001\010\001\255\255\013\001\013\001\003\001\004\001\005\001\
|
|
||||||
\006\001\008\001\008\001\010\001\010\001\255\255\013\001\013\001\
|
|
||||||
\001\001\002\001\003\001\004\001\005\001\006\001\007\001\255\255\
|
|
||||||
\255\255\010\001\001\001\002\001\003\001\004\001\005\001\006\001\
|
|
||||||
\007\001\008\001\001\001\002\001\003\001\004\001\005\001\006\001\
|
|
||||||
\007\001\001\001\002\001\255\255\255\255\005\001\006\001\007\001\
|
|
||||||
\001\001\002\001\255\255\004\001\001\001\002\001\007\001\255\255\
|
|
||||||
\255\255\255\255\007\001"
|
|
||||||
|
|
||||||
let yynames_const = "\
|
|
||||||
PLUS\000\
|
|
||||||
MINUS\000\
|
|
||||||
TIMES\000\
|
|
||||||
DIV\000\
|
|
||||||
LPAREN\000\
|
|
||||||
RPAREN\000\
|
|
||||||
ASSIGN\000\
|
|
||||||
IN\000\
|
|
||||||
IMPLY\000\
|
|
||||||
FUNC\000\
|
|
||||||
EOL\000\
|
|
||||||
"
|
|
||||||
|
|
||||||
let yynames_block = "\
|
|
||||||
INT\000\
|
|
||||||
ID\000\
|
|
||||||
"
|
|
||||||
|
|
||||||
let yyact = [|
|
|
||||||
(fun _ -> failwith "parser")
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'blocks) in
|
|
||||||
Obj.repr(
|
|
||||||
# 15 "parser.mly"
|
|
||||||
( _1 )
|
|
||||||
# 145 "parser.ml"
|
|
||||||
: Ast.ast))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'block) in
|
|
||||||
Obj.repr(
|
|
||||||
# 18 "parser.mly"
|
|
||||||
( _1 )
|
|
||||||
# 152 "parser.ml"
|
|
||||||
: 'blocks))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'blocks) in
|
|
||||||
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'block) in
|
|
||||||
Obj.repr(
|
|
||||||
# 19 "parser.mly"
|
|
||||||
(match _1 with Ast.Node x -> Ast.Node (x @ [_2])
|
|
||||||
| Ast.Int x -> Ast.Node[_1; _2] | Ast.Leaf x -> Ast.Node [_1; _2])
|
|
||||||
# 161 "parser.ml"
|
|
||||||
: 'blocks))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 24 "parser.mly"
|
|
||||||
(_1)
|
|
||||||
# 168 "parser.ml"
|
|
||||||
: 'block))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'let_bind) in
|
|
||||||
Obj.repr(
|
|
||||||
# 25 "parser.mly"
|
|
||||||
(_1)
|
|
||||||
# 175 "parser.ml"
|
|
||||||
: 'block))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 5 : 'typ) in
|
|
||||||
let _2 = (Parsing.peek_val __caml_parser_env 4 : string) in
|
|
||||||
let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
|
|
||||||
let _6 = (Parsing.peek_val __caml_parser_env 0 : 'block) in
|
|
||||||
Obj.repr(
|
|
||||||
# 29 "parser.mly"
|
|
||||||
(Ast.Node [Ast.Leaf "%let"; Ast.Node[_1; Ast.Leaf _2; _4]; _6])
|
|
||||||
# 185 "parser.ml"
|
|
||||||
: 'let_bind))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
|
|
||||||
Obj.repr(
|
|
||||||
# 33 "parser.mly"
|
|
||||||
(Ast.Leaf _1)
|
|
||||||
# 192 "parser.ml"
|
|
||||||
: 'typ))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typ) in
|
|
||||||
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'typ) in
|
|
||||||
Obj.repr(
|
|
||||||
# 34 "parser.mly"
|
|
||||||
(Ast.Node [Ast.Leaf "->"; _1 ; _3])
|
|
||||||
# 200 "parser.ml"
|
|
||||||
: 'typ))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'app_expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 37 "parser.mly"
|
|
||||||
(_1)
|
|
||||||
# 207 "parser.ml"
|
|
||||||
: 'expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bin_expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 38 "parser.mly"
|
|
||||||
(_1)
|
|
||||||
# 214 "parser.ml"
|
|
||||||
: 'expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lam_expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 39 "parser.mly"
|
|
||||||
(_1)
|
|
||||||
# 221 "parser.ml"
|
|
||||||
: 'expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'arg) in
|
|
||||||
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'block) in
|
|
||||||
Obj.repr(
|
|
||||||
# 43 "parser.mly"
|
|
||||||
(Ast.Node [Ast.Leaf "%lambda"; _1 ; _3])
|
|
||||||
# 229 "parser.ml"
|
|
||||||
: 'lam_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'typ) in
|
|
||||||
let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
|
|
||||||
Obj.repr(
|
|
||||||
# 46 "parser.mly"
|
|
||||||
( Ast.Node [_1;Ast.Leaf _2] )
|
|
||||||
# 237 "parser.ml"
|
|
||||||
: 'arg))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
|
|
||||||
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 50 "parser.mly"
|
|
||||||
( Ast.Node [ Ast.Leaf "%apply"; _1; _2] )
|
|
||||||
# 245 "parser.ml"
|
|
||||||
: 'app_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
|
|
||||||
Obj.repr(
|
|
||||||
# 54 "parser.mly"
|
|
||||||
( Ast.Int (int_of_string _1))
|
|
||||||
# 252 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
|
|
||||||
Obj.repr(
|
|
||||||
# 55 "parser.mly"
|
|
||||||
( Ast.Leaf _1 )
|
|
||||||
# 259 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _2 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 56 "parser.mly"
|
|
||||||
( _2 )
|
|
||||||
# 266 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
|
|
||||||
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 57 "parser.mly"
|
|
||||||
( Ast.Node [ Ast.Leaf "+"; _1; _3] )
|
|
||||||
# 274 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
|
|
||||||
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 58 "parser.mly"
|
|
||||||
( Ast.Node[ Ast.Leaf "-"; _1 ; _3] )
|
|
||||||
# 282 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
|
|
||||||
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 59 "parser.mly"
|
|
||||||
( Ast.Node[ Ast.Leaf "*"; _1 ;_3] )
|
|
||||||
# 290 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
|
|
||||||
let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 60 "parser.mly"
|
|
||||||
( Ast.Node[ Ast.Leaf "/"; _1; _3] )
|
|
||||||
# 298 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
; (fun __caml_parser_env ->
|
|
||||||
let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
|
|
||||||
Obj.repr(
|
|
||||||
# 61 "parser.mly"
|
|
||||||
( Ast.Node[ Ast.Leaf "-" ; _2] )
|
|
||||||
# 305 "parser.ml"
|
|
||||||
: 'bin_expr))
|
|
||||||
(* Entry main *)
|
|
||||||
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|
|
||||||
|]
|
|
||||||
let yytables =
|
|
||||||
{ Parsing.actions=yyact;
|
|
||||||
Parsing.transl_const=yytransl_const;
|
|
||||||
Parsing.transl_block=yytransl_block;
|
|
||||||
Parsing.lhs=yylhs;
|
|
||||||
Parsing.len=yylen;
|
|
||||||
Parsing.defred=yydefred;
|
|
||||||
Parsing.dgoto=yydgoto;
|
|
||||||
Parsing.sindex=yysindex;
|
|
||||||
Parsing.rindex=yyrindex;
|
|
||||||
Parsing.gindex=yygindex;
|
|
||||||
Parsing.tablesize=yytablesize;
|
|
||||||
Parsing.table=yytable;
|
|
||||||
Parsing.check=yycheck;
|
|
||||||
Parsing.error_function=parse_error;
|
|
||||||
Parsing.names_const=yynames_const;
|
|
||||||
Parsing.names_block=yynames_block }
|
|
||||||
let main (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
|
|
||||||
(Parsing.yyparse yytables 1 lexfun lexbuf : Ast.ast)
|
|
|
@ -1,17 +0,0 @@
|
||||||
type token =
|
|
||||||
| INT of (string)
|
|
||||||
| ID of (string)
|
|
||||||
| PLUS
|
|
||||||
| MINUS
|
|
||||||
| TIMES
|
|
||||||
| DIV
|
|
||||||
| LPAREN
|
|
||||||
| RPAREN
|
|
||||||
| ASSIGN
|
|
||||||
| IN
|
|
||||||
| IMPLY
|
|
||||||
| FUNC
|
|
||||||
| EOL
|
|
||||||
|
|
||||||
val main :
|
|
||||||
(Lexing.lexbuf -> token) -> Lexing.lexbuf -> Ast.ast
|
|
Loading…
Reference in a new issue