Page
Library
Module
Module type
Parameter
Class
Class type
Source
OpamParserSourceopam format parser
Providing a custom lexbuf argument allows you, for example, to set the initial lexing position. For the first argument, you may use the OpamLexer.token lexing function:
let lexbuf = Lexing.from_string input in
lexbuf.Lexing.lex_curr_p <- current_position;
OpamParser.value OpamLexer.token lexbufval main :
(Lexing.lexbuf -> OpamBaseParser.token) ->
Lexing.lexbuf ->
OpamParserTypes.file_name ->
OpamParserTypes.opamfilePrincipal parser: given a lexbuf and the filename it was read from, returns an OpamParserTypes.opamfile record parsed from it.
Lower-level function just returning a single OpamParserTypes.value from a given lexer.
File parsers
Parse the content of a file already read to a string. Note that for CRLF-detection to work on Windows, it is necessary to read the original file using binary mode on Windows!
Parse the content of a file from an already-opened channel. Note that for CRLF-detection to work on Windows, it is necessary for the channel to be in binary mode!
Parse the content of a file. The file is opened in binary mode, so CRLF-detection works on all platforms.
value parsersParse the first value in the given string. file_name is used for lexer positions.
Parse the first value from the given channel. file_name is used for lexer positions.
Parse the first value from the given file.