coins.cfront
Class EncodedType

java.lang.Object
  extended bycoins.cfront.EncodedType
All Implemented Interfaces:
TokenId, TypeId

class EncodedType
extends java.lang.Object
implements TokenId, TypeId


Field Summary
static int FUNCTION_TYPE_SIZE
           
 
Fields inherited from interface coins.ast.TokenId
AND_E, ANDAND, ARROW, ASM, AUTO, BAD_TOKEN, BREAK, CASE, CAST_OP, CHAR, CHAR_CONST, COND_OP, CONST, CONTINUE, DEFAULT, DIV_E, DO, DOUBLE, DOUBLE_CONST, ELLIPSIS, ELSE, ENUM, EOF, EQ, EXOR_E, EXTERN, FLOAT, FLOAT_CONST, FOR, FUNCALL, GE, GOTO, IDENTIFIER, IF, IGNORE, INDEX_OP, INLINE, INT, INT_CONST, LE, LONG, LONG_CONST, LONG_DOUBLE_CONST, LONGLONG_CONST, LSHIFT, LSHIFT_E, MINUS_E, MINUSMINUS, MOD_E, MUL_E, MUTABLE, NEQ, OR_E, OROR, PLUS_E, PLUSPLUS, PRAGMA, REGISTER, RESTRICT, RETURN, RSHIFT, RSHIFT_E, SHORT, SIGNED, SIZEOF, SKIP_GCC_ASM, SKIP_GCC_ATTRIBUTE, STATIC, STRING_L, STRING_WL, STRUCT, SWITCH, TYPEDEF, TYPEDEF_NAME, UINT_CONST, ULONG_CONST, ULONGLONG_CONST, UNION, UNSIGNED, VOID, VOLATILE, WHILE
 
Fields inherited from interface 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
 
Constructor Summary
(package private) EncodedType()
           
 
Method Summary
 void bePointer()
          Changes to be a pointer type if the type is an array type.
(package private)  void clear()
           
 long computeSizeof(Parser parser)
           
static long computeSizeof(Parser parser, byte[] type, int pos)
           
(package private)  void copy(EncodedType etype)
           
(package private)  boolean dereference()
           
(package private)  void ellipsisToVoid()
           
(package private)  byte[] get()
           
 EncodedType getArrayElemType()
           
 long getArrayParamSize()
          get/set array parameter size.
(package private)  int getArraySize()
           
 EncodedType getDeclaratorType(Declarator pDecl)
           
 EncodedType getReturnValueType()
           
(package private)  int getStorageClass()
           
(package private)  java.lang.String getTagName()
          Returns a struct/union/enum name.
(package private) static java.lang.String getTagName(byte[] type, int pos)
           
(package private)  int getTypeChar()
           
static int getTypeChar(byte[] type, int start)
          Returns the first character except const, volatile, signed, or unsigned.
(package private)  boolean hasIncompleteArray()
           
(package private)  void insert(byte[] b)
           
(package private)  void insert(char c)
           
(package private)  void insert(EncodedType etype)
           
(package private)  void insert(java.lang.String s)
           
(package private)  void insertArgTypes(OldFuncArgs args)
           
(package private)  void insertCv(int cv)
           
(package private)  void insertCv(int insertpos, int cv_t)
           
(package private)  void insertDim(long d)
           
(package private)  void insertEnum(java.lang.String name)
           
(package private)  void insertStruct(java.lang.String name)
           
(package private)  void insertUnion(java.lang.String name)
           
(package private)  boolean isArray()
           
static boolean isArray(byte[] type, int pos)
           
(package private)  boolean isChar()
           
static boolean isChar(byte[] type, int pos)
           
 boolean isDouble()
          isDouble:
static boolean isDouble(byte[] type, int pos)
           
 boolean isDoubleType()
           
 boolean isFloatType()
           
(package private)  boolean isFunction()
           
static boolean isFunction(byte[] type, int pos)
           
(package private)  boolean isIndex()
           
static boolean isIndex(byte[] type, int pos)
           
(package private)  boolean isInteger()
           
static boolean isInteger(byte[] type, int pos)
           
(package private)  boolean isLong()
           
static boolean isLong(byte[] type, int pos)
           
 boolean isLongDoubleType()
           
(package private)  boolean isLongLong()
           
static boolean isLongLong(byte[] type, int pos)
           
(package private)  boolean isNumber()
           
static boolean isNumber(byte[] type, int pos)
           
(package private)  boolean isPointer()
           
static boolean isPointer(byte[] type, int pos)
           
 boolean isSigned()
           
 boolean isStruct()
           
 boolean isValue()
           
static boolean isValue(byte[] type, int pos)
           
 boolean isValueOrFunction()
           
(package private)  boolean isVoid()
           
static boolean isVoid(byte[] type, int pos)
           
