Library
Module
Module type
Parameter
Class
Class type
OpamParser
transitional module with full position types
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 lexbuf
val main :
(Lexing.lexbuf -> OpamBaseParser.token) ->
Lexing.lexbuf ->
OpamParserTypes.FullPos.file_name ->
OpamParserTypes.FullPos.opamfile
Principal parser: given a lexbuf and the filename it was read from, returns an OpamParserTypes.FullPos.opamfile
record parsed from it.
val value :
(Lexing.lexbuf -> OpamBaseParser.token) ->
Lexing.lexbuf ->
OpamParserTypes.FullPos.value
Lower-level function just returning a single OpamParserTypes.FullPos.value
from a given lexer.
val string :
string ->
OpamParserTypes.FullPos.file_name ->
OpamParserTypes.FullPos.opamfile
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!
val channel :
Pervasives.in_channel ->
OpamParserTypes.FullPos.file_name ->
OpamParserTypes.FullPos.opamfile
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
parsersval value_from_string :
string ->
OpamParserTypes.FullPos.file_name ->
OpamParserTypes.FullPos.value
Parse the first value in the given string. file_name
is used for lexer positions.
val value_from_channel :
Pervasives.in_channel ->
OpamParserTypes.FullPos.file_name ->
OpamParserTypes.FullPos.value
Parse the first value from the given channel. file_name
is used for lexer positions.
val value_from_file :
OpamParserTypes.FullPos.file_name ->
OpamParserTypes.FullPos.value
Parse the first value from the given file.
val to_value : OpamParserTypes.FullPos.value -> OpamParserTypes.value
val to_section :
OpamParserTypes.FullPos.opamfile_section ->
OpamParserTypes.opamfile_section
val to_item :
OpamParserTypes.FullPos.opamfile_item ->
OpamParserTypes.opamfile_item
val to_opamfile : OpamParserTypes.FullPos.opamfile -> OpamParserTypes.opamfile