High level AST builders
[ROSE Frontend]

Collaboration diagram for High level AST builders:


Detailed Description

This namespace contains high level SAGE III AST node and subtree builders.

Building AST trees using raw SgNode constructors is tedious and error-prone. It becomes even more difficult with the presence of symbol tables. This namespace contains major AST node builders on top of the constructors to take care of symbol tables, various edges to scope, parent and so on.

Authors:
Chunhua Liao (last modified 2/12/2008)


Builders for expressions

handle side effects of parent pointers, Sg_File_Info, lvalue etc.

Expressions are usually built using bottomup approach, i.e. buiding operands first, then the expression operating on the operands. It is also possible to build expressions with NULL operands or empty values first, then set them afterwards.



#define BUILD_UNARY_PROTO(suffix)
 Template function to build a unary expression of type T with advanced information specified such as parenthesis and file info. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp().
#define BUILD_BINARY_PROTO(suffix)
 Template function to build a binary expression of type T,with extra information for parenthesis and file info, Instantiated functions include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(), buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp().
SgNullExpressionSageBuilder::buildNullExpression ()
 Build a null expression, set file info as the default one.
SgNullExpressionSageBuilder::buildNullExpression_nfi ()
 No file info version of buildNullExpression(). File info is to be set later on.
SgBoolValExpSageBuilder::buildBoolValExp (int value=0)
 Build a bool value expression, the name convention of SgBoolValExp is little different from others for some unknown reason.
SgBoolValExpSageBuilder::buildBoolValExp (bool value=0)
SgBoolValExpSageBuilder::buildBoolValExp_nfi (int value)
SgCharValSageBuilder::buildCharVal (char value=0)
SgCharValSageBuilder::buildCharVal_nfi (char value, const std::string &str)
SgWcharValSageBuilder::buildWcharVal (wchar_t value=0)
SgWcharValSageBuilder::buildWcharVal_nfi (wchar_t value, const std::string &str)
SgComplexValSageBuilder::buildComplexVal (long double real_value=0.0, long double imaginary_value=0.0)
SgComplexValSageBuilder::buildComplexVal (SgValueExp *real_value, SgValueExp *imaginary_value)
SgComplexValSageBuilder::buildComplexVal_nfi (SgValueExp *real_value, SgValueExp *imaginary_value, const std::string &str)
SgComplexValSageBuilder::buildImaginaryVal (long double imaginary_value)
SgComplexValSageBuilder::buildImaginaryVal (SgValueExp *imaginary_value)
SgComplexValSageBuilder::buildImaginaryVal_nfi (SgValueExp *imaginary_value, const std::string &str)
SgDoubleValSageBuilder::buildDoubleVal (double value=0.0)
 Build a double value expression.
SgDoubleValSageBuilder::buildDoubleVal_nfi (double value, const std::string &str)
SgFloatValSageBuilder::buildFloatVal (float value=0.0)
SgFloatValSageBuilder::buildFloatVal_nfi (float value, const std::string &str)
SgIntValSageBuilder::buildIntVal (int value=0)
 Build an integer value expression.
SgIntValSageBuilder::buildIntValHex (int value=0)
SgIntValSageBuilder::buildIntVal_nfi (int value, const std::string &str)
SgLongIntValSageBuilder::buildLongIntVal (long value=0)
 Build a long integer value expression.
SgLongIntValSageBuilder::buildLongIntValHex (long value=0)
SgLongIntValSageBuilder::buildLongIntVal_nfi (long value, const std::string &str)
SgLongLongIntValSageBuilder::buildLongLongIntVal (long long value=0)
 Build a long long integer value expression.
SgLongLongIntValSageBuilder::buildLongLongIntValHex (long long value=0)
SgLongLongIntValSageBuilder::buildLongLongIntVal_nfi (long long value, const std::string &str)
SgEnumValSageBuilder::buildEnumVal_nfi (int value, SgEnumDeclaration *decl, SgName name)
SgLongDoubleValSageBuilder::buildLongDoubleVal (long double value=0.0)
SgLongDoubleValSageBuilder::buildLongDoubleVal_nfi (long double value, const std::string &str)
SgShortValSageBuilder::buildShortVal (short value=0)
SgShortValSageBuilder::buildShortValHex (short value=0)
SgShortValSageBuilder::buildShortVal_nfi (short value, const std::string &str)
SgStringValSageBuilder::buildStringVal (std::string value="")
SgStringValSageBuilder::buildStringVal_nfi (std::string value)
SgUnsignedCharValSageBuilder::buildUnsignedCharVal (unsigned char v=0)
 Build an unsigned char.
SgUnsignedCharValSageBuilder::buildUnsignedCharValHex (unsigned char v=0)
SgUnsignedCharValSageBuilder::buildUnsignedCharVal_nfi (unsigned char v, const std::string &str)
SgUnsignedShortValSageBuilder::buildUnsignedShortVal (unsigned short v=0)
 Build an unsigned short integer.
SgUnsignedShortValSageBuilder::buildUnsignedShortValHex (unsigned short v=0)
SgUnsignedShortValSageBuilder::buildUnsignedShortVal_nfi (unsigned short v, const std::string &str)
SgUnsignedIntValSageBuilder::buildUnsignedIntVal (unsigned int v=0)
 Build an unsigned integer.
SgUnsignedIntValSageBuilder::buildUnsignedIntValHex (unsigned int v=0)
SgUnsignedIntValSageBuilder::buildUnsignedIntVal_nfi (unsigned int v, const std::string &str)
SgUnsignedLongValSageBuilder::buildUnsignedLongVal (unsigned long v=0)
 Build a unsigned long integer.
SgUnsignedLongValSageBuilder::buildUnsignedLongValHex (unsigned long v=0)
SgUnsignedLongValSageBuilder::buildUnsignedLongVal_nfi (unsigned long v, const std::string &str)
SgUnsignedLongLongIntValSageBuilder::buildUnsignedLongLongIntVal (unsigned long long v=0)
 Build an unsigned long long integer.
SgUnsignedLongLongIntValSageBuilder::buildUnsignedLongLongIntValHex (unsigned long long v=0)
SgUnsignedLongLongIntValSageBuilder::buildUnsignedLongLongIntVal_nfi (unsigned long long v, const std::string &str)
SgUpcThreadsSageBuilder::buildUpcThreads ()
 Build UPC THREADS (integer expression).
SgUpcThreadsSageBuilder::buildUpcThreads_nfi ()
SgUpcMythreadSageBuilder::buildUpcMythread ()
 Build UPC MYTHREAD (integer expression).
SgUpcMythreadSageBuilder::buildUpcMythread_nfi ()
SgThisExpSageBuilder::buildThisExp (SgClassSymbol *sym)
 Build this pointer.
SgThisExpSageBuilder::buildThisExp_nfi (SgClassSymbol *sym)
template<class T>
T * SageBuilder::buildUnaryExpression (SgExpression *operand=NULL)
 Template function to build a unary expression of type T. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators).
template<class T>
T * SageBuilder::buildUnaryExpression_nfi (SgExpression *operand)
SgCastExpSageBuilder::buildCastExp (SgExpression *operand_i=NULL, SgType *expression_type=NULL, SgCastExp::cast_type_enum cast_type=SgCastExp::e_C_style_cast)
 Build a type casting expression.
SgCastExpSageBuilder::buildCastExp_nfi (SgExpression *operand_i, SgType *expression_type, SgCastExp::cast_type_enum cast_type)
SgVarArgOpSageBuilder::buildVarArgOp_nfi (SgExpression *operand_i, SgType *expression_type)
 Build vararg op expression.
SgMinusMinusOpSageBuilder::buildMinusMinusOp (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode)
 Build -- expression, Sgop_mode is a value of either SgUnaryOp::prefix or SgUnaryOp::postfix.
SgMinusMinusOpSageBuilder::buildMinusMinusOp_nfi (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode)
SgPlusPlusOpSageBuilder::buildPlusPlusOp (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode)
 Build ++x or x++ , specify prefix or postfix using either SgUnaryOp::prefix or SgUnaryOp::postfix.
SgPlusPlusOpSageBuilder::buildPlusPlusOp_nfi (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode)
SgNewExpSageBuilder::buildNewExp (SgType *type, SgExprListExp *exprListExp, SgConstructorInitializer *constInit, SgExpression *expr, short int val, SgFunctionDeclaration *funcDecl)
template<class T>
T * SageBuilder::buildBinaryExpression (SgExpression *lhs=NULL, SgExpression *rhs=NULL)
 Template function to build a binary expression of type T, taking care of parent pointers, file info, lvalue, etc. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp().
template<class T>
T * SageBuilder::buildBinaryExpression_nfi (SgExpression *lhs, SgExpression *rhs)
SgConditionalExpSageBuilder::buildConditionalExp (SgExpression *test=NULL, SgExpression *a=NULL, SgExpression *b=NULL)
 Build a conditional expression ?:.
SgConditionalExpSageBuilder::buildConditionalExp_nfi (SgExpression *test, SgExpression *a, SgExpression *b, SgType *t)
SgExprListExpSageBuilder::buildExprListExp (SgExpression *expr1=NULL, SgExpression *expr2=NULL, SgExpression *expr3=NULL, SgExpression *expr4=NULL, SgExpression *expr5=NULL, SgExpression *expr6=NULL, SgExpression *expr7=NULL, SgExpression *expr8=NULL, SgExpression *expr9=NULL, SgExpression *expr10=NULL)
 Build a SgExprListExp, used for function call parameter list etc.
