-- @atlcompiler emftvm -- @nsURI EMFTVM=http://soft.vub.ac.be/emftvm/2011/EMFTVM -- Lists all EMFTVM!LocalVariable instances -- $Id$ query ListLocals = EMFTVM!LocalVariable.allInstances() ->iterate(e; acc : String = 'Local variables:\n' | acc + '\t' + (e.name + ':').tabs(3) + (e.typeModel + '!' + e.type).tabs(3) + '(' + (e.startInstructionIndex.toString() + ':' + e.startInstruction.opcode).tabs(3) + '- ' + (e.endInstructionIndex.toString() + ':' + e.endInstruction.opcode) + ')\n') .debug('ListLocals'); helper context String def : tabs(n : Integer) : String = let tabs : Integer = n - (self.size() div 8) in if tabs > 0 then self + '\t' + ''.tabs(tabs-1) else self endif;