Package pygccxml :: Package parser :: Module linker

Source Code for Module pygccxml.parser.linker

  1  # Copyright 2004-2008 Roman Yakovenko.
 
  2  # Distributed under the Boost Software License, Version 1.0. (See
 
  3  # accompanying file LICENSE_1_0.txt or copy at
 
  4  # http://www.boost.org/LICENSE_1_0.txt)
 
  5  
 
  6  import types 
  7  from pygccxml.declarations import * 
  8  
 
9 -class linker_t( decl_visitor_t, type_visitor_t, object ):
10 - def __init__( self, decls, types, access, membership, files ):
11 decl_visitor_t.__init__(self) 12 type_visitor_t.__init__(self) 13 object.__init__(self) 14 15 self.__decls = decls 16 self.__types = types 17 self.__access = access 18 self.__membership = membership 19 self.__files = files 20 self.__inst = None 21 22 self.__compiler = None 23 if self.__decls: 24 for d in self.__decls.itervalues(): 25 self.__compiler = d.compiler 26 break
27
28 - def _get_inst(self):
29 return self.__inst
30 - def _set_inst(self, inst):
31 self.__inst = inst 32 #use inst, to reduce attribute access time 33 if isinstance( inst, declaration_t ) and inst.location: 34 inst.location.file_name = self.__files[inst.location.file_name]
35 instance = property( _get_inst, _set_inst ) 36