ligo/src/passes/1-parser/cameligo/dune
Christian Rinderknecht 4f4294bf56 Refactoring of the front-end towards integration of the local builds
and the globol build, using the parser error messages, for instance.
2020-01-23 18:28:04 +01:00

72 lines
2.0 KiB
Plaintext

;; Build of the lexer
(ocamllex LexToken)
;; Build of the parser
(menhir
(merge_into Parser)
(modules ParToken Parser)
(flags -la 1 --table --strict --explain --external-tokens LexToken))
;; Build of the parser as a library
(library
(name parser_cameligo)
(public_name ligo.parser.cameligo)
(modules
Scoping AST cameligo Parser ParserLog LexToken ParErr)
(libraries
menhirLib
parser_shared
str
simple-utils
tezos-utils)
(preprocess
(pps bisect_ppx --conditional))
(flags (:standard -open Parser_shared -open Simple_utils)))
;; Build of the unlexer (for covering the
;; error states of the LR automaton)
(executable
(name Unlexer)
(libraries str)
(preprocess
(pps bisect_ppx --conditional))
(modules Unlexer))
;; Local build of a standalone lexer
(executable
(name LexerMain)
(libraries parser_cameligo)
(modules LexerMain)
(preprocess
(pps bisect_ppx --conditional))
(flags (:standard -open Parser_shared -open Parser_cameligo)))
;; Local build of a standalone parser
(executable
(name ParserMain)
(libraries parser_cameligo)
(modules ParserMain)
(preprocess
(pps bisect_ppx --conditional))
(flags (:standard -open Simple_utils -open Parser_shared -open Parser_cameligo)))
;; Build of the covering of error states in the LR automaton
(rule
(targets Parser.msg)
(deps (:script_messages ../../../../vendors/ligo-utils/simple-utils/messages.sh) Parser.mly LexToken.mli ParToken.mly)
(action (run %{script_messages} --lex-tokens=LexToken.mli --par-tokens=ParToken.mly Parser.mly)))
;; Build of all the LIGO source file that cover all error states
(rule
(targets all.mligo)
(deps (:script_cover ../../../../vendors/ligo-utils/simple-utils/cover.sh) Parser.mly LexToken.mli ParToken.mly Parser.msg Unlexer.exe)
(action (run %{script_cover} --lex-tokens=LexToken.mli --par-tokens=ParToken.mly --ext=mligo --unlexer=./Unlexer.exe --messages=Parser.msg --dir=. --concatenate Parser.mly )))