SgExprListExpSageBuilder::buildExprListExp (const std::vector< SgExpression * > &exprs)
SgExprListExpSageBuilder::buildExprListExp_nfi ()
SgExprListExpSageBuilder::buildExprListExp_nfi (const std::vector< SgExpression * > &exprs)
SgVarRefExpSageBuilder::buildVarRefExp (const SgName &name, SgScopeStatement *scope=NULL)
 Build SgVarRefExp based on a variable's Sage name. It will lookup symbol table internally starting from scope. A variable name is unique so type can be inferred (double check this).
SgVarRefExpSageBuilder::buildVarRefExp (const std::string &varName, SgScopeStatement *scope=NULL)
 Build SgVarRefExp based on a variable's name. It will lookup symbol table internally starting from scope. A variable is unique so type can be inferred.
SgVarRefExpSageBuilder::buildVarRefExp (const char *varName, SgScopeStatement *scope=NULL)
 Build a variable reference using a C style char array.
SgVarRefExpSageBuilder::buildVarRefExp (SgVariableSymbol *varSymbol)
 Build a variable reference from an existing symbol.
SgVarRefExpSageBuilder::buildVarRefExp_nfi (SgVariableSymbol *varSymbol)
SgVarRefExpSageBuilder::buildVarRefExp (SgVariableDeclaration *vardecl)
 Build a variable reference from an existing variable declaration. The assumption is a SgVariableDeclartion only declares one variable in the ROSE AST.
SgVarRefExpSageBuilder::buildVarRefExp (SgInitializedName *initname, SgScopeStatement *scope=NULL)
 build a variable reference from an initialized name It first tries to grab the associated symbol, then call buildVarRefExp(const SgName& name, SgScopeStatement*) if symbol does not exist.
SgVarRefExpSageBuilder::buildOpaqueVarRefExp (const std::string &varName, SgScopeStatement *scope=NULL)
 Build a variable reference expression at scope to an opaque variable which has unknown information except for its name. Used when referring to an internal variable defined in some headers of runtime libraries.(The headers are not yet inserted into the file during translation). Similar to buildOpaqueType();.
SgFunctionRefExpSageBuilder::buildFunctionRefExp (const SgName &name, const SgType *func_type, SgScopeStatement *scope=NULL)
 Build SgFunctionRefExp based on a C++ function's name and function type. It will lookup symbol table internally starting from scope. A hidden prototype will be created internally to introduce a new function symbol if the function symbol cannot be found.
SgFunctionRefExpSageBuilder::buildFunctionRefExp (const char *name, const SgType *func_type, SgScopeStatement *scope=NULL)
SgFunctionRefExpSageBuilder::buildFunctionRefExp (const SgName &name, SgScopeStatement *scope=NULL)
 Build SgFunctionRefExp based on a C function's name. It will lookup symbol table internally starting from scope and return the first matching function.
SgFunctionRefExpSageBuilder::buildFunctionRefExp (const char *name, SgScopeStatement *scope=NULL)
SgFunctionRefExpSageBuilder::buildFunctionRefExp (const SgFunctionDeclaration *func_decl)
 Build SgFunctionRefExp based on a function's declaration.
SgFunctionRefExpSageBuilder::buildFunctionRefExp (SgFunctionSymbol *sym)
 Build SgFunctionRefExp based on a function's symbol.
SgFunctionRefExpSageBuilder::buildFunctionRefExp_nfi (SgFunctionSymbol *sym)
SgMemberFunctionRefExpSageBuilder::buildMemberFunctionRefExp_nfi (SgMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier)
SgMemberFunctionRefExpSageBuilder::buildMemberFunctionRefExp (SgMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier)
SgClassNameRefExpSageBuilder::buildClassNameRefExp_nfi (SgClassSymbol *sym)
SgClassNameRefExpSageBuilder::buildClassNameRefExp (SgClassSymbol *sym)
SgFunctionCallExpSageBuilder::buildFunctionCallExp (SgFunctionSymbol *sym, SgExprListExp *parameters=NULL)
 Build a function call expression.
SgFunctionCallExpSageBuilder::buildFunctionCallExp_nfi (SgExpression *f, SgExprListExp *parameters=NULL)
SgFunctionCallExpSageBuilder::buildFunctionCallExp (SgExpression *f, SgExprListExp *parameters=NULL)
SgFunctionCallExpSageBuilder::buildFunctionCallExp (const SgName &name, SgType *return_type, SgExprListExp *parameters=NULL, SgScopeStatement *scope=NULL)
 Build a function call expression,it will automatically search for function symbols internally to build a right function reference etc. It tolerates the lack of the function symbol to support generating calls to library functions whose headers have not yet been inserted.
SgAssignInitializerSageBuilder::buildAssignInitializer (SgExpression *operand_i=NULL, SgType *expression_type=NULL)
 Build the rhs of a variable declaration which includes an assignment.
SgAssignInitializerSageBuilder::buildAssignInitializer_nfi (SgExpression *operand_i=NULL, SgType *expression_type=NULL)
SgAggregateInitializerSageBuilder::buildAggregateInitializer (SgExprListExp *initializers=NULL, SgType *type=NULL)
 Build an aggregate initializer.
SgAggregateInitializerSageBuilder::buildAggregateInitializer_nfi (SgExprListExp *initializers, SgType *type=NULL)
SgConstructorInitializerSageBuilder::buildConstructorInitializer (SgMemberFunctionDeclaration *declaration, SgExprListExp *args, SgType *expression_type, bool need_name, bool need_qualifier, bool need_parenthesis_after_name, bool associated_class_unknown)
SgConstructorInitializerSageBuilder::buildConstructorInitializer_nfi (SgMemberFunctionDeclaration *declaration, SgExprListExp *args, SgType *expression_type, bool need_name, bool need_qualifier, bool need_parenthesis_after_name, bool associated_class_unknown)
SgSizeOfOpSageBuilder::buildSizeOfOp (SgExpression *exp=NULL)
 Build sizeof() expression with an expression parameter.
SgSizeOfOpSageBuilder::buildSizeOfOp_nfi (SgExpression *exp)
SgSizeOfOpSageBuilder::buildSizeOfOp (SgType *type=NULL)
 Build sizeof() expression with a type parameter.
SgSizeOfOpSageBuilder::buildSizeOfOp_nfi (SgType *type)

Scope stack interfaces

a global data structure to store current scope and parent scopes.

Scope stack is provided as an alternative to manually passing scope parameters to builder functions. It is not required to be used. Please use the recommendeded operation functions for maintaining the scope stack. Don't use raw container access functions to ScopeStack. e.g. avoid ScopeStack.push_back(), using pushScopeStack() instead.

Todo:
consider complex cases:
  • how many scope stacks to keep? one. examine only one transparently
  • regular: push a child scope of current scope, add symbols etc.
  • irregular: push an arbitrary scope temporarily, add some symbol, then pop
  • even push a chain of scopes
  • restore scopes


void SageBuilder::pushScopeStack (SgScopeStatement *stmt)
 Public interfaces of the scope stack, should be stable.
void SageBuilder::pushScopeStack (SgNode *node)
void SageBuilder::popScopeStack ()
SgScopeStatementSageBuilder::topScopeStack ()
bool SageBuilder::emptyScopeStack ()
void SageBuilder::clearScopeStack ()
std::list< SgScopeStatement * > SageBuilder::ScopeStack
 intended to be a private member, don't access it directly. could be changed any time

Builders for SgType

Builders for simple and complex SgType nodes, such as integer type, function type, array type, struct type, etc.

Todo:
SgModifierType,SgNamedType(SgClassType,SgEnumType,SgTypedefType), SgQualifiedNameType, SgTemplateType,SgTypeComplex, SgTypeDefault,SgTypeEllipse,SgTypeGlobalVoid,SgTypeImaginary


SgTypeBoolSageBuilder::buildBoolType ()
 Built in simple types.
SgTypeCharSageBuilder::buildCharType ()
SgTypeDoubleSageBuilder::buildDoubleType ()
SgTypeFloatSageBuilder::buildFloatType ()
SgTypeIntSageBuilder::buildIntType ()
SgTypeLongSageBuilder::buildLongType ()
SgTypeLongDoubleSageBuilder::buildLongDoubleType ()
SgTypeLongLongSageBuilder::buildLongLongType ()
SgTypeShortSageBuilder::buildShortType ()
SgTypeStringSageBuilder::buildStringType ()
SgTypeStringSageBuilder::buildStringType (SgExpression *stringLengthExpression, size_t stringLengthLiteral)
SgTypeVoidSageBuilder::buildVoidType ()
SgTypeWcharSageBuilder::buildWcharType ()
SgTypeSignedCharSageBuilder::buildSignedCharType ()
SgTypeSignedIntSageBuilder::buildSignedIntType ()
SgTypeSignedLongSageBuilder::buildSignedLongType ()
SgTypeSignedLongLongSageBuilder::buildSignedLongLongType ()
SgTypeSignedShortSageBuilder::buildSignedShortType ()
SgTypeUnsignedCharSageBuilder::buildUnsignedCharType ()
SgTypeUnsignedIntSageBuilder::buildUnsignedIntType ()
SgTypeUnsignedLongSageBuilder::buildUnsignedLongType ()
SgTypeUnsignedLongLongSageBuilder::buildUnsignedLongLongType ()
SgTypeUnsignedShortSageBuilder::buildUnsignedShortType ()
SgTypeUnknownSageBuilder::buildUnknownType ()
SgPointerTypeSageBuilder::buildPointerType (SgType *base_type=NULL)
 Build a pointer type.
