12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152(* This file is free software, part of dolmen. See file "LICENSE" formore information *)(** Interface for Dolmen languages modules *)moduletypeS=sigtypefile(** Meta-data about locations in files. *)typetoken(** The type of tokens produced by the language lexer. *)typestatement(** The type of top-level directives recognised by the parser. *)moduleLexer:Lex.Swithtypetoken:=token(** The Lexer module for the language. *)moduleParser:Parse.Swithtypetoken:=tokenandtypestatement:=statement(** The Parser module for the language. *)valfind:?dir:string->string->stringoption(** Helper function to find a file using a language specification.
Separates directory and file because most include directives in languages
are relative to the directory of the original file being processed. *)valparse_file:string->file*statementlist(** Parse the given file.
@param dir: optional directory to use if the file path is relative. *)valparse_file_lazy:string->file*statementlistLazy.t(** Parse the given file.
@param dir: optional directory to use if the file path is relative. *)valparse_input:[`Stdin|`Fileofstring|`Contentsofstring*string]->file*(unit->statementoption)*(unit->unit)(** Incremental parsing. Given an input to read (either a file, stdin,
or some contents of the form [(filename, s)] where [s] is the contents to parse),
returns a generator that will incrementally parse the statements,
together with a cleanup function to close file descriptors.
In case of a syntax error, the current line will be completely
consumed and parsing will restart at the beginning of the next line.
Useful to process input from [stdin], or even large files where it would
be impractical to parse the entire file before processing it. *)end