[Home] Module Microsoft.FSharp.Compatibility.OCaml.Parsing


Parsing: parser support for parsers produced by fsyacc. Parsers generated by fsyacc provide location information within parser actions. However that information is not available globally, but rather is accessed via the functions available on the following local variable which is available in all parser actions: parseState : 'a Microsoft.FSharp.Tools.FsYacc.IParseState However, this is not compatible with the parser specifications used with ocamlyacc and similar tools, which make a single parser state available globally. If you wish to use a global parser state (e.g. so your code will cross-compile with OCaml) then you can use the functions in this file. You will need to either generate the parser with '--ml-compatibility' option or add the code Parsing.set_parse_state parseState; at the start of each action of your grammar. The functions below simply report the results of corresponding calls to the latest object specified by a call to set_parse_state. Note that there could be unprotected multi-threaded concurrent access for the parser information, so you should not in general use these functions if there may be more than one parser active, and should instead use the functions directly available from the parseState object.

Exceptions

ExceptionDescription
exception Parse_error You can initialize error recovery by raising the Parse_error exception. Note: an abbreviation for = RecoverableParseError

Values

ValueDescription
val rhs_end : int -> int
val rhs_end_pos : int -> position
val rhs_start : int -> int
val rhs_start_pos : int -> position
val set_parse_state : IParseState<position> -> unit
val symbol_end : unit -> int
val symbol_end_pos : unit -> position
val symbol_start : unit -> int
val symbol_start_pos : unit -> position

See Also

Microsoft.FSharp.Compatibility.OCaml


Documentation for assembly FSharp.Compatibility, version 1.9.4.19, generated using F# version 1.9.4.19