Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

parsing(3) [centos man page]

Parsing(3)							   OCaml library							Parsing(3)

NAME
Parsing - The run-time library for parsers generated by ocamlyacc. Module Module Parsing Documentation Module Parsing : sig end The run-time library for parsers generated by ocamlyacc . val symbol_start : unit -> int symbol_start and Parsing.symbol_end are to be called in the action part of a grammar rule only. 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 . 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. 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.0 OCamldoc 2014-06-09 Parsing(3)

Check Out this Related Man Page

OCAMLYACC(1)						      General Commands Manual						      OCAMLYACC(1)

NAME
ocamlyacc - The OCaml parser generator SYNOPSIS
ocamlyacc [ -bprefix ] [ -q ] [ -v ] [ -version ] [ -vnum ] filename.mly DESCRIPTION
The ocamlyacc(1) command produces a parser from a LALR(1) context-free grammar specification with attached semantic actions, in the style of yacc(1). Assuming the input file is grammar.mly, running ocamlyacc produces OCaml code for a parser in the file grammar.ml, and its interface in file grammar.mli. The generated module defines one parsing function per entry point in the grammar. These functions have the same names as the entry points. Parsing functions take as arguments a lexical analyzer (a function from lexer buffers to tokens) and a lexer buffer, and return the seman- tic attribute of the corresponding entry point. Lexical analyzer functions are usually generated from a lexer specification by the ocam- llex(1) program. Lexer buffers are an abstract data type implemented in the standard library module Lexing. Tokens are values from the con- crete type token, defined in the interface file grammar.mli produced by ocamlyacc(1). OPTIONS
The ocamlyacc(1) command recognizes the following options: -bprefix Name the output files prefix.ml, prefix.mli, prefix.output, instead of the default naming convention. -q This option has no effect. -v Generate a description of the parsing tables and a report on conflicts resulting from ambiguities in the grammar. The description is put in file grammar.output. -version Print version string and exit. -vnum Print short version number and exit. - Read the grammar specification from standard input. The default output file names are stdin.ml and stdin.mli. -- file Process file as the grammar specification, even if its name starts with a dash (-) character. This option must be the last on the command line. SEE ALSO
ocamllex(1). The OCaml user's manual, chapter "Lexer and parser generators". OCAMLYACC(1)
Man Page