⇐ MY QUORA-INDEX QUORA - my answered Questions

QUORA - my answered Questions

Q002: Which technique do programming language parsers and interpreters use?

FORTH is an interpreter and compiler and uses a very simple approach. I think even simpler than LISP.

Separate an input string into words, delimited by white spaces. For such a word look at dictionary, if it is found, execute it. If not try to convert it into a number and push it on the data stack. If it is not a number throw an error.

In compile mode search the word in the macro dictionary and execute it. If it is not found search into dictionary and compile a call to it. If it is not found either convert it into a number and compile a literal. If it is not a number throw an exception.

DONE