Documentation
¶
Overview ¶
Package regex provides a regex based lexer using a readable list of named patterns.
eg.
Ident = [[:ascii:]][\w\d]* Whitespace = \s+
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(grammar string) (lexer.Definition, error)
New creates a regex lexer from a readable list of named patterns.
This accepts a grammar where each line is a named regular expression in the form:
# <comment> <name> = <regexp>
eg.
Ident = [[:ascii:]][\w\d]* Whitespace = \s+
Order is relevant. Comments may only occur at the beginning of a line. The regular expression will have surrounding whitespace trimmed before being parsed. Lower-case rules are ignored.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.