Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
Artist
Having just discussed the parser, we now come to the Code Generator. This takes the parse tree and transforms it into executable instructions and data. This can be ::ILA:: sequences (Interactive Language Architecture, ::SHE+ILA::'s datapath and interpreter), for example "A+B*C" (where A,B,C may be numbers, quaternions, or even matrices) may produce
"$F8 $FA $2B $ED $E4 $81 $ED $F8 $FA $2A $ED $E4 $82 $ED $E4 $83 $00 $00"
where $F8 ... $ED ... $ED ... $00 means "node", $FA $2B means "add reduce the following vector", $FA $2A means "multiply reduce the following vector", $E4 $81 "means "Atom of A", $E4 $82 means "Atom of B", and $E4 $83 means "Atom of C". This ::ILA:: code is almost the same as the parse tree, since ::ILA:: interprets the semicompiled code stream. However an alternative code generator could output Assembler code (see "LEESHA"), C++ code, or even COBOL (giggle) code :) The latter remaineth an exercise for the reader... (hehehe)