mikaelpatel / Arduino-FVM

Byte Token Threaded Forth Virtual Machine (FVM) for Arduino

Home Page:https://mikaelpatel.github.io/Arduino-FVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add token compiler

mikaelpatel opened this issue · 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.