1 #!/usr/bin/env python 2 3 """ 4 Additional program AST nodes. 5 6 Copyright (C) 2006, 2007 Paul Boddie <paul@boddie.org.uk> 7 8 This software is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License as 10 published by the Free Software Foundation; either version 2 of 11 the License, or (at your option) any later version. 12 13 This software is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public 19 License along with this library; see the file LICENCE.txt 20 If not, write to the Free Software Foundation, Inc., 21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 22 """ 23 24 class Self: 25 26 """ 27 A program node encapsulating object/context information in an argument list. 28 This is not particularly like Attribute, Class, Instance or other such 29 things, since it actually appears in the program representation. 30 """ 31 32 def __init__(self, attribute): 33 self.types = set() 34 self.types.add(attribute) 35 36 class Op: 37 38 "A replacement AST node representing an operation in a Compare construct." 39 40 def __init__(self, name, expr): 41 self.name = name 42 self.expr = expr 43 44 # vim: tabstop=4 expandtab shiftwidth=4