coins.casttohir
クラス ToHirSym

java.lang.Object
  |
  +--coins.casttohir.ToHirSym
すべての実装インタフェース:
TypeId

public class ToHirSym
extends java.lang.Object
implements TypeId

Create symbol and register it to the symbol table.


フィールドの概要
protected  int fDbgLevel
           
 
インタフェース coins.ast.TypeId から継承したフィールド
ARRAY_T, CHAR_T, CONST_T, DOUBLE_T, ELLIPSIS_T, ENUM_BEGIN, ENUM_END, FLOAT_T, FUNCTION_T, INT_T, LONG_DOUBLE_T, LONG_LONG_T, LONG_T, NO_DIMENSION_T, OFFSET_T, POINTER_T, RESTRICT_T, RETURN_T, S_AUTO, S_EXTERN, S_INLINE, S_NONE, S_REGISTER, S_STATIC, SHORT_T, SIGNED_T, SIZE_T, STRUCT_BEGIN, STRUCT_END, UNION_BEGIN, UNION_END, UNSIGNED_T, VOID_T, VOLATILE_T
 
コンストラクタの概要
(パッケージプライベート) ToHirSym(ToHir tohir)
          Constructor.
 
メソッドの概要
 Type convertType(byte[] b, boolean pLocal)
          Convert type.
(パッケージプライベート)  Subp declareGlobalFunction(int storage, SubpType type, java.lang.String name, boolean init)
          Declare function at global scope.
(パッケージプライベート)  Var declareGlobalVariable(int storage, Type type, java.lang.String name, Expr ini)
          Declare variable at global scope.
(パッケージプライベート)  Subp declareLocalFunction(int storage, SubpType type, java.lang.String name)
          Declare function at local scope.
(パッケージプライベート)  Var declareLocalVariable(int storage, Type type, java.lang.String name, Expr ini)
          Declare variable at local scope.
(パッケージプライベート)  void declareType(Type type, java.lang.String name)
          Declare type (=typedef).
 SymTable getNormalTable()
          Get normal (block scope or global) symbol table other than SymTable owned by STRUCT, UNION, ENUM.
(パッケージプライベート)  void makeQualifiedTypes(Type t, java.lang.String tagname)
          make qualified types of t (=struct or union which has tag of tagname).
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

fDbgLevel

protected int fDbgLevel
コンストラクタの詳細

ToHirSym

ToHirSym(ToHir tohir)
Constructor.

パラメータ:
tohir - Offers cooperation with the object of other packages.
メソッドの詳細

makeQualifiedTypes

void makeQualifiedTypes(Type t,
                        java.lang.String tagname)
make qualified types of t (=struct or union which has tag of tagname). The qualified type of t might be defined while t is an incomplete type. To define the qualified type of t as a complete type again when t became a complete type, this method is called.

パラメータ:
t - complete type (struct or union)
tagname - tag name of the complete type

convertType

public Type convertType(byte[] b,
                        boolean pLocal)
Convert type. Created type symbol is added appropriate symbol table.

パラメータ:
b - AST type information byte array.
戻り値:
HIR type.

getNormalTable

public SymTable getNormalTable()
Get normal (block scope or global) symbol table other than SymTable owned by STRUCT, UNION, ENUM.

戻り値:
Normal symbol table.

declareType

void declareType(Type type,
                 java.lang.String name)
Declare type (=typedef). Create type symbol and add into symTableCurrent.

パラメータ:
type - Type of the symbol.
name - Name of the symbol.

declareGlobalFunction

Subp declareGlobalFunction(int storage,
                           SubpType type,
                           java.lang.String name,
                           boolean init)
Declare function at global scope. Create subprogram symbol and add into symTableRoot.

パラメータ:
storage - AST storage class.
type - HIR SubpType object.
name - Function name.
init - True if declaration has function body.
戻り値:
Declared Subp.

declareLocalFunction

Subp declareLocalFunction(int storage,
                          SubpType type,
                          java.lang.String name)
Declare function at local scope. Create subprogram symbol and add into symTableCurrent.

パラメータ:
type - HIR SubpType object.
name - Function name.
戻り値:
Declared Subp.

declareGlobalVariable

Var declareGlobalVariable(int storage,
                          Type type,
                          java.lang.String name,
                          Expr ini)
Declare variable at global scope. Create variable symbol and add into symTableRoot.

パラメータ:
storage - AST storage class.
type - HIR Type object.
name - Variable name.
ini - Initializer.
戻り値:
Declared Var.

declareLocalVariable

Var declareLocalVariable(int storage,
                         Type type,
                         java.lang.String name,
                         Expr ini)
Declare variable at local scope. Create variable symbol and add into symTableCurrent.

パラメータ:
storage - AST storage class.
type - HIR Type object.
name - Variable name.
ini - Initializer.
戻り値:
Declared Var.