Mercurial > lcfOS
comparison python/c3/analyse.py @ 272:e64bae57cda8
refactor ir
author | Windel Bouwman |
---|---|
date | Sat, 31 Aug 2013 17:58:54 +0200 |
parents | 7416c923a02a |
children | 6f2423df0675 |
comparison
equal
deleted
inserted
replaced
271:cf7d5fb7d9c8 | 272:e64bae57cda8 |
---|---|
108 return t | 108 return t |
109 else: | 109 else: |
110 raise Exception('Error resolving type {} {}'.format(t, type(t))) | 110 raise Exception('Error resolving type {} {}'.format(t, type(t))) |
111 | 111 |
112 def findRefs(self, sym): | 112 def findRefs(self, sym): |
113 if type(sym) in [Variable, Constant]: | 113 if type(sym) in [Constant] or isinstance(sym, Variable): |
114 sym.typ = self.resolveType(sym.typ, sym.scope) | 114 sym.typ = self.resolveType(sym.typ, sym.scope) |
115 elif type(sym) is TypeCast: | 115 elif type(sym) is TypeCast: |
116 sym.to_type = self.resolveType(sym.to_type, sym.scope) | 116 sym.to_type = self.resolveType(sym.to_type, sym.scope) |
117 elif type(sym) is VariableUse: | 117 elif type(sym) is VariableUse: |
118 sym.target = self.resolveDesignator(sym.target, sym.scope) | 118 sym.target = self.resolveDesignator(sym.target, sym.scope) |