coins.lir2c
クラス LirToC

java.lang.Object
  |
  +--coins.lir2c.LirToC

public class LirToC
extends java.lang.Object

LirToC: convert LIR into C code. It is called from coins.driver.Driver.


フィールドの概要
 Module compileUnit
          Module to convert
 java.io.OutputStreamWriter out
          Output Stream Writer
 java.io.PrintWriter stdout
          print writer to output C code
 
コンストラクタの概要
LirToC(Module cU, java.io.OutputStreamWriter fout)
          Constructor (with args)
LirToC(Module cU, java.lang.String dstName)
          Constructor (with args)
 
メソッドの概要
(パッケージプライベート)  java.util.HashMap getArgMap(Function func)
          getArgMap: this method gets the declaration arguments in the Function.
 java.lang.String getEpilogue(Function func)
          getEpilogue: this method gets the epilogue of the function.
static java.lang.String getInitializer(Data data)
           
(パッケージプライベート)  java.util.HashMap getIsFuncOrDataMap(Module cU)
          getIsFuncOrDataMap: this method gets the Function-or-Data Map in the Module object.
(パッケージプライベート)  java.util.HashMap getIsStaticMap(SymTab gmap)
          getIsStaticMap: this method gets the IsStatic Map in the global symbol table.
 java.lang.String getPrologue(Function func)
          getPrologue: this method gets the prologue of the function.
 void invoke()
          the main routine of convertion.
 void invoke2(Function func)
          invoke2: invoke2 method converts the Function object to the C code.
 void recurLirNode(LirNode root, java.io.PrintWriter stdout)
          revurLirNode: the experimental method that traverse LirNodes recursively.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

stdout

public java.io.PrintWriter stdout
print writer to output C code


out

public java.io.OutputStreamWriter out
Output Stream Writer


compileUnit

public Module compileUnit
Module to convert

コンストラクタの詳細

LirToC

public LirToC(Module cU,
              java.lang.String dstName)
       throws java.io.IOException
Constructor (with args)

パラメータ:
cU - The module to convert.
dstName - The filename for the output(C code).

LirToC

public LirToC(Module cU,
              java.io.OutputStreamWriter fout)
       throws java.io.IOException
Constructor (with args)

パラメータ:
cU - The module to convert.
fout - The OutputStreamWriter for the output(C code).
メソッドの詳細

invoke

public void invoke()
the main routine of convertion.


invoke2

public void invoke2(Function func)
invoke2: invoke2 method converts the Function object to the C code. it is called from coins.k3.lir2c.LirToC@invoke.

パラメータ:
func - the function to convert.

recurLirNode

public void recurLirNode(LirNode root,
                         java.io.PrintWriter stdout)
revurLirNode: the experimental method that traverse LirNodes recursively. no need to call this method in coins.k3.lir2c.LirToC@invoke2.

パラメータ:
root - the root node of the LirNodes.
stdout - the print writer to output(C code).

getEpilogue

public java.lang.String getEpilogue(Function func)
getEpilogue: this method gets the epilogue of the function.

パラメータ:
func - The function to get the epilogue.
戻り値:
The string of C code that for Epilogue.

getPrologue

public java.lang.String getPrologue(Function func)
getPrologue: this method gets the prologue of the function.

パラメータ:
func - The function to get the prologue.
戻り値:
The string of C code that for Prologue.

getArgMap

java.util.HashMap getArgMap(Function func)
getArgMap: this method gets the declaration arguments in the Function. for example: func(int a, int b){} will get the hash entries ("int a","-none-") ("int b","-none-")

パラメータ:
func - The function to get argument map.
戻り値:
The HashMap that contains declaration arguments.

getIsStaticMap

java.util.HashMap getIsStaticMap(SymTab gmap)
getIsStaticMap: this method gets the IsStatic Map in the global symbol table.

パラメータ:
gmap - the global symbol table.
戻り値:
The HashMap that contains static values.

getIsFuncOrDataMap

java.util.HashMap getIsFuncOrDataMap(Module cU)
getIsFuncOrDataMap: this method gets the Function-or-Data Map in the Module object.

パラメータ:
cU - the Module to get HashMap entry.
戻り値:
The HashMap that contains the names of value that is Function or Data.

getInitializer

public static java.lang.String getInitializer(Data data)