diff --git a/basis/stack-checker/alien/alien-docs.factor b/basis/stack-checker/alien/alien-docs.factor index 967f419aac..c96cfa6868 100644 --- a/basis/stack-checker/alien/alien-docs.factor +++ b/basis/stack-checker/alien/alien-docs.factor @@ -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." } ; diff --git a/basis/stack-checker/known-words/known-words-docs.factor b/basis/stack-checker/known-words/known-words-docs.factor index f656c1d909..95bbbc87b3 100644 --- a/basis/stack-checker/known-words/known-words-docs.factor +++ b/basis/stack-checker/known-words/known-words-docs.factor @@ -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." } ; diff --git a/basis/stack-checker/values/values-docs.factor b/basis/stack-checker/values/values-docs.factor index 9745d94f5d..c87dad50c1 100644 --- a/basis/stack-checker/values/values-docs.factor +++ b/basis/stack-checker/values/values-docs.factor @@ -3,4 +3,4 @@ IN: stack-checker.values HELP: { $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." } ; diff --git a/basis/stack-checker/visitor/visitor-docs.factor b/basis/stack-checker/visitor/visitor-docs.factor new file mode 100644 index 0000000000..4805d4edae --- /dev/null +++ b/basis/stack-checker/visitor/visitor-docs.factor @@ -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}" + } +} ;