mikaelpatel/Arduino-FVM

Add token compiler

mikaelpatel opened this issue · 5 comments

Compile forth statements to virtual machine instructions (in C++).

Initial token compiler with support for basic control structures. See commit c61711b.

Token compiler will handle comments. See update d3623be.

Token compiler will generate code for constants and variables. See update 0803a7a.

Token compiler understands the following words:

  1. : NAME WORDS ;
  2. variable NAME
  3. VALUE constant NAME
  4. Conditional control structure; CONDITION if-then, if-else-then
  5. Loop control structure; begin-again, begin-CONDITION until, begin-CONDITION while-repeat
  6. ( COMMENT)
  7. room
  8. compiled-words
  9. generate-code
  10. All kernel words

Token compiler will compile string print (dot-quote) ." STRING"
See commit b17f941.