Title: Theory / Unimportant / CS / Programming / oCaml / Manual{ / 13 Lexer and Parser / Lex;
Tags: récupéré computer_to_instruction fromCommandLine hasNotNewEffectReturnsMeaning
On every note of this deck, unless a note says otherwise:
Page: https://caml.inria.fr/pub/docs/manual-ocaml/libref/Lexing.html
Language: ocamllex
Page: https://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html

Extension: mll
Description: ocaml syntax
Means: ml lex
Other fields (not shown on cards):
Page: https://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html
Chapter: 13
Section: 1

Instruction: ocamllex foo
Page: https://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html
Effect: produces OCaml code for a lexical analyzer in file foo
Chapter: 13
Section: 1

Fla: -ml
Effect: Output code that does not use OCaml’s built-in automata
interpreter. Instead, the automaton is encoded by OCaml functions.
Prefix: ocamllex
Chapter: 13
Section: 1
Assuming: Debugging ocamllex. Not production

Page: https://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html
Effect: the output file name is bar
Chapter: 13
Section: 1
Abbreviation: -o bar

Fla: -q
Effect: quiet mode
Prefix: ocamllex
Chapter: 13
Section: 1

Fla: -version
Effect: Print version string and exit.
Prefix: ocamllex
Flag abbreviation: -v
Chapter: 13
Section: 1

Fla: -vnum
Effect: Print short version number and exit
Prefix: ocamllex
Chapter: 13
Section: 1

Fla: -help
Effect: Display a short usage summary and exit.Display a short usage summary and exit.
Prefix: ocamllex
Chapter: 13
Section: 1

Instruction: from_channel
Effect: takes an in_channel and create a lexbuf from it
Where to use it: Lexing

Instruction: from_string
Effect: takes a string and create a lexbuf from it
Where to use it: Lexing

Instruction: from_function
Effect: takes a function and create a lexbuf from it. The function takes bytes seuqence, and an integer n and put at most n characters in the byte sequence
Where to use it: Lexing

Instruction: l.refill_buff
Effect: the function charged to put more characters in the lexer
Variables: l a lexbuf

Instruction: l.lex_buffer
Effect: The current part of the string in the buffer
Variables: l a lexbuf
Typ: bytes

Instruction: l.foo
Effect: todo
Variables: l a lexbuf

Instruction: lexeme_start_p
Effect: the position of the first character matched by the regexp
Context: action

Instruction: lexeme_end_p lexbuf
Effect: the position of the successor of the last character matched by the regexp
Context: action

Instruction: newline lexbuf
Effect: Update the lex_curr_p field of the lexbuf to reflect the start of a new line.
Context: action

Instruction: flush_input lexbuf
Effect: Discard the contents of the buffer and reset the current
position to 0.
Context: action

Instruction: symbol_start ()
Effect: the offset of the first character of the string that matches the left-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: symbol_start_pos ()
Effect: the position of the first character of the string that matches the left-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: symbol_end_pos ()
Effect: the position of the successor of the last character of the string that matches the left-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: symbol_end ()
Effect: the offset of the successor of the last character of the string that matches the left-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: rhs_end_pos foo
Effect: the position of the successor of the last character of the footh element that matches the right-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: rhs_end foo
Effect: the offset of the successor of the last character of the footh element that matches the right-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: rhs_left_pos foo
Effect: the position of the first character of the footh element that matches the right-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: rhs_left foo
Effect: the offset of the first character of the footh element that matches the right-hand side of the rule
Context: action part of rule
Where to use it: Parsing

Instruction: clear_parser
Effect: Empty the parser stack.
Context: action part of rule
Where to use it: Parsing

Instruction: set_trace foo
Effect: turns on/off the fact that parser's trace should be written
Where to use it: Parsing
Name: The previous value of this value