Constructors
constructor
- new Scanner(source: string, file?: string): Scanner
-
Parameters
-
source: string
-
file: string = ''
Properties
Private current
current: number = 0
Private file
file: string
Private line
line: number = 1
Private source
source: string
Private start
start: number = 0
Private tokens
tokens: Token[] = []
Methods
Private addToken
- addToken(type: TokenType, literal?: any): void
-
Parameters
-
type: TokenType
-
literal: any = null
Returns void
Private isAlpha
- isAlpha(c: string): boolean
-
Parameters
Returns boolean
Private isAlphaNumeric
- isAlphaNumeric(c: string): boolean
-
Parameters
Returns boolean
Private isDigit
- isDigit(c: string): boolean
-
Parameters
Returns boolean
Private match
- match(char: string): boolean
-
Parameters
Returns boolean