First draft of the macro lexer

This commit is contained in:
Wolfsblvt
2024-07-16 01:24:03 +02:00
parent 7a36901bfc
commit f63b875b76
4 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { CstParser } from './lib.js';
import { MacroLexer } from './MacroLexer.js';
/**
* The singleton instance of the MacroParser.
*
* @type {MacroParser}
*/
let instance;
export { instance as MacroParser };
class MacroParser extends CstParser {
/** @type {MacroParser} */ static #instance;
/** @type {MacroParser} */ static get instance() { return MacroParser.#instance ?? (MacroParser.#instance = new MacroParser()); }
/** @private */
constructor() {
super(MacroLexer.def);
// const $ = this;
this.performSelfAnalysis();
}
}
instance = MacroParser.instance;