coins.lir2c
クラス Convert

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

public class Convert
extends java.lang.Object

Convert: converts LirNode to C code. a node of LirNode is converted to a line of C code (excepts "switch" sentence).


コンストラクタの概要
Convert()
          Constructor(with no arg)
 
メソッドの概要
(パッケージプライベート)  java.lang.String biOpToStr(LirNode node, LirNode child1, LirNode child2, java.lang.String Ope, boolean inMEM, LirNode parent)
          biOpToStr: get the expression of C code for bi Operator node(ADD,etc).
(パッケージプライベート)  java.lang.String dump(LirNode node, boolean inMEM, LirNode parent)
          dump: main method of the convertion.
 java.lang.String invoke(LirNode node)
          invoke: the method that you should call it first.
(パッケージプライベート)  java.lang.String lirToTypeStr(LirNode node)
          lirToTypeStr: get type string of the variable, expression, etc by calling coins.backend.Type@toString() method.
(パッケージプライベート)  java.lang.String lirToTypeStr2(LirNode node)
          lirToTypeStr2: get type string of the variable, expression, etc by calling coins.backend.Type@toString() method.
(パッケージプライベート)  java.lang.String lirToTypeStr3(LirNode node)
          lirToTypeStr3: get type string and parenthes of the variable, expression, etc by calling coins.backend.Type@toString() method.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Convert

public Convert()
Constructor(with no arg)

メソッドの詳細

invoke

public java.lang.String invoke(LirNode node)
invoke: the method that you should call it first.

パラメータ:
node - the root node that will convert to C code.
戻り値:
the C string of lir nodes.

dump

java.lang.String dump(LirNode node,
                      boolean inMEM,
                      LirNode parent)
dump: main method of the convertion. it called by invoke method and dump method(dump method calls dump method recursively).

パラメータ:
node - the node that will convert to a part of C code.
inMEM - the boolean value which node are in MEM expression.
parent - the node that is a parent of the node.
戻り値:
the string that is a part of C code.

lirToTypeStr

java.lang.String lirToTypeStr(LirNode node)
lirToTypeStr: get type string of the variable, expression, etc by calling coins.backend.Type@toString() method. note: aggregate objects do not support.

パラメータ:
node - the node to get the type string.
戻り値:
the type string of LirNode.

lirToTypeStr2

java.lang.String lirToTypeStr2(LirNode node)
lirToTypeStr2: get type string of the variable, expression, etc by calling coins.backend.Type@toString() method. note: aggregate objects do not support(return "").

パラメータ:
node - the node to get the type string.
戻り値:
the type string of LirNode.

lirToTypeStr3

java.lang.String lirToTypeStr3(LirNode node)
lirToTypeStr3: get type string and parenthes of the variable, expression, etc by calling coins.backend.Type@toString() method. note: if the node is aggregate object, return "".

パラメータ:
node - the node to get the type string.
戻り値:
the type string and parenthes of LirNode.

biOpToStr

java.lang.String biOpToStr(LirNode node,
                           LirNode child1,
                           LirNode child2,
                           java.lang.String Ope,
                           boolean inMEM,
                           LirNode parent)
biOpToStr: get the expression of C code for bi Operator node(ADD,etc).

パラメータ:
node - the node to convert.
child1 - the node of first child node.
child2 - the node of second child node.
inMEM - the node that is in the MEM expression is true, or false.
parent - the node that is a parent of the node.
戻り値:
the C code for the node.