isa_parser.py (6691:cd68b6ecd68d) | isa_parser.py (6728:5037062422c8) |
---|---|
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 --- 571 unchanged lines hidden (view full) --- 580 codeObj.wrap_decode_block('\n%s:' % label, 'break;\n') 581 codeObj.has_decode_default = (label == 'default') 582 t[0] = codeObj 583 584 # The case label is either a list of one or more constants or 585 # 'default' 586 def p_case_label_0(self, t): 587 'case_label : intlit_list' | 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 --- 571 unchanged lines hidden (view full) --- 580 codeObj.wrap_decode_block('\n%s:' % label, 'break;\n') 581 codeObj.has_decode_default = (label == 'default') 582 t[0] = codeObj 583 584 # The case label is either a list of one or more constants or 585 # 'default' 586 def p_case_label_0(self, t): 587 'case_label : intlit_list' |
588 t[0] = ': '.join(map(lambda a: 'case %#x' % a, t[1])) | 588 def make_case(intlit): 589 if intlit >= 2**32: 590 return 'case ULL(%#x)' % intlit 591 else: 592 return 'case %#x' % intlit 593 t[0] = ': '.join(map(make_case, t[1])) |
589 590 def p_case_label_1(self, t): 591 'case_label : DEFAULT' 592 t[0] = 'default' 593 594 # 595 # The constant list for a decode case label must be non-empty, but 596 # may have one or more comma-separated integer literals in it. --- 1443 unchanged lines hidden --- | 594 595 def p_case_label_1(self, t): 596 'case_label : DEFAULT' 597 t[0] = 'default' 598 599 # 600 # The constant list for a decode case label must be non-empty, but 601 # may have one or more comma-separated integer literals in it. --- 1443 unchanged lines hidden --- |