(x: string | CharStream)
| 25 | constructor(source: string) |
| 26 | constructor(stream: CharStream) |
| 27 | constructor(x: string | CharStream) { |
| 28 | if (typeof x === 'string') { |
| 29 | this.stream = new CharStream(x); |
| 30 | } else { |
| 31 | this.stream = x; |
| 32 | } |
| 33 | this._tokens.push(this.readToken()); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * カーソル位置にあるトークンを取得します。 |