import { LexicalScope } from '../SDT/LexicalScope' ; export class Terminal { constructor ( public value ) { this . value = value ; } public lvalue ( ) { return this . value ; } public rvalue ( ) { return this . value ; } public print ( level ) { console . log ( '' . padStart ( level * 2 ) + this . value ) ; } } export class Identifier extends Terminal { private scope : LexicalScope ; public bindLexicalScope ( scope ) { this . scope = scope . lookup ( this . value ) ; if ( this . scope === null ) { throw `sytnax error: ${ this . value } is not defined` ; } } } export class Numeral extends Terminal { }