package batteries
Install
Dune Dependency
Authors
Maintainers
Sources
md5=d02c4f044e53edca010de46f9139ce00
sha512=99a5afa3604c4cf0c849c670111d617f7f255acb0da043b73ddffdf0e299948bce52516ee31921f269de6088156c4e0a187e0b931543c6819c6b25966b303281
doc/batteries.unthreaded/BatGenlex/Languages/Make/index.html
Module Languages.Make
Source
Create a lexer from a language definition
Parameters
module M : Definition
Signature
High-level API
val feed :
(char, BatCharParser.position) BatParserCo.Source.t ->
(token, BatCharParser.position) BatParserCo.Source.t
Drop comments, present reserved operators and reserved names as Kwd
, operators and identifiers as Ident
, integer numbers as Int
, floating-point numbers as Float
and characters as Char
.
If the language is not case_sensitive
, identifiers and keywords are returned in lower-case.
Medium-level API
Remove any leading whitespaces
Accepts any non-reserved identifier/operator. If the language is not case_sensitive
, the identifier is returned in lower-case.
Accepts any identifier. If the language is not case_sensitive
, the identifier is returned in lower-case.
Accepts a character literal, i.e. one character (or an escape) between two quotes.
Accepts a string, i.e. one sequence of characters or escapes between two double quotes, on one line.
Parse an integer.
Parse a floating-point number.
val number :
(char, [ `Float of float | `Integer of int ], BatCharParser.position)
BatParserCo.t
Parse either an integer or a floating-point number.
Low-level API
As CharParser.char
, but case-insensitive if specified by case_sensitive
.
As CharParser.string
, but case-insensitive if specified by case_sensitive
.
Apply this filter to your own parsers if you want them to ignore following comments.