|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcetus.hir.Statement
cetus.hir.CompoundStatement
public class CompoundStatement
Represents a group of statements that are treated as a single statement.
| Field Summary |
|---|
| Fields inherited from class cetus.hir.Statement |
|---|
annotations, children, line_number, object_print_method, parent |
| Constructor Summary | |
|---|---|
CompoundStatement()
Creates an empty compound statement. |
|
| Method Summary | |
|---|---|
void |
addDeclaration(Declaration decl)
Adds a declaration after the last declaration; this models the C language's requirement that all declarations appear at the beginning of a block. |
void |
addDeclarationAfter(Declaration ref,
Declaration decl)
Add a declaration after the reference declaration. |
void |
addDeclarationBefore(Declaration ref,
Declaration decl)
Add a declaration before the reference declaration. |
void |
addStatement(Statement stmt)
Adds a statement to the end of this compound statement. |
void |
addStatementAfter(Statement ref_stmt,
Statement new_stmt)
Add a new Statement After this Statement |
void |
addStatementBefore(Statement ref_stmt,
Statement new_stmt)
Add a new Statement Before this Statement |
java.lang.Object |
clone()
|
int |
countStatements()
Returns the total number of Statements contained within this CompoundStatement. |
static void |
defaultPrint(CompoundStatement stmt,
java.io.OutputStream stream)
Prints a statement to a stream. |
Declaration |
findSymbol(IDExpression name)
Retrieves the declaration for a symbol, possibly searching through parent symbol tables. |
java.util.List |
getParentTables()
Returns a list of symbol tables that are parents of this table in the distributed symbol table graph. |
java.util.Map<IDExpression,Declaration> |
getTable()
Provides direct access to the symbol table; it's generally not a good idea to modify this directly. |
void |
removeChild(Traversable child)
Removes a specific child of this statement; some statements do not support this method. |
java.lang.String |
toString()
Returns a string representation of this compound statement. |
| Methods inherited from class cetus.hir.Statement |
|---|
annotate, annotateAfter, annotateBefore, annotationToString, containsAnnotation, detach, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getChildren, getParent, getProcedure, print, removeAnnotations, removeAnnotations, setChild, setLineNumber, setParent, setPrintMethod, swapWith, toAnnotatedString, verify, where |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompoundStatement()
| Method Detail |
|---|
public void addDeclaration(Declaration decl)
addDeclaration in interface SymbolTabledecl - The declaration to add.
public void addDeclarationBefore(Declaration ref,
Declaration decl)
SymbolTable
addDeclarationBefore in interface SymbolTableref - The reference point.decl - The declaration to add.
public void addDeclarationAfter(Declaration ref,
Declaration decl)
SymbolTable
addDeclarationAfter in interface SymbolTableref - The reference point.decl - The declaration to add.public void addStatement(Statement stmt)
stmt - The statement to add.
public void addStatementBefore(Statement ref_stmt,
Statement new_stmt)
new_stmt - The Statement to be addedref_stmt - Reference point
public void addStatementAfter(Statement ref_stmt,
Statement new_stmt)
new_stmt - The Statement to be addedref_stmt - Reference pointpublic java.lang.Object clone()
clone in class Statementpublic int countStatements()
public static void defaultPrint(CompoundStatement stmt,
java.io.OutputStream stream)
stmt - The statement to print.stream - The stream on which to print the statement.public java.lang.String toString()
toString in class Statementpublic Declaration findSymbol(IDExpression name)
SymbolTable
findSymbol in interface SymbolTablename - The name of the symbol.public java.util.List getParentTables()
SymbolTable
getParentTables in interface SymbolTablepublic java.util.Map<IDExpression,Declaration> getTable()
SymbolTable
getTable in interface SymbolTablepublic void removeChild(Traversable child)
Statement
removeChild in interface TraversableremoveChild in class Statementchild - The child to remove.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||