(package private)  void restore(int p)
           
(package private)  int save()
           
 void setArrayParamSize(long s)
           
(package private)  void setArraySize(int n, Lex lex)
           
(package private)  void setArraySizeIfCharArray(int n, Lex lex)
           
(package private)  void setStorageClass(int s)
           
(package private)  boolean toBePromotedToInteger()
           
static boolean toBePromotedToInteger(byte[] type, int pos)
           
(package private)  char top()
           
(package private)  boolean toReturnType()
           
 java.lang.String toString()
           
static java.lang.String toString(byte[] type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FUNCTION_TYPE_SIZE

public static int FUNCTION_TYPE_SIZE
Constructor Detail

EncodedType

EncodedType()
Method Detail

clear

void clear()

top

char top()

copy

void copy(EncodedType etype)

insert

void insert(char c)

insert

void insert(java.lang.String s)

insert

void insert(byte[] b)

insert

void insert(EncodedType etype)

insertCv

void insertCv(int cv)

insertCv

void insertCv(int insertpos,
              int cv_t)

insertDim

void insertDim(long d)

setArraySize

void setArraySize(int n,
                  Lex lex)
            throws ParseError
Throws:
ParseError

getArraySize

int getArraySize()

setArraySizeIfCharArray

void setArraySizeIfCharArray(int n,
                             Lex lex)
                       throws ParseError
Throws:
ParseError

hasIncompleteArray

boolean hasIncompleteArray()

insertStruct

void insertStruct(java.lang.String name)

insertUnion

void insertUnion(java.lang.String name)

insertEnum

void insertEnum(java.lang.String name)

insertArgTypes

void insertArgTypes(OldFuncArgs args)

dereference

boolean dereference()

toReturnType

boolean toReturnType()

getTypeChar

int getTypeChar()

getTagName

java.lang.String getTagName()
Returns a struct/union/enum name.


getTagName

static java.lang.String getTagName(byte[] type,
                                   int pos)

save

int save()

restore

void restore(int p)

get

byte[] get()

getTypeChar

public static int getTypeChar(byte[] type,
                              int start)
Returns the first character except const, volatile, signed, or unsigned.

Parameters:
type - encoded type

bePointer

public void bePointer()
Changes to be a pointer type if the type is an array type.


isSigned

public boolean isSigned()

isFunction

boolean isFunction()

isFunction

public static boolean isFunction(byte[] type,
                                 int pos)

isPointer

boolean isPointer()

isPointer

public static boolean isPointer(byte[] type,
                                int pos)

isArray

boolean isArray()

isArray

public static boolean isArray(byte[] type,
                              int pos)

isValue

public boolean isValue()

isValue

public static boolean isValue(byte[] type,
                              int pos)

isValueOrFunction

public boolean isValueOrFunction()

isLong

boolean isLong()

isLong

public static boolean isLong(byte[] type,
                             int pos)

isLongLong

boolean isLongLong()

isLongLong

public static boolean isLongLong(byte[] type,
                                 int pos)

isIndex

boolean isIndex()

isIndex

public static boolean isIndex(byte[] type,
                              int pos)

isInteger

boolean isInteger()

isInteger

public static boolean isInteger(byte[] type,
                                int pos)

toBePromotedToInteger

boolean toBePromotedToInteger()

toBePromotedToInteger

public static boolean toBePromotedToInteger(byte[] type,
                                            int pos)

isNumber

boolean isNumber()

isNumber

public static boolean isNumber(byte[] type,
                               int pos)

isDouble

public boolean isDouble()
isDouble:

Returns:
true if float, double, or long double.

isDouble

public static boolean isDouble(byte[] type,
                               int pos)

isFloatType

public boolean isFloatType()

isDoubleType

public boolean isDoubleType()

isLongDoubleType

public boolean isLongDoubleType()

getArrayElemType

public EncodedType getArrayElemType()

getDeclaratorType

public EncodedType getDeclaratorType(Declarator pDecl)

isStruct

public boolean isStruct()

isChar

boolean isChar()

isChar

public static boolean isChar(byte[] type,
                             int pos)

isVoid

boolean isVoid()

isVoid

public static boolean isVoid(byte[] type,
                             int pos)

toString

public java.lang.String toString()

computeSizeof

public long computeSizeof(Parser parser)
                   throws ParseError
Throws:
ParseError

computeSizeof

public static long computeSizeof(Parser parser,
                                 byte[] type,
                                 int pos)
                          throws ParseError
Throws:
ParseError

toString

public static java.lang.String toString(byte[] type)

getArrayParamSize

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


setArrayParamSize

public void setArrayParamSize(long s)

getReturnValueType

public EncodedType getReturnValueType()

ellipsisToVoid

void ellipsisToVoid()

setStorageClass

void setStorageClass(int s)

getStorageClass

int getStorageClass()