micro_asm.py (4613:7f670817a86c) | micro_asm.py (5009:78d53ea88c74) |
---|---|
1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 126 unchanged lines hidden (view full) --- 135 microop = eval('__microopClassFromInsideTheAssembler(%s)' % 136 statement.params, {}, parser.symbols) 137 except: 138 print_error("Error creating microop object with mnemonic %s." % \ 139 statement.mnemonic) 140 raise 141 try: 142 for label in statement.labels: | 1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 126 unchanged lines hidden (view full) --- 135 microop = eval('__microopClassFromInsideTheAssembler(%s)' % 136 statement.params, {}, parser.symbols) 137 except: 138 print_error("Error creating microop object with mnemonic %s." % \ 139 statement.mnemonic) 140 raise 141 try: 142 for label in statement.labels: |
143 container.labels[label.name] = microop | 143 container.labels[label.text] = microop |
144 if label.extern: | 144 if label.extern: |
145 container.externs[label.name] = microop | 145 container.externs[label.text] = microop |
146 container.add_microop(microop) 147 except: 148 print_error("Error adding microop.") 149 raise 150 elif statement.is_directive: 151 if statement.name not in container.directives.keys(): 152 raise Exception, "Unrecognized directive: %s" % statement.name 153 parser.symbols["__directiveFunctionFromInsideTheAssembler"] = \ --- 280 unchanged lines hidden (view full) --- 434 'labels : label' 435 t[0] = [t[1]] 436 437def p_labels_1(t): 438 'labels : labels label' 439 t[1].append(t[2]) 440 t[0] = t[1] 441 | 146 container.add_microop(microop) 147 except: 148 print_error("Error adding microop.") 149 raise 150 elif statement.is_directive: 151 if statement.name not in container.directives.keys(): 152 raise Exception, "Unrecognized directive: %s" % statement.name 153 parser.symbols["__directiveFunctionFromInsideTheAssembler"] = \ --- 280 unchanged lines hidden (view full) --- 434 'labels : label' 435 t[0] = [t[1]] 436 437def p_labels_1(t): 438 'labels : labels label' 439 t[1].append(t[2]) 440 t[0] = t[1] 441 |
442# labels on lines by themselves are attached to the following instruction. 443def p_labels_2(t): 444 'labels : labels NEWLINE' 445 t[0] = t[1] 446 |
|
442def p_label_0(t): 443 'label : ID COLON' 444 label = Label() 445 label.is_extern = False 446 label.text = t[1] 447 t[0] = label 448 449def p_label_1(t): --- 47 unchanged lines hidden --- | 447def p_label_0(t): 448 'label : ID COLON' 449 label = Label() 450 label.is_extern = False 451 label.text = t[1] 452 t[0] = label 453 454def p_label_1(t): --- 47 unchanged lines hidden --- |