]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/instructions/syntax/syntax.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / basis / compiler / cfg / instructions / syntax / syntax.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: classes.tuple classes.tuple.parser kernel words
4 make fry sequences parser ;
5 IN: compiler.cfg.instructions.syntax
6
7 : insn-word ( -- word )
8     #! We want to put the insn tuple in compiler.cfg.instructions,
9     #! but we cannot have circularity between that vocabulary and
10     #! this one.
11     "insn" "compiler.cfg.instructions" lookup ;
12
13 : INSN:
14     parse-tuple-definition "regs" suffix
15     [ dup tuple eq? [ drop insn-word ] when ] dip
16     [ define-tuple-class ]
17     [ 2drop save-location ]
18     [ 2drop dup '[ f _ boa , ] define-inline ]
19     3tri ; parsing