2018-05-22 16:39:48 +00:00
|
|
|
Gir uses two types of IR, with and without offsets
|
|
|
|
|
|
|
|
Without offsets
|
|
|
|
---------------
|
|
|
|
This is produced by `parse`. Each subsection shows the properties the
|
|
|
|
command object of that type has in IR without offsets
|
|
|
|
|
|
|
|
### add
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `add`
|
|
|
|
value | The number to add to current cell
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
Generated on `+` and `-`
|
|
|
|
|
|
|
|
### moveHead
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `add`
|
|
|
|
type | `moveHead`
|
|
|
|
value | The number of steps to move the tape head right
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
Generated on `<` and `>`
|
|
|
|
|
|
|
|
### writeByte
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `writeByte`
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
Generated on `.`
|
|
|
|
|
|
|
|
### readByte
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `readByte`
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
Generated on `,`
|
|
|
|
|
|
|
|
### loop
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
2018-05-22 16:39:48 +00:00
|
|
|
type | `loop`
|
|
|
|
contents | An array of the commands making up the loop body
|
|
|
|
|
|
|
|
Generated on `[`…`]`
|
|
|
|
|
|
|
|
### clear
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `clear`
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
Not generated by the parser directly, but generated by optimizations
|
|
|
|
|
|
|
|
|
|
|
|
With offsets
|
|
|
|
------------
|
|
|
|
This is produced by the optimization pass `addOffsetProperties`. Each
|
|
|
|
subsection shows the properties the command object of that type has in IR
|
|
|
|
with offsets
|
|
|
|
|
|
|
|
### add
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `add`
|
|
|
|
value | The number to add to the cell
|
|
|
|
offfset | The location of the cell relative to current tape position
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
### moveHead
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `moveHead`
|
|
|
|
value | The number of steps to move the tape head right
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
### writeByte
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `writeByte`
|
|
|
|
offset | The location of the cell relative to current tape position
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
### readByte
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `readByte`
|
|
|
|
offset | The location of the cell relative to current tape position
|
2018-05-22 16:39:48 +00:00
|
|
|
|
|
|
|
### loop
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
-----------|------
|
2018-05-22 16:39:48 +00:00
|
|
|
type | `loop`
|
|
|
|
contents | An array of the commands making up the loop body
|
|
|
|
isBalanced | Whether execution of the loop body ends in same cell it started in
|
|
|
|
|
|
|
|
### clear
|
2018-05-22 16:48:09 +00:00
|
|
|
property | value
|
|
|
|
---------|------
|
|
|
|
type | `clear`
|
|
|
|
offset | The location of the cell relative to current tape position
|