Var.py (9219:258753d3bc47) Var.py (10305:76745b567dc3)
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;

--- 18 unchanged lines hidden (view full) ---

27
28from slicc.symbols.Symbol import Symbol
29
30class Var(Symbol):
31 def __init__(self, symtab, ident, location, type, code, pairs,
32 machine=None):
33 super(Var, self).__init__(symtab, ident, location, pairs)
34
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;

--- 18 unchanged lines hidden (view full) ---

27
28from slicc.symbols.Symbol import Symbol
29
30class Var(Symbol):
31 def __init__(self, symtab, ident, location, type, code, pairs,
32 machine=None):
33 super(Var, self).__init__(symtab, ident, location, pairs)
34
35 if machine:
36 self.c_ident = "%s_%s" % (machine, ident)
37 else:
38 self.c_ident = ident
39
40 self.machine = machine
41 self.type = type
42 self.code = code
43
44 def __repr__(self):
35 self.machine = machine
36 self.type = type
37 self.code = code
38
39 def __repr__(self):
45 return "[Var id: %s]" % (self.c_ident)
40 return "[Var id: %s]" % (self.ident)
46
47 def writeCodeFiles(self, path, includes):
48 pass
49
50__all__ = [ "Var" ]
41
42 def writeCodeFiles(self, path, includes):
43 pass
44
45__all__ = [ "Var" ]