========================================= Romeo Intermediate Language Specification Author........ Kevin P. Albrecht Version....... 0.09 Date.......... 22 Nov 2002 ========================================= - all programs must end with 'stop' - in this document, guarantees by the parser are in square brackets OPERATIONS ---------- ==SPECIAL== nop line number: (line number), a: (filename) jump a: (statement index number) stop cond a: (boolean), b: (jump to if a<>0), c: (jump to if a=0) TYPE(a): int, rat ==TYPE CONVERSION== - converts puts converted value of 'b' into 'a' - 'xir' means int->rat xir xis xri xrs xsi xsr ==ASSIGNMENT== set a: b TYPE: int, rat, str ==UNARY ARITH== neg a: -b TYPE: int, rat; [ a.type == b.type ] ==BINARY ARITH== add a: b + c TYPE: int, rat sub a: b - c TYPE: int, rat mult a: b * c TYPE: int, rat div a: b / c TYPE: int, rat eq a: b = c TYPE: int, rat neq a: b <> c TYPE: int, rat lt a: b < c TYPE: int, rat gt a: b > c TYPE: int, rat lteq a: b <= c TYPE: int, rat gteq a: b >= c TYPE: int, rat or a: b or c TYPE: int, rat and a: b and c TYPE: int, rat ==BINARY STRING== cat a: b (concatenate) c TYPE: str seq a: b = c TYPE: str sneq a: b <> c TYPE: str ==CONSOLE== cin a: (input) TYPE: int, rat, str [a.type == str] cout (output): a TYPE: int, rat, str - does not output a newline character by default.