Documentation ¶
Overview ¶
(c) 2018-2022 by Carl Kingsford (carlk@cs.cmu.edu). See LICENSE.txt.
Index ¶
Constants ¶
View Source
const ( ILLEGAL TokenType = "ILLEGAL" EOF = "EOF" IDENT = "IDENT" STRING = "STRING" AT = "@" COMMA = "," LBRACE = "{" RBRACE = "}" HASH = "#" EQUALS = "=" )
The types of tokens that the lexer can return.
Variables ¶
View Source
var EOFToken = &Token{Type: EOF}
Functions ¶
This section is empty.
Types ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
func (*Lexer) NextToken ¶
NextToken produces the next token. Assumes curRune will give the next unprocessed character. We must maintain that invariant after New and nextToken. If braceStrings is true, treats {}-delimitated regions as a string (requiring balanced {} strings).
func (*Lexer) SkipToNewLine ¶
SkipToNewLine skips until the current run is '\n'.
Click to show internal directories.
Click to hide internal directories.