Skip to content

Instantly share code, notes, and snippets.

@rprichard
Created November 5, 2015 17:51
Show Gist options
  • Save rprichard/b9833a5f17126ae3cdf4 to your computer and use it in GitHub Desktop.
Save rprichard/b9833a5f17126ae3cdf4 to your computer and use it in GitHub Desktop.
Menhir test grammar (also works with yacc)
%token ID
%token DOT
%token DOTDOT
%token EOF
%start prog
%type <Prog> prog
%nonassoc DOTDOT
%nonassoc DOT
%%
prog : expr EOF {};
expr
: DOTDOT
| expr DOT ID
| ID
{}
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment