From: <bl...@us...> - 2003-05-30 07:28:05
|
Update of /cvsroot/cpptool/rfta/src/pyrfta/test/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv1528/src/pyrfta/test/rfta Modified Files: __init__.py Log Message: * cleaned up & added conversion to string Index: __init__.py =================================================================== RCS file: /cvsroot/cpptool/rfta/src/pyrfta/test/rfta/__init__.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** __init__.py 29 May 2003 14:05:56 -0000 1.1 --- __init__.py 30 May 2003 07:28:02 -0000 1.2 *************** *** 1,11 **** from _pyrfta import * ! ##source = "void f() { return; }" ! ##parser = Parser( source ) ! ##fn = parser.getFunctionAt( 16 ) ! ##print fn.functionName.name ! ##body = fn.body ! ##for statement in body.getStatements(): ! ## print statement ! --- 1,20 ---- from _pyrfta import * ! def _identifier_str( self ): ! return self.identifier ! ! def _declarator_str( self ): ! return self.type.typeText + ' ' + self.name.identifier + self.typeSuffix.typeText + def _declarator_expr_str( self ): + s = 'DeclarationExpr<' + self.primaryType.typeText + " " + sep = '' + for decl in self.getDeclarators(): + s += sep + s += str(decl) + sep = ',' + return s + '>' + + Declarator.__str__ = _declarator_str + DeclaratorExpression.__repr__ = _declarator_expr_str + Identifier.__str__ = _identifier_str \ No newline at end of file |