commit 5e37631c5ac2fed820015f12f39ceaae8148c4a0 Author: Simon Petit Date: Wed Dec 11 08:33:41 2024 +0100 init diff --git a/_build/.actions/default/test/runtest-bcd2b6285bc969ccc96da55ab1dd841f b/_build/.actions/default/test/runtest-bcd2b6285bc969ccc96da55ab1dd841f new file mode 100644 index 0000000..e69de29 diff --git a/_build/.actions/default/test/runtest-ec02f3ded99b1fabb963ed73c18818ce b/_build/.actions/default/test/runtest-ec02f3ded99b1fabb963ed73c18818ce new file mode 100644 index 0000000..e69de29 diff --git a/_build/.db b/_build/.db new file mode 100644 index 0000000..6ed12c7 Binary files /dev/null and b/_build/.db differ diff --git a/_build/.digest-db b/_build/.digest-db new file mode 100644 index 0000000..efdb69c Binary files /dev/null and b/_build/.digest-db differ diff --git a/_build/.filesystem-clock b/_build/.filesystem-clock new file mode 100644 index 0000000..c61f4a7 --- /dev/null +++ b/_build/.filesystem-clock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_build/.lock b/_build/.lock new file mode 100644 index 0000000..e69de29 diff --git a/_build/.sandbox/.hg/requires b/_build/.sandbox/.hg/requires new file mode 100644 index 0000000..387e851 --- /dev/null +++ b/_build/.sandbox/.hg/requires @@ -0,0 +1 @@ +Escaping the Dune sandbox \ No newline at end of file diff --git a/_build/default/.dune/configurator b/_build/default/.dune/configurator new file mode 100644 index 0000000..19708df --- /dev/null +++ b/_build/default/.dune/configurator @@ -0,0 +1,2 @@ +(ocamlc /usr/bin/ocamlc.opt) +(ocaml_config_vars (afl_instrument false) (architecture amd64) (asm x86_64-linux-gnu-as) (asm_cfi_supported true) (ast_impl_magic_number Caml1999M030) (ast_intf_magic_number Caml1999N030) (bytecomp_c_compiler "x86_64-linux-gnu-gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security -D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2") (bytecomp_c_libraries "-lm -lpthread") (c_compiler x86_64-linux-gnu-gcc) (ccomp_type cc) (cma_magic_number Caml1999A030) (cmi_magic_number Caml1999I030) (cmo_magic_number Caml1999O030) (cmt_magic_number Caml1999T030) (cmx_magic_number Caml1999Y030) (cmxa_magic_number Caml1999Z030) (cmxs_magic_number Caml1999D030) (default_executable_name a.out) (default_safe_string true) (exec_magic_number Caml1999X030) (ext_asm .s) (ext_dll .so) (ext_exe "") (ext_lib .a) (ext_obj .o) (flambda false) (flat_float_array true) (function_sections true) (host x86_64-pc-linux-gnu) (int_size 63) (linear_magic_number Caml1999L030) (model default) (native_c_compiler "x86_64-linux-gnu-gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security -D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2") (native_c_libraries "-lm ") (native_pack_linker "x86_64-linux-gnu-ld -r -o ") (ocamlc_cflags "-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security") (ocamlc_cppflags "-D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2") (ocamlopt_cflags "-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security") (ocamlopt_cppflags "-D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2") (os_type Unix) (ranlib x86_64-linux-gnu-ranlib) (safe_string true) (standard_library /usr/lib/ocaml) (standard_library_default /usr/lib/ocaml) (supports_shared_libraries true) (system linux) (systhread_supported true) (target x86_64-pc-linux-gnu) (version 4.13.1) (windows_unicode false) (with_frame_pointers false) (word_size 64)) diff --git a/_build/default/.dune/configurator.v2 b/_build/default/.dune/configurator.v2 new file mode 100644 index 0000000..6fe4a49 --- /dev/null +++ b/_build/default/.dune/configurator.v2 @@ -0,0 +1 @@ +((6:ocamlc19:/usr/bin/ocamlc.opt)(17:ocaml_config_vars((14:afl_instrument5:false)(12:architecture5:amd64)(3:asm19:x86_64-linux-gnu-as)(17:asm_cfi_supported4:true)(21:ast_impl_magic_number12:Caml1999M030)(21:ast_intf_magic_number12:Caml1999N030)(19:bytecomp_c_compiler241:x86_64-linux-gnu-gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security -D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2)(20:bytecomp_c_libraries14:-lm -lpthread)(10:c_compiler20:x86_64-linux-gnu-gcc)(10:ccomp_type2:cc)(16:cma_magic_number12:Caml1999A030)(16:cmi_magic_number12:Caml1999I030)(16:cmo_magic_number12:Caml1999O030)(16:cmt_magic_number12:Caml1999T030)(16:cmx_magic_number12:Caml1999Y030)(17:cmxa_magic_number12:Caml1999Z030)(17:cmxs_magic_number12:Caml1999D030)(23:default_executable_name5:a.out)(19:default_safe_string4:true)(17:exec_magic_number12:Caml1999X030)(7:ext_asm2:.s)(7:ext_dll3:.so)(7:ext_exe0:)(7:ext_lib2:.a)(7:ext_obj2:.o)(7:flambda5:false)(16:flat_float_array4:true)(17:function_sections4:true)(4:host19:x86_64-pc-linux-gnu)(8:int_size2:63)(19:linear_magic_number12:Caml1999L030)(5:model7:default)(17:native_c_compiler241:x86_64-linux-gnu-gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security -D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2)(18:native_c_libraries4:-lm )(18:native_pack_linker26:x86_64-linux-gnu-ld -r -o )(13:ocamlc_cflags165:-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security)(15:ocamlc_cppflags54:-D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2)(15:ocamlopt_cflags165:-O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -ffile-prefix-map=/build/ocaml-SC7b9w/ocaml-4.13.1=. -fstack-protector-strong -Wformat -Werror=format-security)(17:ocamlopt_cppflags54:-D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2)(7:os_type4:Unix)(6:ranlib23:x86_64-linux-gnu-ranlib)(11:safe_string4:true)(16:standard_library14:/usr/lib/ocaml)(24:standard_library_default14:/usr/lib/ocaml)(25:supports_shared_libraries4:true)(6:system5:linux)(19:systhread_supported4:true)(6:target19:x86_64-pc-linux-gnu)(7:version6:4.13.1)(15:windows_unicode5:false)(19:with_frame_pointers5:false)(9:word_size2:64)))) \ No newline at end of file diff --git a/_build/default/META.mock_csv b/_build/default/META.mock_csv new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi b/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi new file mode 100644 index 0000000..cb528f2 Binary files /dev/null and b/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi differ diff --git a/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti b/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti new file mode 100644 index 0000000..2d8f933 Binary files /dev/null and b/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti differ diff --git a/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx b/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx new file mode 100644 index 0000000..d760a0a Binary files /dev/null and b/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx differ diff --git a/_build/default/bin/.main.eobjs/native/dune__exe__Main.o b/_build/default/bin/.main.eobjs/native/dune__exe__Main.o new file mode 100644 index 0000000..c9ee7f0 Binary files /dev/null and b/_build/default/bin/.main.eobjs/native/dune__exe__Main.o differ diff --git a/_build/default/bin/.merlin-conf/exe-main b/_build/default/bin/.merlin-conf/exe-main new file mode 100644 index 0000000..f4e0d46 Binary files /dev/null and b/_build/default/bin/.merlin-conf/exe-main differ diff --git a/_build/default/bin/main.exe b/_build/default/bin/main.exe new file mode 100755 index 0000000..e098141 Binary files /dev/null and b/_build/default/bin/main.exe differ diff --git a/_build/default/bin/main.ml b/_build/default/bin/main.ml new file mode 100644 index 0000000..0542a2c --- /dev/null +++ b/_build/default/bin/main.ml @@ -0,0 +1,8 @@ +let () = + let path = Sys.argv.(1) in + let ic = open_in path in + let len = in_channel_length ic in + let config = really_input_string ic len in + let lexbuf = Lexing.from_string config in + let _ = Parser.main Lexer.read_token lexbuf in + Printf.printf("ok") diff --git a/_build/default/bin/main.mli b/_build/default/bin/main.mli new file mode 100644 index 0000000..335ae1f --- /dev/null +++ b/_build/default/bin/main.mli @@ -0,0 +1 @@ +(* Auto-generated by Dune *) \ No newline at end of file diff --git a/_build/default/lexer/.lexer.objs/byte/lexer.cmi b/_build/default/lexer/.lexer.objs/byte/lexer.cmi new file mode 100644 index 0000000..0df8b19 Binary files /dev/null and b/_build/default/lexer/.lexer.objs/byte/lexer.cmi differ diff --git a/_build/default/lexer/.lexer.objs/byte/lexer.cmo b/_build/default/lexer/.lexer.objs/byte/lexer.cmo new file mode 100644 index 0000000..dfa7a30 Binary files /dev/null and b/_build/default/lexer/.lexer.objs/byte/lexer.cmo differ diff --git a/_build/default/lexer/.lexer.objs/byte/lexer.cmt b/_build/default/lexer/.lexer.objs/byte/lexer.cmt new file mode 100644 index 0000000..0b32018 Binary files /dev/null and b/_build/default/lexer/.lexer.objs/byte/lexer.cmt differ diff --git a/_build/default/lexer/.lexer.objs/native/lexer.cmx b/_build/default/lexer/.lexer.objs/native/lexer.cmx new file mode 100644 index 0000000..a11b6e5 Binary files /dev/null and b/_build/default/lexer/.lexer.objs/native/lexer.cmx differ diff --git a/_build/default/lexer/.lexer.objs/native/lexer.o b/_build/default/lexer/.lexer.objs/native/lexer.o new file mode 100644 index 0000000..c3e85aa Binary files /dev/null and b/_build/default/lexer/.lexer.objs/native/lexer.o differ diff --git a/_build/default/lexer/.merlin-conf/lib-lexer b/_build/default/lexer/.merlin-conf/lib-lexer new file mode 100644 index 0000000..7430c5f Binary files /dev/null and b/_build/default/lexer/.merlin-conf/lib-lexer differ diff --git a/_build/default/lexer/lexer.a b/_build/default/lexer/lexer.a new file mode 100644 index 0000000..4de316d Binary files /dev/null and b/_build/default/lexer/lexer.a differ diff --git a/_build/default/lexer/lexer.cma b/_build/default/lexer/lexer.cma new file mode 100644 index 0000000..366ce63 Binary files /dev/null and b/_build/default/lexer/lexer.cma differ diff --git a/_build/default/lexer/lexer.cmxa b/_build/default/lexer/lexer.cmxa new file mode 100644 index 0000000..e8ce425 Binary files /dev/null and b/_build/default/lexer/lexer.cmxa differ diff --git a/_build/default/lexer/lexer.cmxs b/_build/default/lexer/lexer.cmxs new file mode 100755 index 0000000..3d4e8f9 Binary files /dev/null and b/_build/default/lexer/lexer.cmxs differ diff --git a/_build/default/lexer/lexer.ml b/_build/default/lexer/lexer.ml new file mode 100644 index 0000000..f2545d8 --- /dev/null +++ b/_build/default/lexer/lexer.ml @@ -0,0 +1,736 @@ +# 1 "lexer/lexer.mll" + +open Parser + +# 6 "lexer/lexer.ml" +let __ocaml_lex_tables = { + Lexing.lex_base = + "\000\000\242\255\075\000\002\000\245\255\246\255\247\255\248\255\ + \002\000\249\255\160\000\235\000\054\001\129\001\204\001\023\002\ + \098\002\173\002\248\002\067\003\142\003\217\003\036\004\111\004\ + \186\004\005\005\080\005\155\005\230\005\049\006\124\006\199\006\ + \018\007\093\007\168\007\243\007\062\008\137\008"; + Lexing.lex_backtrk = + "\012\000\255\255\012\000\011\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\000\000\012\000\001\000\012\000\012\000\012\000\ + \012\000\002\000\012\000\012\000\003\000\012\000\012\000\012\000\ + \004\000\012\000\012\000\012\000\012\000\005\000"; + Lexing.lex_default = + "\255\255\000\000\255\255\255\255\000\000\000\000\000\000\000\000\ + \255\255\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\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255"; + Lexing.lex_trans = + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\003\000\009\000\003\000\009\000\008\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \003\000\000\000\003\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\007\000\000\000\000\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\006\000\000\000\005\000\000\000\002\000\ + \000\000\002\000\002\000\002\000\012\000\002\000\002\000\002\000\ + \002\000\014\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\011\000\013\000\015\000\002\000\010\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\002\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\002\000\ + \001\000\033\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\002\000\000\000\029\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\002\000\000\000\026\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \002\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\021\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\000\000\ + \000\000\000\000\000\000\002\000\000\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\019\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\002\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \016\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\002\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\017\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\002\000\000\000\002\000\002\000\ + \002\000\002\000\018\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\002\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\002\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\020\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\002\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \002\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\022\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\000\000\ + \000\000\000\000\000\000\002\000\000\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\023\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\002\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\024\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\002\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\025\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\002\000\000\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\002\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\027\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\002\000\000\000\002\000\002\000\002\000\002\000\ + \028\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\002\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \002\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\030\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\000\000\ + \000\000\000\000\000\000\002\000\000\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\031\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\002\000\000\000\ + \002\000\002\000\002\000\002\000\032\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\002\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\002\000\000\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\034\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\002\000\ + \000\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\035\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\000\000\000\000\ + \000\000\000\000\002\000\000\000\002\000\002\000\002\000\002\000\ + \036\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\000\000\000\000\000\000\000\000\002\000\000\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\037\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \002\000\000\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\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\003\000\008\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\ + \000\000\255\255\003\000\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\ + \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\255\255\255\255\ + \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\000\000\255\255\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\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ + \000\000\000\000\000\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\255\255\255\255\ + \255\255\255\255\002\000\255\255\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\ + \002\000\002\000\002\000\002\000\002\000\002\000\255\255\255\255\ + \255\255\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\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\ + \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\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\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\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\255\255\255\255\255\255\255\255\012\000\255\255\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\ + \012\000\013\000\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\013\000\255\255\255\255\255\255\255\255\ + \013\000\255\255\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\013\000\013\000\013\000\013\000\013\000\ + \013\000\013\000\013\000\013\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\016\000\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\016\000\255\255\255\255\255\255\ + \255\255\016\000\255\255\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\ + \016\000\016\000\016\000\016\000\016\000\017\000\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ + \255\255\255\255\255\255\255\255\017\000\255\255\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ + \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ + \018\000\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\018\000\255\255\255\255\255\255\255\255\018\000\ + \255\255\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\018\000\018\000\018\000\018\000\018\000\018\000\ + \018\000\018\000\018\000\019\000\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\019\000\255\255\255\255\ + \255\255\255\255\019\000\255\255\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\ + \019\000\019\000\019\000\019\000\019\000\019\000\020\000\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \020\000\255\255\255\255\255\255\255\255\020\000\255\255\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \020\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\ + \020\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\021\000\255\255\255\255\255\255\255\255\ + \021\000\255\255\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ + \021\000\021\000\021\000\021\000\022\000\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\022\000\255\255\ + \255\255\255\255\255\255\022\000\255\255\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\ + \022\000\022\000\022\000\022\000\022\000\022\000\022\000\023\000\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\023\000\255\255\255\255\255\255\255\255\023\000\255\255\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\ + \023\000\023\000\024\000\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\024\000\255\255\255\255\255\255\ + \255\255\024\000\255\255\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\ + \024\000\024\000\024\000\024\000\024\000\025\000\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ + \255\255\255\255\255\255\255\255\025\000\255\255\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ + \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\255\255\255\255\255\255\255\255\026\000\ + \255\255\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\ + \026\000\026\000\026\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\255\255\255\255\ + \255\255\255\255\027\000\255\255\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\ + \027\000\027\000\027\000\027\000\027\000\027\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\255\255\255\255\255\255\255\255\028\000\255\255\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\ + \028\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\255\255\255\255\255\255\255\255\ + \029\000\255\255\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\ + \029\000\029\000\029\000\029\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\255\255\255\255\ + \255\255\255\255\255\255\255\255\255\255\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\255\255\ + \255\255\255\255\255\255\030\000\255\255\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\ + \030\000\030\000\030\000\030\000\030\000\030\000\030\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\255\255\255\255\255\255\255\255\031\000\255\255\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\ + \031\000\031\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\255\255\255\255\255\255\255\255\ + \255\255\255\255\255\255\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\255\255\255\255\255\255\ + \255\255\032\000\255\255\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\ + \032\000\032\000\032\000\032\000\032\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\255\255\ + \255\255\255\255\255\255\255\255\255\255\255\255\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \255\255\255\255\255\255\255\255\033\000\255\255\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\255\255\255\255\255\255\255\255\255\255\255\255\ + \255\255\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\255\255\255\255\255\255\255\255\034\000\ + \255\255\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\ + \034\000\034\000\034\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\255\255\255\255\255\255\ + \255\255\255\255\255\255\255\255\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\255\255\255\255\ + \255\255\255\255\035\000\255\255\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\ + \035\000\035\000\035\000\035\000\035\000\035\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \255\255\255\255\255\255\255\255\255\255\255\255\255\255\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\255\255\255\255\255\255\255\255\036\000\255\255\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\ + \036\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\255\255\255\255\255\255\255\255\255\255\ + \255\255\255\255\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\255\255\255\255\255\255\255\255\ + \037\000\255\255\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\ + \037\000\037\000\037\000\037\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 read_token lexbuf = + __ocaml_lex_read_token_rec lexbuf 0 +and __ocaml_lex_read_token_rec lexbuf __ocaml_lex_state = + match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with + | 0 -> +# 12 "lexer/lexer.mll" + ( TYPE ) +# 661 "lexer/lexer.ml" + + | 1 -> +# 13 "lexer/lexer.mll" + ( INT ) +# 666 "lexer/lexer.ml" + + | 2 -> +# 14 "lexer/lexer.mll" + ( STRING ) +# 671 "lexer/lexer.ml" + + | 3 -> +# 15 "lexer/lexer.mll" + ( DATE ) +# 676 "lexer/lexer.ml" + + | 4 -> +# 16 "lexer/lexer.mll" + ( RANGE ) +# 681 "lexer/lexer.ml" + + | 5 -> +# 17 "lexer/lexer.mll" + ( VALUES ) +# 686 "lexer/lexer.ml" + + | 6 -> +# 18 "lexer/lexer.mll" + ( LF ) +# 691 "lexer/lexer.ml" + + | 7 -> +# 19 "lexer/lexer.mll" + ( EQUALS ) +# 696 "lexer/lexer.ml" + + | 8 -> +# 20 "lexer/lexer.mll" + ( LEFT_BRACKET ) +# 701 "lexer/lexer.ml" + + | 9 -> +# 21 "lexer/lexer.mll" + ( RIGHT_BRACKET ) +# 706 "lexer/lexer.ml" + + | 10 -> +# 22 "lexer/lexer.mll" + ( COMMA ) +# 711 "lexer/lexer.ml" + + | 11 -> +# 23 "lexer/lexer.mll" + ( read_token lexbuf ) +# 716 "lexer/lexer.ml" + + | 12 -> +let +# 24 "lexer/lexer.mll" + ident +# 722 "lexer/lexer.ml" += Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in +# 24 "lexer/lexer.mll" + ( IDENT ident ) +# 726 "lexer/lexer.ml" + + | 13 -> +# 25 "lexer/lexer.mll" + ( EOF ) +# 731 "lexer/lexer.ml" + + | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; + __ocaml_lex_read_token_rec lexbuf __ocaml_lex_state + +;; + diff --git a/_build/default/lexer/lexer.mll b/_build/default/lexer/lexer.mll new file mode 100644 index 0000000..11f94d0 --- /dev/null +++ b/_build/default/lexer/lexer.mll @@ -0,0 +1,25 @@ +{ +open Parser +} + +let whitespace = [' ' '\t']+ +let newline = ('\n'|"\r\n") +let digit = ['0'-'9'] +let alpha = ['a'-'z' 'A'-'Z' '_'] +let alphanumeric = (alpha|digit) + +rule read_token = parse + | "type" { TYPE } + | "int" { INT } + | "string" { STRING } + | "date" { DATE } + | "range" { RANGE } + | "values" { VALUES } + | newline { LF } + | '=' { EQUALS } + | '[' { LEFT_BRACKET } + | ']' { RIGHT_BRACKET } + | ',' { COMMA } + | whitespace { read_token lexbuf } + | alphanumeric* as ident { IDENT ident } + | eof { EOF } diff --git a/_build/default/lib/.ast.objs/byte/ast.cmi b/_build/default/lib/.ast.objs/byte/ast.cmi new file mode 100644 index 0000000..0d85380 Binary files /dev/null and b/_build/default/lib/.ast.objs/byte/ast.cmi differ diff --git a/_build/default/lib/.ast.objs/byte/ast.cmo b/_build/default/lib/.ast.objs/byte/ast.cmo new file mode 100644 index 0000000..d5dac26 Binary files /dev/null and b/_build/default/lib/.ast.objs/byte/ast.cmo differ diff --git a/_build/default/lib/.ast.objs/byte/ast.cmt b/_build/default/lib/.ast.objs/byte/ast.cmt new file mode 100644 index 0000000..d1d0d1a Binary files /dev/null and b/_build/default/lib/.ast.objs/byte/ast.cmt differ diff --git a/_build/default/lib/.ast.objs/native/ast.cmx b/_build/default/lib/.ast.objs/native/ast.cmx new file mode 100644 index 0000000..4ffb951 Binary files /dev/null and b/_build/default/lib/.ast.objs/native/ast.cmx differ diff --git a/_build/default/lib/.ast.objs/native/ast.o b/_build/default/lib/.ast.objs/native/ast.o new file mode 100644 index 0000000..c8eadf9 Binary files /dev/null and b/_build/default/lib/.ast.objs/native/ast.o differ diff --git a/_build/default/lib/.merlin-conf/lib-ast b/_build/default/lib/.merlin-conf/lib-ast new file mode 100644 index 0000000..9ef2987 Binary files /dev/null and b/_build/default/lib/.merlin-conf/lib-ast differ diff --git a/_build/default/lib/ast.a b/_build/default/lib/ast.a new file mode 100644 index 0000000..4410b90 Binary files /dev/null and b/_build/default/lib/ast.a differ diff --git a/_build/default/lib/ast.cma b/_build/default/lib/ast.cma new file mode 100644 index 0000000..b2238c6 Binary files /dev/null and b/_build/default/lib/ast.cma differ diff --git a/_build/default/lib/ast.cmxa b/_build/default/lib/ast.cmxa new file mode 100644 index 0000000..1c63a8f Binary files /dev/null and b/_build/default/lib/ast.cmxa differ diff --git a/_build/default/lib/ast.cmxs b/_build/default/lib/ast.cmxs new file mode 100755 index 0000000..7d1df61 Binary files /dev/null and b/_build/default/lib/ast.cmxs differ diff --git a/_build/default/lib/ast.ml b/_build/default/lib/ast.ml new file mode 100644 index 0000000..4bdaad0 --- /dev/null +++ b/_build/default/lib/ast.ml @@ -0,0 +1,73 @@ +type data = + | Columns of column list +and column = + | Column of string * data_type * values (*name * type * value/range *) +and data_type = + | Int + | String + | Date +and values = + | Range of string * string + | Values of string list + +let random_int lower_bound upper_bound = + let i = Random.int (upper_bound +1 - lower_bound) + lower_bound in + string_of_int i + +let random_string values = + let len = List.length values in + let idx = Random.int len in + List.nth values idx + +let generate_row column = + match column with + | Column(_, Int, Range(min, max)) -> + let lower_bound = int_of_string min in + let upper_bound = int_of_string max in + random_int lower_bound upper_bound + | Column(_, String, Values(values)) -> + random_string values + | _ -> failwith "Invalid column" + +let get_headers columns = + let rec aux cols = + match cols with + | [] -> [] + | [Column(name, _, _)] -> [name] + | Column(name, _, _)::l -> name::(aux l) + in + match columns with + | Columns(cols) -> aux cols + + +let generate_rows columns n = + let aux col = + match col with + | Column(_, Int, Range(min, max)) -> + let lower_bound = int_of_string min in + let upper_bound = int_of_string max in + random_int lower_bound upper_bound + | Column(_, String, Values(values)) -> + random_string values + | _ -> failwith "Wrong column specification" + in + let rec aux1 cols = + match cols with + | [] -> [] + | [col] -> [aux col] + | col :: l -> (aux col)::(aux1 l) + in + let rec aux2 cols n = + match n with + | 0 -> [] + | n -> (aux1 cols)::(aux2 cols (n-1)) + in + aux2 columns n + + + +let generate_csv columns delim = + let header_list = get_headers columns in + let header = String.concat delim header_list in + print_string header + diff --git a/_build/default/mock_csv.dune-package b/_build/default/mock_csv.dune-package new file mode 100644 index 0000000..72407ec --- /dev/null +++ b/_build/default/mock_csv.dune-package @@ -0,0 +1,4 @@ +(lang dune 3.16) +(name mock_csv) +(sections (lib .) (bin ../../bin)) +(files (lib (META dune-package opam)) (bin (mock_csv))) diff --git a/_build/default/mock_csv.install b/_build/default/mock_csv.install new file mode 100644 index 0000000..1053572 --- /dev/null +++ b/_build/default/mock_csv.install @@ -0,0 +1,8 @@ +lib: [ + "_build/install/default/lib/mock_csv/META" + "_build/install/default/lib/mock_csv/dune-package" + "_build/install/default/lib/mock_csv/opam" +] +bin: [ + "_build/install/default/bin/mock_csv" +] diff --git a/_build/default/mock_csv.opam b/_build/default/mock_csv.opam new file mode 100644 index 0000000..25fce1a --- /dev/null +++ b/_build/default/mock_csv.opam @@ -0,0 +1,31 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A short synopsis" +description: "A longer description" +maintainer: ["Simon Petit"] +authors: ["Simon Petit"] +license: "LICENSE" +tags: ["topics" "to describe" "your" "project"] +homepage: "https://github.com/username/reponame" +doc: "https://url/to/documentation" +bug-reports: "https://github.com/username/reponame/issues" +depends: [ + "ocaml" + "dune" {>= "3.16"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/username/reponame.git" diff --git a/_build/default/parser/.merlin-conf/lib-parser b/_build/default/parser/.merlin-conf/lib-parser new file mode 100644 index 0000000..fe2b5a1 Binary files /dev/null and b/_build/default/parser/.merlin-conf/lib-parser differ diff --git a/_build/default/parser/.parser.objs/byte/parser.cmi b/_build/default/parser/.parser.objs/byte/parser.cmi new file mode 100644 index 0000000..0ad0938 Binary files /dev/null and b/_build/default/parser/.parser.objs/byte/parser.cmi differ diff --git a/_build/default/parser/.parser.objs/byte/parser.cmo b/_build/default/parser/.parser.objs/byte/parser.cmo new file mode 100644 index 0000000..ddc91ab Binary files /dev/null and b/_build/default/parser/.parser.objs/byte/parser.cmo differ diff --git a/_build/default/parser/.parser.objs/byte/parser.cmt b/_build/default/parser/.parser.objs/byte/parser.cmt new file mode 100644 index 0000000..d963257 Binary files /dev/null and b/_build/default/parser/.parser.objs/byte/parser.cmt differ diff --git a/_build/default/parser/.parser.objs/byte/parser.cmti b/_build/default/parser/.parser.objs/byte/parser.cmti new file mode 100644 index 0000000..a6e6f6a Binary files /dev/null and b/_build/default/parser/.parser.objs/byte/parser.cmti differ diff --git a/_build/default/parser/.parser.objs/native/parser.cmx b/_build/default/parser/.parser.objs/native/parser.cmx new file mode 100644 index 0000000..3ade8e6 Binary files /dev/null and b/_build/default/parser/.parser.objs/native/parser.cmx differ diff --git a/_build/default/parser/.parser.objs/native/parser.o b/_build/default/parser/.parser.objs/native/parser.o new file mode 100644 index 0000000..1b8e026 Binary files /dev/null and b/_build/default/parser/.parser.objs/native/parser.o differ diff --git a/_build/default/parser/.parser.objs/parser__mock.impl.all-deps b/_build/default/parser/.parser.objs/parser__mock.impl.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/parser/.parser.objs/parser__mock.impl.d b/_build/default/parser/.parser.objs/parser__mock.impl.d new file mode 100644 index 0000000..eb807be --- /dev/null +++ b/_build/default/parser/.parser.objs/parser__mock.impl.d @@ -0,0 +1 @@ +parser/parser__mock.ml.mock: Ast Lexing List diff --git a/_build/default/parser/parser.a b/_build/default/parser/parser.a new file mode 100644 index 0000000..413eb2a Binary files /dev/null and b/_build/default/parser/parser.a differ diff --git a/_build/default/parser/parser.cma b/_build/default/parser/parser.cma new file mode 100644 index 0000000..96adab5 Binary files /dev/null and b/_build/default/parser/parser.cma differ diff --git a/_build/default/parser/parser.cmxa b/_build/default/parser/parser.cmxa new file mode 100644 index 0000000..ef1df94 Binary files /dev/null and b/_build/default/parser/parser.cmxa differ diff --git a/_build/default/parser/parser.cmxs b/_build/default/parser/parser.cmxs new file mode 100755 index 0000000..9085390 Binary files /dev/null and b/_build/default/parser/parser.cmxs differ diff --git a/_build/default/parser/parser.conflicts b/_build/default/parser/parser.conflicts new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/parser/parser.ml b/_build/default/parser/parser.ml new file mode 100644 index 0000000..a74d1d9 --- /dev/null +++ b/_build/default/parser/parser.ml @@ -0,0 +1,463 @@ + +module MenhirBasics = struct + + exception Error + + let _eRR = + fun _s -> + raise Error + + type token = + | VALUES + | TYPE + | STRING + | RIGHT_BRACKET + | RANGE + | LF + | LEFT_BRACKET + | INT + | IDENT of ( +# 9 "parser/parser.mly" + (string) +# 23 "parser/parser.ml" + ) + | EQUALS + | EOF + | DATE + | COMMA + +end + +include MenhirBasics + +# 1 "parser/parser.mly" + +(* Header: Define the AST type *) +open Ast + +# 39 "parser/parser.ml" + +type ('s, 'r) _menhir_state = + | MenhirState00 : ('s, _menhir_box_main) _menhir_state + (** State 00. + Stack shape : . + Start symbol: main. *) + + | MenhirState07 : (('s, _menhir_box_main) _menhir_cell1_columns, _menhir_box_main) _menhir_state + (** State 07. + Stack shape : columns. + Start symbol: main. *) + + | MenhirState19 : (('s, _menhir_box_main) _menhir_cell1_column_name _menhir_cell0_column_type, _menhir_box_main) _menhir_state + (** State 19. + Stack shape : column_name column_type. + Start symbol: main. *) + + | MenhirState23 : ((('s, _menhir_box_main) _menhir_cell1_column_name _menhir_cell0_column_type, _menhir_box_main) _menhir_cell1_values, _menhir_box_main) _menhir_state + (** State 23. + Stack shape : column_name column_type values. + Start symbol: main. *) + + +and ('s, 'r) _menhir_cell1_column_name = + | MenhirCell1_column_name of 's * ('s, 'r) _menhir_state * (string) + +and 's _menhir_cell0_column_type = + | MenhirCell0_column_type of 's * (Ast.data_type) + +and ('s, 'r) _menhir_cell1_columns = + | MenhirCell1_columns of 's * ('s, 'r) _menhir_state * (Ast.column list) + +and ('s, 'r) _menhir_cell1_values = + | MenhirCell1_values of 's * ('s, 'r) _menhir_state * (string list) + +and _menhir_box_main = + | MenhirBox_main of (Ast.data) [@@unboxed] + +let _menhir_action_01 = + fun _1 _3 _5 -> + ( +# 25 "parser/parser.mly" + ( Column(_1, _3, _5) ) +# 83 "parser/parser.ml" + : (Ast.column)) + +let _menhir_action_02 = + fun _2 -> + ( +# 29 "parser/parser.mly" + ( _2 ) +# 91 "parser/parser.ml" + : (string)) + +let _menhir_action_03 = + fun () -> + ( +# 33 "parser/parser.mly" + ( Int ) +# 99 "parser/parser.ml" + : (Ast.data_type)) + +let _menhir_action_04 = + fun () -> + ( +# 34 "parser/parser.mly" + ( String ) +# 107 "parser/parser.ml" + : (Ast.data_type)) + +let _menhir_action_05 = + fun () -> + ( +# 35 "parser/parser.mly" + ( Date ) +# 115 "parser/parser.ml" + : (Ast.data_type)) + +let _menhir_action_06 = + fun _4 -> + ( +# 39 "parser/parser.mly" + ( Values(List.rev(_4)) ) +# 123 "parser/parser.ml" + : (Ast.values)) + +let _menhir_action_07 = + fun _4 -> + ( +# 40 "parser/parser.mly" + ( _4 ) +# 131 "parser/parser.ml" + : (Ast.values)) + +let _menhir_action_08 = + fun _1 -> + ( +# 20 "parser/parser.mly" + ( [_1] ) +# 139 "parser/parser.ml" + : (Ast.column list)) + +let _menhir_action_09 = + fun _1 _4 -> + ( +# 21 "parser/parser.mly" + ( _4::_1 ) +# 147 "parser/parser.ml" + : (Ast.column list)) + +let _menhir_action_10 = + fun _1 -> + ( +# 17 "parser/parser.mly" + ( Columns(List.rev(_1)) ) +# 155 "parser/parser.ml" + : (Ast.data)) + +let _menhir_action_11 = + fun _1 _3 -> + ( +# 49 "parser/parser.mly" + ( Range(_1, _3) ) +# 163 "parser/parser.ml" + : (Ast.values)) + +let _menhir_action_12 = + fun _1 -> + ( +# 53 "parser/parser.mly" + ( _1 ) +# 171 "parser/parser.ml" + : (string)) + +let _menhir_action_13 = + fun _1 -> + ( +# 44 "parser/parser.mly" + ( [_1] ) +# 179 "parser/parser.ml" + : (string list)) + +let _menhir_action_14 = + fun _1 _3 -> + ( +# 45 "parser/parser.mly" + ( _3::_1 ) +# 187 "parser/parser.ml" + : (string list)) + +let _menhir_print_token : token -> string = + fun _tok -> + match _tok with + | COMMA -> + "COMMA" + | DATE -> + "DATE" + | EOF -> + "EOF" + | EQUALS -> + "EQUALS" + | IDENT _ -> + "IDENT" + | INT -> + "INT" + | LEFT_BRACKET -> + "LEFT_BRACKET" + | LF -> + "LF" + | RANGE -> + "RANGE" + | RIGHT_BRACKET -> + "RIGHT_BRACKET" + | STRING -> + "STRING" + | TYPE -> + "TYPE" + | VALUES -> + "VALUES" + +let _menhir_fail : unit -> 'a = + fun () -> + Printf.eprintf "Internal failure -- please contact the parser generator's developers.\n%!"; + assert false + +include struct + + [@@@ocaml.warning "-4-37"] + + let rec _menhir_run_01 : type ttv_stack. ttv_stack -> _ -> _ -> (ttv_stack, _menhir_box_main) _menhir_state -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _menhir_s -> + let _tok = _menhir_lexer _menhir_lexbuf in + match (_tok : MenhirBasics.token) with + | IDENT _v -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | RIGHT_BRACKET -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _2 = _v in + let _v = _menhir_action_02 _2 in + let _menhir_stack = MenhirCell1_column_name (_menhir_stack, _menhir_s, _v) in + (match (_tok : MenhirBasics.token) with + | LF -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | TYPE -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | EQUALS -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | STRING -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _v = _menhir_action_04 () in + _menhir_goto_column_type _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | INT -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _v = _menhir_action_03 () in + _menhir_goto_column_type _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | DATE -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _v = _menhir_action_05 () in + _menhir_goto_column_type _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR () + + and _menhir_goto_column_type : type ttv_stack. (ttv_stack, _menhir_box_main) _menhir_cell1_column_name -> _ -> _ -> _ -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok -> + let _menhir_stack = MenhirCell0_column_type (_menhir_stack, _v) in + match (_tok : MenhirBasics.token) with + | LF -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | VALUES -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | EQUALS -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | LEFT_BRACKET -> + let _menhir_s = MenhirState19 in + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | IDENT _v -> + _menhir_run_20 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | RANGE -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | EQUALS -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | LEFT_BRACKET -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | IDENT _v_1 -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | COMMA -> + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | IDENT _v_2 -> + let _tok = _menhir_lexer _menhir_lexbuf in + let (_3, _1) = (_v_2, _v_1) in + let _v = _menhir_action_11 _1 _3 in + (match (_tok : MenhirBasics.token) with + | RIGHT_BRACKET -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _4 = _v in + let _v = _menhir_action_07 _4 in + _menhir_goto_column_value _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | _ -> + _eRR () + + and _menhir_run_20 : type ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_main) _menhir_state -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _1 = _v in + let _v = _menhir_action_12 _1 in + _menhir_goto_value _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + + and _menhir_goto_value : type ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_main) _menhir_state -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok -> + match _menhir_s with + | MenhirState19 -> + _menhir_run_25 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + | MenhirState23 -> + _menhir_run_24 _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | _ -> + _menhir_fail () + + and _menhir_run_25 : type ttv_stack. ((ttv_stack, _menhir_box_main) _menhir_cell1_column_name _menhir_cell0_column_type as 'stack) -> _ -> _ -> _ -> ('stack, _menhir_box_main) _menhir_state -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok -> + let _1 = _v in + let _v = _menhir_action_13 _1 in + _menhir_goto_values _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + + and _menhir_goto_values : type ttv_stack. ((ttv_stack, _menhir_box_main) _menhir_cell1_column_name _menhir_cell0_column_type as 'stack) -> _ -> _ -> _ -> ('stack, _menhir_box_main) _menhir_state -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok -> + match (_tok : MenhirBasics.token) with + | RIGHT_BRACKET -> + let _tok = _menhir_lexer _menhir_lexbuf in + let _4 = _v in + let _v = _menhir_action_06 _4 in + _menhir_goto_column_value _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | COMMA -> + let _menhir_stack = MenhirCell1_values (_menhir_stack, _menhir_s, _v) in + let _menhir_s = MenhirState23 in + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | IDENT _v -> + _menhir_run_20 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s + | _ -> + _eRR ()) + | _ -> + _eRR () + + and _menhir_goto_column_value : type ttv_stack. (ttv_stack, _menhir_box_main) _menhir_cell1_column_name _menhir_cell0_column_type -> _ -> _ -> _ -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok -> + let MenhirCell0_column_type (_menhir_stack, _3) = _menhir_stack in + let MenhirCell1_column_name (_menhir_stack, _menhir_s, _1) = _menhir_stack in + let _5 = _v in + let _v = _menhir_action_01 _1 _3 _5 in + _menhir_goto_column _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + + and _menhir_goto_column : type ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_main) _menhir_state -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok -> + match _menhir_s with + | MenhirState00 -> + _menhir_run_37 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + | MenhirState07 -> + _menhir_run_35 _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok + | _ -> + _menhir_fail () + + and _menhir_run_37 : type ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_main) _menhir_state -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok -> + let _1 = _v in + let _v = _menhir_action_08 _1 in + _menhir_goto_columns _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + + and _menhir_goto_columns : type ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_main) _menhir_state -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok -> + match (_tok : MenhirBasics.token) with + | LF -> + let _menhir_stack = MenhirCell1_columns (_menhir_stack, _menhir_s, _v) in + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | LF -> + let _menhir_s = MenhirState07 in + let _tok = _menhir_lexer _menhir_lexbuf in + (match (_tok : MenhirBasics.token) with + | LEFT_BRACKET -> + _menhir_run_01 _menhir_stack _menhir_lexbuf _menhir_lexer _menhir_s + | _ -> + _eRR ()) + | _ -> + _eRR ()) + | EOF -> + let _1 = _v in + let _v = _menhir_action_10 _1 in + MenhirBox_main _v + | _ -> + _eRR () + + and _menhir_run_35 : type ttv_stack. (ttv_stack, _menhir_box_main) _menhir_cell1_columns -> _ -> _ -> _ -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok -> + let MenhirCell1_columns (_menhir_stack, _menhir_s, _1) = _menhir_stack in + let _4 = _v in + let _v = _menhir_action_09 _1 _4 in + _menhir_goto_columns _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + + and _menhir_run_24 : type ttv_stack. ((ttv_stack, _menhir_box_main) _menhir_cell1_column_name _menhir_cell0_column_type, _menhir_box_main) _menhir_cell1_values -> _ -> _ -> _ -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok -> + let MenhirCell1_values (_menhir_stack, _menhir_s, _1) = _menhir_stack in + let _3 = _v in + let _v = _menhir_action_14 _1 _3 in + _menhir_goto_values _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok + + let _menhir_run_00 : type ttv_stack. ttv_stack -> _ -> _ -> _menhir_box_main = + fun _menhir_stack _menhir_lexbuf _menhir_lexer -> + let _menhir_s = MenhirState00 in + let _tok = _menhir_lexer _menhir_lexbuf in + match (_tok : MenhirBasics.token) with + | LEFT_BRACKET -> + _menhir_run_01 _menhir_stack _menhir_lexbuf _menhir_lexer _menhir_s + | _ -> + _eRR () + +end + +let main = + fun _menhir_lexer _menhir_lexbuf -> + let _menhir_stack = () in + let MenhirBox_main v = _menhir_run_00 _menhir_stack _menhir_lexbuf _menhir_lexer in + v diff --git a/_build/default/parser/parser.mli b/_build/default/parser/parser.mli new file mode 100644 index 0000000..a1babd4 --- /dev/null +++ b/_build/default/parser/parser.mli @@ -0,0 +1,25 @@ + +(* The type of tokens. *) + +type token = + | VALUES + | TYPE + | STRING + | RIGHT_BRACKET + | RANGE + | LF + | LEFT_BRACKET + | INT + | IDENT of (string) + | EQUALS + | EOF + | DATE + | COMMA + +(* This exception is raised by the monolithic API functions. *) + +exception Error + +(* The monolithic API. *) + +val main: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Ast.data) diff --git a/_build/default/parser/parser.mly b/_build/default/parser/parser.mly new file mode 100644 index 0000000..d1ff77f --- /dev/null +++ b/_build/default/parser/parser.mly @@ -0,0 +1,53 @@ +%{ +(* Header: Define the AST type *) +open Ast +%} + +%token EQUALS COMMA LEFT_BRACKET RIGHT_BRACKET LF +%token INT STRING DATE +%token TYPE RANGE VALUES +%token IDENT +%token EOF +%start main +%type main + +%% + +main: + | columns EOF { Columns(List.rev($1)) } + +columns: + | column { [$1] } + | columns LF LF column { $4::$1 } + + +column : + | column_name LF column_type LF column_value { Column($1, $3, $5) } + + +column_name : + | LEFT_BRACKET IDENT RIGHT_BRACKET { $2 } + + +column_type: + | TYPE EQUALS INT { Int } + | TYPE EQUALS STRING { String } + | TYPE EQUALS DATE { Date } + + +column_value: + | VALUES EQUALS LEFT_BRACKET values RIGHT_BRACKET { Values(List.rev($4)) } + | RANGE EQUALS LEFT_BRACKET range RIGHT_BRACKET { $4 } + + +values : + | value { [$1] } + | values COMMA value { $3::$1 } + + +range : + | IDENT COMMA IDENT { Range($1, $3) } + + +value: + | IDENT { $1 } diff --git a/_build/default/parser/parser__mock.ml.mock b/_build/default/parser/parser__mock.ml.mock new file mode 100644 index 0000000..612b4bc --- /dev/null +++ b/_build/default/parser/parser__mock.ml.mock @@ -0,0 +1,307 @@ + +type token = + | VALUES + | TYPE + | STRING + | RIGHT_BRACKET + | RANGE + | LF + | LEFT_BRACKET + | INT + | IDENT of ( +# 9 "parser/parser.mly" + (string) +# 15 "parser/parser__mock.ml.mock" +) + | EQUALS + | EOF + | DATE + | COMMA + +# 1 "parser/parser.mly" + +(* Header: Define the AST type *) +open Ast + +# 27 "parser/parser__mock.ml.mock" + +let menhir_begin_marker = + 0 + +and (xv_values, xv_value, xv_range, xv_main, xv_columns, xv_column_value, xv_column_type, xv_column_name, xv_column) = + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 45 "parser/parser.mly" + _3 +# 36 "parser/parser__mock.ml.mock" + : 'tv_value) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 45 "parser/parser.mly" + _2 +# 40 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 45 "parser/parser.mly" + _1 +# 44 "parser/parser__mock.ml.mock" + : 'tv_values) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_values -> + +# 45 "parser/parser.mly" + ( _3::_1 ) +# 49 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 44 "parser/parser.mly" + _1 +# 54 "parser/parser__mock.ml.mock" + : 'tv_value) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_values -> + +# 44 "parser/parser.mly" + ( [_1] ) +# 59 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 53 "parser/parser.mly" + _1 +# 64 "parser/parser__mock.ml.mock" + : ( +# 9 "parser/parser.mly" + (string) +# 68 "parser/parser__mock.ml.mock" + )) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_value -> + +# 53 "parser/parser.mly" + ( _1 ) +# 73 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 49 "parser/parser.mly" + _3 +# 78 "parser/parser__mock.ml.mock" + : ( +# 9 "parser/parser.mly" + (string) +# 82 "parser/parser__mock.ml.mock" + )) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 49 "parser/parser.mly" + _2 +# 86 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 49 "parser/parser.mly" + _1 +# 90 "parser/parser__mock.ml.mock" + : ( +# 9 "parser/parser.mly" + (string) +# 94 "parser/parser__mock.ml.mock" + )) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_range -> + +# 49 "parser/parser.mly" + ( Range(_1, _3) ) +# 99 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 17 "parser/parser.mly" + _2 +# 104 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 17 "parser/parser.mly" + _1 +# 108 "parser/parser__mock.ml.mock" + : 'tv_columns) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : ( +# 12 "parser/parser.mly" + (data) +# 112 "parser/parser__mock.ml.mock" + ) -> + ( +# 17 "parser/parser.mly" + ( Columns(List.rev(_1)) ) +# 117 "parser/parser__mock.ml.mock" + : 'tv_main) in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 21 "parser/parser.mly" + _4 +# 122 "parser/parser__mock.ml.mock" + : 'tv_column) (_startpos__4_ : Lexing.position) (_endpos__4_ : Lexing.position) (_startofs__4_ : int) (_endofs__4_ : int) (_loc__4_ : Lexing.position * Lexing.position) ( +# 21 "parser/parser.mly" + _3 +# 126 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 21 "parser/parser.mly" + _2 +# 130 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 21 "parser/parser.mly" + _1 +# 134 "parser/parser__mock.ml.mock" + : 'tv_columns) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_columns -> + +# 21 "parser/parser.mly" + ( _4::_1 ) +# 139 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 20 "parser/parser.mly" + _1 +# 144 "parser/parser__mock.ml.mock" + : 'tv_column) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_columns -> + +# 20 "parser/parser.mly" + ( [_1] ) +# 149 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 40 "parser/parser.mly" + _5 +# 154 "parser/parser__mock.ml.mock" + : unit) (_startpos__5_ : Lexing.position) (_endpos__5_ : Lexing.position) (_startofs__5_ : int) (_endofs__5_ : int) (_loc__5_ : Lexing.position * Lexing.position) ( +# 40 "parser/parser.mly" + _4 +# 158 "parser/parser__mock.ml.mock" + : 'tv_range) (_startpos__4_ : Lexing.position) (_endpos__4_ : Lexing.position) (_startofs__4_ : int) (_endofs__4_ : int) (_loc__4_ : Lexing.position * Lexing.position) ( +# 40 "parser/parser.mly" + _3 +# 162 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 40 "parser/parser.mly" + _2 +# 166 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 40 "parser/parser.mly" + _1 +# 170 "parser/parser__mock.ml.mock" + : unit) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column_value -> + +# 40 "parser/parser.mly" + ( _4 ) +# 175 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 39 "parser/parser.mly" + _5 +# 180 "parser/parser__mock.ml.mock" + : unit) (_startpos__5_ : Lexing.position) (_endpos__5_ : Lexing.position) (_startofs__5_ : int) (_endofs__5_ : int) (_loc__5_ : Lexing.position * Lexing.position) ( +# 39 "parser/parser.mly" + _4 +# 184 "parser/parser__mock.ml.mock" + : 'tv_values) (_startpos__4_ : Lexing.position) (_endpos__4_ : Lexing.position) (_startofs__4_ : int) (_endofs__4_ : int) (_loc__4_ : Lexing.position * Lexing.position) ( +# 39 "parser/parser.mly" + _3 +# 188 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 39 "parser/parser.mly" + _2 +# 192 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 39 "parser/parser.mly" + _1 +# 196 "parser/parser__mock.ml.mock" + : unit) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column_value -> + +# 39 "parser/parser.mly" + ( Values(List.rev(_4)) ) +# 201 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 35 "parser/parser.mly" + _3 +# 206 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 35 "parser/parser.mly" + _2 +# 210 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 35 "parser/parser.mly" + _1 +# 214 "parser/parser__mock.ml.mock" + : unit) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column_type -> + +# 35 "parser/parser.mly" + ( Date ) +# 219 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 34 "parser/parser.mly" + _3 +# 224 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 34 "parser/parser.mly" + _2 +# 228 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 34 "parser/parser.mly" + _1 +# 232 "parser/parser__mock.ml.mock" + : unit) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column_type -> + +# 34 "parser/parser.mly" + ( String ) +# 237 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 33 "parser/parser.mly" + _3 +# 242 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 33 "parser/parser.mly" + _2 +# 246 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 33 "parser/parser.mly" + _1 +# 250 "parser/parser__mock.ml.mock" + : unit) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column_type -> + +# 33 "parser/parser.mly" + ( Int ) +# 255 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 29 "parser/parser.mly" + _3 +# 260 "parser/parser__mock.ml.mock" + : unit) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 29 "parser/parser.mly" + _2 +# 264 "parser/parser__mock.ml.mock" + : ( +# 9 "parser/parser.mly" + (string) +# 268 "parser/parser__mock.ml.mock" + )) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 29 "parser/parser.mly" + _1 +# 272 "parser/parser__mock.ml.mock" + : unit) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column_name -> + +# 29 "parser/parser.mly" + ( _2 ) +# 277 "parser/parser__mock.ml.mock" + in + let _ = fun (_startpos : Lexing.position) (_endpos : Lexing.position) (_endpos__0_ : Lexing.position) (_symbolstartpos : Lexing.position) (_startofs : int) (_endofs : int) (_endofs__0_ : int) (_symbolstartofs : int) (_sloc : Lexing.position * Lexing.position) (_loc : Lexing.position * Lexing.position) ( +# 25 "parser/parser.mly" + _5 +# 282 "parser/parser__mock.ml.mock" + : 'tv_column_value) (_startpos__5_ : Lexing.position) (_endpos__5_ : Lexing.position) (_startofs__5_ : int) (_endofs__5_ : int) (_loc__5_ : Lexing.position * Lexing.position) ( +# 25 "parser/parser.mly" + _4 +# 286 "parser/parser__mock.ml.mock" + : unit) (_startpos__4_ : Lexing.position) (_endpos__4_ : Lexing.position) (_startofs__4_ : int) (_endofs__4_ : int) (_loc__4_ : Lexing.position * Lexing.position) ( +# 25 "parser/parser.mly" + _3 +# 290 "parser/parser__mock.ml.mock" + : 'tv_column_type) (_startpos__3_ : Lexing.position) (_endpos__3_ : Lexing.position) (_startofs__3_ : int) (_endofs__3_ : int) (_loc__3_ : Lexing.position * Lexing.position) ( +# 25 "parser/parser.mly" + _2 +# 294 "parser/parser__mock.ml.mock" + : unit) (_startpos__2_ : Lexing.position) (_endpos__2_ : Lexing.position) (_startofs__2_ : int) (_endofs__2_ : int) (_loc__2_ : Lexing.position * Lexing.position) ( +# 25 "parser/parser.mly" + _1 +# 298 "parser/parser__mock.ml.mock" + : 'tv_column_name) (_startpos__1_ : Lexing.position) (_endpos__1_ : Lexing.position) (_startofs__1_ : int) (_endofs__1_ : int) (_loc__1_ : Lexing.position * Lexing.position) : 'tv_column -> + +# 25 "parser/parser.mly" + ( Column(_1, _3, _5) ) +# 303 "parser/parser__mock.ml.mock" + in + ((let rec diverge() = diverge() in diverge()) : 'tv_values * 'tv_value * 'tv_range * 'tv_main * 'tv_columns * 'tv_column_value * 'tv_column_type * 'tv_column_name * 'tv_column) + +and menhir_end_marker = + 0 diff --git a/_build/default/parser/parser__mock.mli.inferred b/_build/default/parser/parser__mock.mli.inferred new file mode 100644 index 0000000..67df411 --- /dev/null +++ b/_build/default/parser/parser__mock.mli.inferred @@ -0,0 +1,25 @@ +type token = + VALUES + | TYPE + | STRING + | RIGHT_BRACKET + | RANGE + | LF + | LEFT_BRACKET + | INT + | IDENT of string + | EQUALS + | EOF + | DATE + | COMMA +val menhir_begin_marker : int +val xv_values : string list +val xv_value : string +val xv_range : Ast.values +val xv_main : Ast.data +val xv_columns : Ast.column list +val xv_column_value : Ast.values +val xv_column_type : Ast.data_type +val xv_column_name : string +val xv_column : Ast.column +val menhir_end_marker : int diff --git a/_build/default/test/.merlin-conf/exe-test_header b/_build/default/test/.merlin-conf/exe-test_header new file mode 100644 index 0000000..d56cb39 Binary files /dev/null and b/_build/default/test/.merlin-conf/exe-test_header differ diff --git a/_build/default/test/.merlin-conf/exe-test_mock_csv b/_build/default/test/.merlin-conf/exe-test_mock_csv new file mode 100644 index 0000000..0126541 Binary files /dev/null and b/_build/default/test/.merlin-conf/exe-test_mock_csv differ diff --git a/_build/default/test/.merlin-conf/exe-test_random_int b/_build/default/test/.merlin-conf/exe-test_random_int new file mode 100644 index 0000000..1b3e116 Binary files /dev/null and b/_build/default/test/.merlin-conf/exe-test_random_int differ diff --git a/_build/default/test/.test_header.eobjs/byte/dune__exe.cmi b/_build/default/test/.test_header.eobjs/byte/dune__exe.cmi new file mode 100644 index 0000000..555f9a3 Binary files /dev/null and b/_build/default/test/.test_header.eobjs/byte/dune__exe.cmi differ diff --git a/_build/default/test/.test_header.eobjs/byte/dune__exe.cmo b/_build/default/test/.test_header.eobjs/byte/dune__exe.cmo new file mode 100644 index 0000000..83073f2 Binary files /dev/null and b/_build/default/test/.test_header.eobjs/byte/dune__exe.cmo differ diff --git a/_build/default/test/.test_header.eobjs/byte/dune__exe.cmt b/_build/default/test/.test_header.eobjs/byte/dune__exe.cmt new file mode 100644 index 0000000..f7632fb Binary files /dev/null and b/_build/default/test/.test_header.eobjs/byte/dune__exe.cmt differ diff --git a/_build/default/test/.test_header.eobjs/byte/dune__exe__Test_header.cmi b/_build/default/test/.test_header.eobjs/byte/dune__exe__Test_header.cmi new file mode 100644 index 0000000..ae2f71d Binary files /dev/null and b/_build/default/test/.test_header.eobjs/byte/dune__exe__Test_header.cmi differ diff --git a/_build/default/test/.test_header.eobjs/byte/dune__exe__Test_header.cmti b/_build/default/test/.test_header.eobjs/byte/dune__exe__Test_header.cmti new file mode 100644 index 0000000..5451995 Binary files /dev/null and b/_build/default/test/.test_header.eobjs/byte/dune__exe__Test_header.cmti differ diff --git a/_build/default/test/.test_header.eobjs/dune__exe.ml-gen b/_build/default/test/.test_header.eobjs/dune__exe.ml-gen new file mode 100644 index 0000000..c3f7938 --- /dev/null +++ b/_build/default/test/.test_header.eobjs/dune__exe.ml-gen @@ -0,0 +1,13 @@ +(* generated by dune *) + +(** @canonical Dune__exe.Test_generate_row *) +module Test_generate_row = Dune__exe__Test_generate_row + +(** @canonical Dune__exe.Test_header *) +module Test_header = Dune__exe__Test_header + +(** @canonical Dune__exe.Test_mock_csv *) +module Test_mock_csv = Dune__exe__Test_mock_csv + +(** @canonical Dune__exe.Test_random_int *) +module Test_random_int = Dune__exe__Test_random_int diff --git a/_build/default/test/.test_header.eobjs/dune__exe__Test_header.impl.all-deps b/_build/default/test/.test_header.eobjs/dune__exe__Test_header.impl.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/test/.test_header.eobjs/dune__exe__Test_header.impl.d b/_build/default/test/.test_header.eobjs/dune__exe__Test_header.impl.d new file mode 100644 index 0000000..8818de5 --- /dev/null +++ b/_build/default/test/.test_header.eobjs/dune__exe__Test_header.impl.d @@ -0,0 +1 @@ +test/test_header.ml: Ast diff --git a/_build/default/test/.test_header.eobjs/dune__exe__Test_header.intf.all-deps b/_build/default/test/.test_header.eobjs/dune__exe__Test_header.intf.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/test/.test_header.eobjs/dune__exe__Test_header.intf.d b/_build/default/test/.test_header.eobjs/dune__exe__Test_header.intf.d new file mode 100644 index 0000000..5b71eca --- /dev/null +++ b/_build/default/test/.test_header.eobjs/dune__exe__Test_header.intf.d @@ -0,0 +1 @@ +test/test_header.mli: diff --git a/_build/default/test/.test_header.eobjs/native/dune__exe.cmx b/_build/default/test/.test_header.eobjs/native/dune__exe.cmx new file mode 100644 index 0000000..bef368d Binary files /dev/null and b/_build/default/test/.test_header.eobjs/native/dune__exe.cmx differ diff --git a/_build/default/test/.test_header.eobjs/native/dune__exe.o b/_build/default/test/.test_header.eobjs/native/dune__exe.o new file mode 100644 index 0000000..951c22f Binary files /dev/null and b/_build/default/test/.test_header.eobjs/native/dune__exe.o differ diff --git a/_build/default/test/.test_header.eobjs/native/dune__exe__Test_header.cmx b/_build/default/test/.test_header.eobjs/native/dune__exe__Test_header.cmx new file mode 100644 index 0000000..d7d5860 Binary files /dev/null and b/_build/default/test/.test_header.eobjs/native/dune__exe__Test_header.cmx differ diff --git a/_build/default/test/.test_header.eobjs/native/dune__exe__Test_header.o b/_build/default/test/.test_header.eobjs/native/dune__exe__Test_header.o new file mode 100644 index 0000000..84b0b25 Binary files /dev/null and b/_build/default/test/.test_header.eobjs/native/dune__exe__Test_header.o differ diff --git a/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmi b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmi new file mode 100644 index 0000000..33a2437 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmi differ diff --git a/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmo b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmo new file mode 100644 index 0000000..2ae5665 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmo differ diff --git a/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmt b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmt new file mode 100644 index 0000000..ecee821 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe.cmt differ diff --git a/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe__Test_mock_csv.cmi b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe__Test_mock_csv.cmi new file mode 100644 index 0000000..bed84c0 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe__Test_mock_csv.cmi differ diff --git a/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe__Test_mock_csv.cmti b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe__Test_mock_csv.cmti new file mode 100644 index 0000000..f0b511f Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/byte/dune__exe__Test_mock_csv.cmti differ diff --git a/_build/default/test/.test_mock_csv.eobjs/dune__exe.ml-gen b/_build/default/test/.test_mock_csv.eobjs/dune__exe.ml-gen new file mode 100644 index 0000000..c3f7938 --- /dev/null +++ b/_build/default/test/.test_mock_csv.eobjs/dune__exe.ml-gen @@ -0,0 +1,13 @@ +(* generated by dune *) + +(** @canonical Dune__exe.Test_generate_row *) +module Test_generate_row = Dune__exe__Test_generate_row + +(** @canonical Dune__exe.Test_header *) +module Test_header = Dune__exe__Test_header + +(** @canonical Dune__exe.Test_mock_csv *) +module Test_mock_csv = Dune__exe__Test_mock_csv + +(** @canonical Dune__exe.Test_random_int *) +module Test_random_int = Dune__exe__Test_random_int diff --git a/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.impl.all-deps b/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.impl.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.impl.d b/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.impl.d new file mode 100644 index 0000000..9a2e17c --- /dev/null +++ b/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.impl.d @@ -0,0 +1 @@ +test/test_mock_csv.ml: Ast Lexer Lexing Parser diff --git a/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.intf.all-deps b/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.intf.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.intf.d b/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.intf.d new file mode 100644 index 0000000..527ae1b --- /dev/null +++ b/_build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.intf.d @@ -0,0 +1 @@ +test/test_mock_csv.mli: diff --git a/_build/default/test/.test_mock_csv.eobjs/native/dune__exe.cmx b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe.cmx new file mode 100644 index 0000000..76cc636 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe.cmx differ diff --git a/_build/default/test/.test_mock_csv.eobjs/native/dune__exe.o b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe.o new file mode 100644 index 0000000..951c22f Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe.o differ diff --git a/_build/default/test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.cmx b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.cmx new file mode 100644 index 0000000..4e1b4c5 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.cmx differ diff --git a/_build/default/test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.o b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.o new file mode 100644 index 0000000..d6f9783 Binary files /dev/null and b/_build/default/test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.o differ diff --git a/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmi b/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmi new file mode 100644 index 0000000..bf7b640 Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmi differ diff --git a/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmo b/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmo new file mode 100644 index 0000000..7a6af05 Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmo differ diff --git a/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmt b/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmt new file mode 100644 index 0000000..3cb74a4 Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/byte/dune__exe.cmt differ diff --git a/_build/default/test/.test_random_int.eobjs/byte/dune__exe__Test_random_int.cmi b/_build/default/test/.test_random_int.eobjs/byte/dune__exe__Test_random_int.cmi new file mode 100644 index 0000000..b6872b9 Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/byte/dune__exe__Test_random_int.cmi differ diff --git a/_build/default/test/.test_random_int.eobjs/byte/dune__exe__Test_random_int.cmti b/_build/default/test/.test_random_int.eobjs/byte/dune__exe__Test_random_int.cmti new file mode 100644 index 0000000..55919fe Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/byte/dune__exe__Test_random_int.cmti differ diff --git a/_build/default/test/.test_random_int.eobjs/dune__exe.ml-gen b/_build/default/test/.test_random_int.eobjs/dune__exe.ml-gen new file mode 100644 index 0000000..c3f7938 --- /dev/null +++ b/_build/default/test/.test_random_int.eobjs/dune__exe.ml-gen @@ -0,0 +1,13 @@ +(* generated by dune *) + +(** @canonical Dune__exe.Test_generate_row *) +module Test_generate_row = Dune__exe__Test_generate_row + +(** @canonical Dune__exe.Test_header *) +module Test_header = Dune__exe__Test_header + +(** @canonical Dune__exe.Test_mock_csv *) +module Test_mock_csv = Dune__exe__Test_mock_csv + +(** @canonical Dune__exe.Test_random_int *) +module Test_random_int = Dune__exe__Test_random_int diff --git a/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.impl.all-deps b/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.impl.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.impl.d b/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.impl.d new file mode 100644 index 0000000..bb147cd --- /dev/null +++ b/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.impl.d @@ -0,0 +1 @@ +test/test_random_int.ml: Ast diff --git a/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.intf.all-deps b/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.intf.all-deps new file mode 100644 index 0000000..e69de29 diff --git a/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.intf.d b/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.intf.d new file mode 100644 index 0000000..f4f28a5 --- /dev/null +++ b/_build/default/test/.test_random_int.eobjs/dune__exe__Test_random_int.intf.d @@ -0,0 +1 @@ +test/test_random_int.mli: diff --git a/_build/default/test/.test_random_int.eobjs/native/dune__exe.cmx b/_build/default/test/.test_random_int.eobjs/native/dune__exe.cmx new file mode 100644 index 0000000..eeb4f46 Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/native/dune__exe.cmx differ diff --git a/_build/default/test/.test_random_int.eobjs/native/dune__exe.o b/_build/default/test/.test_random_int.eobjs/native/dune__exe.o new file mode 100644 index 0000000..951c22f Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/native/dune__exe.o differ diff --git a/_build/default/test/.test_random_int.eobjs/native/dune__exe__Test_random_int.cmx b/_build/default/test/.test_random_int.eobjs/native/dune__exe__Test_random_int.cmx new file mode 100644 index 0000000..50b51aa Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/native/dune__exe__Test_random_int.cmx differ diff --git a/_build/default/test/.test_random_int.eobjs/native/dune__exe__Test_random_int.o b/_build/default/test/.test_random_int.eobjs/native/dune__exe__Test_random_int.o new file mode 100644 index 0000000..d1ab8e1 Binary files /dev/null and b/_build/default/test/.test_random_int.eobjs/native/dune__exe__Test_random_int.o differ diff --git a/_build/default/test/files/test1.toml b/_build/default/test/files/test1.toml new file mode 100644 index 0000000..e07aeab --- /dev/null +++ b/_build/default/test/files/test1.toml @@ -0,0 +1,3 @@ +[id] +type=int +range=[0,1000] diff --git a/_build/default/test/test_header.exe b/_build/default/test/test_header.exe new file mode 100755 index 0000000..4e37eac Binary files /dev/null and b/_build/default/test/test_header.exe differ diff --git a/_build/default/test/test_header.ml b/_build/default/test/test_header.ml new file mode 100644 index 0000000..4bbb6cd --- /dev/null +++ b/_build/default/test/test_header.ml @@ -0,0 +1,28 @@ +open Ast + +let () = + let cols = Columns([ + Column( + "id", + Int, + Values("test"::"test"::[]) + ) + ]) in + let headers = get_headers cols in + assert(headers = ["id"]); + + let cols = Columns( + Column( + "id", + Int, + Values("test"::"test"::[]) + ):: + Column( + "name", + Int, + Range("1", "2") + )::[] + ) in + let headers = get_headers cols in + assert(headers = "id"::"name"::[]); + diff --git a/_build/default/test/test_header.mli b/_build/default/test/test_header.mli new file mode 100644 index 0000000..335ae1f --- /dev/null +++ b/_build/default/test/test_header.mli @@ -0,0 +1 @@ +(* Auto-generated by Dune *) \ No newline at end of file diff --git a/_build/default/test/test_mock_csv.exe b/_build/default/test/test_mock_csv.exe new file mode 100755 index 0000000..3c847d8 Binary files /dev/null and b/_build/default/test/test_mock_csv.exe differ diff --git a/_build/default/test/test_mock_csv.ml b/_build/default/test/test_mock_csv.ml new file mode 100644 index 0000000..5c562ee --- /dev/null +++ b/_build/default/test/test_mock_csv.ml @@ -0,0 +1,55 @@ +open Ast + +let parse_config config = + let lexbuf = Lexing.from_string config in + Parser.main Lexer.read_token lexbuf + +let () = + assert (parse_config "[id]\ntype=string\nvalues=[test, test]" = Columns([ + Column( + "id", + String, + Values(["test";"test"]) + ) + ]) +); + + assert (parse_config "[id]\n type = int \n range = [7, 77]" = Columns([ + Column( + "id", + Int, + Range("7","77") + ) + ]) +); + assert (parse_config "[id]\ntype=int\nrange=[7,77]\n\n[name]\ntype=string\nvalues=[Alice,Bob]" = + Columns([ + Column( + "id", + Int, + Range("7","77") + ); + Column( + "name", + String, + Values(["Alice";"Bob"]) + ) + ]) +); + + + let ic = open_in "files/test1.toml" in + let len = in_channel_length ic in + let config = really_input_string ic len in + print_string config; + + let cols = parse_config config in + assert (cols = + Columns([ + Column( + "id", + Int, + Range("0", "1000") + ) + ]) + ); diff --git a/_build/default/test/test_mock_csv.mli b/_build/default/test/test_mock_csv.mli new file mode 100644 index 0000000..335ae1f --- /dev/null +++ b/_build/default/test/test_mock_csv.mli @@ -0,0 +1 @@ +(* Auto-generated by Dune *) \ No newline at end of file diff --git a/_build/default/test/test_random_int.exe b/_build/default/test/test_random_int.exe new file mode 100755 index 0000000..98ec6d3 Binary files /dev/null and b/_build/default/test/test_random_int.exe differ diff --git a/_build/default/test/test_random_int.ml b/_build/default/test/test_random_int.ml new file mode 100644 index 0000000..55cd707 --- /dev/null +++ b/_build/default/test/test_random_int.ml @@ -0,0 +1,7 @@ +open Ast + +let () = + let s = random_int 7 77 in + let i = int_of_string s in + assert( i <= 77 ); + assert( i >= 7 ); diff --git a/_build/default/test/test_random_int.mli b/_build/default/test/test_random_int.mli new file mode 100644 index 0000000..335ae1f --- /dev/null +++ b/_build/default/test/test_random_int.mli @@ -0,0 +1 @@ +(* Auto-generated by Dune *) \ No newline at end of file diff --git a/_build/install/default/bin/mock_csv b/_build/install/default/bin/mock_csv new file mode 120000 index 0000000..9cc466a --- /dev/null +++ b/_build/install/default/bin/mock_csv @@ -0,0 +1 @@ +../../../default/bin/main.exe \ No newline at end of file diff --git a/_build/install/default/lib/mock_csv/META b/_build/install/default/lib/mock_csv/META new file mode 120000 index 0000000..bc81fcb --- /dev/null +++ b/_build/install/default/lib/mock_csv/META @@ -0,0 +1 @@ +../../../../default/META.mock_csv \ No newline at end of file diff --git a/_build/install/default/lib/mock_csv/dune-package b/_build/install/default/lib/mock_csv/dune-package new file mode 120000 index 0000000..0d4f337 --- /dev/null +++ b/_build/install/default/lib/mock_csv/dune-package @@ -0,0 +1 @@ +../../../../default/mock_csv.dune-package \ No newline at end of file diff --git a/_build/install/default/lib/mock_csv/opam b/_build/install/default/lib/mock_csv/opam new file mode 120000 index 0000000..7ae6437 --- /dev/null +++ b/_build/install/default/lib/mock_csv/opam @@ -0,0 +1 @@ +../../../../default/mock_csv.opam \ No newline at end of file diff --git a/_build/log b/_build/log new file mode 100644 index 0000000..9db589e --- /dev/null +++ b/_build/log @@ -0,0 +1,25 @@ +# dune test +# OCAMLPARAM: unset +# Shared cache: disabled +# Shared cache location: /home/simon/.cache/dune/db +# Workspace root: /home/simon/Documents/mock_csv +# Auto-detected concurrency: 4 +# Dune context: +# { name = "default" +# ; kind = "default" +# ; profile = Dev +# ; merlin = true +# ; fdo_target_exe = None +# ; build_dir = In_build_dir "default" +# ; instrument_with = [] +# } +$ /usr/bin/ocamlc.opt -config > /tmp/dune_66a9f6_output +$ (cd _build/default && /usr/bin/ocamldep.opt -modules -impl test/test_mock_csv.ml) > _build/default/test/.test_mock_csv.eobjs/dune__exe__Test_mock_csv.impl.d +$ (cd _build/default && /usr/bin/ocamlopt.opt -w @1..3@5..28@31..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -I test/.test_mock_csv.eobjs/byte -I test/.test_mock_csv.eobjs/native -I lexer/.lexer.objs/byte -I lexer/.lexer.objs/native -I lib/.ast.objs/byte -I lib/.ast.objs/native -I parser/.parser.objs/byte -I parser/.parser.objs/native -intf-suffix .ml -no-alias-deps -opaque -open Dune__exe -o test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.cmx -c -impl test/test_mock_csv.ml) +$ (cd _build/default && /usr/bin/ocamlopt.opt -w @1..3@5..28@31..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o test/test_mock_csv.exe lib/ast.cmxa parser/parser.cmxa lexer/lexer.cmxa test/.test_mock_csv.eobjs/native/dune__exe.cmx test/.test_mock_csv.eobjs/native/dune__exe__Test_mock_csv.cmx) +$ (cd _build/default/test && ./test_mock_csv.exe) +> [id] +> type=int +> range=[0,1000] +> Fatal error: exception Parser.MenhirBasics.Error +[2] diff --git a/bin/dune b/bin/dune new file mode 100644 index 0000000..7fdc7a5 --- /dev/null +++ b/bin/dune @@ -0,0 +1,4 @@ +(executable + (public_name mock_csv) + (name main) + (libraries lexer parser ast)) diff --git a/bin/main.ml b/bin/main.ml new file mode 100644 index 0000000..0542a2c --- /dev/null +++ b/bin/main.ml @@ -0,0 +1,8 @@ +let () = + let path = Sys.argv.(1) in + let ic = open_in path in + let len = in_channel_length ic in + let config = really_input_string ic len in + let lexbuf = Lexing.from_string config in + let _ = Parser.main Lexer.read_token lexbuf in + Printf.printf("ok") diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..ed81498 --- /dev/null +++ b/dune-project @@ -0,0 +1,28 @@ +(lang dune 3.16) + +(name mock_csv) + +(generate_opam_files true) + +(source + (github username/reponame)) + +(authors "Simon Petit") + +(maintainers "Simon Petit") + +(license LICENSE) + +(documentation https://url/to/documentation) + +(using menhir 3.0) + +(package + (name mock_csv) + (synopsis "A short synopsis") + (description "A longer description") + (depends ocaml dune) + (tags + (topics "to describe" your project))) + +; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/lexer/dune b/lexer/dune new file mode 100644 index 0000000..52aeb33 --- /dev/null +++ b/lexer/dune @@ -0,0 +1,6 @@ +(library + (name lexer) + (modules lexer) + (libraries parser)) + +(ocamllex lexer) diff --git a/lexer/lexer.mll b/lexer/lexer.mll new file mode 100644 index 0000000..11f94d0 --- /dev/null +++ b/lexer/lexer.mll @@ -0,0 +1,25 @@ +{ +open Parser +} + +let whitespace = [' ' '\t']+ +let newline = ('\n'|"\r\n") +let digit = ['0'-'9'] +let alpha = ['a'-'z' 'A'-'Z' '_'] +let alphanumeric = (alpha|digit) + +rule read_token = parse + | "type" { TYPE } + | "int" { INT } + | "string" { STRING } + | "date" { DATE } + | "range" { RANGE } + | "values" { VALUES } + | newline { LF } + | '=' { EQUALS } + | '[' { LEFT_BRACKET } + | ']' { RIGHT_BRACKET } + | ',' { COMMA } + | whitespace { read_token lexbuf } + | alphanumeric* as ident { IDENT ident } + | eof { EOF } diff --git a/lib/ast.ml b/lib/ast.ml new file mode 100644 index 0000000..4bdaad0 --- /dev/null +++ b/lib/ast.ml @@ -0,0 +1,73 @@ +type data = + | Columns of column list +and column = + | Column of string * data_type * values (*name * type * value/range *) +and data_type = + | Int + | String + | Date +and values = + | Range of string * string + | Values of string list + +let random_int lower_bound upper_bound = + let i = Random.int (upper_bound +1 - lower_bound) + lower_bound in + string_of_int i + +let random_string values = + let len = List.length values in + let idx = Random.int len in + List.nth values idx + +let generate_row column = + match column with + | Column(_, Int, Range(min, max)) -> + let lower_bound = int_of_string min in + let upper_bound = int_of_string max in + random_int lower_bound upper_bound + | Column(_, String, Values(values)) -> + random_string values + | _ -> failwith "Invalid column" + +let get_headers columns = + let rec aux cols = + match cols with + | [] -> [] + | [Column(name, _, _)] -> [name] + | Column(name, _, _)::l -> name::(aux l) + in + match columns with + | Columns(cols) -> aux cols + + +let generate_rows columns n = + let aux col = + match col with + | Column(_, Int, Range(min, max)) -> + let lower_bound = int_of_string min in + let upper_bound = int_of_string max in + random_int lower_bound upper_bound + | Column(_, String, Values(values)) -> + random_string values + | _ -> failwith "Wrong column specification" + in + let rec aux1 cols = + match cols with + | [] -> [] + | [col] -> [aux col] + | col :: l -> (aux col)::(aux1 l) + in + let rec aux2 cols n = + match n with + | 0 -> [] + | n -> (aux1 cols)::(aux2 cols (n-1)) + in + aux2 columns n + + + +let generate_csv columns delim = + let header_list = get_headers columns in + let header = String.concat delim header_list in + print_string header + diff --git a/lib/dune b/lib/dune new file mode 100644 index 0000000..84b7fb2 --- /dev/null +++ b/lib/dune @@ -0,0 +1,3 @@ +(library + (modules ast) + (name ast)) diff --git a/mock_csv.opam b/mock_csv.opam new file mode 100644 index 0000000..25fce1a --- /dev/null +++ b/mock_csv.opam @@ -0,0 +1,31 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A short synopsis" +description: "A longer description" +maintainer: ["Simon Petit"] +authors: ["Simon Petit"] +license: "LICENSE" +tags: ["topics" "to describe" "your" "project"] +homepage: "https://github.com/username/reponame" +doc: "https://url/to/documentation" +bug-reports: "https://github.com/username/reponame/issues" +depends: [ + "ocaml" + "dune" {>= "3.16"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/username/reponame.git" diff --git a/parser/dune b/parser/dune new file mode 100644 index 0000000..a05e733 --- /dev/null +++ b/parser/dune @@ -0,0 +1,6 @@ +(library + (name parser) + (libraries ast)) + +(menhir + (modules parser)) diff --git a/parser/parser.mly b/parser/parser.mly new file mode 100644 index 0000000..d1ff77f --- /dev/null +++ b/parser/parser.mly @@ -0,0 +1,53 @@ +%{ +(* Header: Define the AST type *) +open Ast +%} + +%token EQUALS COMMA LEFT_BRACKET RIGHT_BRACKET LF +%token INT STRING DATE +%token TYPE RANGE VALUES +%token IDENT +%token EOF +%start main +%type main + +%% + +main: + | columns EOF { Columns(List.rev($1)) } + +columns: + | column { [$1] } + | columns LF LF column { $4::$1 } + + +column : + | column_name LF column_type LF column_value { Column($1, $3, $5) } + + +column_name : + | LEFT_BRACKET IDENT RIGHT_BRACKET { $2 } + + +column_type: + | TYPE EQUALS INT { Int } + | TYPE EQUALS STRING { String } + | TYPE EQUALS DATE { Date } + + +column_value: + | VALUES EQUALS LEFT_BRACKET values RIGHT_BRACKET { Values(List.rev($4)) } + | RANGE EQUALS LEFT_BRACKET range RIGHT_BRACKET { $4 } + + +values : + | value { [$1] } + | values COMMA value { $3::$1 } + + +range : + | IDENT COMMA IDENT { Range($1, $3) } + + +value: + | IDENT { $1 } diff --git a/test/dune b/test/dune new file mode 100644 index 0000000..8436eb7 --- /dev/null +++ b/test/dune @@ -0,0 +1,13 @@ +(test + (name test_mock_csv) + (libraries lexer parser ast) + (deps + (:file ./files/test1.toml))) + +(test + (name test_random_int) + (libraries ast)) + +(test + (name test_header) + (libraries ast)) diff --git a/test/files/test1.toml b/test/files/test1.toml new file mode 100644 index 0000000..e07aeab --- /dev/null +++ b/test/files/test1.toml @@ -0,0 +1,3 @@ +[id] +type=int +range=[0,1000] diff --git a/test/test_generate_row.ml b/test/test_generate_row.ml new file mode 100644 index 0000000..94e1e90 --- /dev/null +++ b/test/test_generate_row.ml @@ -0,0 +1,2 @@ +open Ast + diff --git a/test/test_header.ml b/test/test_header.ml new file mode 100644 index 0000000..4bbb6cd --- /dev/null +++ b/test/test_header.ml @@ -0,0 +1,28 @@ +open Ast + +let () = + let cols = Columns([ + Column( + "id", + Int, + Values("test"::"test"::[]) + ) + ]) in + let headers = get_headers cols in + assert(headers = ["id"]); + + let cols = Columns( + Column( + "id", + Int, + Values("test"::"test"::[]) + ):: + Column( + "name", + Int, + Range("1", "2") + )::[] + ) in + let headers = get_headers cols in + assert(headers = "id"::"name"::[]); + diff --git a/test/test_mock_csv.ml b/test/test_mock_csv.ml new file mode 100644 index 0000000..5c562ee --- /dev/null +++ b/test/test_mock_csv.ml @@ -0,0 +1,55 @@ +open Ast + +let parse_config config = + let lexbuf = Lexing.from_string config in + Parser.main Lexer.read_token lexbuf + +let () = + assert (parse_config "[id]\ntype=string\nvalues=[test, test]" = Columns([ + Column( + "id", + String, + Values(["test";"test"]) + ) + ]) +); + + assert (parse_config "[id]\n type = int \n range = [7, 77]" = Columns([ + Column( + "id", + Int, + Range("7","77") + ) + ]) +); + assert (parse_config "[id]\ntype=int\nrange=[7,77]\n\n[name]\ntype=string\nvalues=[Alice,Bob]" = + Columns([ + Column( + "id", + Int, + Range("7","77") + ); + Column( + "name", + String, + Values(["Alice";"Bob"]) + ) + ]) +); + + + let ic = open_in "files/test1.toml" in + let len = in_channel_length ic in + let config = really_input_string ic len in + print_string config; + + let cols = parse_config config in + assert (cols = + Columns([ + Column( + "id", + Int, + Range("0", "1000") + ) + ]) + ); diff --git a/test/test_random_int.ml b/test/test_random_int.ml new file mode 100644 index 0000000..55cd707 --- /dev/null +++ b/test/test_random_int.ml @@ -0,0 +1,7 @@ +open Ast + +let () = + let s = random_int 7 77 in + let i = int_of_string s in + assert( i <= 77 ); + assert( i >= 7 );