Documentation ¶
Overview ¶
Package builder generates the parser code for a given grammar. It makes no attempt to verify the correctness of the grammar.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicLatinLookup ¶ added in v1.1.0
func BasicLatinLookup(chars, ranges []rune, unicodeClasses []string, ignoreCase bool) (basicLatinChars [128]bool)
BasicLatinLookup calculates the decision results for the first 256 characters of the UTF-8 character set for a given set of chars, ranges and unicodeClasses to speedup the CharClassMatcher.
Types ¶
type Option ¶
type Option func(*builder) Option
Option is a function that can set an option on the builder. It returns the previous setting as an Option.
func BasicLatinLookupTable ¶ added in v1.1.0
BasicLatinLookupTable returns an option that specifies the basicLatinLookup option If basicLatinLookup is true, a lookup slice for the first 128 chars of the Unicode table (Basic Latin) is generated for each CharClassMatcher to increase the character matching.
func Nolint ¶ added in v1.1.0
Nolint returns an option that specifies the nolint option If nolint is true, special '// nolint: ...' comments are added to the generated parser to suppress warnings by gometalinter.
func Optimize ¶ added in v1.1.0
Optimize returns an option that specifies the optimize option If optimize is true, the Debug and Memoize code is completely removed from the resulting parser
func ReceiverName ¶
ReceiverName returns an option that specifies the receiver name to use for the current struct (which is the struct on which all code blocks except the initializer are generated).