| Polaris: ArgNumberExpr.h Source File | ||
|
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members
ArgNumberExpr.hGo to the documentation of this file.00001 /// 00002 #ifndef _ARG_NUMBER_EXPR_H 00003 #define _ARG_NUMBER_EXPR_H 00004 /// 00005 /// \class ArgNumberExpr 00006 /// \brief Expression for arguments in a statement function. 00007 /// \defgroup Polaris 00008 /// \ingroup Polaris 00009 /// Expression 00010 /// \see Expression/ArgNumberExpr.h 00011 /// \see Expression/ArgNumberExpr.h 00012 /// \see Expression/Expression.cc 00013 /// 00014 /// \endcode 00015 /// \section Description Description 00016 /// An ArgNumberExpr is the expression for arguments of a statement 00017 /// function. Arg number 1 is the first statement function argument, 00018 /// arg number 2 is the second, and so forth. These should never be 00019 /// seen in a scanned program since statement functions are in-lined as 00020 /// the program is being parsed. 00021 /// 00022 #ifdef POLARIS_GNU_PRAGMAS 00023 #pragma interface 00024 #endif 00025 /// 00026 #ifndef _EXPRESSION_H 00027 #include "Expression.h" 00028 #endif 00029 /// 00030 class ArgNumberExpr : public Expression { 00031 friend class ExprTable; 00032 00033 protected: 00034 int _value; 00035 00036 ArgNumberExpr(const Type & etype); 00037 00038 public: 00039 inline ArgNumberExpr(const Type & etype, int arg_value); 00040 inline ArgNumberExpr(const ArgNumberExpr & e); 00041 virtual ~ArgNumberExpr(); 00042 00043 virtual ArgNumberExpr & operator = (const ArgNumberExpr &); 00044 00045 inline void value(int i); 00046 inline int value() const; 00047 ///< Access the argument number of myself. 00048 00049 virtual Expression *clone() const; 00050 virtual int structures_OK() const; 00051 virtual void convert(BinRep & exprSet, Symtab & symtab); 00052 virtual void print_debug(ostream & o, Boolean debug) const; 00053 virtual const ExprSignature & update_signature(); 00054 virtual int node_compare(const Expression & ex) const; 00055 ///< See Expression.h. 00056 00057 virtual int exchange_expr( VDL & vdl ); 00058 ///< Create a node in the "expression" member and return the index. 00059 00060 }; 00061 00062 00063 ///< inline implementations 00064 00065 00066 inline 00067 ArgNumberExpr::ArgNumberExpr(const Type & etype) 00068 : Expression(ARG_OP, etype) 00069 { 00070 ///< nothing to do 00071 } 00072 00073 inline 00074 ArgNumberExpr::ArgNumberExpr(const Type & etype, int arg_value) 00075 : Expression(ARG_OP, etype) 00076 { 00077 _value = arg_value; 00078 } 00079 00080 inline 00081 ArgNumberExpr::ArgNumberExpr(const ArgNumberExpr & e) 00082 : Expression(e) 00083 { 00084 _value = e.value(); 00085 } 00086 00087 inline void 00088 ArgNumberExpr::value(int i) 00089 { 00090 _value = i; 00091 } 00092 00093 inline int 00094 ArgNumberExpr::value() const 00095 { 00096 return _value; 00097 } 00098 00099 #endif |
||
|