Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expression ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
* This is an implementation of the a Lexer, used to convert text into tokens * (http://en.wikipedia.org/wiki/Lexical_analysis) using the regexp package. * * Because the regexp package is implemented using a NFA * (http://en.wikipedia.org/wiki/Nondeterministic_finite_automaton), * it's very effective for this use case.
type Matcher ¶
type Matcher interface {
Name() string // A unique name for this matcher
Exprs() []Expression // The regular expressions that match this token
IsValid(args *token.TokenArgs, expNum int) bool
BuildToken(args *token.TokenArgs, expNum int) (openToken token.Token, closeToken token.Token)
}
A Matcher pairs a set of regexps and a set of tokens.
Click to show internal directories.
Click to hide internal directories.