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 --- 1204 unchanged lines hidden (view full) --- 1213 def p_specification(self, t): 1214 'specification : opt_defs_and_outputs name_decl opt_defs_and_outputs decode_block' 1215 global_code = t[1] 1216 isa_name = t[2] 1217 namespace = isa_name + "Inst" 1218 # wrap the decode block as a function definition 1219 t[4].wrap_decode_block(''' 1220StaticInstPtr |
1221%(isa_name)s::Decoder::decodeInst(%(isa_name)s::ExtMachInst machInst) |
1222{ 1223 using namespace %(namespace)s; 1224''' % vars(), '}') 1225 # both the latter output blocks and the decode block are in 1226 # the namespace 1227 namespace_code = t[3] + t[4] 1228 # pass it all back to the caller of yacc.parse() 1229 t[0] = (isa_name, namespace, global_code, namespace_code) --- 779 unchanged lines hidden --- |