Documentation ¶
Overview ¶
Package lexer (通用)词法分析器模块
Index ¶
- Constants
- type Lexer
- func (l *Lexer) Analyse() []*Token
- func (l *Lexer) MakeComment() *Token
- func (l *Lexer) MakeComment2() *Token
- func (l *Lexer) MakeErr(prefix ...string) *Token
- func (l *Lexer) MakeNumber() *Token
- func (l *Lexer) MakeOp() *Token
- func (l *Lexer) MakeString() *Token
- func (l *Lexer) MakeVarOrKeyword() *Token
- type Token
- type TokenType
Constants ¶
View Source
const EndToken = "$"
EndToken 结束符号常量定义
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenType ¶
type TokenType int
const ( KEYWORD TokenType = 1 // 关键字类型为 1 TYPE TokenType = 2 // 类型类型为 2 VARIABLE TokenType = 3 // 变量类型为 3 OPERATOR TokenType = 4 // 操作符类型为 4 BRACKET TokenType = 5 // 括号类型为 5 STRING TokenType = 6 // 字符串类型为 6 FLOAT TokenType = 7 // 浮点数类型为 7 BOOLEAN TokenType = 8 // 布尔类型为 8 INTEGER TokenType = 9 // 整数类型为 9 COMMENT TokenType = 10 // 注释类型为 10 ERROR TokenType = -1 // 错误类型为 -1 END TokenType = -2 // 结束类型为 -2 )
Click to show internal directories.
Click to hide internal directories.