]> gitweb.factorcode.org Git - factor.git/blob - core/syntax/early-parser.facts
more sql changes
[factor.git] / core / syntax / early-parser.facts
1 USING: help kernel parser sequences ;
2
3 IN: help
4 : $parsing-note
5     drop
6     "This word should only be called from parsing words."
7     $notes ;
8
9 HELP: use
10 { $var-description "A variable holding the current vocabulary search path as a sequence of hashtables." }
11 { $see-also in use+ set-use POSTPONE: USING: POSTPONE: USE: } ;
12
13 HELP: in
14 { $var-description "A variable holding the current vocabulary for new definitions." }
15 { $see-also use set-in POSTPONE: IN: } ;
16
17 HELP: check-vocab
18 { $values { "name" "a string" } { "vocab" "a hashtable or " { $link f } } }
19 { $description "Outputs a named vocabulary. If the vocabulary does not exist, throws a restartable " { $link check-vocab } " error. If the user invokes the restart, this word outputs " { $link f } "." }
20 { $error-description "Thrown by " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } " when a given vocabulary does not exist. Vocabularies must be created by " { $link POSTPONE: IN: } " before being used." } ;
21
22 HELP: use+
23 { $values { "vocab" "a string" } }
24 { $description "Adds a new vocabulary at the front of the search path. Subsequent word lookups by the parser will search this vocabulary first." }
25 $parsing-note
26 { $errors "Throws an error if the vocabulary does not exist." }
27 { $see-also in use add-use set-use POSTPONE: USE: } ;
28
29 HELP: set-use
30 { $values { "seq" "a sequence of strings" } }
31 { $description "Sets the vocabulary search path. Later vocabularies take precedence." }
32 { $errors "Throws an error if one of the vocabularies does not exist." }
33 $parsing-note
34 { $see-also in use use+ add-use file-vocabs } ;
35
36 HELP: add-use
37 { $values { "seq" "a sequence of strings" } }
38 { $description "Adds multiple vocabularies to the search path, with later vocabularies taking precedence." }
39 { $errors "Throws an error if one of the vocabularies does not exist." }
40 $parsing-note
41 { $see-also in use use+ set-use POSTPONE: USING: } ;
42
43 HELP: set-in
44 { $values { "name" "a string" } }
45 { $description "Sets the current vocabulary where new words will be defined, creating the vocabulary first if it does not exist." }
46 $parsing-note
47 { $see-also in use POSTPONE: IN: } ;
48
49 HELP: parsing?
50 { $values { "obj" "an object" } { "?" "a boolean" } }
51 { $description "Tests if an object is a parsing word." }
52 { $notes "Outputs " { $link f } " if the object is not a word." } ;
53
54 HELP: file
55 { $var-description "Variable stores the file name being parsed. This is the input parameter to " { $link parse-stream } "." } ;
56
57 HELP: line-number
58 { $var-description "Variable holds the line number being parsed." } ;
59
60 HELP: line-text
61 { $var-description "Variable holds the text of the line being parsed." } ;
62
63 HELP: column
64 { $var-description "Variable holds the column number being parsed." } ;
65
66 HELP: save-location
67 { $values { "word" "a word" } }
68 { $description "Sets the " { $snippet "\"file\"" } " and " {  $snippet "\"line\"" } " word properties to the current parser location." }
69 $parsing-note ;
70
71 HELP: create-in
72 { $values { "string" "a word name" } { "word" "a new word" } }
73 { $description "Creates a word in the current vocabulary. Until re-defined, the word throws an error when invoked." }
74 $parsing-note ;
75
76 HELP: create-constructor
77 { $values { "class" "a word" } { "word" "a new word" } }
78 { $description "Creates a new word in the current vocabulary, named by surrounding " { $snippet "class" } " with angle brackets." }
79 { $examples
80     { $example "SYMBOL: foo" "foo create-constructor ." "<foo>" }
81 } ;
82
83 HELP: parse-error
84 { $error-description "Thrown when the parser encounters invalid input. A parse error wraps an underlying error and holds the file being parsed, line number, and column number." } ;