oonski94 (1158312), страница 4
Текст из файла (страница 4)
To get more information about the Sage++ mailing lists, send a non-emptymail message to:sage-request@cica.indiana.eduAll the Sage++ papers, manuals, program les, and hypertext documents are also available via theanonymous FTP archive ftpcica.cica.indiana.edu:pub/sageA hypertext version of the Sage++ User's Guide and other papers may be accessed through the WWWaddresshttp://www.cica.indiana.edu/sage/home-page.htmlBug reports may be sent tosage-bugs@cica.indiana.edu6 Limitations of Sage++Sage++ has proven to be a powerful tool in our compiler prototyping experiments, but it still has anumber of limitations.
The most important of these is that it is not easy for users to add languageextensions to Fortran or C. To add a new statement to a language, the parser (based on a the GNUBison version of YACC) must be extended, a new node type must be added to the internal form, anda corresponding subclass added to the Sage++ hierarchy. The unparser module, which is table driven,must also be extended to recognize this new node. While we have done this several times (we haveadded some of the PCF, Fortran-S, Fortran-M and HPF extensions to Fortran and extended C++ todene our pC++ language [5] as well as the proposed CC++ syntax), it is not an easy task, becauseit requires a complete understanding of the internal parser structures.
A future version of Sage++ willwork with a dierent parser generator that will, we hope, simplify this task.7 ConclusionsThe Sage++ object hierarchy provides a exible and extensible tool for manipulating an internal representation of programs written in C/C++ and Fortran (and its extensions). Coupled with parsersand an unparser, the Sage++ toolkit allows researchers to construct a wide variety of source-to-sourcetransformation systems eciently, signicantly reducing the development time that is usually associatedwith building such systems from scratch.Sage++ is still under development. Many of the improvements and extensions already implementedhave been suggested by Sage++ users.
We would like to thank them all, and in particular Bernd Mohr,Andrew Mauer, Darryl Brown, Michael Golden, and Craig Chase.References[1] G. Fox, S. Hiranandani, K. Kennedy, C. Koelbel, U. Kremer, C. Tseng, and M. Wu. "Fortran DLanguage Specication." Tech. Report COMP TR90079 from the Dept. Computer Science, RiceUniversity, March 1991.[2] P.
Brezany, M. Gerndt, V. Sipkova, and H.P. Zima. "SUPERB support for irregular scienticcomputations." In Proceedings of the Scalable High Performance Computing Conference (SHPCC92). IEEE Computer Society Press, April 1992, pp. 314{321.[3] F. Bodin, L. Kervella, and T. Priol. "Fortran-S: A Fortran Interface for Shared Virtual MemoryArchitectures." In Proceedings, Supercomputing 93, Portland Oregon.[4] J. Dongarra, R. Pozzo, D.
Walker, "An Object Oriented Design for High Performance LinearAlgebra on Distributed Memory Architectures," In Proceedings of the First Annual Object-OrientedNumerics Conference (OON-SKI), Sunriver, Oregon, Apr. 1993, pp. 257{264.[5] F. Bodin, D. Gannon, P. Beckman, S. Narayana, S. Yang , \Distributed pC++: Basic Ideasfor an Object Parallel Language," In Proceedings of the First Annual Object-Oriented NumericsConference (OON-SKI), Sunriver, Oregon, Apr. 1993, pp. 1-24.[6] Polychronopoulos, C., Girkar, M., Haghighat, M., et al, "The Structure of Parafrase-2: An Advanced Parallelizing Compiler for C and Fortran", In Languages and Compilers for Parallel Computing, Gelernter, D., Nicolau, A., Padua, D., eds., MIT Press 1990, pp. 423{453.[7] A.
V. Aho and R. Sethi and J. D. Ullman, Compiler Principles, Techniques, and Tools, AddisonWesley, 1986.[8] W. Pugh, D. Wonnacott "Eliminating False Data Dependences Using the Omega Test" Tech.Report CS-TR-2993, from the Dept. of Computer Science, Univ. of Maryland; an earlier versionappeared at the ACM SIGPLAN PLDI'92 conference.[9] A. Malony, B. Mohr, P. Beckman, D. Gannon, S.
Yang, F. Bodin, \Performance Analysis of pC++:A Portable Data-Parallel Programming System for Scalable Parallel Computers", In Proc. 8th Int.Parallel Processing Symb. (IPPS), Cancun, Mexico, Apr. 1994.[10] A.Griewank, \On Automatic Dierentiation", In Mathematical Programming: Recent Developmentsand Applications, M. Iri and K. Tanabe, eds., Kluwer Academic Publishers, 1989, pp. 83{108.Top Level Block Denition Statements, F=Fortran(90), C=C(++)Class NameParent ClassmeaningSgProgHedrStmtSgProcHedrStmtF: program stmtSgProcHedrStmtSgStatementF: subroutine denitionSgFuncHedrStmtSgProcHedrStmtC,F: function denitionSgModuleStmtSgStatementF: module stmtSgInterfaceStmtSgStatementF: module interfaceSgBlockDataStmtSgStatementF: block data stmtSgClassStmtSgStatementC: classfgSgStructStmtSgClassStmtC: structfgSgUnionStmtSgClassStmtC: unionfgSgEnumStmtSgClassStmtC: enumfgSgBasicBlockStmtSgStatementC: f gBasic Control StatementsSgForStmtSgStatementF: do(), C: for()fgSgWhileStmtSgStatementF: while(), C: while()fgSgDoWhileStmtSgWhileStmtC: dofgwhile()SgLogIfStmtSgStatementF: if()stmtSgWhereStmtSgLogIfStmtF: where() stmtSgIfStmtSgStatementF: if() then, C: if()fgelsefgSgIfElseIfStmtSgIfStmtF: elseif() thenSgArithIfStmtSgStatementF: if() less,equal,greaterSgSwitchStmtSgStatementF: case, C:switch()fgSgCaseOptionStmtSgStatementC: case x:Executable Leaf StatementsSgExecutableStatement SgStatementabstract classSgAssignStmtSgExecutableStatement F: assignmentSgPointerAssignStmtSgAssignStmtF: pointer = dataSgCExpStmtSgExecutableStatement C: expr, ..., expr;SgContinueStmtSgExecutableStatement F: continueSgControlEndStmtSgExecutableStatement F,C: end of blockSgExitStmtSgControlEndStmtF: exitSgBreakStmtSgExecutableStatement C: breakSgCycleStmtSgExecutableStatement F: cycleSgReturnStmtSgExecutableStatement F,C: returnSgGotoStmtSgExecutableStatement F,C: goto labelSgAssignedGotoStmtSgLabelListStmtF: goto variableSgComputedGotoStmt SgLabelListStmtF: goto(x) l1, l2, ...gCallStmtSgExecutableStatement F: call f()Leaf Declaration StatementsSgDeclarationStatement SgStatementabstract classSgVarDeclStmtSgDeclarationStatement F,C: var decl, C: fnct protoSgParameterStmtSgDeclarationStatement F: parameter()SgImplicitStmtSgDeclarationStatement F: implicitSgUseStmtSgDeclarationStatement F: usesSgStmtFunctionStmtSgDeclarationStatement F: statement function<Class NameSgExpressionExpression Classes for C++ and Fortran 90MeaningThe root class; also home for the basic binary operators:+ %= = & j && jj + = & = = = % = ^=, = = = == ! =::A base type (i.e.
a \literal") valueFortran keyword values in I/O statements, etc.*expr, & expr, sizeof(expr), expr, +expr, ++lhd, rhs++,lhs, rhs , expr, and !expr(typename) expr;delete [size] expr;new typename (expr);(expr1) ? expr2 : expr3;function name(expr1, expr2, ....);(functionpointer)(expr1,expr2,expr3);Expression lists: expr1, expr2, ... ;Fortran name referencesScalar variable referencesC++ "this" referenceFortran X(exp,exp) or C X[exp][exp];Pointer used as array: (pointer)[index1][index2];*pointer; (also SgUnaryExp)StructName.eld;Fortran 90 structure constructor;Fortran 90 array constructor;[ exprlist ] ;Used for initializations: f expr1,expr2, ...
g;Used for EQUIVALENCE, NAMELIST and COMMON statementsFortran 90 attributesFortran 90 keyword argumentvector range op: low:up:strideFortran 90 USE statement ONLY attributeFortran 90 USE statement renamingFortran default control args to Input/Output stmtsFortran index variable bound instantiationFortran type expressionFortran sequence expressionFortran string length expressionFortran default nodeFortran label reference;SgValueExpSgKeywordValExpSgUnaryExpSgCastExpSgDeleteExpSgNewExpSgExprIfExpSgFunctionCallExpSgFuncPntrExpSgExprListExpSgRefExpSgVarRefExpSgThisExpSgArrayRefExpSgPntrArrRefExpSgPointerDerefExpSgRecordRefExpSgStructConstExpSgConstExpSgVecConstExpSgInitListExpSgObjectListExpSgAttributeExpSgKeywordArgExpSgSubscriptExpSgUseOnlyExpSgUseRenameExpSgSpecPairExpSgIOAccessExpSgTypeExpSgSeqExpSgStringLengthExpSgDefaultExpSgLabelRefExp;; =;;=;; <<; >>; <; >; <;<<; >>;>;;;; ;;;;;>;;;:;.