Surface.Parser_driverSourceWrapping module around parser and lexer that offers the parse_source_file API
Three-way minimum
Computes the levenshtein distance between two strings, used to provide error messages suggestions
Style with which to display syntax hints in the terminal output
Usage: raise_parser_error error_loc last_good_loc token msg
Raises an error message featuring the error_loc position where the parser has failed, the token on which the parser has failed, and the error message msg. If available, displays last_good_loc the location of the last token correctly parsed.
val fail :
Sedlexing.lexbuf ->
'semantic_value I.env ->
(string * Parser.token) list ->
'semantic_value I.env option ->
'aUsage: fail lexbuf env token_list last_input_needed
Raises an error with meaningful hints about what the parsing error was. lexbuf is the lexing buffer state at the failure point, env is the Menhir environment and last_input_needed is the last checkpoint of a valid Menhir state before the parsing error. token_list is provided by things like Surface.Lexer.token_list_language_agnostic and is used to provide suggestions of the tokens acceptable at the failure point
val loop :
(unit -> Parser.token * Lexing.position * Lexing.position) ->
(string * Parser.token) list ->
Sedlexing.lexbuf ->
Ast.source_file_or_master I.env option ->
Ast.source_file_or_master I.checkpoint ->
Ast.source_file_or_masterMain parsing loop
val sedlex_with_menhir :
(Sedlexing.lexbuf -> Parser.token) ->
(string * Parser.token) list ->
(Lexing.position -> Ast.source_file_or_master I.checkpoint) ->
Sedlexing.lexbuf ->
Ast.source_file_or_masterStub that wraps the parsing main loop and handles the Menhir/Sedlex type difference for lexbuf.
Parses a single source file
Expands the include directives in a parsing result, thus parsing new source files