calcium-js
Version:
Calcium runtime on JavaScript
18 lines • 474 B
JavaScript
import { CommandNotDefined } from './error';
import { Index } from './statement';
export class Parser {
constructor(table) {
this.table = table;
}
readStmt(stmt) {
const keyword = stmt[Index.Command];
const generator = this.table.get(keyword);
if (generator) {
return generator(this, stmt);
}
else {
throw new CommandNotDefined(keyword);
}
}
}
//# sourceMappingURL=parser.js.map