]> gitweb.factorcode.org Git - factor.git/blobdiff - core/parser/parser-docs.factor
Changing : foo ; parsing to SYNTAX: foo ;
[factor.git] / core / parser / parser-docs.factor
index 23bc41a1bb30f2b320d00be0877ee5760ca3938d..547f7c0490ebd3805c2ca5277eaa85b8be8245b7 100644 (file)
@@ -54,8 +54,10 @@ $nl
 ARTICLE: "parsing-words" "Parsing words"
 "The Factor parser follows a simple recursive-descent design. The parser reads successive tokens from the input; if the token identifies a number or an ordinary word, it is added to an accumulator vector. Otherwise if the token identifies a parsing word, the parsing word is executed immediately."
 $nl
-"Parsing words are marked by suffixing the definition with a " { $link POSTPONE: parsing } " declaration. Here is the simplest possible parsing word; it prints a greeting at parse time:"
-{ $code ": hello \"Hello world\" print ; parsing" }
+"Parsing words are defined using the a defining word:"
+{ $subsection POSTPONE: SYNTAX: }
+"Parsing words have uppercase names by convention. Here is the simplest possible parsing word; it prints a greeting at parse time:"
+{ $code "SYNTAX: HELLO \"Hello world\" print ;" }
 "Parsing words must not pop or push items from the stack; however, they are permitted to access the accumulator vector supplied by the parser at the top of the stack. That is, parsing words must have stack effect " { $snippet "( accum -- accum )" } ", where " { $snippet "accum" } " is the accumulator vector supplied by the parser."
 $nl
 "Parsing words can read input, add word definitions to the dictionary, and do anything an ordinary word can."