Skip to content

Instantly share code, notes, and snippets.

@cognominal
Created September 5, 2009 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cognominal/181438 to your computer and use it in GitHub Desktop.
Save cognominal/181438 to your computer and use it in GitHub Desktop.
expand a rule #grammar
In S05, is there a way to "expand" a rule within another?
Example, <=v> whould expand the productions of v within a
rule so that
token t { <=v> | <d> }
token v { <a> | <b> | <c> }
Compared to C<< <=v> >>, C<< <=v> would
would avoid an additional level in the parse tree, that would
be equivalent to :
token t { <a> | [ <b> | <c> | <d> ] }
that is to :
token t { <a> | [ <b> | <c> | <d> ] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment