Stdlib.Parsing(3)

hii bestie πŸ’– okay so this is the Stdlib.Parsing page from the OCaml library manual β€” manual name: Stdlib.Parsing(3). The header is doing its thing up top, we’re just folding the name in here so nobody copies a line, periodt.

✨ NAME ✨

Stdlib.Parsing β€” the source literally says no description, bestie 😭. That’s it. That’s the whole NAME section.

🧩 Module

Module Stdlib.Parsing

πŸ“š Documentation

Module Parsing : (module Stdlib__Parsing)


  • val symbol_start : unit -> int β€” symbol_start and Parsing.symbol_end are to be called in the action part of a grammar rule only, okay? They return the offset of the string that matches the left-hand side of the rule: symbol_start() returns the offset of the first character; symbol_end() returns the offset after the last character. The first character in a file is at offset 0. πŸ’…
  • val symbol_end : unit -> int β€” see Parsing.symbol_start for the whole vibe, bestie.
  • val rhs_start : int -> int β€” Same as Parsing.symbol_start and Parsing.symbol_end, but return the offset of the string matching the n th item on the right-hand side of the rule, where n is the integer parameter to rhs_start and rhs_end. n is 1 for the leftmost item. ✨
  • val rhs_end : int -> int β€” See Parsing.rhs_start. πŸ’–
  • val symbol_start_pos : unit -> Lexing.position β€” Same as symbol_start, but return a position instead of an offset. πŸ¦‹
  • val symbol_end_pos : unit -> Lexing.position β€” Same as symbol_end, but return a position instead of an offset. 🌸
  • val rhs_start_pos : int -> Lexing.position β€” Same as rhs_start, but return a position instead of an offset. πŸ’œ
  • val rhs_end_pos : int -> Lexing.position β€” Same as rhs_end, but return a position instead of an offset. ⭐
  • val clear_parser : unit -> unit β€” Empty the parser stack, bestie. Call it just after a parsing function has returned, to remove all pointers from the parser stack to structures that were built by semantic actions during parsing. This is optional, but lowers the memory requirements of the programs. 🧹✨
  • exception Parse_error β€” Raised when a parser encounters a syntax error. Can also be raised from the action part of a grammar rule, to initiate error recovery. πŸ˜­πŸ’€
  • val set_trace : bool -> bool β€” Control debugging support for ocamlyacc-generated parsers. After Parsing.set_trace true, the pushdown automaton that executes the parsers prints a trace of its actions (reading a token, shifting a state, reducing by a rule) on standard output. Parsing.set_trace false turns this debugging trace off. The boolean returned is the previous state of the trace flag. Since 3.11 πŸ”₯

mwah πŸ’‹ that’s the whole page, no cap. Cute lil footer sign-off: source/version is OCamldoc, date is 2026-06-22, and the page is Stdlib.Parsing(3). byeee 🫢✨

πŸ“¦ where this page comes from