coins.ffront
Class HeaderStmt

java.lang.Object
  extended bycoins.ffront.FStmt
      extended bycoins.ffront.HeaderStmt
All Implemented Interfaces:
Node

public class HeaderStmt
extends FStmt


Field Summary
 
Fields inherited from class coins.ffront.FStmt
defLabel, fDeclMgr, fESMgr, fHir, fHirUtil, fLine, fSymTable, fTypeUtil, generatedStmts, hir, stmt
 
Constructor Summary
HeaderStmt(Token pIdent, FirList pArgs, boolean isF, Pair pType, int line, FirToHir pfHir)
           
 
Method Summary
 void addEntryStmt(FirList entryList)
          Make an entry statement and add it to entryList.
 void change(FirList pArgs, FirList entryStmtList)
          Change this header statement as follows: (1) change subprogram name "abc" to "abc_" (2) replace parameter list (3) make computed GOTO statement to go to the place of each ENTRY statement and add it as the first stmt
 void changeToSubprogram()
          Change this function statement to subprogram statement.
 FirList getArgs()
           
 Token getIdToken()
           
 java.lang.String getLexem()
           
 java.lang.String getOriginalIdString()
           
 Var getReturnVar()
           
 java.lang.String getReturnVarString()
           
 Token getReturnVarToken()
           
 int getStar()
           
 Pair getTypePair()
           
 boolean isFunction()
           
 void print(int level, java.lang.String spaces)
           
 void process()
          define optional label and add it to generated statements
 void setReturnVar(Var pVar)
           
 void setStar(int pInt)
           
 java.lang.String toString()
           
 
Methods inherited from class coins.ffront.FStmt
addGeneratedStmt, addGeneratedStmtFirst, addLabel, addResultTo, dp, getLabelString, getResult, hasNotLabel, makeArgAddr, makeExp, mergeSymTable, preprocess, setLineAndFileInfo, setSymTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeaderStmt

public HeaderStmt(Token pIdent,
                  FirList pArgs,
                  boolean isF,
                  Pair pType,
                  int line,
                  FirToHir pfHir)
Method Detail

print

public void print(int level,
                  java.lang.String spaces)
Specified by:
print in interface Node
Overrides:
print in class FStmt

toString

public java.lang.String toString()
Specified by:
toString in interface Node
Overrides:
toString in class FStmt

addEntryStmt

public void addEntryStmt(FirList entryList)
Make an entry statement and add it to entryList. For example, from FUNCTION f(r) make ENTRY f(r) and add it to entryList and to programBody as the first ENTRY statement. Add "i_" to fArgs as the first parameter.

Parameters:
entryList -

change

public void change(FirList pArgs,
                   FirList entryStmtList)
Change this header statement as follows: (1) change subprogram name "abc" to "abc_" (2) replace parameter list (3) make computed GOTO statement to go to the place of each ENTRY statement and add it as the first stmt

Parameters:
pArgs -
entryStmtList -

changeToSubprogram

public void changeToSubprogram()
Change this function statement to subprogram statement. Change funcType FUNCTION funcName(...) to SUBROUTINE funcName_(funcType funcName, ...)


getReturnVarString

public java.lang.String getReturnVarString()

getReturnVarToken

public Token getReturnVarToken()

isFunction

public boolean isFunction()

getTypePair

public Pair getTypePair()

getLexem

public java.lang.String getLexem()

getIdToken

public Token getIdToken()

getArgs

public FirList getArgs()

setStar

public void setStar(int pInt)

getStar

public int getStar()

setReturnVar

public void setReturnVar(Var pVar)

getReturnVar

public Var getReturnVar()

getOriginalIdString

public java.lang.String getOriginalIdString()

process

public void process()
Description copied from class: FStmt
define optional label and add it to generated statements

Overrides:
process in class FStmt