AST.py (7007:79413d1ec307) | AST.py (8452:3f2c329e9046) |
---|---|
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 16 unchanged lines hidden (view full) --- 25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 28from slicc.util import PairContainer, Location 29 30class AST(PairContainer): 31 def __init__(self, slicc, pairs=None): 32 self.slicc = slicc | 1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 16 unchanged lines hidden (view full) --- 25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 28from slicc.util import PairContainer, Location 29 30class AST(PairContainer): 31 def __init__(self, slicc, pairs=None): 32 self.slicc = slicc |
33 self.location = Location(slicc.current_file, slicc.lexer.lineno) | 33 self.location = Location(slicc.current_source, slicc.current_line) |
34 self.pairs = {} 35 if pairs: 36 self.pairs.update(getattr(pairs, "pairs", pairs)) 37 38 @property 39 def symtab(self): 40 return self.slicc.symtab 41 --- 26 unchanged lines hidden --- | 34 self.pairs = {} 35 if pairs: 36 self.pairs.update(getattr(pairs, "pairs", pairs)) 37 38 @property 39 def symtab(self): 40 return self.slicc.symtab 41 --- 26 unchanged lines hidden --- |