Docs: more docs for stack-checker.* words

db4
Björn Lindqvist 2014-05-18 19:46:57 +02:00 committed by John Benediktsson
parent 2d7f344109
commit 4f91e9efbb
4 changed files with 43 additions and 2 deletions

View File

@ -1,5 +1,25 @@
USING: alien effects help.markup help.syntax ;
USING: alien alien.c-types compiler.tree effects help.markup help.syntax
quotations sequences ;
IN: stack-checker.alien
HELP: alien-node-params
{ $class-description "Base class for the parameter slot of " { $link #alien-node } " nodes. It has the following slots:"
{ $table
{ { $slot "return" } { "a " { $link c-type-name } " which indicates the type of the functions return value." } }
{ { $slot "parameters" } { "a " { $link sequence } " of " { $link c-type-name } " giving the types of the functions parameters." } }
}
} ;
HELP: param-prep-quot
{ $values { "params" alien-node-params } { "quot" quotation } }
{ $description "Builds a quotation which coerces values on the stack to the required types for the alien call." }
{ $examples
{ $example
"USING: prettyprint stack-checker.alien ;"
"T{ alien-invoke-params { parameters { void* c-string int } } } param-prep-quot ."
"[ [ [ [ ] dip >c-ptr ] dip \ utf8 string>alien ] dip >fixnum ]"
}
} ;
HELP: infer-alien-invoke
{ $description "Appends the necessary SSA nodes for performing an " { $link alien-invoke } " call to the IR tree being constructed." } ;

View File

@ -1,6 +1,14 @@
USING: help.markup help.syntax sequences words ;
IN: stack-checker.known-words
HELP: infer-special
{ $values { "word" word } }
{ $description "Performs inferencing of a word with the \"special\" property set." } ;
HELP: infer-ndip
{ $values { "word" word } { "n" "the dip depth" } }
{ $description "Performs inferencing for one of the dip words." } ;
HELP: define-primitive
{ $values { "word" word } { "inputs" sequence } { "outputs" sequence } }
{ $description "Marks the word as a primitive whose input and output types must be the given ones." } ;

View File

@ -3,4 +3,4 @@ IN: stack-checker.values
HELP: <value>
{ $values { "value" number } }
{ $description "Outputs a series of monotonically increasing numbers." } ;
{ $description "Outputs a series of monotonically increasing numbers. They are used to assign unique ids to nodes " { $slot "in-d" } " and " { $slot "out-d" } " slots." } ;

View File

@ -0,0 +1,13 @@
USING: compiler.tree help.markup help.syntax kernel sequences words ;
IN: stack-checker.visitor
HELP: #>r,
{ $values { "inputs" sequence } { "outputs" sequence } }
{ $description "Emits a " { $link #shuffle } " node that copies values from the data stack to the retain stack. This node is primarily outputted by the " { $link dip } " word and its relatives." }
{ $examples
{ $example
"USING: namespaces prettyprint stack-checker.visitor ;"
"V{ } stack-visitor set { 123 } { 124 } #>r, stack-visitor get ."
"V{\n T{ #shuffle\n { mapping { { 124 123 } } }\n { in-d { 123 } }\n { out-r { 124 } }\n }\n}"
}
} ;