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,2 @@
(lang dune 1.4)
(using menhir 2.0)

View file

@ -0,0 +1,5 @@
Test the menhir extension version 2.0
$ dune build ./src/test.exe --debug-dependency-path
$ ls _build/default/src/test.exe
_build/default/src/test.exe

View file

@ -0,0 +1,13 @@
(ocamllex lexer1 lexer2)
(menhir
(modules test_menhir1)
(flags :standard --unused-tokens))
(menhir
(merge_into test_base)
(flags --explain)
(modules tokens parser))
(executables
(names test))

View file

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

View file

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

View file

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

View file

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

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 }

View file

@ -0,0 +1,5 @@
%token <char> TOKEN
%token EOF
%%