module Op: sig
.. end
Open this module to bring the operator functions into the current scope.
val (!:) : char -> Cf_lexer.expr_t
Use !:c
to compose an expression that matches the character c
.
val (!^) : (char -> bool) -> Cf_lexer.expr_t
Use !^f
to compose an expression that matches any character for which
the satisfier function f
returns true
.
val (!~) : char Cf_seq.t -> Cf_lexer.expr_t
Use !~z
to compose an expression that matches the sequence of
characters z
.
val (!$) : string -> Cf_lexer.expr_t
Use !$lit
to compose an expression that matches the string literal
lit
.
val ($|) : Cf_lexer.expr_t -> Cf_lexer.expr_t -> Cf_lexer.expr_t
Alternating composition. Use a $| b
to compose an expression that
matches either expression a
or expression b
.
val ($&) : Cf_lexer.expr_t -> Cf_lexer.expr_t -> Cf_lexer.expr_t
Serial composition. Use a $& b
to compose an expression that matches
expression a
followed by expression b
.
val (!*) : Cf_lexer.expr_t -> Cf_lexer.expr_t
Star composition. Use !*a
to compose an expression that matches zero
or any number of instances of a
.
val (!+) : Cf_lexer.expr_t -> Cf_lexer.expr_t
Plus composition. Use !+a
to compose an expression that matches one
or more instances of a
.
val (!?) : Cf_lexer.expr_t -> Cf_lexer.expr_t
Optional composition. Use !?a
to compose an expression that matches
zero or one instance of a
.
val ($=) : Cf_lexer.expr_t -> 'a -> (#Cf_lexer.cursor, 'a) Cf_lexer.rule_t
Literal token rule. Use e $= obj
to compose a rule that outputs the
literal object obj
when the expression e
is recognized.
val ($>) : Cf_lexer.expr_t ->
(char Cf_seq.t -> 'a) -> (#Cf_lexer.cursor, 'a) Cf_lexer.rule_t
Character sequence token rule. Use e $> f
to compose a rule that
applies the sequence of character recognized by the expression e
to
the tokenizer function f
to produce its result.
val ($^) : Cf_lexer.expr_t -> (string -> 'a) -> (#Cf_lexer.cursor, 'a) Cf_lexer.rule_t
String token rule. Use e $> f
to compose a rule that applies the
string recognized by the expression e
to the tokenizer function f
to produce its result.
val ($@) : Cf_lexer.expr_t ->
(int -> (#Cf_lexer.cursor as 'a, 'b) Cf_lexer.t) -> ('a, 'b) Cf_lexer.rule_t
Advanced token rule. Use e $@ f
to compose a rule that applies the
length of the character sequence recognized by the expression e
to
the advanced tokenizer function f
to obtain a parser that produces
the output of the rule and makes any other manipulations necessary to
continue parsing the input stream. If the parser returned by f
does
not recognize the input, then no output is produced by the lexer.
val (!@) : (#Cf_lexer.cursor as 'a, 'b) Cf_lexer.rule_t list -> ('a, 'b) Cf_lexer.rule_t
Rule aggregation. Use this operator to combine a list of rules into a
single rule.