PARSING WORDS in parsing.fs and parsing-ext.c Version 0.8.3 dnw 27-Feb-09 Our naming policy tries to distinguish three kinds of parsing: ANS Forth strings, the parse area, and the input stream (across line ends). Words with "PARSE" or ">IN" in the name parse the parse area. Words with "INSTREAM" in the name parse the input stream across lines or blocks. Words with neither, with exceptions like (*, parse strings. Words that take a single character or whitespace as parsing delimiter have no prefix. Those that take a string pattern have the prefix "S-", and those that take any of a null-terminated set of characters have the prefix "{}". In words with "SCAN" in the name, motion stops at the first character of the delimiter, and no flag is left. In words with "SEEK" in the name, motion stops at the first character after the delimiter, or off end, and a flag is left. In words with "SEPARATE" in the name, the delimiter is excluded from the output, and a flag is left. At present the pfe external module parsing-ext.c implements a few more words than the ANS Forth implementation parse.fs. LIBRARY STRING PARSING-LIB-S ANS FORTH STRINGS ToolBelt 2002: STRING/ END-C@ SKIP SCAN TRIM| [aka TRIM] SCAN-BACK [aka BACK] WHITE? [aka Is-White] ToolBelt 2000: /SPLIT S-STARTS [aka STARTS?] S-ENDS [aka ENDS?] Other string extensions: CUT-FIRST CUT-LAST KEEP-FIRST KEEP-LAST SKIP-BACK |TRIM |TRIM| SEEK {}IN {}SCAN {}SEEK {}STARTS {}ENDS SEPARATE {}SEPARATE S-SEPARATE S-AFTER FIRST-WORD SEPARATE-WORD WHITE-DELIMITED? PFE only: S-STARTS-NC S-ENDS-NC Not implemented: STARTS STARTS-NC ENDS ENDS-NC {}SKIP S-SKIP S-SCAN S-SEEK INPUT STREAM Parse area: PARSE-AREA@ PARSE-AREA! EMPTY-PARSE-AREA PARSE-AREA-EMPTY? PARSE-NAME PREPARSE-NAME PARSE-NAME-AWAY >IN++ >IN-- Defined in parsing-test.fs: >IN+ >IN- PFE only: SPACE|PUNCT-PARSE Not implemented: {}PARSE S-PARSE PARSE-AWAY {}PARSE-AWAY Across lines or blocks: \\ ?EMIT-CR NEXT-INSTREAM-NAME S-SEEK-INSTREAM |S|-SEEK-INSTREAM (* Not implemented: SKIP-INSTREAM SCAN-INSTREAM SEEK-INSTREAM {}SKIP-INSTREAM {}SCAN-INSTREAM {}SEEK-INSTREAM