Represents the fundamental class for all statements.
Files are broken down into statements, 'SgStatement' is the base class for the representation of statements. SgStatement has mant derived classes,corresponding to the many different kinds of statements in the languages Sage++ can deal with. Each statement has a unique integer idetifier id, and an integer variant tag which can be used to idetify its type. These are available through SgStatement's 'id()' and 'variant()' member functions. SgStatement's 'thebif' member provides access to the low level representation of statements, bif nodes. Each statement has a context: it may have a lexical predecessor and a lexical successor, and it may be nested within a control block of another statement, or in a block structured definition like a C struct. This enclosing statement is called the control parent; it defines the structure of the parse tree.
SgStatement(PTR_BFND bif)
SgStatement(int code, SgLabel *lab, SgSymbol *symb, SgExpression *e1, SgExpression *e2, SgExpression *e3)
SgStatement(SgStatement &)
int lineNumber()
int id()
int variant()
SgExpression* expr(int i)
int hasSymbol()
SgSymbol* symbol()
char* fileName()
int hasLabel()
SgLabel* label()
void setlineNumber(int n)
void setId(int n)
void setVariant(int n)
void setExpression(int i, SgExpression &e)
void setLabel(SgLabel &l)
void setLabel(SgLabel * l)
void setSymbol(SgSymbol &s)
SgStatement* lexNext()
SgStatement* lexPrev()
SgStatement* controlParent()
void setLexNext(SgStatement &s)
void setControlParent(SgStatement &s)
int numberOfChildrenList1()
int numberOfChildrenList2()
SgStatement* childList1(int i)
SgStatement* childList2(int i)
SgStatement* nextInChildList()
SgStatement* firstStmtForDeclaration()
SgStatement* lastDeclaration()
SgStatement* firstExecutable()
SgStatement* lastExecutable()
SgStatement* lastNodeOfStmt()
SgStatement* nodeBefore()
void insertStmtBefore(SgStatement &s)
void insertStmtBefore(SgStatement &s, SgStatement &cp)
void insertStmtAfter(SgStatement &s)
void insertStmtAfter(SgStatement &s, SgStatement &cp)
SgStatement* extractStmt()
SgStatement* extractStmtBody()
void replaceWithStmt(SgStatement &s)
void simpledeleteStmt()
void deleteStmt()
SgStatement& copy(void)
SgStatement* copyPtr(void)
SgStatement& copyOne(void)
SgStatement* copyOnePtr(void)
SgStatement& copyBlock(void)
SgStatement* copyBlockPtr(void)
int isIncludedInStmt(SgStatement &s)
void replaceSymbByExp(SgSymbol &symb, SgExpression &exp)
void replaceSymbBySymb(SgSymbol &symb, SgSymbol &newsymb)
void replaceSymbBySymbSameName(SgSymbol &symb, SgSymbol &newsymb)
void replaceTypeInStmt(SgType &old, SgType &newtype)
char* unparse()
void unparsestdout()
void sunparse(char *buffer)
char* comments()
void addComment(char *com)
void setComments(char *comments)
int numberOfComments()
int hasAnnotations()
~SgStatement()
SgSymbol* SgStatement::GetSymbolInScope(SgStatement * scope, char * name)
SgSymbol* SgStatement::GetSymbolInScope(SgStatement * scope, char * mixstring, char * genname, char * basename)
SgSymbol* SgStatement::GetSymbolInScope(SgStatement * scope, char * mixstring, char * genname, char * basename, int counter)
SgSymbol* SgStatement::GetSymbolInScope(SgStatement * scope, char * mixstring, char * genname, char * basename, int c1, int c2)
SgSymbol* SgStatement::getSymbolInCurrentScope(char * name)
SgSymbol* SgStatement::getSymbolInCurrentScope(char * mixstring, char * genname, char * basename)
SgSymbol* SgStatement::getSymbolInCurrentScope(char * mixstring, char * genname, char * basename, int counter)
SgSymbol* SgStatement::getSymbolInCurrentScope(char * mixstring, char * genname, char * basename, int c1, int c2)
SgStatement* getScopeForDeclare()
int numberOfAttributes()
int numberOfAttributes(int type)
void* attributeValue(int i)
int attributeType(int i)
void* attributeValue(int i, int type)
void addAttribute(int type, void *a, int size)
void addAttribute(int type)
void addAttribute(void *a, int size)
void addAttribute(SgAttribute *att)
void* deleteAttribute(int i)
void* deleteAttribute(int i, int type)
void deleteAllAttribute()
void deleteAllAttribute(int type)
SgAttribute* getAttribute(int i)
SgAttribute* getAttribute(int i, int type)
void addDeclSpec(int type)
void clearDeclSpec()
int isFriend()
Email contact: zgs@npac.syr.edu