SgReferenceTypeSageBuilder::buildReferenceType (SgType *base_type=NULL)
 Build a reference type.
SgModifierTypeSageBuilder::buildConstType (SgType *base_type=NULL)
 Build a const type.
SgModifierTypeSageBuilder::buildVolatileType (SgType *base_type=NULL)
 Build a volatile type.
SgModifierTypeSageBuilder::buildRestrictType (SgType *base_type)
 Build a restrict type.
SgArrayTypeSageBuilder::buildArrayType (SgType *base_type=NULL, SgExpression *index=NULL)
 Build ArrayType.
SgModifierTypeSageBuilder::buildFortranKindType (SgType *base_type, SgExpression *kindExpression)
 Build a type based on the Fortran kind mechanism.
SgFunctionTypeSageBuilder::buildFunctionType (SgType *return_type, SgFunctionParameterTypeList *typeList=NULL)
 Build function type from return type and parameter type list.
SgFunctionTypeSageBuilder::buildFunctionType (SgType *return_type, SgFunctionParameterList *argList=NULL)
 Build function type from return type and parameter list.
SgMemberFunctionTypeSageBuilder::buildMemberFunctionType (SgType *return_type, SgFunctionParameterTypeList *typeList, SgClassDefinition *struct_name, unsigned int mfunc_specifier)
SgTypeSageBuilder::buildOpaqueType (std::string const type_name, SgScopeStatement *scope)
 Build an opaque type with a name, useful when a type's details are unknown during transformation, especially for a runtime library's internal type. Must provide scope here.
SgModifierTypeSageBuilder::buildUpcStrictType (SgType *base_type=NULL)
 Build a UPC strict type.
SgModifierTypeSageBuilder::buildUpcRelaxedType (SgType *base_type=NULL)
 Build a UPC relaxed type.
SgModifierTypeSageBuilder::buildUpcSharedType (SgType *base_type=NULL, long layout=-1)
 Build a UPC shared type.
SgModifierTypeSageBuilder::buildUpcBlockIndefiniteType (SgType *base_type=NULL)
 Build a UPC shared[] type.
SgModifierTypeSageBuilder::buildUpcBlockStarType (SgType *base_type=NULL)
 Build a UPC shared[*] type.
SgModifierTypeSageBuilder::buildUpcBlockNumberType (SgType *base_type, long block_factor)
 Build a UPC shared[n] type.
SgTypeComplexSageBuilder::buildComplexType (SgType *base_type=NULL)
 Build a complex type.
SgTypeImaginarySageBuilder::buildImaginaryType (SgType *base_type=NULL)
 Build an imaginary type.

Builders for support nodes

AST high level builders for SgSupport nodes

SgInitializedNameSageBuilder::buildInitializedName (const SgName &name, SgType *type, SgInitializer *init=NULL)
 Initialized names are tricky, their scope vary depending on context, so scope and symbol information are not needed until the initialized name is being actually used somewhere.
SgInitializedNameSageBuilder::buildInitializedName (const std::string &name, SgType *type)
SgInitializedNameSageBuilder::buildInitializedName (const char *name, SgType *type)
SgInitializedNameSageBuilder::buildInitializedName_nfi (const SgName &name, SgType *type, SgInitializer *init)
SgFunctionParameterTypeListSageBuilder::buildFunctionParameterTypeList (SgFunctionParameterList *paralist)
 Build SgFunctionParameterTypeList from SgFunctionParameterList.
SgFunctionParameterTypeListSageBuilder::buildFunctionParameterTypeList (SgExprListExp *expList)
 Build SgFunctionParameterTypeList from an expression list, useful when building a function call.
SgFunctionParameterTypeListSageBuilder::buildFunctionParameterTypeList ()
 Build an empty SgFunctionParameterTypeList.

Builders for statements

AST high level builders for SgStatement, explicit scope parameters are allowed for flexibility. Please use SageInterface::appendStatement(), prependStatement(), and insertStatement() to attach the newly built statements into an AST tree. Calling member functions like SgScopeStatement::prepend_statement() or using container functions such as pushback() is discouraged since they don't handle many side effects for symbol tables, source file information, scope and parent pointers etc.

SgVariableDeclarationSageBuilder::buildVariableDeclaration (const SgName &name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL)
 Build a variable declaration, handle symbol table transparently.
SgVariableDeclarationSageBuilder::buildVariableDeclaration (const std::string &name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL)
SgVariableDeclarationSageBuilder::buildVariableDeclaration (const char *name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL)
SgVariableDeclarationSageBuilder::buildVariableDeclaration_nfi (const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope)
SgTypedefDeclarationSageBuilder::buildTypedefDeclaration (const std::string &name, SgType *base_type, SgScopeStatement *scope=NULL)
 Build a typedef declaration, such as: typedef int myint;.
SgTypedefDeclarationSageBuilder::buildTypedefDeclaration_nfi (const std::string &name, SgType *base_type, SgScopeStatement *scope=NULL)
SgFunctionParameterListSageBuilder::buildFunctionParameterList (SgInitializedName *in1=NULL, SgInitializedName *in2=NULL, SgInitializedName *in3=NULL, SgInitializedName *in4=NULL, SgInitializedName *in5=NULL, SgInitializedName *in6=NULL, SgInitializedName *in7=NULL, SgInitializedName *in8=NULL, SgInitializedName *in9=NULL, SgInitializedName *in10=NULL)
 Build an empty SgFunctionParameterList, possibly with some initialized names filled in.
SgFunctionParameterListSageBuilder::buildFunctionParameterList_nfi ()
SgFunctionParameterListSageBuilder::buildFunctionParameterList (SgFunctionParameterTypeList *paraTypeList)
 Build an SgFunctionParameterList from SgFunctionParameterTypeList, like (int, float,...), used for parameter list of prototype functions when function type( including parameter type list) is known.
SgFunctionParameterListSageBuilder::buildFunctionParameterList_nfi (SgFunctionParameterTypeList *paraTypeList)
template<class actualFunction>
actualFunction * SageBuilder::buildNondefiningFunctionDeclaration_T (const SgName &name, SgType *return_type, SgFunctionParameterList *paralist, bool isMemberFunction, SgScopeStatement *scope=NULL)
 A template function for function prototype declaration builders.
SgFunctionDeclarationSageBuilder::buildNondefiningFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
 Build a prototype for a function, handle function type, symbol etc transparently.
SgFunctionDeclarationSageBuilder::buildNondefiningFunctionDeclaration (const SgFunctionDeclaration *funcdecl, SgScopeStatement *scope=NULL)
 Build a prototype for an existing function declaration (defining or nondefining is fine).
SgMemberFunctionDeclarationSageBuilder::buildNondefiningMemberFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
 Build a prototype member function declaration.
SgMemberFunctionDeclarationSageBuilder::buildDefiningMemberFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
 Build a defining ( non-prototype) member function declaration.
SgMemberFunctionDeclarationSageBuilder::buildNondefiningMemberFunctionDeclaration (const SgMemberFunctionDeclaration *funcdecl, SgScopeStatement *scope=NULL)
 Build a prototype for an existing member function declaration (defining or nondefining is fine).
