This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,8 @@
(ocamllex lexer1)
(menhir
(modules test_menhir1)
(flags :standard --cmly))
(executables
(names test))

View file

@ -0,0 +1,2 @@
(lang dune 1.1)
(using menhir 1.0)

View file

@ -0,0 +1,7 @@
{
open Test_menhir1
}
rule lex = parse
| 'c' { TOKEN 'c' }
| eof { EOF }

View file

@ -0,0 +1,3 @@
$ dune build ./test.exe --debug-dependency-path
$ ls _build/default/test.exe
_build/default/test.exe

View file

@ -0,0 +1,6 @@
let s = "foo bar baz"
let () =
let lex1 = Lexing.from_string s in
ignore (Test_menhir1.main Lexer1.lex lex1);

View file

@ -0,0 +1,10 @@
%token <char> TOKEN
%token EOF
%start <char list> main
%%
main:
| c = TOKEN EOF { [c] }
| c = TOKEN xs = main { c :: xs }