Last active
December 10, 2015 17:24
-
-
Save grondilu/352d2b3d5b8566d9b9ad to your computer and use it in GitHub Desktop.
draft for day7 of adventofcode.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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