coins.ffront
Class BlockIfStmt

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

public class BlockIfStmt
extends FStmt

Block IF statement: block_if_part opt_else_if_parts opt_else_part END_IF


Field Summary
(package private)  Stmt fElsePart
           
(package private)  Stmt fThenPart
           
 
Fields inherited from class coins.ffront.FStmt
defLabel, fDeclMgr, fESMgr, fHir, fHirUtil, fLine, fSymTable, fTypeUtil, generatedStmts, hir, stmt
 
Constructor Summary
BlockIfStmt(Node pIfPart, FirList pOptElseIfs, FirList pOptElse, int line, FirToHir pfHir)
           
 
Method Summary
 void print(int level, java.lang.String spaces)
           
 void process()
          Translate block if statement
 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
 

Field Detail

fThenPart

Stmt fThenPart

fElsePart

Stmt fElsePart
Constructor Detail

BlockIfStmt

public BlockIfStmt(Node pIfPart,
                   FirList pOptElseIfs,
                   FirList pOptElse,
                   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

process

public void process()
Translate block if statement
   IF (e1) THEN       // fIfPart.left
     s1               // fIfPart.right
   ELSE IF (e2) THEN  // fOptElseIfs.get(0).left
     s2               // fOptElseIfs.get(0).right
   ELSE IF (e3) THEN  // fOptElseIfs.get(1).left
     s3               // fOptElseIfs.get(1).right
   ELSE
     s4               // fOptElse
   END IF
 to
   if (e1) s1
   else { if (e2) s2
          else { if (e3) s3
                 else s4  }
        }
 

Overrides:
process in class FStmt