template<class actualFunction>
actualFunction * SageBuilder::buildDefiningFunctionDeclaration_T (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
 A template function for function declaration builders.
SgFunctionDeclarationSageBuilder::buildDefiningFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
 Build a function declaration with a function body.
SgFunctionDeclarationSageBuilder::buildDefiningFunctionDeclaration (const std::string &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
SgFunctionDeclarationSageBuilder::buildDefiningFunctionDeclaration (const char *name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL)
SgProcedureHeaderStatementSageBuilder::buildProcedureHeaderStatement (const char *name, SgType *return_type, SgFunctionParameterList *parlist, SgProcedureHeaderStatement::subprogram_kind_enum, SgScopeStatement *scope=NULL)
 Build a Fortran subroutine or procedure.
SgExprStatementSageBuilder::buildFunctionCallStmt (const SgName &name, SgType *return_type, SgExprListExp *parameters=NULL, SgScopeStatement *scope=NULL)
 Build a regular function call statement.
SgExprStatementSageBuilder::buildFunctionCallStmt (SgExpression *function, SgExprListExp *parameters=NULL)
 Build a function call statement using function expression and argument list only, like (*funcPtr)(args);.
SgLabelStatementSageBuilder::buildLabelStatement (const SgName &name, SgStatement *stmt=NULL, SgScopeStatement *scope=NULL)
 Note that the scope of a label statement is special.
SgLabelStatementSageBuilder::buildLabelStatement_nfi (const SgName &name, SgStatement *stmt, SgScopeStatement *scope)
SgGotoStatementSageBuilder::buildGotoStatement (SgLabelStatement *label=NULL)
 Build a goto statement.
SgGotoStatementSageBuilder::buildGotoStatement_nfi (SgLabelStatement *label)
SgCaseOptionStmtSageBuilder::buildCaseOptionStmt (SgExpression *key=NULL, SgStatement *body=NULL)
 Build a case option statement.
SgCaseOptionStmtSageBuilder::buildCaseOptionStmt_nfi (SgExpression *key, SgStatement *body)
SgDefaultOptionStmtSageBuilder::buildDefaultOptionStmt (SgStatement *body=NULL)
 Build a default option statement.
SgDefaultOptionStmtSageBuilder::buildDefaultOptionStmt_nfi (SgStatement *body)
SgExprStatementSageBuilder::buildExprStatement (SgExpression *exp=NULL)
 Build a SgExprStatement, set File_Info automatically.
SgExprStatementSageBuilder::buildExprStatement_nfi (SgExpression *exp)
SgSwitchStatementSageBuilder::buildSwitchStatement (SgStatement *item_selector=NULL, SgStatement *body=NULL)
 Build a switch statement.
SgSwitchStatementSageBuilder::buildSwitchStatement (SgExpression *item_selector, SgStatement *body=NULL)
SgSwitchStatementSageBuilder::buildSwitchStatement_nfi (SgStatement *item_selector, SgStatement *body)
SgIfStmtSageBuilder::buildIfStmt (SgStatement *conditional, SgStatement *true_body, SgStatement *false_body)
 Build if statement.
SgIfStmtSageBuilder::buildIfStmt (SgExpression *conditional, SgStatement *true_body, SgStatement *false_body)
SgIfStmtSageBuilder::buildIfStmt_nfi (SgStatement *conditional, SgStatement *true_body, SgStatement *false_body)
SgForStatementSageBuilder::buildForStatement (SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgStatement *loop_body)
 Build a for statement, assume none of the arguments is NULL.
SgForStatementSageBuilder::buildForStatement_nfi (SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgStatement *loop_body)
SgUpcForAllStatementSageBuilder::buildUpcForAllStatement_nfi (SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgExpression *affinity, SgStatement *loop_body)
 Build a UPC forall statement.
SgWhileStmtSageBuilder::buildWhileStmt (SgStatement *condition, SgStatement *body)
 Build while statement.
SgWhileStmtSageBuilder::buildWhileStmt (SgExpression *condition, SgStatement *body)
SgWhileStmtSageBuilder::buildWhileStmt_nfi (SgStatement *condition, SgStatement *body)
SgDoWhileStmtSageBuilder::buildDoWhileStmt (SgStatement *body, SgStatement *condition)
 Build do-while statement.
SgDoWhileStmtSageBuilder::buildDoWhileStmt (SgStatement *body, SgExpression *condition)
SgDoWhileStmtSageBuilder::buildDoWhileStmt_nfi (SgStatement *body, SgStatement *condition)
SgPragmaDeclarationSageBuilder::buildPragmaDeclaration (const std::string &name, SgScopeStatement *scope=NULL)
 Build pragma declaration, handle SgPragma and defining/nondefining pointers internally.
SgPragmaDeclarationSageBuilder::buildPragmaDeclaration_nfi (const std::string &name, SgScopeStatement *scope)
SgPragmaSageBuilder::buildPragma (const std::string &name)
 Build SgPragma.
SgBasicBlockSageBuilder::buildBasicBlock (SgStatement *stmt1=NULL, SgStatement *stmt2=NULL, SgStatement *stmt3=NULL, SgStatement *stmt4=NULL, SgStatement *stmt5=NULL, SgStatement *stmt6=NULL, SgStatement *stmt7=NULL, SgStatement *stmt8=NULL, SgStatement *stmt9=NULL, SgStatement *stmt10=NULL)
 Build a SgBasicBlock, setting file info internally.
SgBasicBlockSageBuilder::buildBasicBlock_nfi ()
SgBasicBlockSageBuilder::buildBasicBlock_nfi (const std::vector< SgStatement * > &)
SgExprStatementSageBuilder::buildAssignStatement (SgExpression *lhs, SgExpression *rhs)
 Build an assignment statement from lefthand operand and right hand operand.
SgBreakStmtSageBuilder::buildBreakStmt ()
 Build a break statement.
SgBreakStmtSageBuilder::buildBreakStmt_nfi ()
SgContinueStmtSageBuilder::buildContinueStmt ()
 Build a continue statement.
SgContinueStmtSageBuilder::buildContinueStmt_nfi ()
SgClassDefinitionSageBuilder::buildClassDefinition (SgClassDeclaration *d=NULL)
 Build a class definition scope statement.
SgClassDefinitionSageBuilder::buildClassDefinition_nfi (SgClassDeclaration *d=NULL)
 Build a class definition scope statement.
SgClassDeclarationSageBuilder::buildNondefiningClassDeclaration_nfi (const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope)
 Build a structure first nondefining declaration, without file info.
SgClassDeclarationSageBuilder::buildNondefiningClassDeclaration (SgName name, SgScopeStatement *scope)
SgClassDeclarationSageBuilder::buildDefiningClassDeclaration (SgName name, SgScopeStatement *scope)
SgClassDeclarationSageBuilder::buildClassDeclaration (SgName name, SgScopeStatement *scope)
SgEnumDeclarationSageBuilder::buildNondefiningEnumDeclaration_nfi (const SgName &name, SgScopeStatement *scope)
 Build an enum first nondefining declaration, without file info.
SgClassDeclarationSageBuilder::buildStructDeclaration (const SgName &name, SgScopeStatement *scope=NULL)
 Build a structure, It is also a declaration statement in SAGE III.
SgClassDeclarationSageBuilder::buildStructDeclaration (const std::string &name, SgScopeStatement *scope=NULL)
SgClassDeclarationSageBuilder::buildStructDeclaration (const char *name, SgScopeStatement *scope=NULL)
SgNamespaceDeclarationStatementSageBuilder::buildNamespaceDeclaration (const SgName &name, SgScopeStatement *scope=NULL)
SgNamespaceDeclarationStatementSageBuilder::buildNamespaceDeclaration_nfi (const SgName &name, bool unnamednamespace, SgScopeStatement *scope)
SgNamespaceDefinitionStatementSageBuilder::buildNamespaceDefinition (SgNamespaceDeclarationStatement *d=NULL)
SgClassDeclarationSageBuilder::buildClassDeclaration_nfi (const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgClassDeclaration *nonDefiningDecl)
SgEnumDeclarationSageBuilder::buildEnumDeclaration (const SgName &name, SgScopeStatement *scope=NULL)
 Build an enum, It is also a declaration statement in SAGE III.
SgEnumDeclarationSageBuilder::buildEnumDeclaration_nfi (const SgName &name, SgScopeStatement *scope=NULL)
 Build an enum, It is also a declaration statement in SAGE III.
SgReturnStmtSageBuilder::buildReturnStmt (SgExpression *expression=NULL)
 Build a return statement.
SgReturnStmtSageBuilder::buildReturnStmt_nfi (SgExpression *expression)
SgNullStatementSageBuilder::buildNullStatement ()
 Build a NULL statement.
SgNullStatementSageBuilder::buildNullStatement_nfi ()
SgAsmStmtSageBuilder::buildAsmStatement (std::string s)
 Build a NULL statement.
SgAsmStmtSageBuilder::buildAsmStatement_nfi (std::string s)
SgAsmStmtSageBuilder::buildMultibyteNopStatement (int n)

Builders for others

AST high level builders for others

SgFileSageBuilder::buildFile (const std::string &inputFileName, const std::string &outputFileName, SgProject *project=NULL)
 Build a SgFile node and attach it to SgProject.
PreprocessingInfo * SageBuilder::buildComment (SgLocatedNode *target, const std::string &content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before, PreprocessingInfo::DirectiveType dtype=PreprocessingInfo::CpreprocessorUnknownDeclaration)
 Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment().
PreprocessingInfo * SageBuilder::buildCpreprocessorDefineDeclaration (SgLocatedNode *target, const std::string &content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before)
 Build and attach define XX directives, pass "#define xxx xxx" as content.
AbstractHandle::abstract_handle * SageBuilder::buildAbstractHandle (SgNode *n)
 Build an abstract handle from a SgNode.


Define Documentation

#define BUILD_UNARY_PROTO ( suffix   ) 

Value:

Sg##suffix * build##suffix(SgExpression* op =NULL); \
Sg##suffix * build##suffix##_nfi(SgExpression* op);
Template function to build a unary expression of type T with advanced information specified such as parenthesis and file info. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp().

The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.

#define BUILD_BINARY_PROTO ( suffix   ) 

Value:

Sg##suffix * build##suffix(SgExpression* lhs =NULL, SgExpression* rhs =NULL); \
Sg##suffix * build##suffix##_nfi(SgExpression* lhs, SgExpression* rhs);
Template function to build a binary expression of type T,with extra information for parenthesis and file info, Instantiated functions include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(), buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp().

The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.


Function Documentation

void SageBuilder::pushScopeStack ( SgScopeStatement stmt  ) 

Public interfaces of the scope stack, should be stable.

void SageBuilder::pushScopeStack ( SgNode node  ) 

void SageBuilder::popScopeStack (  ) 

SgScopeStatement* SageBuilder::topScopeStack (  ) 

bool SageBuilder::emptyScopeStack (  ) 

void SageBuilder::clearScopeStack (  ) 

SgTypeBool* SageBuilder::buildBoolType (  ) 

Built in simple types.

SgTypeChar* SageBuilder::buildCharType (  ) 

SgTypeDouble* SageBuilder::buildDoubleType (  ) 

SgTypeFloat* SageBuilder::buildFloatType (  ) 

SgTypeInt* SageBuilder::buildIntType (  ) 

SgTypeLong* SageBuilder::buildLongType (  ) 

SgTypeLongDouble* SageBuilder::buildLongDoubleType (  ) 

SgTypeLongLong* SageBuilder::buildLongLongType (  ) 

SgTypeShort* SageBuilder::buildShortType (  ) 

SgTypeString* SageBuilder::buildStringType (  ) 

SgTypeString* SageBuilder::buildStringType ( SgExpression stringLengthExpression,
size_t  stringLengthLiteral 
)

SgTypeVoid* SageBuilder::buildVoidType (  ) 

SgTypeWchar* SageBuilder::buildWcharType (  ) 

SgTypeSignedChar* SageBuilder::buildSignedCharType (  ) 

SgTypeSignedInt* SageBuilder::buildSignedIntType (  ) 

SgTypeSignedLong* SageBuilder::buildSignedLongType (  ) 

SgTypeSignedLongLong* SageBuilder::buildSignedLongLongType (  ) 

SgTypeSignedShort* SageBuilder::buildSignedShortType (  ) 

SgTypeUnsignedChar* SageBuilder::buildUnsignedCharType (  ) 

SgTypeUnsignedInt* SageBuilder::buildUnsignedIntType (  ) 

SgTypeUnsignedLong* SageBuilder::buildUnsignedLongType (  ) 

SgTypeUnsignedLongLong* SageBuilder::buildUnsignedLongLongType (  ) 

SgTypeUnsignedShort* SageBuilder::buildUnsignedShortType (  ) 

SgTypeUnknown* SageBuilder::buildUnknownType (  ) 

SgPointerType* SageBuilder::buildPointerType ( SgType base_type = NULL  ) 

Build a pointer type.

SgReferenceType* SageBuilder::buildReferenceType ( SgType base_type = NULL  ) 

Build a reference type.

SgModifierType* SageBuilder::buildConstType ( SgType base_type = NULL  ) 

Build a const type.

SgModifierType* SageBuilder::buildVolatileType ( SgType base_type = NULL  ) 

Build a volatile type.

SgModifierType* SageBuilder::buildRestrictType ( SgType base_type  ) 

Build a restrict type.

SgArrayType* SageBuilder::buildArrayType ( SgType base_type = NULL,
SgExpression index = NULL 
)

Build ArrayType.

SgModifierType* SageBuilder::buildFortranKindType ( SgType base_type,
SgExpression kindExpression 
)

Build a type based on the Fortran kind mechanism.

SgFunctionType* SageBuilder::buildFunctionType ( SgType return_type,
SgFunctionParameterTypeList typeList = NULL 
)

Build function type from return type and parameter type list.

SgFunctionType* SageBuilder::buildFunctionType ( SgType return_type,
SgFunctionParameterList argList = NULL 
)

Build function type from return type and parameter list.

SgMemberFunctionType* SageBuilder::buildMemberFunctionType ( SgType return_type,
SgFunctionParameterTypeList typeList,
SgClassDefinition struct_name,
unsigned int  mfunc_specifier 
)

SgType* SageBuilder::buildOpaqueType ( std::string const   type_name,
SgScopeStatement scope 
)

Build an opaque type with a name, useful when a type's details are unknown during transformation, especially for a runtime library's internal type. Must provide scope here.

Some types are not known during translation but nevertheless are needed. For example, some internal types from a runtime library. To work around this problem: this function prepends a hidden typedef declaration into scope 'typedef int OpaqueTypeName;' The translation-generated code is expected to include the runtime library's headers to have the real type declarations.

SgModifierType* SageBuilder::buildUpcStrictType ( SgType base_type = NULL  ) 

Build a UPC strict type.

SgModifierType* SageBuilder::buildUpcRelaxedType ( SgType base_type = NULL  ) 

Build a UPC relaxed type.

SgModifierType* SageBuilder::buildUpcSharedType ( SgType base_type = NULL,
long  layout = -1 
)

Build a UPC shared type.

SgModifierType* SageBuilder::buildUpcBlockIndefiniteType ( SgType base_type = NULL  ) 

Build a UPC shared[] type.

SgModifierType* SageBuilder::buildUpcBlockStarType ( SgType base_type = NULL  ) 

Build a UPC shared[*] type.

SgModifierType* SageBuilder::buildUpcBlockNumberType ( SgType base_type,
long  block_factor 
)

Build a UPC shared[n] type.

SgTypeComplex* SageBuilder::buildComplexType ( SgType base_type = NULL  ) 

Build a complex type.

SgTypeImaginary* SageBuilder::buildImaginaryType ( SgType base_type = NULL  ) 

Build an imaginary type.

SgNullExpression* SageBuilder::buildNullExpression (  ) 

Build a null expression, set file info as the default one.

SgNullExpression* SageBuilder::buildNullExpression_nfi (  ) 

No file info version of buildNullExpression(). File info is to be set later on.

SgBoolValExp* SageBuilder::buildBoolValExp ( int  value = 0  ) 

Build a bool value expression, the name convention of SgBoolValExp is little different from others for some unknown reason.

SgBoolValExp* SageBuilder::buildBoolValExp ( bool  value = 0  ) 

SgBoolValExp* SageBuilder::buildBoolValExp_nfi ( int  value  ) 

SgCharVal* SageBuilder::buildCharVal ( char  value = 0  ) 

SgCharVal* SageBuilder::buildCharVal_nfi ( char  value,
const std::string &  str 
)

SgWcharVal* SageBuilder::buildWcharVal ( wchar_t  value = 0  ) 

SgWcharVal* SageBuilder::buildWcharVal_nfi ( wchar_t  value,
const std::string &  str 
)

SgComplexVal* SageBuilder::buildComplexVal ( long double  real_value = 0.0,
long double  imaginary_value = 0.0 
)

SgComplexVal* SageBuilder::buildComplexVal ( SgValueExp real_value,
SgValueExp imaginary_value 
)

SgComplexVal* SageBuilder::buildComplexVal_nfi ( SgValueExp real_value,
SgValueExp imaginary_value,
const std::string &  str 
)

SgComplexVal* SageBuilder::buildImaginaryVal ( long double  imaginary_value  ) 

SgComplexVal* SageBuilder::buildImaginaryVal ( SgValueExp imaginary_value  ) 

SgComplexVal* SageBuilder::buildImaginaryVal_nfi ( SgValueExp imaginary_value,
const std::string &  str 
)

SgDoubleVal* SageBuilder::buildDoubleVal ( double  value = 0.0  ) 

Build a double value expression.

SgDoubleVal* SageBuilder::buildDoubleVal_nfi ( double  value,
const std::string &  str 
)

SgFloatVal* SageBuilder::buildFloatVal ( float  value = 0.0  ) 

SgFloatVal* SageBuilder::buildFloatVal_nfi ( float  value,
const std::string &  str 
)

SgIntVal* SageBuilder::buildIntVal ( int  value = 0  ) 

Build an integer value expression.

SgIntVal* SageBuilder::buildIntValHex ( int  value = 0  ) 

SgIntVal* SageBuilder::buildIntVal_nfi ( int  value,
const std::string &  str 
)

SgLongIntVal* SageBuilder::buildLongIntVal ( long  value = 0  ) 

Build a long integer value expression.

SgLongIntVal* SageBuilder::buildLongIntValHex ( long  value = 0  ) 

SgLongIntVal* SageBuilder::buildLongIntVal_nfi ( long  value,
const std::string &  str 
)

SgLongLongIntVal* SageBuilder::buildLongLongIntVal ( long long  value = 0  ) 

Build a long long integer value expression.

SgLongLongIntVal* SageBuilder::buildLongLongIntValHex ( long long  value = 0  ) 

SgLongLongIntVal* SageBuilder::buildLongLongIntVal_nfi ( long long  value,
const std::string &  str 
)

SgEnumVal* SageBuilder::buildEnumVal_nfi ( int  value,
SgEnumDeclaration decl,
SgName  name 
)

SgLongDoubleVal* SageBuilder::buildLongDoubleVal ( long double  value = 0.0  ) 

SgLongDoubleVal* SageBuilder::buildLongDoubleVal_nfi ( long double  value,
const std::string &  str 
)

SgShortVal* SageBuilder::buildShortVal ( short  value = 0  ) 

SgShortVal* SageBuilder::buildShortValHex ( short  value = 0  ) 

SgShortVal* SageBuilder::buildShortVal_nfi ( short  value,
const std::string &  str 
)

SgStringVal* SageBuilder::buildStringVal ( std::string  value = ""  ) 

SgStringVal* SageBuilder::buildStringVal_nfi ( std::string  value  ) 

SgUnsignedCharVal* SageBuilder::buildUnsignedCharVal ( unsigned char  v = 0  ) 

Build an unsigned char.

SgUnsignedCharVal* SageBuilder::buildUnsignedCharValHex ( unsigned char  v = 0  ) 

SgUnsignedCharVal* SageBuilder::buildUnsignedCharVal_nfi ( unsigned char  v,
const std::string &  str 
)

SgUnsignedShortVal* SageBuilder::buildUnsignedShortVal ( unsigned short  v = 0  ) 

Build an unsigned short integer.

SgUnsignedShortVal* SageBuilder::buildUnsignedShortValHex ( unsigned short  v = 0  ) 

SgUnsignedShortVal* SageBuilder::buildUnsignedShortVal_nfi ( unsigned short  v,
const std::string &  str 
)

SgUnsignedIntVal* SageBuilder::buildUnsignedIntVal ( unsigned int  v = 0  ) 

Build an unsigned integer.

SgUnsignedIntVal* SageBuilder::buildUnsignedIntValHex ( unsigned int  v = 0  ) 

SgUnsignedIntVal* SageBuilder::buildUnsignedIntVal_nfi ( unsigned int  v,
const std::string &  str 
)

SgUnsignedLongVal* SageBuilder::buildUnsignedLongVal ( unsigned long  v = 0  ) 

Build a unsigned long integer.

SgUnsignedLongVal* SageBuilder::buildUnsignedLongValHex ( unsigned long  v = 0  ) 

SgUnsignedLongVal* SageBuilder::buildUnsignedLongVal_nfi ( unsigned long  v,
const std::string &  str 
)

SgUnsignedLongLongIntVal* SageBuilder::buildUnsignedLongLongIntVal ( unsigned long long  v = 0  ) 

Build an unsigned long long integer.

SgUnsignedLongLongIntVal* SageBuilder::buildUnsignedLongLongIntValHex ( unsigned long long  v = 0  ) 

SgUnsignedLongLongIntVal* SageBuilder::buildUnsignedLongLongIntVal_nfi ( unsigned long long  v,
const std::string &  str 
)

SgUpcThreads* SageBuilder::buildUpcThreads (  ) 

Build UPC THREADS (integer expression).

SgUpcThreads* SageBuilder::buildUpcThreads_nfi (  ) 

SgUpcMythread* SageBuilder::buildUpcMythread (  ) 

Build UPC MYTHREAD (integer expression).

SgUpcMythread* SageBuilder::buildUpcMythread_nfi (  ) 

SgThisExp* SageBuilder::buildThisExp ( SgClassSymbol sym  ) 

Build this pointer.

SgThisExp* SageBuilder::buildThisExp_nfi ( SgClassSymbol sym  ) 

template<class T>
T* SageBuilder::buildUnaryExpression ( SgExpression operand = NULL  ) 

Template function to build a unary expression of type T. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators).

The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.

template<class T>
T* SageBuilder::buildUnaryExpression_nfi ( SgExpression operand  ) 

SgCastExp* SageBuilder::buildCastExp ( SgExpression operand_i = NULL,
SgType expression_type = NULL,
SgCastExp::cast_type_enum  cast_type = SgCastExp::e_C_style_cast 
)

Build a type casting expression.

SgCastExp* SageBuilder::buildCastExp_nfi ( SgExpression operand_i,
SgType expression_type,
SgCastExp::cast_type_enum  cast_type 
)

SgVarArgOp* SageBuilder::buildVarArgOp_nfi ( SgExpression operand_i,
SgType expression_type 
)

Build vararg op expression.

SgMinusMinusOp* SageBuilder::buildMinusMinusOp ( SgExpression operand_i,
SgUnaryOp::Sgop_mode  a_mode 
)

Build -- expression, Sgop_mode is a value of either SgUnaryOp::prefix or SgUnaryOp::postfix.

SgMinusMinusOp* SageBuilder::buildMinusMinusOp_nfi ( SgExpression operand_i,
SgUnaryOp::Sgop_mode  a_mode 
)

SgPlusPlusOp* SageBuilder::buildPlusPlusOp ( SgExpression operand_i,
SgUnaryOp::Sgop_mode  a_mode 
)

Build ++x or x++ , specify prefix or postfix using either SgUnaryOp::prefix or SgUnaryOp::postfix.

SgPlusPlusOp* SageBuilder::buildPlusPlusOp_nfi ( SgExpression operand_i,
SgUnaryOp::Sgop_mode  a_mode 
)

SgNewExp* SageBuilder::buildNewExp ( SgType type,
SgExprListExp exprListExp,
SgConstructorInitializer constInit,
SgExpression expr,
short int  val,
SgFunctionDeclaration funcDecl 
)

template<class T>
T* SageBuilder::buildBinaryExpression ( SgExpression lhs = NULL,
SgExpression rhs = NULL 
)

Template function to build a binary expression of type T, taking care of parent pointers, file info, lvalue, etc. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp().

The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.

template<class T>
T* SageBuilder::buildBinaryExpression_nfi ( SgExpression lhs,
SgExpression rhs 
)

SgConditionalExp* SageBuilder::buildConditionalExp ( SgExpression test = NULL,
SgExpression a = NULL,
SgExpression b = NULL 
)

Build a conditional expression ?:.

SgConditionalExp* SageBuilder::buildConditionalExp_nfi ( SgExpression test,
SgExpression a,
SgExpression b,
SgType t 
)

SgExprListExp* SageBuilder::buildExprListExp ( SgExpression expr1 = NULL,
SgExpression expr2 = NULL,
SgExpression expr3 = NULL,
SgExpression expr4 = NULL,
SgExpression expr5 = NULL,
SgExpression expr6 = NULL,
SgExpression expr7 = NULL,
SgExpression expr8 = NULL,
SgExpression expr9 = NULL,
SgExpression expr10 = NULL 
)

Build a SgExprListExp, used for function call parameter list etc.

SgExprListExp* SageBuilder::buildExprListExp ( const std::vector< SgExpression * > &  exprs  ) 

SgExprListExp* SageBuilder::buildExprListExp_nfi (  ) 

SgExprListExp* SageBuilder::buildExprListExp_nfi ( const std::vector< SgExpression * > &  exprs  ) 

SgVarRefExp* SageBuilder::buildVarRefExp ( const SgName name,
SgScopeStatement scope = NULL 
)

Build SgVarRefExp based on a variable's Sage name. It will lookup symbol table internally starting from scope. A variable name is unique so type can be inferred (double check this).

It is possible to build a reference to a variable with known name before the variable is declaration, especially during bottomup construction of AST. In this case, SgTypeUnknown is used to indicate the variable reference needing postprocessing fix using fixVariableReferences() once the AST is complete and all variable declarations exist. But the side effect is some get_type() operation may not recognize the unknown type before the fix. So far, I extended SgPointerDerefExp::get_type() and SgPntrArrRefExp::get_type() for SgTypeUnknown. There may be others needing the same extension.

SgVarRefExp* SageBuilder::buildVarRefExp ( const std::string &  varName,
SgScopeStatement scope = NULL 
)

Build SgVarRefExp based on a variable's name. It will lookup symbol table internally starting from scope. A variable is unique so type can be inferred.

SgVarRefExp* SageBuilder::buildVarRefExp ( const char *  varName,
SgScopeStatement scope = NULL 
)

Build a variable reference using a C style char array.

SgVarRefExp* SageBuilder::buildVarRefExp ( SgVariableSymbol varSymbol  ) 

Build a variable reference from an existing symbol.

SgVarRefExp* SageBuilder::buildVarRefExp_nfi ( SgVariableSymbol varSymbol  ) 

SgVarRefExp* SageBuilder::buildVarRefExp ( SgVariableDeclaration vardecl  ) 

Build a variable reference from an existing variable declaration. The assumption is a SgVariableDeclartion only declares one variable in the ROSE AST.

SgVarRefExp* SageBuilder::buildVarRefExp ( SgInitializedName initname,
SgScopeStatement scope = NULL 
)

build a variable reference from an initialized name It first tries to grab the associated symbol, then call buildVarRefExp(const SgName& name, SgScopeStatement*) if symbol does not exist.

SgVarRefExp* SageBuilder::buildOpaqueVarRefExp ( const std::string &  varName,
SgScopeStatement scope = NULL 
)

Build a variable reference expression at scope to an opaque variable which has unknown information except for its name. Used when referring to an internal variable defined in some headers of runtime libraries.(The headers are not yet inserted into the file during translation). Similar to buildOpaqueType();.

It will declare a hidden int varName at the specified scope to cheat the AST consistence tests.

SgFunctionRefExp* SageBuilder::buildFunctionRefExp ( const SgName name,
const SgType func_type,
SgScopeStatement scope = NULL 
)

Build SgFunctionRefExp based on a C++ function's name and function type. It will lookup symbol table internally starting from scope. A hidden prototype will be created internally to introduce a new function symbol if the function symbol cannot be found.

SgFunctionRefExp* SageBuilder::buildFunctionRefExp ( const char *  name,
const SgType func_type,
SgScopeStatement scope = NULL 
)

SgFunctionRefExp* SageBuilder::buildFunctionRefExp ( const SgName name,
SgScopeStatement scope = NULL 
)

Build SgFunctionRefExp based on a C function's name. It will lookup symbol table internally starting from scope and return the first matching function.

SgFunctionRefExp* SageBuilder::buildFunctionRefExp ( const char *  name,
SgScopeStatement scope = NULL 
)

SgFunctionRefExp* SageBuilder::buildFunctionRefExp ( const SgFunctionDeclaration func_decl  ) 

Build SgFunctionRefExp based on a function's declaration.

SgFunctionRefExp* SageBuilder::buildFunctionRefExp ( SgFunctionSymbol sym  ) 

Build SgFunctionRefExp based on a function's symbol.

SgFunctionRefExp* SageBuilder::buildFunctionRefExp_nfi ( SgFunctionSymbol sym  ) 

SgMemberFunctionRefExp* SageBuilder::buildMemberFunctionRefExp_nfi ( SgMemberFunctionSymbol sym,
bool  virtual_call,
bool  need_qualifier 
)

SgMemberFunctionRefExp* SageBuilder::buildMemberFunctionRefExp ( SgMemberFunctionSymbol sym,
bool  virtual_call,
bool  need_qualifier 
)

SgClassNameRefExp* SageBuilder::buildClassNameRefExp_nfi ( SgClassSymbol sym  ) 

SgClassNameRefExp* SageBuilder::buildClassNameRefExp ( SgClassSymbol sym  ) 

SgFunctionCallExp* SageBuilder::buildFunctionCallExp ( SgFunctionSymbol sym,
SgExprListExp parameters = NULL 
)

Build a function call expression.

SgFunctionCallExp* SageBuilder::buildFunctionCallExp_nfi ( SgExpression f,
SgExprListExp parameters = NULL 
)

SgFunctionCallExp* SageBuilder::buildFunctionCallExp ( SgExpression f,
SgExprListExp parameters = NULL 
)

SgFunctionCallExp* SageBuilder::buildFunctionCallExp ( const SgName name,
SgType return_type,
SgExprListExp parameters = NULL,
SgScopeStatement scope = NULL 
)

Build a function call expression,it will automatically search for function symbols internally to build a right function reference etc. It tolerates the lack of the function symbol to support generating calls to library functions whose headers have not yet been inserted.

SgAssignInitializer* SageBuilder::buildAssignInitializer ( SgExpression operand_i = NULL,
SgType expression_type = NULL 
)

Build the rhs of a variable declaration which includes an assignment.

SgAssignInitializer* SageBuilder::buildAssignInitializer_nfi ( SgExpression operand_i = NULL,
SgType expression_type = NULL 
)

SgAggregateInitializer* SageBuilder::buildAggregateInitializer ( SgExprListExp initializers = NULL,
SgType type = NULL 
)

Build an aggregate initializer.

SgAggregateInitializer* SageBuilder::buildAggregateInitializer_nfi ( SgExprListExp initializers,
SgType type = NULL 
)

SgConstructorInitializer* SageBuilder::buildConstructorInitializer ( SgMemberFunctionDeclaration declaration,
SgExprListExp args,
SgType expression_type,
bool  need_name,
bool  need_qualifier,
bool  need_parenthesis_after_name,
bool  associated_class_unknown 
)

SgConstructorInitializer* SageBuilder::buildConstructorInitializer_nfi ( SgMemberFunctionDeclaration declaration,
SgExprListExp args,
SgType expression_type,
bool  need_name,
bool  need_qualifier,
bool  need_parenthesis_after_name,
bool  associated_class_unknown 
)

SgSizeOfOp* SageBuilder::buildSizeOfOp ( SgExpression exp = NULL  ) 

Build sizeof() expression with an expression parameter.

SgSizeOfOp* SageBuilder::buildSizeOfOp_nfi ( SgExpression exp  ) 

SgSizeOfOp* SageBuilder::buildSizeOfOp ( SgType type = NULL  ) 

Build sizeof() expression with a type parameter.

SgSizeOfOp* SageBuilder::buildSizeOfOp_nfi ( SgType type  ) 

SgInitializedName* SageBuilder::buildInitializedName ( const SgName name,
SgType type,
SgInitializer init = NULL 
)

Initialized names are tricky, their scope vary depending on context, so scope and symbol information are not needed until the initialized name is being actually used somewhere.

e.g the scope of arguments of functions are different for defining and nondefining functions.

SgInitializedName* SageBuilder::buildInitializedName ( const std::string &  name,
SgType type 
)

SgInitializedName* SageBuilder::buildInitializedName ( const char *  name,
SgType type 
)

SgInitializedName* SageBuilder::buildInitializedName_nfi ( const SgName name,
SgType type,
SgInitializer init 
)

SgFunctionParameterTypeList* SageBuilder::buildFunctionParameterTypeList ( SgFunctionParameterList paralist  ) 

Build SgFunctionParameterTypeList from SgFunctionParameterList.

SgFunctionParameterTypeList* SageBuilder::buildFunctionParameterTypeList ( SgExprListExp expList  ) 

Build SgFunctionParameterTypeList from an expression list, useful when building a function call.

SgFunctionParameterTypeList* SageBuilder::buildFunctionParameterTypeList (  ) 

Build an empty SgFunctionParameterTypeList.

SgVariableDeclaration* SageBuilder::buildVariableDeclaration ( const SgName name,
SgType type,
SgInitializer varInit = NULL,
SgScopeStatement scope = NULL 
)

Build a variable declaration, handle symbol table transparently.

SgVariableDeclaration* SageBuilder::buildVariableDeclaration ( const std::string &  name,
SgType type,
SgInitializer varInit = NULL,
SgScopeStatement scope = NULL 
)

SgVariableDeclaration* SageBuilder::buildVariableDeclaration ( const char *  name,
SgType type,
SgInitializer varInit = NULL,
SgScopeStatement scope = NULL 
)

SgVariableDeclaration* SageBuilder::buildVariableDeclaration_nfi ( const SgName name,
SgType type,
SgInitializer varInit,
SgScopeStatement scope 
)

SgTypedefDeclaration* SageBuilder::buildTypedefDeclaration ( const std::string &  name,
SgType base_type,
SgScopeStatement scope = NULL 
)

Build a typedef declaration, such as: typedef int myint;.

SgTypedefDeclaration* SageBuilder::buildTypedefDeclaration_nfi ( const std::string &  name,
SgType base_type,
SgScopeStatement scope = NULL 
)

SgFunctionParameterList* SageBuilder::buildFunctionParameterList ( SgInitializedName in1 = NULL,
SgInitializedName in2 = NULL,
SgInitializedName in3 = NULL,
SgInitializedName in4 = NULL,
SgInitializedName in5 = NULL,
SgInitializedName in6 = NULL,
SgInitializedName in7 = NULL,
SgInitializedName in8 = NULL,
SgInitializedName in9 = NULL,
SgInitializedName in10 = NULL 
)

Build an empty SgFunctionParameterList, possibly with some initialized names filled in.

SgFunctionParameterList* SageBuilder::buildFunctionParameterList_nfi (  ) 

SgFunctionParameterList* SageBuilder::buildFunctionParameterList ( SgFunctionParameterTypeList paraTypeList  ) 

Build an SgFunctionParameterList from SgFunctionParameterTypeList, like (int, float,...), used for parameter list of prototype functions when function type( including parameter type list) is known.

SgFunctionParameterList* SageBuilder::buildFunctionParameterList_nfi ( SgFunctionParameterTypeList paraTypeList  ) 

template<class actualFunction>
actualFunction* SageBuilder::buildNondefiningFunctionDeclaration_T ( const SgName name,
SgType return_type,
SgFunctionParameterList paralist,
bool  isMemberFunction,
SgScopeStatement scope = NULL 
)

A template function for function prototype declaration builders.

SgFunctionDeclaration* SageBuilder::buildNondefiningFunctionDeclaration ( const SgName name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

Build a prototype for a function, handle function type, symbol etc transparently.

SgFunctionDeclaration* SageBuilder::buildNondefiningFunctionDeclaration ( const SgFunctionDeclaration funcdecl,
SgScopeStatement scope = NULL 
)

Build a prototype for an existing function declaration (defining or nondefining is fine).

SgMemberFunctionDeclaration* SageBuilder::buildNondefiningMemberFunctionDeclaration ( const SgName name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

Build a prototype member function declaration.

SgMemberFunctionDeclaration* SageBuilder::buildDefiningMemberFunctionDeclaration ( const SgName name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

Build a defining ( non-prototype) member function declaration.

SgMemberFunctionDeclaration* SageBuilder::buildNondefiningMemberFunctionDeclaration ( const SgMemberFunctionDeclaration funcdecl,
SgScopeStatement scope = NULL 
)

Build a prototype for an existing member function declaration (defining or nondefining is fine).

template<class actualFunction>
actualFunction* SageBuilder::buildDefiningFunctionDeclaration_T ( const SgName name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

A template function for function declaration builders.

SgFunctionDeclaration* SageBuilder::buildDefiningFunctionDeclaration ( const SgName name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

Build a function declaration with a function body.

SgFunctionDeclaration* SageBuilder::buildDefiningFunctionDeclaration ( const std::string &  name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

SgFunctionDeclaration* SageBuilder::buildDefiningFunctionDeclaration ( const char *  name,
SgType return_type,
SgFunctionParameterList parlist,
SgScopeStatement scope = NULL 
)

SgProcedureHeaderStatement* SageBuilder::buildProcedureHeaderStatement ( const char *  name,
SgType return_type,
SgFunctionParameterList parlist,
SgProcedureHeaderStatement::subprogram_kind_enum  ,
SgScopeStatement scope = NULL 
)

Build a Fortran subroutine or procedure.

SgExprStatement* SageBuilder::buildFunctionCallStmt ( const SgName name,
SgType return_type,
SgExprListExp parameters = NULL,
SgScopeStatement scope = NULL 
)

Build a regular function call statement.

SgExprStatement* SageBuilder::buildFunctionCallStmt ( SgExpression function,
SgExprListExp parameters = NULL 
)

Build a function call statement using function expression and argument list only, like (*funcPtr)(args);.

SgLabelStatement* SageBuilder::buildLabelStatement ( const SgName name,
SgStatement stmt = NULL,
SgScopeStatement scope = NULL 
)

Note that the scope of a label statement is special.

It is SgFunctionDefinition, not the closest scope statement such as SgBasicBlock.

SgLabelStatement* SageBuilder::buildLabelStatement_nfi ( const SgName name,
SgStatement stmt,
SgScopeStatement scope 
)

SgGotoStatement* SageBuilder::buildGotoStatement ( SgLabelStatement label = NULL  ) 

Build a goto statement.

SgGotoStatement* SageBuilder::buildGotoStatement_nfi ( SgLabelStatement label  ) 

SgCaseOptionStmt* SageBuilder::buildCaseOptionStmt ( SgExpression key = NULL,
SgStatement body = NULL 
)

Build a case option statement.

SgCaseOptionStmt* SageBuilder::buildCaseOptionStmt_nfi ( SgExpression key,
SgStatement body 
)

SgDefaultOptionStmt* SageBuilder::buildDefaultOptionStmt ( SgStatement body = NULL  ) 

Build a default option statement.

SgDefaultOptionStmt* SageBuilder::buildDefaultOptionStmt_nfi ( SgStatement body  ) 

SgExprStatement* SageBuilder::buildExprStatement ( SgExpression exp = NULL  ) 

Build a SgExprStatement, set File_Info automatically.

SgExprStatement* SageBuilder::buildExprStatement_nfi ( SgExpression exp  ) 

SgSwitchStatement* SageBuilder::buildSwitchStatement ( SgStatement item_selector = NULL,
SgStatement body = NULL 
)

Build a switch statement.

SgSwitchStatement* SageBuilder::buildSwitchStatement ( SgExpression item_selector,
SgStatement body = NULL 
) [inline]

SgSwitchStatement* SageBuilder::buildSwitchStatement_nfi ( SgStatement item_selector,
SgStatement body 
)

SgIfStmt* SageBuilder::buildIfStmt ( SgStatement conditional,
SgStatement true_body,
SgStatement false_body 
)

Build if statement.

SgIfStmt* SageBuilder::buildIfStmt ( SgExpression conditional,
SgStatement true_body,
SgStatement false_body 
) [inline]

SgIfStmt* SageBuilder::buildIfStmt_nfi ( SgStatement conditional,
SgStatement true_body,
SgStatement false_body 
)

SgForStatement* SageBuilder::buildForStatement ( SgStatement initialize_stmt,
SgStatement test,
SgExpression increment,
SgStatement loop_body 
)

Build a for statement, assume none of the arguments is NULL.

SgForStatement* SageBuilder::buildForStatement_nfi ( SgStatement initialize_stmt,
SgStatement test,
SgExpression increment,
SgStatement loop_body 
)

SgUpcForAllStatement* SageBuilder::buildUpcForAllStatement_nfi ( SgStatement initialize_stmt,
SgStatement test,
SgExpression increment,
SgExpression affinity,
SgStatement loop_body 
)

Build a UPC forall statement.

SgWhileStmt* SageBuilder::buildWhileStmt ( SgStatement condition,
SgStatement body 
)

Build while statement.

SgWhileStmt* SageBuilder::buildWhileStmt ( SgExpression condition,
SgStatement body 
) [inline]

SgWhileStmt* SageBuilder::buildWhileStmt_nfi ( SgStatement condition,
SgStatement body 
)

SgDoWhileStmt* SageBuilder::buildDoWhileStmt ( SgStatement body,
SgStatement condition 
)

Build do-while statement.

SgDoWhileStmt* SageBuilder::buildDoWhileStmt ( SgStatement body,
SgExpression condition 
) [inline]

SgDoWhileStmt* SageBuilder::buildDoWhileStmt_nfi ( SgStatement body,
SgStatement condition 
)

SgPragmaDeclaration* SageBuilder::buildPragmaDeclaration ( const std::string &  name,
SgScopeStatement scope = NULL 
)

Build pragma declaration, handle SgPragma and defining/nondefining pointers internally.

SgPragmaDeclaration* SageBuilder::buildPragmaDeclaration_nfi ( const std::string &  name,
SgScopeStatement scope 
)

SgPragma* SageBuilder::buildPragma ( const std::string &  name  ) 

Build SgPragma.

SgBasicBlock* SageBuilder::buildBasicBlock ( SgStatement stmt1 = NULL,
SgStatement stmt2 = NULL,
SgStatement stmt3 = NULL,
SgStatement stmt4 = NULL,
SgStatement stmt5 = NULL,
SgStatement stmt6 = NULL,
SgStatement stmt7 = NULL,
SgStatement stmt8 = NULL,
SgStatement stmt9 = NULL,
SgStatement stmt10 = NULL 
)

Build a SgBasicBlock, setting file info internally.

SgBasicBlock* SageBuilder::buildBasicBlock_nfi (  ) 

SgBasicBlock* SageBuilder::buildBasicBlock_nfi ( const std::vector< SgStatement * > &   ) 

SgExprStatement* SageBuilder::buildAssignStatement ( SgExpression lhs,
SgExpression rhs 
)

Build an assignment statement from lefthand operand and right hand operand.

SgBreakStmt* SageBuilder::buildBreakStmt (  ) 

Build a break statement.

SgBreakStmt* SageBuilder::buildBreakStmt_nfi (  ) 

SgContinueStmt* SageBuilder::buildContinueStmt (  ) 

Build a continue statement.

SgContinueStmt* SageBuilder::buildContinueStmt_nfi (  ) 

SgClassDefinition* SageBuilder::buildClassDefinition ( SgClassDeclaration d = NULL  ) 

Build a class definition scope statement.

SgClassDefinition* SageBuilder::buildClassDefinition_nfi ( SgClassDeclaration d = NULL  ) 

Build a class definition scope statement.

SgClassDeclaration* SageBuilder::buildNondefiningClassDeclaration_nfi ( const SgName name,
SgClassDeclaration::class_types  kind,
SgScopeStatement scope 
)

Build a structure first nondefining declaration, without file info.

SgClassDeclaration* SageBuilder::buildNondefiningClassDeclaration ( SgName  name,
SgScopeStatement scope 
)

SgClassDeclaration* SageBuilder::buildDefiningClassDeclaration ( SgName  name,
SgScopeStatement scope 
)

SgClassDeclaration* SageBuilder::buildClassDeclaration ( SgName  name,
SgScopeStatement scope 
)

SgEnumDeclaration* SageBuilder::buildNondefiningEnumDeclaration_nfi ( const SgName name,
SgScopeStatement scope 
)

Build an enum first nondefining declaration, without file info.

SgClassDeclaration* SageBuilder::buildStructDeclaration ( const SgName name,
SgScopeStatement scope = NULL 
)

Build a structure, It is also a declaration statement in SAGE III.

SgClassDeclaration* SageBuilder::buildStructDeclaration ( const std::string &  name,
SgScopeStatement scope = NULL 
)

SgClassDeclaration* SageBuilder::buildStructDeclaration ( const char *  name,
SgScopeStatement scope = NULL 
)

SgNamespaceDeclarationStatement* SageBuilder::buildNamespaceDeclaration ( const SgName name,
SgScopeStatement scope = NULL 
)

SgNamespaceDeclarationStatement* SageBuilder::buildNamespaceDeclaration_nfi ( const SgName name,
bool  unnamednamespace,
SgScopeStatement scope 
)

SgNamespaceDefinitionStatement* SageBuilder::buildNamespaceDefinition ( SgNamespaceDeclarationStatement d = NULL  ) 

SgClassDeclaration* SageBuilder::buildClassDeclaration_nfi ( const SgName name,
SgClassDeclaration::class_types  kind,
SgScopeStatement scope,
SgClassDeclaration nonDefiningDecl 
)

SgEnumDeclaration* SageBuilder::buildEnumDeclaration ( const SgName name,
SgScopeStatement scope = NULL 
)

Build an enum, It is also a declaration statement in SAGE III.

SgEnumDeclaration* SageBuilder::buildEnumDeclaration_nfi ( const SgName name,
SgScopeStatement scope = NULL 
)

Build an enum, It is also a declaration statement in SAGE III.

SgReturnStmt* SageBuilder::buildReturnStmt ( SgExpression expression = NULL  ) 

Build a return statement.

SgReturnStmt* SageBuilder::buildReturnStmt_nfi ( SgExpression expression  ) 

SgNullStatement* SageBuilder::buildNullStatement (  ) 

Build a NULL statement.

SgNullStatement* SageBuilder::buildNullStatement_nfi (  ) 

SgAsmStmt* SageBuilder::buildAsmStatement ( std::string  s  ) 

Build a NULL statement.

SgAsmStmt* SageBuilder::buildAsmStatement_nfi ( std::string  s  ) 

SgAsmStmt* SageBuilder::buildMultibyteNopStatement ( int  n  ) 

SgFile* SageBuilder::buildFile ( const std::string &  inputFileName,
const std::string &  outputFileName,
SgProject project = NULL 
)

Build a SgFile node and attach it to SgProject.

The input file will be loaded if exists, or an empty one will be generated from scratch transparently. Output file name is used to specify the output file name of unparsing. The final SgFile will be inserted to project automatically. If not provided, a new SgProject will be generated internally. Using SgFile->get_project() to retrieve it in this case.

PreprocessingInfo* SageBuilder::buildComment ( SgLocatedNode target,
const std::string &  content,
PreprocessingInfo::RelativePositionType  position = PreprocessingInfo::before,
PreprocessingInfo::DirectiveType  dtype = PreprocessingInfo::CpreprocessorUnknownDeclaration 
)

Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment().

PreprocessingInfo* SageBuilder::buildCpreprocessorDefineDeclaration ( SgLocatedNode target,
const std::string &  content,
PreprocessingInfo::RelativePositionType  position = PreprocessingInfo::before 
)

Build and attach define XX directives, pass "#define xxx xxx" as content.

AbstractHandle::abstract_handle* SageBuilder::buildAbstractHandle ( SgNode n  ) 

Build an abstract handle from a SgNode.


Variable Documentation

std::list<SgScopeStatement*> SageBuilder::ScopeStack

intended to be a private member, don't access it directly. could be changed any time


Generated on Mon Aug 30 21:33:18 2010 for ROSE by  doxygen 1.4.7