Documentation
¶
Index ¶
- Constants
- func Parse(input io.Reader) (rs *ast.RuleSet, err error)
- func YYmain(filenames ...string) (interface{}, error)
- type Scanner
- func (yy *Scanner) Input() (byte, error)
- func (yy *Scanner) Lex() YYtype
- func (yy *Scanner) NewFile()
- func (yy *Scanner) Restart(input_file io.Reader)
- func (s *Scanner) Token(t int) YYtype
- func (s *Scanner) TokenFloat64(t int, v float64) YYtype
- func (s *Scanner) TokenHexString(hexTokens []ast.HexToken) YYtype
- func (s *Scanner) TokenInt64(t int, v int64) YYtype
- func (s *Scanner) TokenRegExp(reg *ast.LiteralRegexp) YYtype
- func (s *Scanner) TokenString(t int, v string) YYtype
- type YYcontext
- type YYtype
Constants ¶
View Source
const ( ModGlobal modifiers = 1 << iota ModPrivate ModASCII ModWide ModXor ModFullword ModNocase ModBase64 ModBase64Wide )
View Source
const COMMENT = 3
View Source
const REGEXP = 2
View Source
const STR = 1
View Source
const UNARY_MINUS = 57404
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Scanner ¶
type Scanner struct {
In io.Reader
Out io.Writer
Lineno int
Filename string
Wrap func(*Scanner) bool
IsInteractive func(io.Reader) bool
Context YYcontext
Interactive bool
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner() *Scanner
func (*Scanner) Restart ¶
* Immediately switch to a different input stream.
- @param input_file A readable stream. *
- @note This function does not reset the start condition to @c yyInitial .
func (*Scanner) Token ¶ added in v0.4.0
Token creates a YYtype struct for the given token type with no associated value.
func (*Scanner) TokenFloat64 ¶ added in v0.5.4
func (*Scanner) TokenHexString ¶ added in v0.4.0
func (*Scanner) TokenRegExp ¶ added in v0.4.0
func (s *Scanner) TokenRegExp(reg *ast.LiteralRegexp) YYtype
type YYtype ¶
YYtype is the structure returned by the lexer every time the scanner asks for the next token. Each token may have an associated value, for example, the _IDENTIFIER_ token has an associated string with the identifier's name. If the lexer wants to return an error to the scanner it sets the Error field and leaves the Token and Value empty.
Click to show internal directories.
Click to hide internal directories.