00001 #ifndef ROSE_SAGE_BUILDER_INTERFACE
00002 #define ROSE_SAGE_BUILDER_INTERFACE
00003
00004
00005 #include <string>
00006
00020 namespace SageBuilder{
00021
00022 #if 0
00023
00024 SgExpression* buildConst(SgType* t, const string & val);
00025 SgExpression* buildConstInt(int val);
00026
00027
00028
00029
00030 SgClassDeclaration* buildClassDeclaration(...,class_type);
00031
00032 SgClassDeclaration* buildStruct(...);
00033 SgClassDeclaration* buildClass(...);
00034 SgClassDeclaration* buildUnion(...);
00035
00036
00037 SgTemplateInstantiationMemberFunctionDecl* buildForwardFunctionDeclaration
00038 (SgTemplateInstantiationMemberFunctionDecl * memberFunctionInstantiation);
00039
00040
00041
00042
00043 #endif
00044
00045
00047
00062 extern std::list<SgScopeStatement*> ScopeStack;
00063
00064
00066 extern bool symbol_table_case_insensitive_semantics;
00067
00069 void pushScopeStack (SgScopeStatement* stmt);
00070 void pushScopeStack (SgNode* node);
00071 void popScopeStack();
00072 SgScopeStatement* topScopeStack() ;
00073 bool emptyScopeStack();
00074 void clearScopeStack();
00075
00077
00078
00080
00086
00087 SgTypeBool * buildBoolType();
00088 SgTypeChar * buildCharType();
00089 SgTypeDouble* buildDoubleType();
00090 SgTypeFloat* buildFloatType();
00091 SgTypeInt * buildIntType();
00092 SgTypeLong* buildLongType();
00093 SgTypeLongDouble* buildLongDoubleType();
00094 SgTypeLongLong * buildLongLongType();
00095 SgTypeShort* buildShortType();
00096
00097
00098 SgTypeString* buildStringType();
00099
00100 SgTypeString* buildStringType( SgExpression* stringLengthExpression );
00101
00102 SgTypeVoid * buildVoidType();
00103 SgTypeWchar* buildWcharType();
00104
00105 SgTypeSignedChar* buildSignedCharType();
00106 SgTypeSignedInt* buildSignedIntType();
00107 SgTypeSignedLong* buildSignedLongType();
00108 SgTypeSignedLongLong* buildSignedLongLongType();
00109 SgTypeSignedShort* buildSignedShortType();
00110
00111 SgTypeUnsignedChar* buildUnsignedCharType();
00112 SgTypeUnsignedInt* buildUnsignedIntType();
00113 SgTypeUnsignedLong* buildUnsignedLongType();
00114 SgTypeUnsignedLongLong* buildUnsignedLongLongType();
00115 SgTypeUnsignedShort* buildUnsignedShortType();
00116 SgTypeUnknown * buildUnknownType();
00117
00119 SgPointerType* buildPointerType(SgType *base_type = NULL);
00120
00122 SgReferenceType* buildReferenceType(SgType *base_type = NULL);
00123
00124
00125
00126
00127
00129 SgModifierType* buildModifierType(SgType* base_type = NULL);
00130
00132 SgModifierType* buildConstType(SgType* base_type = NULL);
00133
00135 SgModifierType* buildVolatileType(SgType* base_type = NULL);
00136
00138 SgModifierType* buildRestrictType(SgType* base_type);
00139
00141 SgArrayType* buildArrayType(SgType* base_type=NULL, SgExpression* index=NULL);
00142
00143
00145 SgModifierType* buildFortranKindType(SgType* base_type, SgExpression* kindExpression );
00146
00148 SgFunctionType *
00149 buildFunctionType(SgType* return_type, SgFunctionParameterTypeList * typeList=NULL);
00150
00152 SgFunctionType *
00153 buildFunctionType(SgType* return_type, SgFunctionParameterList * argList=NULL);
00154
00155
00156 SgMemberFunctionType *
00157 buildMemberFunctionType(SgType* return_type, SgFunctionParameterTypeList * typeList, SgClassDefinition *struct_name, unsigned int mfunc_specifier);
00158
00160
00166 SgType* buildOpaqueType(std::string const type_name, SgScopeStatement * scope);
00167
00168
00170 SgModifierType* buildUpcStrictType(SgType *base_type = NULL);
00171
00173 SgModifierType* buildUpcRelaxedType(SgType *base_type = NULL);
00174
00176
00177 SgModifierType* buildUpcSharedType(SgType *base_type = NULL, long layout = -1);
00178
00180 SgModifierType* buildUpcBlockIndefiniteType(SgType *base_type = NULL);
00181
00183 SgModifierType* buildUpcBlockStarType(SgType *base_type = NULL);
00184
00186 SgModifierType* buildUpcBlockNumberType(SgType *base_type, long block_factor);
00187
00189 SgTypeComplex* buildComplexType(SgType *base_type = NULL);
00190
00192 SgTypeImaginary* buildImaginaryType(SgType *base_type = NULL);
00193
00195 SgConstVolatileModifier * buildConstVolatileModifier (SgConstVolatileModifier::cv_modifier_enum mtype=SgConstVolatileModifier::e_unknown);
00197
00198
00200
00212
00213
00214 SgVariantExpression * buildVariantExpression();
00215
00217 SgNullExpression* buildNullExpression();
00219 SgNullExpression* buildNullExpression_nfi();
00220
00222 SgBoolValExp* buildBoolValExp(int value = 0);
00223 SgBoolValExp* buildBoolValExp(bool value = 0);
00224 SgBoolValExp* buildBoolValExp_nfi(int value);
00225
00226 SgCharVal* buildCharVal(char value = 0);
00227 SgCharVal* buildCharVal_nfi(char value, const std::string& str);
00228
00229 SgWcharVal* buildWcharVal(wchar_t value = 0);
00230 SgWcharVal* buildWcharVal_nfi(wchar_t value, const std::string& str);
00231
00232 SgComplexVal* buildComplexVal(long double real_value = 0.0, long double imaginary_value = 0.0 );
00233 SgComplexVal* buildComplexVal(SgValueExp* real_value, SgValueExp* imaginary_value);
00234 SgComplexVal* buildComplexVal_nfi(SgValueExp* real_value, SgValueExp* imaginary_value, const std::string& str);
00235 SgComplexVal* buildImaginaryVal(long double imaginary_value);
00236 SgComplexVal* buildImaginaryVal(SgValueExp* imaginary_value);
00237 SgComplexVal* buildImaginaryVal_nfi(SgValueExp* imaginary_value, const std::string& str);
00238
00240 SgDoubleVal* buildDoubleVal(double value = 0.0);
00241 SgDoubleVal* buildDoubleVal_nfi(double value, const std::string& str);
00242
00243 SgFloatVal* buildFloatVal(float value = 0.0);
00244 SgFloatVal* buildFloatVal_nfi(float value, const std::string& str);
00245
00247 SgIntVal* buildIntVal(int value = 0);
00248 SgIntVal* buildIntValHex(int value = 0);
00249 SgIntVal* buildIntVal_nfi(int value, const std::string& str);
00250
00252 SgLongIntVal* buildLongIntVal(long value = 0);
00253 SgLongIntVal* buildLongIntValHex(long value = 0);
00254 SgLongIntVal* buildLongIntVal_nfi(long value, const std::string& str);
00255
00257 SgLongLongIntVal* buildLongLongIntVal(long long value = 0);
00258 SgLongLongIntVal* buildLongLongIntValHex(long long value = 0);
00259 SgLongLongIntVal* buildLongLongIntVal_nfi(long long value, const std::string& str);
00260
00261 SgEnumVal* buildEnumVal_nfi(int value, SgEnumDeclaration* decl, SgName name);
00262
00263 SgLongDoubleVal* buildLongDoubleVal(long double value = 0.0);
00264 SgLongDoubleVal* buildLongDoubleVal_nfi(long double value, const std::string& str);
00265
00266 SgShortVal* buildShortVal(short value = 0);
00267 SgShortVal* buildShortValHex(short value = 0);
00268 SgShortVal* buildShortVal_nfi(short value, const std::string& str);
00269
00270 SgStringVal* buildStringVal(std::string value="");
00271 SgStringVal* buildStringVal_nfi(std::string value);
00272
00274 SgUnsignedCharVal* buildUnsignedCharVal(unsigned char v = 0);
00275 SgUnsignedCharVal* buildUnsignedCharValHex(unsigned char v = 0);
00276 SgUnsignedCharVal* buildUnsignedCharVal_nfi(unsigned char v, const std::string& str);
00277
00279 SgUnsignedShortVal* buildUnsignedShortVal(unsigned short v = 0);
00280 SgUnsignedShortVal* buildUnsignedShortValHex(unsigned short v = 0);
00281 SgUnsignedShortVal* buildUnsignedShortVal_nfi(unsigned short v, const std::string& str);
00282
00284 SgUnsignedIntVal* buildUnsignedIntVal(unsigned int v = 0);
00285 SgUnsignedIntVal* buildUnsignedIntValHex(unsigned int v = 0);
00286 SgUnsignedIntVal* buildUnsignedIntVal_nfi(unsigned int v, const std::string& str);
00287
00289 SgUnsignedLongVal* buildUnsignedLongVal(unsigned long v = 0);
00290 SgUnsignedLongVal* buildUnsignedLongValHex(unsigned long v = 0);
00291 SgUnsignedLongVal* buildUnsignedLongVal_nfi(unsigned long v, const std::string& str);
00292
00294 SgUnsignedLongLongIntVal* buildUnsignedLongLongIntVal(unsigned long long v = 0);
00295 SgUnsignedLongLongIntVal* buildUnsignedLongLongIntValHex(unsigned long long v = 0);
00296 SgUnsignedLongLongIntVal* buildUnsignedLongLongIntVal_nfi(unsigned long long v, const std::string& str);
00297
00299 SgUpcThreads* buildUpcThreads();
00300 SgUpcThreads* buildUpcThreads_nfi();
00301
00303 SgUpcMythread* buildUpcMythread();
00304 SgUpcMythread* buildUpcMythread_nfi();
00305
00307 SgThisExp* buildThisExp(SgClassSymbol* sym);
00308 SgThisExp* buildThisExp_nfi(SgClassSymbol* sym);
00309
00311 SgSuperExp* buildSuperExp(SgClassSymbol* sym);
00312 SgSuperExp* buildSuperExp_nfi(SgClassSymbol* sym);
00313
00315 SgLambdaRefExp* buildLambdaRefExp(SgType* return_type, SgFunctionParameterList* params, SgScopeStatement* scope);
00316
00318
00321 template <class T> T* buildUnaryExpression(SgExpression* operand = NULL);
00322 template <class T> T* buildUnaryExpression_nfi(SgExpression* operand);
00324
00328 #define BUILD_UNARY_PROTO(suffix) \
00329 Sg##suffix * build##suffix(SgExpression* op =NULL); \
00330 Sg##suffix * build##suffix##_nfi(SgExpression* op);
00331
00332 BUILD_UNARY_PROTO(AddressOfOp)
00333 BUILD_UNARY_PROTO(BitComplementOp)
00334 BUILD_UNARY_PROTO(MinusOp)
00335 BUILD_UNARY_PROTO(NotOp)
00336 BUILD_UNARY_PROTO(PointerDerefExp)
00337 BUILD_UNARY_PROTO(UnaryAddOp)
00338 BUILD_UNARY_PROTO(MinusMinusOp)
00339 BUILD_UNARY_PROTO(PlusPlusOp)
00340 BUILD_UNARY_PROTO(RealPartOp)
00341 BUILD_UNARY_PROTO(ImagPartOp)
00342 BUILD_UNARY_PROTO(ConjugateOp)
00343 BUILD_UNARY_PROTO(VarArgStartOneOperandOp)
00344 BUILD_UNARY_PROTO(VarArgEndOp)
00345
00347 SgCastExp * buildCastExp(SgExpression * operand_i = NULL,
00348 SgType * expression_type = NULL,
00349 SgCastExp::cast_type_enum cast_type = SgCastExp::e_C_style_cast);
00350 SgCastExp * buildCastExp_nfi(SgExpression * operand_i,
00351 SgType * expression_type,
00352 SgCastExp::cast_type_enum cast_type);
00353
00355 SgVarArgOp * buildVarArgOp_nfi(SgExpression * operand_i, SgType * expression_type);
00356
00358 SgMinusMinusOp *buildMinusMinusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
00359 SgMinusMinusOp *buildMinusMinusOp_nfi(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
00360
00362 SgPlusPlusOp* buildPlusPlusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
00363 SgPlusPlusOp* buildPlusPlusOp_nfi(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
00364
00366 SgThrowOp* buildThrowOp(SgExpression *, SgThrowOp::e_throw_kind);
00367
00368 SgNewExp * buildNewExp(SgType* type,
00369 SgExprListExp* exprListExp,
00370 SgConstructorInitializer* constInit,
00371 SgExpression* expr,
00372 short int val,
00373 SgFunctionDeclaration* funcDecl);
00374
00375 SgDeleteExp* buildDeleteExp(SgExpression* variable,
00376 short is_array,
00377 short need_global_specifier,
00378 SgFunctionDeclaration* deleteOperatorDeclaration);
00379
00380
00381 #undef BUILD_UNARY_PROTO
00382
00384
00387 template <class T> T* buildBinaryExpression(SgExpression* lhs =NULL, SgExpression* rhs =NULL);
00388 template <class T> T* buildBinaryExpression_nfi(SgExpression* lhs, SgExpression* rhs);
00390
00394 #define BUILD_BINARY_PROTO(suffix) \
00395 Sg##suffix * build##suffix(SgExpression* lhs =NULL, SgExpression* rhs =NULL); \
00396 Sg##suffix * build##suffix##_nfi(SgExpression* lhs, SgExpression* rhs);
00397
00398 BUILD_BINARY_PROTO(AddOp)
00399 BUILD_BINARY_PROTO(AndAssignOp)
00400 BUILD_BINARY_PROTO(AndOp)
00401 BUILD_BINARY_PROTO(ArrowExp)
00402 BUILD_BINARY_PROTO(ArrowStarOp)
00403 BUILD_BINARY_PROTO(AssignOp)
00404 BUILD_BINARY_PROTO(BitAndOp)
00405 BUILD_BINARY_PROTO(BitOrOp)
00406 BUILD_BINARY_PROTO(BitXorOp)
00407
00408 BUILD_BINARY_PROTO(CommaOpExp)
00409 BUILD_BINARY_PROTO(ConcatenationOp)
00410 BUILD_BINARY_PROTO(DivAssignOp)
00411 BUILD_BINARY_PROTO(DivideOp)
00412 BUILD_BINARY_PROTO(DotExp)
00413 BUILD_BINARY_PROTO(DotStarOp)
00414 BUILD_BINARY_PROTO(EqualityOp)
00415
00416 BUILD_BINARY_PROTO(ExponentiationOp)
00417 BUILD_BINARY_PROTO(ExponentiationAssignOp)
00418 BUILD_BINARY_PROTO(GreaterOrEqualOp)
00419 BUILD_BINARY_PROTO(GreaterThanOp)
00420 BUILD_BINARY_PROTO(IntegerDivideOp)
00421 BUILD_BINARY_PROTO(IntegerDivideAssignOp)
00422 BUILD_BINARY_PROTO(IorAssignOp)
00423 BUILD_BINARY_PROTO(IsOp)
00424 BUILD_BINARY_PROTO(IsNotOp)
00425
00426 BUILD_BINARY_PROTO(LessOrEqualOp)
00427 BUILD_BINARY_PROTO(LessThanOp)
00428 BUILD_BINARY_PROTO(LshiftAssignOp)
00429 BUILD_BINARY_PROTO(LshiftOp)
00430
00431 BUILD_BINARY_PROTO(MembershipOp)
00432 BUILD_BINARY_PROTO(MinusAssignOp)
00433 BUILD_BINARY_PROTO(ModAssignOp)
00434 BUILD_BINARY_PROTO(ModOp)
00435 BUILD_BINARY_PROTO(MultAssignOp)
00436 BUILD_BINARY_PROTO(MultiplyOp)
00437
00438 BUILD_BINARY_PROTO(NonMembershipOp)
00439 BUILD_BINARY_PROTO(NotEqualOp)
00440 BUILD_BINARY_PROTO(OrOp)
00441 BUILD_BINARY_PROTO(PlusAssignOp)
00442 BUILD_BINARY_PROTO(PntrArrRefExp)
00443 BUILD_BINARY_PROTO(RshiftAssignOp)
00444 BUILD_BINARY_PROTO(JavaUnsignedRshiftAssignOp)
00445
00446 BUILD_BINARY_PROTO(RshiftOp)
00447 BUILD_BINARY_PROTO(JavaUnsignedRshiftOp)
00448 BUILD_BINARY_PROTO(ScopeOp)
00449 BUILD_BINARY_PROTO(SubtractOp)
00450 BUILD_BINARY_PROTO(XorAssignOp)
00451
00452 BUILD_BINARY_PROTO(VarArgCopyOp)
00453 BUILD_BINARY_PROTO(VarArgStartOp)
00454
00455 #undef BUILD_BINARY_PROTO
00456
00458 SgConditionalExp * buildConditionalExp(SgExpression* test =NULL, SgExpression* a =NULL, SgExpression* b =NULL);
00459 SgConditionalExp * buildConditionalExp_nfi(SgExpression* test, SgExpression* a, SgExpression* b, SgType* t);
00460
00462 SgExprListExp * 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);
00463 SgExprListExp * buildExprListExp(const std::vector<SgExpression*>& exprs);
00464 SgExprListExp * buildExprListExp_nfi();
00465 SgExprListExp * buildExprListExp_nfi(const std::vector<SgExpression*>& exprs);
00466
00468 SgTupleExp * buildTupleExp(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);
00469 SgTupleExp * buildTupleExp(const std::vector<SgExpression*>& exprs);
00470 SgTupleExp * buildTupleExp_nfi();
00471 SgTupleExp * buildTupleExp_nfi(const std::vector<SgExpression*>& exprs);
00472
00474 SgListExp * buildListExp(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);
00475 SgListExp * buildListExp(const std::vector<SgExpression*>& exprs);
00476 SgListExp * buildListExp_nfi();
00477 SgListExp * buildListExp_nfi(const std::vector<SgExpression*>& exprs);
00478
00479 SgComprehension * buildComprehension(SgExpression *target, SgExpression *iter, SgExprListExp *ifs);
00480 SgComprehension * buildComprehension_nfi(SgExpression *target, SgExpression *iter, SgExprListExp *ifs);
00481
00482 SgListComprehension * buildListComprehension(SgExpression *elt, SgExprListExp *generators);
00483 SgListComprehension * buildListComprehension_nfi(SgExpression *elt, SgExprListExp *generators);
00484
00485 SgSetComprehension * buildSetComprehension(SgExpression *elt, SgExprListExp *generators);
00486 SgSetComprehension * buildSetComprehension_nfi(SgExpression *elt, SgExprListExp *generators);
00487
00488 SgDictionaryComprehension * buildDictionaryComprehension(SgKeyDatumPair *kd_pair, SgExprListExp *generators);
00489 SgDictionaryComprehension * buildDictionaryComprehension_nfi(SgKeyDatumPair *kd_pair, SgExprListExp *generators);
00490
00492
00496 SgVarRefExp * buildVarRefExp(const SgName& name, SgScopeStatement* scope=NULL);
00497
00499 SgVarRefExp * buildVarRefExp(const std::string& varName, SgScopeStatement* scope=NULL);
00500
00502 SgVarRefExp * buildVarRefExp(const char* varName, SgScopeStatement* scope=NULL);
00503
00505 SgVarRefExp * buildVarRefExp(SgVariableSymbol* varSymbol);
00506 SgVarRefExp * buildVarRefExp_nfi(SgVariableSymbol* varSymbol);
00507
00509 SgVarRefExp * buildVarRefExp(SgVariableDeclaration* vardecl);
00510
00513 SgVarRefExp * buildVarRefExp(SgInitializedName* initname, SgScopeStatement* scope=NULL);
00514
00516
00518 SgVarRefExp* buildOpaqueVarRefExp(const std::string& varName,SgScopeStatement* scope=NULL);
00519
00521 SgLabelRefExp * buildLabelRefExp(SgLabelSymbol * s);
00522
00524 SgFunctionRefExp * buildFunctionRefExp(const SgName& name, const SgType* func_type, SgScopeStatement* scope=NULL);
00525
00526 SgFunctionRefExp * buildFunctionRefExp(const char* name, const SgType* func_type, SgScopeStatement* scope=NULL);
00527
00529 SgFunctionRefExp * buildFunctionRefExp(const SgName& name,SgScopeStatement* scope=NULL);
00530
00531 SgFunctionRefExp * buildFunctionRefExp(const char* name,SgScopeStatement* scope=NULL);
00532
00534 SgFunctionRefExp * buildFunctionRefExp(const SgFunctionDeclaration* func_decl);
00535
00537 SgFunctionRefExp * buildFunctionRefExp(SgFunctionSymbol* sym);
00538 SgFunctionRefExp * buildFunctionRefExp_nfi(SgFunctionSymbol* sym);
00539 SgMemberFunctionRefExp * buildMemberFunctionRefExp_nfi(SgMemberFunctionSymbol* sym, bool virtual_call, bool need_qualifier);
00540 SgMemberFunctionRefExp * buildMemberFunctionRefExp(SgMemberFunctionSymbol* sym, bool virtual_call, bool need_qualifier);
00541 SgClassNameRefExp * buildClassNameRefExp_nfi(SgClassSymbol* sym);
00542 SgClassNameRefExp * buildClassNameRefExp(SgClassSymbol* sym);
00543
00545 SgFunctionCallExp* buildFunctionCallExp(SgFunctionSymbol* sym, SgExprListExp* parameters=NULL);
00546 SgFunctionCallExp* buildFunctionCallExp_nfi(SgExpression* f, SgExprListExp* parameters=NULL);
00547 SgFunctionCallExp* buildFunctionCallExp(SgExpression* f, SgExprListExp* parameters=NULL);
00548
00550 SgFunctionCallExp*
00551 buildFunctionCallExp(const SgName& name, SgType* return_type, \
00552 SgExprListExp* parameters=NULL, SgScopeStatement* scope=NULL);
00553
00555 SgCudaKernelCallExp * buildCudaKernelCallExp_nfi(
00556 SgExpression * kernel,
00557 SgExprListExp* parameters = NULL,
00558 SgCudaKernelExecConfig * config = NULL
00559 );
00560
00562 SgCudaKernelExecConfig * buildCudaKernelExecConfig_nfi(
00563 SgExpression *grid = NULL,
00564 SgExpression *blocks = NULL,
00565 SgExpression *shared = NULL,
00566 SgExpression *stream = NULL
00567 );
00568
00570 SgAssignInitializer * buildAssignInitializer(SgExpression * operand_i = NULL, SgType * expression_type = NULL);
00571 SgAssignInitializer * buildAssignInitializer_nfi(SgExpression * operand_i = NULL, SgType * expression_type = NULL);
00572
00574 SgAggregateInitializer * buildAggregateInitializer(SgExprListExp * initializers = NULL, SgType * type = NULL);
00575 SgAggregateInitializer * buildAggregateInitializer_nfi(SgExprListExp * initializers, SgType * type = NULL);
00576
00577
00578 SgConstructorInitializer * buildConstructorInitializer( SgMemberFunctionDeclaration *declaration,SgExprListExp *args,SgType *expression_type,bool need_name,bool need_qualifier,bool need_parenthesis_after_name,bool associated_class_unknown);
00579 SgConstructorInitializer * buildConstructorInitializer_nfi( SgMemberFunctionDeclaration *declaration,SgExprListExp *args,SgType *expression_type,bool need_name,bool need_qualifier,bool need_parenthesis_after_name,bool associated_class_unknown);
00580
00582 SgSizeOfOp* buildSizeOfOp(SgExpression* exp= NULL);
00583 SgSizeOfOp* buildSizeOfOp_nfi(SgExpression* exp);
00584
00586 SgSizeOfOp* buildSizeOfOp(SgType* type = NULL);
00587 SgSizeOfOp* buildSizeOfOp_nfi(SgType* type);
00588
00589
00591 SgJavaInstanceOfOp* buildJavaInstanceOfOp(SgExpression* exp = NULL, SgType* type = NULL);
00592
00593
00595
00596
00598
00602
00603
00606 SgInitializedName* buildInitializedName(const SgName & name, SgType* type, SgInitializer* init = NULL);
00607 SgInitializedName* buildInitializedName(const std::string &name, SgType* type);
00608 SgInitializedName* buildInitializedName(const char* name, SgType* type);
00609 SgInitializedName* buildInitializedName_nfi(const SgName & name, SgType* type, SgInitializer* init);
00610
00612 SgFunctionParameterTypeList *
00613 buildFunctionParameterTypeList(SgFunctionParameterList * paralist);
00614
00616 SgFunctionParameterTypeList *
00617 buildFunctionParameterTypeList(SgExprListExp * expList);
00618
00620 SgFunctionParameterTypeList *
00621 buildFunctionParameterTypeList(SgType* type0 = NULL, SgType* type1 = NULL,
00622 SgType* type2 = NULL, SgType* type3 = NULL,
00623 SgType* type4 = NULL, SgType* type5 = NULL,
00624 SgType* type6 = NULL, SgType* type7 = NULL);
00625
00626
00627
00629
00635
00636 SgVariableDeclaration*
00637 buildVariableDeclaration(const SgName & name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL);
00638
00639 SgVariableDeclaration*
00640 buildVariableDeclaration(const std::string & name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL);
00641
00642 SgVariableDeclaration*
00643 buildVariableDeclaration(const char* name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL);
00644
00645 SgVariableDeclaration*
00646 buildVariableDeclaration_nfi(const SgName & name, SgType *type, SgInitializer *varInit, SgScopeStatement* scope);
00647
00649 SgTypedefDeclaration*
00650 buildTypedefDeclaration(const std::string& name, SgType* base_type, SgScopeStatement* scope = NULL);
00651
00652 SgTypedefDeclaration*
00653 buildTypedefDeclaration_nfi(const std::string& name, SgType* base_type, SgScopeStatement* scope = NULL);
00654
00656 SgFunctionParameterList * 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);
00657 SgFunctionParameterList * buildFunctionParameterList_nfi();
00658
00660 SgFunctionParameterList*
00661 buildFunctionParameterList(SgFunctionParameterTypeList * paraTypeList);
00662
00663 SgFunctionParameterList*
00664 buildFunctionParameterList_nfi(SgFunctionParameterTypeList * paraTypeList);
00665
00666
00667
00668
00669
00671
00672
00673
00674 template <class actualFunction>
00675 actualFunction*
00676 buildNondefiningFunctionDeclaration_T (const SgName & name, SgType* return_type, SgFunctionParameterList * paralist, bool isMemberFunction, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0);
00677
00679 SgFunctionDeclaration *
00680 buildNondefiningFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00681
00683 SgFunctionDeclaration *
00684 buildNondefiningFunctionDeclaration (const SgFunctionDeclaration* funcdecl, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00685
00687
00688
00689 SgMemberFunctionDeclaration *
00690 buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0);
00691
00693
00694
00695
00697 SgMemberFunctionDeclaration *
00698 buildDefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00699
00701 SgMemberFunctionDeclaration *
00702 buildDefiningMemberFunctionDeclaration (const SgName & name, SgMemberFunctionType* func_type, SgFunctionParameterList* paralist, SgScopeStatement* scope, SgExprListExp* decoratorList = NULL);
00703
00705 SgMemberFunctionDeclaration *
00706 buildDefiningMemberFunctionDeclaration (const SgName & name, SgMemberFunctionType* func_type, SgScopeStatement* scope, SgExprListExp* decoratorList = NULL);
00707
00709
00710
00711 SgMemberFunctionDeclaration *
00712 buildNondefiningMemberFunctionDeclaration (const SgMemberFunctionDeclaration* funcdecl, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0);
00713
00715 template <class actualFunction>
00716 actualFunction *
00717 buildDefiningFunctionDeclaration_T (const SgName & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00718
00720 SgFunctionDeclaration *
00721 buildDefiningFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00722
00723 SgFunctionDeclaration *
00724 buildDefiningFunctionDeclaration (const std::string & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00725
00726 SgFunctionDeclaration *
00727 buildDefiningFunctionDeclaration (const char* name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
00728
00730 SgProcedureHeaderStatement*
00731 buildProcedureHeaderStatement(const char* name, SgType* return_type, SgFunctionParameterList * parlist, SgProcedureHeaderStatement::subprogram_kind_enum, SgScopeStatement* scope=NULL);
00732
00734 SgExprStatement*
00735 buildFunctionCallStmt(const SgName& name, SgType* return_type, SgExprListExp* parameters=NULL, SgScopeStatement* scope=NULL);
00736
00738 SgExprStatement*
00739 buildFunctionCallStmt(SgExpression* function, SgExprListExp* parameters=NULL);
00740
00741
00743
00746 SgLabelStatement * buildLabelStatement(const SgName& name, SgStatement * stmt = NULL, SgScopeStatement* scope=NULL);
00747 SgLabelStatement * buildLabelStatement_nfi(const SgName& name, SgStatement * stmt, SgScopeStatement* scope);
00748
00750 SgGotoStatement * buildGotoStatement(SgLabelStatement * label=NULL);
00751 SgGotoStatement * buildGotoStatement_nfi(SgLabelStatement * label);
00752
00754 SgGotoStatement * buildGotoStatement(SgLabelSymbol* symbol);
00755
00757 SgCaseOptionStmt * buildCaseOptionStmt( SgExpression * key = NULL,SgStatement *body = NULL);
00758 SgCaseOptionStmt * buildCaseOptionStmt_nfi( SgExpression * key,SgStatement *body);
00759
00761 SgDefaultOptionStmt * buildDefaultOptionStmt( SgStatement *body = NULL);
00762 SgDefaultOptionStmt * buildDefaultOptionStmt_nfi( SgStatement *body);
00763
00765 SgExprStatement* buildExprStatement(SgExpression* exp = NULL);
00766 SgExprStatement* buildExprStatement_nfi(SgExpression* exp);
00767
00769 SgSwitchStatement* buildSwitchStatement(SgStatement *item_selector = NULL,SgStatement *body = NULL);
00770 inline SgSwitchStatement* buildSwitchStatement(SgExpression *item_selector, SgStatement *body = NULL) {
00771 return buildSwitchStatement(buildExprStatement(item_selector), body);
00772 }
00773 SgSwitchStatement* buildSwitchStatement_nfi(SgStatement *item_selector,SgStatement *body);
00774
00776 SgIfStmt * buildIfStmt(SgStatement* conditional, SgStatement * true_body, SgStatement * false_body);
00777 inline SgIfStmt * buildIfStmt(SgExpression* conditional, SgStatement * true_body, SgStatement * false_body) {
00778 return buildIfStmt(buildExprStatement(conditional), true_body, false_body);
00779 }
00780 SgIfStmt * buildIfStmt_nfi(SgStatement* conditional, SgStatement * true_body, SgStatement * false_body);
00781
00783 SgForInitStatement * buildForInitStatement();
00784 SgForInitStatement * buildForInitStatement(const SgStatementPtrList & statements);
00785 SgForInitStatement * buildForInitStatement_nfi(SgStatementPtrList & statements);
00786
00788 SgForStatement * buildForStatement(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
00789 SgForStatement * buildForStatement_nfi(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
00790 SgForStatement * buildForStatement_nfi(SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
00791
00793 SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgExpression* affinity, SgStatement * loop_body);
00794 SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgExpression* affinity, SgStatement * loop_body);
00795
00797 SgWhileStmt * buildWhileStmt(SgStatement * condition, SgStatement *body, SgStatement *else_body = NULL);
00798 inline SgWhileStmt * buildWhileStmt(SgExpression * condition, SgStatement *body, SgStatement* else_body = NULL) {
00799 return buildWhileStmt(buildExprStatement(condition), body, else_body);
00800 }
00801 SgWhileStmt * buildWhileStmt_nfi(SgStatement * condition, SgStatement *body, SgStatement *else_body = NULL);
00802
00804 SgWithStatement* buildWithStatement(SgExpression* expr, SgStatement* body);
00805 SgWithStatement* buildWithStatement_nfi(SgExpression* expr, SgStatement* body);
00806
00808 SgDoWhileStmt * buildDoWhileStmt(SgStatement * body, SgStatement *condition);
00809 inline SgDoWhileStmt * buildDoWhileStmt(SgStatement* body, SgExpression * condition) {
00810 return buildDoWhileStmt(body, buildExprStatement(condition));
00811 }
00812 SgDoWhileStmt * buildDoWhileStmt_nfi(SgStatement * body, SgStatement *condition);
00813
00815 SgPragmaDeclaration * buildPragmaDeclaration(const std::string & name, SgScopeStatement* scope=NULL);
00816 SgPragmaDeclaration * buildPragmaDeclaration_nfi(const std::string & name, SgScopeStatement* scope);
00817
00819 SgPragma* buildPragma(const std::string & name);
00820
00822 SgBasicBlock * 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);
00823 SgBasicBlock * buildBasicBlock_nfi();
00824 SgBasicBlock * buildBasicBlock_nfi(const std::vector<SgStatement*>&);
00825
00827 SgExprStatement*
00828 buildAssignStatement(SgExpression* lhs,SgExpression* rhs);
00829
00830
00832 SgExprStatement* buildAssignStatement_ast_translate(SgExpression* lhs,SgExpression* rhs);
00833
00835 SgBreakStmt* buildBreakStmt();
00836 SgBreakStmt* buildBreakStmt_nfi();
00837
00839 SgContinueStmt* buildContinueStmt();
00840 SgContinueStmt* buildContinueStmt_nfi();
00841
00843 SgPassStatement* buildPassStatement();
00844 SgPassStatement* buildPassStatement_nfi();
00845
00847 SgAssertStmt* buildAssertStmt(SgExpression* test);
00848 SgAssertStmt* buildAssertStmt(SgExpression *test, SgExpression *exceptionArgument);
00849 SgAssertStmt* buildAssertStmt_nfi(SgExpression* test);
00850
00852 SgYieldExpression* buildYieldExpression(SgExpression* value);
00853 SgYieldExpression* buildYieldExpression_nfi(SgExpression* value);
00854
00856 SgKeyDatumPair* buildKeyDatumPair (SgExpression* key, SgExpression* datum);
00857 SgKeyDatumPair* buildKeyDatumPair_nfi(SgExpression* key, SgExpression* datum);
00858
00860 SgDictionaryExp* buildDictionaryExp (std::vector<SgKeyDatumPair*> pairs);
00861 SgDictionaryExp* buildDictionaryExp_nfi(std::vector<SgKeyDatumPair*> pairs);
00862
00864 SgActualArgumentExpression* buildActualArgumentExpression(SgName arg_name, SgExpression* arg);
00865 SgActualArgumentExpression* buildActualArgumentExpression_nfi(SgName arg_name, SgExpression* arg);
00866
00868 SgDeleteExp* buildDeleteExp(SgExpression *target, bool is_array = false, bool need_global_specifier = false, SgFunctionDeclaration *deleteOperatorDeclaration = NULL);
00869 SgDeleteExp* buildDeleteExp_nfi(SgExpression *target, bool is_array = false, bool need_global_specifier = false, SgFunctionDeclaration *deleteOperatorDeclaration = NULL);
00870
00872 SgClassDefinition* buildClassDefinition(SgClassDeclaration *d = NULL);
00873
00875 SgClassDefinition* buildClassDefinition_nfi(SgClassDeclaration *d = NULL);
00876
00878 SgClassDeclaration* buildNondefiningClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope);
00879
00880
00881 SgClassDeclaration* buildNondefiningClassDeclaration ( SgName name, SgScopeStatement* scope );
00882 SgClassDeclaration* buildDefiningClassDeclaration ( SgName name, SgScopeStatement* scope );
00883
00884
00885 SgClassDeclaration* buildClassDeclaration ( SgName name, SgScopeStatement* scope );
00886
00888 SgEnumDeclaration* buildNondefiningEnumDeclaration_nfi(const SgName& name, SgScopeStatement* scope);
00889
00891 SgClassDeclaration * buildStructDeclaration(const SgName& name, SgScopeStatement* scope=NULL);
00892 SgClassDeclaration * buildStructDeclaration(const std::string& name, SgScopeStatement* scope=NULL);
00893 SgClassDeclaration * buildStructDeclaration(const char* name, SgScopeStatement* scope=NULL);
00894
00896 SgStmtDeclarationStatement* buildStmtDeclarationStatement(SgStatement* stmt);
00897 SgStmtDeclarationStatement* buildStmtDeclarationStatement_nfi(SgStatement* stmt);
00898
00899
00900 SgNamespaceDeclarationStatement * buildNamespaceDeclaration(const SgName& name, SgScopeStatement* scope=NULL);
00901 SgNamespaceDeclarationStatement * buildNamespaceDeclaration_nfi(const SgName& name, bool unnamednamespace, SgScopeStatement* scope );
00902 SgNamespaceDefinitionStatement * buildNamespaceDefinition(SgNamespaceDeclarationStatement* d=NULL);
00903
00904
00905 SgNaryComparisonOp* buildNaryComparisonOp(SgExpression* lhs);
00906 SgNaryComparisonOp* buildNaryComparisonOp_nfi(SgExpression* lhs);
00907 SgNaryBooleanOp* buildNaryBooleanOp(SgExpression* lhs);
00908 SgNaryBooleanOp* buildNaryBooleanOp_nfi(SgExpression* lhs);
00909
00910 SgStringConversion* buildStringConversion(SgExpression* exp);
00911 SgStringConversion* buildStringConversion_nfi(SgExpression* exp);
00912
00913
00914
00915 SgClassDeclaration * buildClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, SgClassDeclaration* nonDefiningDecl);
00916
00918 SgEnumDeclaration * buildEnumDeclaration(const SgName& name, SgScopeStatement* scope=NULL);
00919
00921 SgEnumDeclaration * buildEnumDeclaration_nfi(const SgName& name, SgScopeStatement* scope=NULL);
00922
00924 SgReturnStmt* buildReturnStmt(SgExpression* expression = NULL);
00925 SgReturnStmt* buildReturnStmt_nfi(SgExpression* expression);
00926
00928 SgNullStatement* buildNullStatement();
00929 SgNullStatement* buildNullStatement_nfi();
00930
00932 SgAttributeSpecificationStatement * buildAttributeSpecificationStatement(SgAttributeSpecificationStatement::attribute_spec_enum kind);
00933
00935 SgFortranIncludeLine* buildFortranIncludeLine(std::string filename);
00936
00938 SgCommonBlockObject* buildCommonBlockObject(std::string name="", SgExprListExp* exp_list=NULL);
00939
00941 SgCommonBlock* buildCommonBlock(SgCommonBlockObject* first_block=NULL);
00942
00943
00944
00945 SgCatchOptionStmt* buildCatchOptionStmt(SgVariableDeclaration* condition=NULL, SgStatement* body=NULL);
00946
00947
00948
00949 SgTryStmt* buildTryStmt(SgStatement* body,
00950 SgCatchOptionStmt* catch0=NULL,
00951 SgCatchOptionStmt* catch1=NULL,
00952 SgCatchOptionStmt* catch2=NULL,
00953 SgCatchOptionStmt* catch3=NULL,
00954 SgCatchOptionStmt* catch4=NULL);
00955
00956
00957
00958
00959
00960
00961
00962 SgTryStmt* buildTryStmt(SgBasicBlock *try_body, SgBasicBlock *finally_body = NULL);
00963
00964
00965
00966 SgCatchStatementSeq *buildCatchStatementSeq(SgCatchOptionStmt * = NULL);
00967
00968
00969
00970 SgJavaSynchronizedStatement *buildJavaSynchronizedStatement(SgExpression *, SgBasicBlock *);
00971
00972
00973
00974 SgJavaThrowStatement *buildJavaThrowStatement(SgThrowOp *);
00975
00976
00977
00978
00979 SgJavaForEachStatement *buildJavaForEachStatement(SgVariableDeclaration * = NULL, SgExpression * = NULL, SgStatement * = NULL);
00980
00981
00982
00983 SgJavaLabelStatement *buildJavaLabelStatement(const SgName &, SgStatement * = NULL);
00984
00985
00986 SgExecStatement* buildExecStatement(SgExpression* executable, SgExpression* globals = NULL, SgExpression* locals = NULL);
00987 SgExecStatement* buildExecStatement_nfi(SgExpression* executable, SgExpression* globals = NULL, SgExpression* locals = NULL);
00988
00989
00990 SgPythonPrintStmt* buildPythonPrintStmt(SgExpression* dest = NULL, SgExprListExp* values = NULL);
00991 SgPythonPrintStmt* buildPythonPrintStmt_nfi(SgExpression* dest = NULL, SgExprListExp* values = NULL);
00992
00993
00994 SgPythonGlobalStmt* buildPythonGlobalStmt(SgInitializedNamePtrList& names);
00995 SgPythonGlobalStmt* buildPythonGlobalStmt_nfi(SgInitializedNamePtrList& names);
00996
00997
00999 SgAsmStmt* buildAsmStatement(std::string s);
01000 SgAsmStmt* buildAsmStatement_nfi(std::string s);
01001
01002
01003
01004 SgAsmStmt* buildMultibyteNopStatement( int n );
01005
01006
01008
01009
01011
01015
01016
01018 SgFile* buildFile(const std::string& inputFileName,const std::string& outputFileName, SgProject* project=NULL);
01019
01021 PreprocessingInfo* buildComment(SgLocatedNode* target, const std::string & content,
01022 PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before,
01023 PreprocessingInfo::DirectiveType dtype= PreprocessingInfo::CpreprocessorUnknownDeclaration);
01024
01026 PreprocessingInfo* buildCpreprocessorDefineDeclaration(SgLocatedNode* target,
01027 const std::string & content,
01028 PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before);
01029
01030 #ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
01032 AbstractHandle::abstract_handle * buildAbstractHandle(SgNode* n);
01033 #endif
01034
01036
01037 }
01038 #endif //ROSE_SAGE_BUILDER_INTERFACE