Skip to content

Example parser don't work on Node #88

@jcubic

Description

@jcubic

I've used example Calculator grammar with this at the end:

function print(result) {
    console.log(result);
}

__parse(process.argv[2]);

and when I've execute on Linux:

node parser-jscc.js "10+2"

I've got this cryptic exception:

/home/kuba/projects/jcubic/parsers/parser-jscc.js:166
                            throw new Error("At chr " + chr + " and pos " + pos +
                            ^

Error: At chr 49 and pos 0, DfaLex._dfaData[0] appears to exist, but its line property is undefined.
    at DfaLex.exec (/home/kuba/projects/jcubic/parsers/parser-jscc.js:166:14)
    at PcbClass.lex (/home/kuba/projects/jcubic/parsers/parser-jscc.js:331:10)
    at parse (/home/kuba/projects/jcubic/parsers/parser-jscc.js:393:7)
    at Object.<anonymous> (/home/kuba/projects/jcubic/parsers/parser-jscc.js:470:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions