The Default Forth Parser

  Some parts of this page/site are currently incomplete & will be updated asap
  Other parts will change continually so use “Refresh” in your browser !!
  There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone. This site is best viewed via a computer’s HD monitor


What is “Parsing” ?

Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term parsing comes from Latin pars (orationis), meaning part (of speech)”

“The term has slightly different meanings in different branches of linguistics and computer science. Traditional sentence parsing is often performed as a method of understanding the exact meaning of a sentence or word, sometimes with the aid of devices such as sentence diagrams. It usually emphasizes the importance of grammatical divisions such as subject and predicate”

“Within computational linguistics the term is used to refer to the formal analysis by a computer of a sentence or other string of words into its constituents, resulting in a parse tree showing their syntactic relation to each other, which may also contain semantic and other information (p-values).[citation needed] Some parsing algorithms may generate a parse forest or list of parse trees for a syntactically ambiguous input”

Clearly, this kind of parsing is very complex, so it will be no surprise to learn that the default Forth Parser is much, much simpler…

The Forth Parser Rules

The default Forth Parser is the Forth Word INTERPRET which is invoked in the word QUIT, which is known as the “Outer-Interpreter”

INTERPRET is the text interpreter which sequentially executes or compiles text from the input stream depending on STATE. If the word cannot be found after searching CONTEXT and CURRENT, it is converted to a number according to the current base. That also failing, an error message echoing the name with a “ ?” will be printed”    (Ting 2013, p. 23)

References:

Ting, C. H., 2013. Systems Guide to fig-Forth [online]. 3rd ed. San Mateo, CA 94402, USA: Offete Enterprises, Inc. Available from: http://figforth.org.uk/library/Systems.Guide.to.figForth.pdf.

Knuth, D. E., 1997. The Art of Computer Programming - Vol 1 - Fundamental Algorithms - 3rd Ed.

Schweller, K. G., 2003. Turing Machine. Available from: http://web.bvu.edu/faculty/schweller/Turing/Turing.html.

Taivalsaari, A., 2003. Virtual Machine Design. Available from: http://figforth.org.uk/library/VMDesign1.pdf.

Turing, A., 1936. The Turing Machine. Available from: http://introcs.cs.princeton.edu/java/52turing/.


Updated: 27th February 2022 by David Husband
© 2021 David Husband, a.k.a. Baremetal Engineer Extraordinaire
All Rights Reserved – All Trademarks & Copyrights Acknowledged
All personal information is subject to the Data Protection Act 2018 & the UK GDPR
“ad auxilium aliis ad auxilium sibi”