Mercurial > lcfOS
view python/burg.x @ 336:d1ecc493384e
Added spiffy armtoken class for bit fiddeling. Added cool test that checks for build repeatability
author | Windel Bouwman |
---|---|
date | Wed, 19 Feb 2014 22:32:15 +0100 |
parents | 44f336460c2a |
children | 818be710e13d |
line wrap: on
line source
%tokens ':' ';' '(' ')' ',' template id number '%%' '%terminal' header %% burgdef: header '%%' directives '%%' rules { self.system.header_lines = $1.val }; directives: | directives directive; directive: termdef; termdef: '%terminal' termids; termids: | termids termid; termid: id { self.system.add_terminal($1.val) }; rules: | rules rule; rule: id ':' tree cost template { self.system.add_rule($1.val, $3, $4, $5.val) }; cost: number { return $1.val }; tree: id { return self.system.tree($1.val) } | id '(' tree ')' { return self.system.tree($1.val, $3) } | id '(' tree ',' tree ')' { return self.system.tree($1.val, $3, $5) };