Documentation ¶
Index ¶
Constants ¶
View Source
const ( NoState = -1 NumStates = 17 NumSymbols = 20 )
Variables ¶
View Source
var ActTab = ActionTable{ ActionRow{ Accept: 0, Ignore: "", }, ActionRow{ Accept: -1, Ignore: "!whitespace", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 2, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 3, Ignore: "", }, ActionRow{ Accept: 5, Ignore: "", }, ActionRow{ Accept: 4, Ignore: "", }, }
View Source
var TransTab = TransitionTable{ func(r rune) int { switch { case r == 9: return 1 case r == 10: return 1 case r == 13: return 1 case r == 32: return 1 case 65 <= r && r <= 90: return 2 case r == 95: return 3 case 97 <= r && r <= 100: return 2 case r == 101: return 4 case 102 <= r && r <= 104: return 2 case r == 105: return 5 case 106 <= r && r <= 115: return 2 case r == 116: return 6 case 117 <= r && r <= 122: return 2 } return NoState }, func(r rune) int { switch { } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 107: return 8 case r == 108: return 10 case 109 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 101: return 8 case r == 102: return 11 case 103 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 103: return 8 case r == 104: return 12 case 105 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 114: return 8 case r == 115: return 13 case 116 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 100: return 8 case r == 101: return 14 case 102 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 100: return 8 case r == 101: return 15 case 102 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 109: return 8 case r == 110: return 16 case 111 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, func(r rune) int { switch { case 48 <= r && r <= 57: return 7 case 65 <= r && r <= 90: return 8 case r == 95: return 9 case 97 <= r && r <= 122: return 8 } return NoState }, }
Functions ¶
This section is empty.
Types ¶
type ActionTable ¶
type Lexer ¶
func NewLexerFile ¶
type SourceContext ¶
type SourceContext struct {
Filepath string
}
SourceContext is a simple instance of a token.Context which contains the name of the source file.
func (*SourceContext) Source ¶
func (s *SourceContext) Source() string
type TransitionTable ¶
Let s be the current state Let r be the current input rune transitionTable[s](r) returns the next state.
Click to show internal directories.
Click to hide internal directories.