       unless variable?
         throw SyntaxError "variable \"#{name}\" is not declared"
       linkTypes value.type, variable.type
-    "set [#{variable.label}], #{value.access}"
+    "set #{variable.access()}, #{value.access}"
 
   isStatement: (o) ->
     o?.level is LEVEL_TOP and @context? and "?" in @context

      @root = @parent.root
      @extraAsm = @root.extraAsm
      @nextLabel = @root.nextLabel
  find: (name) ->
    @names[name] or @parent?.find name
  createVariable: (name, type) ->
    variable = new Variable "_"+name, type, this
    @names[name] = variable
    @extraAsm.push variable
    variable
  createBuiltinFunc: (name, type, asm) ->
    label = @nextLabel()
    @extraAsm.push {asm: ":#{label}\n#{asm}"}
    variable = @createVariable name, type
    variable.asm = ":#{variable.label} dat #{label}"
  createLiteralString: (value) ->
    label = @nextLabel()
    asm = ":#{label} dat #{value.length}, #{JSON.stringify value}"
    @extraAsm.push {asm}
    label
  createFunc: (codeNode) ->
    new Func @nextLabel(), codeNode
  createSubNamespace: ->
    new Namespace this


  # A **Block** is the only node that can serve as the root.
  compileRoot: ->
    o = {namespace: new Namespace}
    codes = []
    codes.push "; stdlib"
    codes.push o.namespace.createBuiltinFunc "printc", new Type("func", [intType], voidType), stdlib.printc
    codes.push o.namespace.createBuiltinFunc "prints", new Type("func", [stringType], voidType), stdlib.prints
    codes.push "; main"
    codes.push @compileStatement o
    codes.push "; exit"
    codes.push "set [0x8ffe], 0"
    codes.push ""

    for variable in o.namespace.extraAsm
      codes.push variable.asm
