Skip to content

Instantly share code, notes, and snippets.

View peter-leonov's full-sized avatar

Peter Leonov peter-leonov

View GitHub Profile
> You're welcome!
>
> In answer to your questions and remarks:
>
> 1) I'm sorry, but jison is /not/ a /port/ of bison…
Understand. Who may want to just copy such a monster.
>
> 1.a) jison combines a lexer and LALR(1) parser in one package.
It is cool and I like it. But, as you write below, in my case the builtin lexer is not the case :(
> 1.b) jison may share 4 alphanumerics with bison and may support a large
@peter-leonov
peter-leonov / gist:5659189
Created May 27, 2013 21:31
Parsable, but meant broken by Jison grammar.
%pure_parser
%token keyword_class keyword_module keyword_def keyword_undef keyword_begin keyword_rescue keyword_ensure keyword_end keyword_if keyword_unless keyword_then keyword_elsif keyword_else keyword_case keyword_when keyword_while keyword_until keyword_for keyword_break keyword_next keyword_redo keyword_retry keyword_in keyword_do keyword_do_cond keyword_do_block keyword_do_LAMBDA keyword_return keyword_yield keyword_super keyword_self keyword_nil keyword_true keyword_false keyword_and keyword_or keyword_not modifier_if modifier_unless modifier_while modifier_until modifier_rescue keyword_alias keyword_defined keyword_BEGIN keyword_END keyword__LINE__ keyword__FILE__ keyword__ENCODING__
%token <id> tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tLABEL
%token <node> tINTEGER tFLOAT tSTRING_CONTENT tCHAR
%token <node> tNTH_REF tBACK_REF
%token <num> tREGEXP_END
%type <node> singleton strings string string1 xstring regexp