Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Created August 17, 2012 14:44
Show Gist options
  • Save Idorobots/3379336 to your computer and use it in GitHub Desktop.
Save Idorobots/3379336 to your computer and use it in GitHub Desktop.
ASM reader to PEG correspondence
sequence: (A B C ...) => A B C ...
ordered choice: (/ A B C ...) => A / B / C / ...
optional branch: (? ...) => (...)?
zero or more: (* ...) => (...)*
one or more: (+ ...) => (...)+
not: (! ...) => !(...)
and (lookahead): (& ...) => &(...)
drop node: (: ...) - Drops a node from the parse tree.
concat captures: (~ ...) - Concatenates captures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment