]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/instructions/syntax/syntax-docs.factor
core: Add words/unwords/unwords-as and use them.
[factor.git] / basis / compiler / cfg / instructions / syntax / syntax-docs.factor
1 USING: help.markup help.syntax literals multiline sequences splitting ;
2 IN: compiler.cfg.instructions.syntax
3
4 <<
5 STRING: parse-insn-slot-specs-code
6 USING: compiler.cfg.instructions.syntax prettyprint splitting ;
7 "use: src/int-rep temp: temp/int-rep" words parse-insn-slot-specs .
8 ;
9
10 STRING: parse-insn-slot-specs-result
11 {
12     T{ insn-slot-spec
13         { type use }
14         { name "src" }
15         { rep int-rep }
16     }
17     T{ insn-slot-spec
18         { type temp }
19         { name "temp" }
20         { rep int-rep }
21     }
22 }
23 ;
24 >>
25
26 HELP: parse-insn-slot-specs
27 { $values
28   { "seq" "a " { $link sequence } " of tokens" }
29   { "specs" "a " { $link sequence } " of " { $link insn-slot-spec } " items." }
30 }
31 { $description "Parses a sequence of tokens into a sequence of instruction slot specifiers." }
32 { $examples
33   { $example $[ parse-insn-slot-specs-code parse-insn-slot-specs-result ] }
34 } ;