Skip to content

Instantly share code, notes, and snippets.

@grondilu
Last active December 10, 2015 17:24
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 grondilu/352d2b3d5b8566d9b9ad to your computer and use it in GitHub Desktop.
Save grondilu/352d2b3d5b8566d9b9ad to your computer and use it in GitHub Desktop.
draft for day7 of adventofcode.com
grammar circuit {
rule TOP { <wiring>+ }
rule wiring { <expression> '->' <destination=identifier> }
rule expression { <NOT> | <AND> | <OR> | <RSHIFT> | <LSHIFT> | <value> }
token value { <literal> | <identifier> }
token literal { <.digit>+ }
token identifier { <.alpha>+ }
rule NOT { NOT <value> }
rule AND { <left=value> AND <right=value> }
rule OR { <left=value> OR <right=value> }
rule RSHIFT { <left=value> RSHIFT <right=value> }
rule LSHIFT { <left=value> LSHIFT <right=value> }
}
circuit.parse: slurp, actions => class {
# do cool S17 stuff here?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment