EnumDeclAST.py (6657:ef5fae93a3b2) | EnumDeclAST.py (6714:028047200ff7) |
---|---|
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; --- 24 unchanged lines hidden (view full) --- 33 super(EnumDeclAST, self).__init__(slicc, pairs) 34 35 self.type_ast = type_ast 36 self.fields = fields 37 38 def __repr__(self): 39 return "[EnumDecl: %s]" % (self.type_ast) 40 | 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; --- 24 unchanged lines hidden (view full) --- 33 super(EnumDeclAST, self).__init__(slicc, pairs) 34 35 self.type_ast = type_ast 36 self.fields = fields 37 38 def __repr__(self): 39 return "[EnumDecl: %s]" % (self.type_ast) 40 |
41 def files(self, hh, cc, parent=None): | 41 def files(self, parent=None): |
42 if "external" in self: | 42 if "external" in self: |
43 return | 43 return set() |
44 45 if parent: 46 ident = "%s_%s" % (parent, self.type_ast.ident) 47 else: 48 ident = self.type_ast.ident | 44 45 if parent: 46 ident = "%s_%s" % (parent, self.type_ast.ident) 47 else: 48 ident = self.type_ast.ident |
49 hh.add("%s.hh" % ident) 50 cc.add("%s.cc" % ident) | 49 s = set(("%s.hh" % ident, "%s.cc" % ident)) 50 return s |
51 52 def generate(self): 53 ident = str(self.type_ast) 54 55 # Make the new type 56 t = Type(self.symtab, ident, self.location, self.pairs, 57 self.state_machine) 58 self.symtab.newSymbol(t) --- 13 unchanged lines hidden --- | 51 52 def generate(self): 53 ident = str(self.type_ast) 54 55 # Make the new type 56 t = Type(self.symtab, ident, self.location, self.pairs, 57 self.state_machine) 58 self.symtab.newSymbol(t) --- 13 unchanged lines hidden --- |