coins.ast
クラス Declarator

java.lang.Object
  |
  +--coins.ast.ASTree
        |
        +--coins.ast.Declarator
すべての実装インタフェース:
java.io.Serializable, Stmnt, TypeId

public class Declarator
extends ASTree
implements TypeId, Stmnt

Declaration of a single symbol.

関連項目:
直列化された形式

フィールドの概要
 
インタフェース 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
 
コンストラクタの概要
Declarator(java.lang.String name, java.lang.String fname, int line)
          Constructs a declarator.
 
メソッドの概要
 void accept(Visitor v)
          Is a method for the visitor pattern.
 java.lang.String fileName()
          Returns the file name including the statement.
 DeclaratorList getArgs()
          Returns the argument list if the declared symbol is a function.
 long getArrayParamSize()
          get/set array parameter size.
 int getBitFieldSize()
          If this declarator is not a bit-field member, then this method returns 0.
 Expr getInitializer()
          Returns an initializer expression if any.
 ASTree getLeft()
          Returns an initializer expression or null.
 java.lang.String getName()
          Returns the symbol name.
 ASTree getRight()
          Returns null.
 long getSize()
          Returns the size (in byte) of the type of this declarator.
 int getStorage()
          Returns storage specifiers.
protected  java.lang.String getTag()
          Returns the type of this node.
 byte[] getType()
          Returns the encoded type of the declared symbol.
 boolean isItBitField()
           
 boolean isTypedef()
          Returns true if this declarator is part of a typedef declaration.
 int lineNumber()
          Returns the line number of the statement.
 void setArgs(DeclaratorList args)
           
 void setArrayParamSize(long s)
           
 void setAsBitField()
           
 void setBitFieldSize(int s)
           
 void setInitializer(Expr i)
           
 void setLeft(ASTree _left)
           
 void setName(java.lang.String name)
           
 void setRight(ASTree _right)
           
 void setStorage(int s)
           
 void setType(byte[] t, long s)
           
 void setTypedefed(boolean b)
           
 java.lang.String toString()
           
 
クラス coins.ast.ASTree から継承したメソッド
putSeparator, rightToString, toString1
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Declarator

public Declarator(java.lang.String name,
                  java.lang.String fname,
                  int line)
Constructs a declarator.

パラメータ:
name - the name of the declared variable.
fname - the file name including the declaration.
line - the line number.
メソッドの詳細

getLeft

public ASTree getLeft()
Returns an initializer expression or null.

定義:
クラス ASTree 内の getLeft

getRight

public ASTree getRight()
Returns null.

定義:
クラス ASTree 内の getRight

setLeft

public void setLeft(ASTree _left)
定義:
クラス ASTree 内の setLeft

setRight

public void setRight(ASTree _right)
定義:
クラス ASTree 内の setRight

accept

public void accept(Visitor v)
クラス ASTree の記述:
Is a method for the visitor pattern. It calls atXXX() on the given visitor, where XXX is the class name of the node object.

定義:
クラス ASTree 内の accept

fileName

public java.lang.String fileName()
インタフェース Stmnt の記述:
Returns the file name including the statement.

定義:
インタフェース Stmnt 内の fileName

lineNumber

public int lineNumber()
インタフェース Stmnt の記述:
Returns the line number of the statement.

定義:
インタフェース Stmnt 内の lineNumber

setTypedefed

public void setTypedefed(boolean b)

setName

public void setName(java.lang.String name)

setType

public void setType(byte[] t,
                    long s)

setStorage

public void setStorage(int s)

setArgs

public void setArgs(DeclaratorList args)

setInitializer

public void setInitializer(Expr i)

setBitFieldSize

public void setBitFieldSize(int s)

setAsBitField

public void setAsBitField()

isItBitField

public boolean isItBitField()

isTypedef

public boolean isTypedef()
Returns true if this declarator is part of a typedef declaration.


getType

public byte[] getType()
Returns the encoded type of the declared symbol. See ast.TypeId


getSize

public long getSize()
Returns the size (in byte) of the type of this declarator. It returns -1 if the type is void, function, ...


getName

public java.lang.String getName()
Returns the symbol name. It may be null.


getStorage

public int getStorage()
Returns storage specifiers. See ast.TypeId


getArgs

public DeclaratorList getArgs()
Returns the argument list if the declared symbol is a function.


getInitializer

public Expr getInitializer()
Returns an initializer expression if any.


getBitFieldSize

public int getBitFieldSize()
If this declarator is not a bit-field member, then this method returns 0.


getTag

protected java.lang.String getTag()
クラス ASTree の記述:
Returns the type of this node. This method is used by toString().

オーバーライド:
クラス ASTree 内の getTag

getArrayParamSize

public long getArrayParamSize()
get/set array parameter size.


setArrayParamSize

public void setArrayParamSize(long s)

toString

public java.lang.String toString()
オーバーライド:
クラス ASTree 内の toString