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