How to use the chevrotain.getTokenConstructor function in chevrotain

To help you get started, we’ve selected a few chevrotain examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github christianvoigt / argdown / packages / argdown-parser / src / ArgdownParser.js View on Github external
logAstRecursively(value, pre, str) {
        if (value === undefined) {
            str += "undefined";
            return str;
        } else if (value.tokenType) {
            str += getTokenConstructor(value).tokenName;
            return str;
        }
        str += value.name;
        if (value.children && value.children.length > 0) {
            let nextPre = pre + " |";
            for (let child of value.children) {
                str += "\n" + nextPre + "__";
                str = this.logAstRecursively(child, nextPre, str);
            }
            str += "\n" + pre;
        }
        return str;
    }
github christianvoigt / argdown / packages / argdown-parser / src / ArgdownTreeWalker.js View on Github external
getTokenName(tokenInstance){
    let constr = getTokenConstructor(tokenInstance);
    return constr.tokenName;
  }