2020-01-10 15:32:54 +01:00
|
|
|
;; Build of the lexer
|
|
|
|
|
2019-12-10 13:47:31 +00:00
|
|
|
(ocamllex LexToken)
|
|
|
|
|
2020-01-10 15:32:54 +01:00
|
|
|
;; Build of the parser
|
|
|
|
|
2019-12-10 13:47:31 +00:00
|
|
|
(menhir
|
2020-01-10 15:32:54 +01:00
|
|
|
(merge_into Parser)
|
|
|
|
(modules ParToken Parser)
|
|
|
|
(flags -la 1 --table --explain --strict --external-tokens LexToken))
|
|
|
|
|
|
|
|
;; Build of the parser as a library
|
2019-12-10 13:47:31 +00:00
|
|
|
|
|
|
|
(library
|
|
|
|
(name parser_reasonligo)
|
|
|
|
(public_name ligo.parser.reasonligo)
|
2019-12-24 14:25:40 +01:00
|
|
|
(modules
|
|
|
|
SyntaxError reasonligo LexToken Parser)
|
2019-12-10 13:47:31 +00:00
|
|
|
(libraries
|
2019-12-24 14:25:40 +01:00
|
|
|
menhirLib
|
|
|
|
parser_shared
|
|
|
|
parser_cameligo
|
|
|
|
str
|
|
|
|
simple-utils
|
|
|
|
tezos-utils
|
|
|
|
getopt)
|
2019-12-11 12:23:11 +01:00
|
|
|
(preprocess
|
2020-01-03 16:58:37 +01:00
|
|
|
(pps bisect_ppx --conditional))
|
2019-12-17 17:03:43 +01:00
|
|
|
(flags (:standard -open Simple_utils -open Parser_shared -open Parser_cameligo)))
|
2019-12-10 13:47:31 +00:00
|
|
|
|
2020-01-10 15:32:54 +01:00
|
|
|
;; 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
|
|
|
|
|
2019-12-10 13:47:31 +00:00
|
|
|
(executable
|
|
|
|
(name LexerMain)
|
2020-01-03 16:58:37 +01:00
|
|
|
(libraries parser_reasonligo)
|
|
|
|
(modules LexerMain)
|
2019-12-11 19:07:52 +01:00
|
|
|
(preprocess
|
2020-01-03 16:58:37 +01:00
|
|
|
(pps bisect_ppx --conditional))
|
2019-12-17 17:03:43 +01:00
|
|
|
(flags (:standard -open Parser_shared -open Parser_reasonligo)))
|
2019-12-10 13:47:31 +00:00
|
|
|
|
2020-01-10 15:32:54 +01:00
|
|
|
;; Local build of a standalone parser
|
|
|
|
|
2019-12-10 13:47:31 +00:00
|
|
|
(executable
|
|
|
|
(name ParserMain)
|
2019-12-17 17:03:43 +01:00
|
|
|
(libraries
|
2019-12-24 14:25:40 +01:00
|
|
|
parser_reasonligo
|
|
|
|
parser_cameligo)
|
2019-12-17 17:03:43 +01:00
|
|
|
(modules
|
2020-01-04 19:49:22 +01:00
|
|
|
ParErr ParserMain)
|
2019-12-11 19:07:52 +01:00
|
|
|
(preprocess
|
2020-01-03 16:58:37 +01:00
|
|
|
(pps bisect_ppx --conditional))
|
2019-12-24 08:08:50 +01:00
|
|
|
(flags (:standard -open Simple_utils -open Parser_cameligo -open Parser_shared -open Parser_reasonligo)))
|
2019-12-26 13:31:54 +01:00
|
|
|
|
2020-01-10 15:32:54 +01:00
|
|
|
;; Build of the covering of error states in the LR automaton
|
2020-01-09 16:41:21 +01:00
|
|
|
|
|
|
|
(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 )))
|
|
|
|
|
2020-01-10 15:32:54 +01:00
|
|
|
;; Build of all the LIGO source file that cover all error states
|
|
|
|
|
2020-01-09 16:41:21 +01:00
|
|
|
(rule
|
|
|
|
(targets all.ligo)
|
|
|
|
(deps (:script_cover ../../../../vendors/ligo-utils/simple-utils/cover.sh) Parser.mly LexToken.mli ParToken.mly Parser.msg Unlexer.exe)
|
2020-01-10 15:32:54 +01:00
|
|
|
(action (run %{script_cover} --lex-tokens=LexToken.mli --par-tokens=ParToken.mly --ext=religo --unlexer=./Unlexer.exe --messages=Parser.msg --dir=. --concatenate Parser.mly )))
|