Skip to content

Latest commit

 

History

History

parser

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Parse

Lexical/Syntax analyzer

Infer についてのメモ

https://discuss.ocaml.org/t/generate-a-parser-enabling-incremental-api-and-inspection-api/9380/2

menhir --explain --inspection --table --dump --infer-write-query mockfile.ml parser.mly
# to generate mockfile.ml

ocamlfind ocamlc -I . -I src syntax.ml -c -o syntax.cmi

ocamlfind ocamlc -I lib -package menhirLib -i mockfile.ml > sigfile
# to generate sigfile. Note that -I lib refers to the directory of external modules, their .cm[io] files should be ready to use.

menhir --explain --inspection --table --dump --infer-read-reply sigfile parser.mly
# to generate especially parser_e.ml, parser_e.mli, .conflicts and automaton.

rm mockfile.ml
rm parser.automaton
rm parser.conflicts
rm parser.mli
rm sigfile
rm syntax.cmi
rm syntax.cmo