Skip to content

Instantly share code, notes, and snippets.

@edenc
Created November 24, 2010 03:48
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 edenc/713076 to your computer and use it in GitHub Desktop.
Save edenc/713076 to your computer and use it in GitHub Desktop.
grammar MyApp {
rule TOP { <cd> }
rule cd { <cd_object> { say "View" } }
rule cd_collection { '/cd' { say "CD Collection" } }
rule cd_object { <cd_collection> '/' $<id>=(\d+) { say "CD Object: $id" } }
}
MyApp.parse('/cd/1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment