Splitting Grammar and Lexer file #125

ghost opened this Issue Dec 19, 2012 · 2 comments


None yet
2 participants

ghost commented Dec 19, 2012

I want to put the lexer part in its own file. As described in http://zaach.github.com/jison/docs/#specifying-a-language it should work if i specify the lexer file as the second parameter of the jison command.

I've tried it with my own lexer file and ClassyLang grammar, but it didn't worked.

I get the following error (c.jison == classy.jison and c.jisonlex == classy.jisonlex):

E:\xxx\xxx\xxx\Global>jison c.jison c.jisonlex --debug

throw new Error(str);
Error: Parse error on line 19:
Expecting '%%', 'EOF', 'ACTION', '{', '<', '|', '(', 'SPECIAL_GROUP', '/', '/!', '.', '^', '$', 'NAME_BRACE', 'ANY_GROUP_REGEX', 'ESCAPE_CHAR', 'STRIN
G_LIT', 'CHARACTER_LIT', got '+'
at Object.parseError (C:\Users\xxx\AppData\Roaming\npm\node_modules\jison\lib\jison\util\lex-parser.js:133:11)
at Object.parse (C:\Users\xxx\AppData\Roaming\npm\node_modules\jison\lib\jison\util\lex-parser.js:185:22)
at Object.parse (C:\Users\xxx\AppData\Roaming\npm\node_modules\jison\lib\jison\jisonlex.js:6:19)
at processGrammar (C:\Users\xxx\AppData\Roaming\npm\node_modules\jison\lib\jison\cli-wrapper.js:86:50)
at Object.exports.main (C:\Users\xxx\AppData\Roaming\npm\node_modules\jison\lib\jison\cli-wrapper.js:54:46)
at Object. (C:\Users\xxx\AppData\Roaming\npm\node_modules\jison\lib\jison\cli-wrapper.js:96:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

I've used the classy files from https://github.com/zaach/jison/tree/master/examples and JISON v 0.3.12.

Is this a bug or are the classy grammar files out of date or is there another way to split the lexer part from the grammar?

@ghost ghost assigned zaach Jan 15, 2013

Looks like I have the same issue.


zaach commented Jun 22, 2013

Reopen if this is still a problem as of >= v0.4.5.

@zaach zaach closed this Jun 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment