summaryrefslogtreecommitdiff
path: root/src/modules/ast/assembly-tree.scm
blob: ee3e1164594884ea331b8852c9764c41334023ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(define-module (modules ast assembly-tree)
  #:use-module (srfi srfi-9)
  #:export (make-subroutine
            subroutine?
            subroutine-label
            subroutine-instructions

            make-instruction
            instruction?
            instruction-operator
            instruction-operand-1
            instruction-operand-2))

(define-record-type <subroutine>
  (make-subroutine label instrs)
  subroutine?
  (label subroutine-label)
  (instrs subroutine-instructions))

(define-record-type <instruction>
  (make-instruction op oper1 oper2)
  instruction?
  (op instruction-operator)
  (oper1 instruction-operand-1)
  (oper2 instruction-operand-2))