coins.sym
インタフェース Sym

すべてのスーパーインタフェース:
Sym0
既知のサブインタフェースの一覧:
BaseType, BoolConst, CharConst, Const, DefinedType, Elem, EnumType, ExpId, FloatConst, FlowAnalSym, IntConst, Label, NamedConst, OperandSym, Param, PointerType, RegionType, StringConst, StructType, Subp, SubpType, Type, UnionType, Var, VectorType
既知の実装クラスの一覧:
BaseTypeImpl, BoolConstImpl, CharConstImpl, ConstImpl, DefinedTypeImpl, ElemImpl, EnumTypeImpl, ExpIdImpl, FloatConstImpl, IntConstImpl, LabelImpl, NamedConstImpl, OperandSymImpl, ParamImpl, PointerTypeImpl, RegionTypeImpl, StringConstImpl, StructTypeImpl, SubpImpl, SubpTypeImpl, SymImpl, TypeImpl, UnionTypeImpl, VarImpl, VectorTypeImpl

public interface Sym
extends Sym0

Sym interface

 Symbol interface extends Sym0.
   Sym instances can be created by methids in this
   interface and it is not necessary to use "new" directly.
   Read HIR.java before using this interface.
   Related interfaces: SymRoot.java, SymTable.java.

 Relation of the symbol class and related classes:

   SymTable // Symbol table class. An instance of SymTable
            // is created for each scope defining new symbols
            // such as Var, Subp, Type, Const, etc.

 Sym0  // Simplified symbol class.
   |
   Sym // Symbol class (super class of all symbol classes).
     | //  Symbols in the same scope are contained in the same
     | //  symbol table (instance of SymTable).
     |
     |- OperandSym // Symbol that may be used as an operand
     |   |         //  of executable expressions.
     |   |
     |   |- Var   // Variable that can be assigned a value
     |   |   |    //  and variable with const attribute.
     |   |   |- Param // Formal parameter class.
     |   |   |- Elem  // Class for structure element,
     |   |            //  union element, etc.
     |   |
     |   |- Const // Constant class
     |   |   |- IntConst    // integer constant
     |   |   |- FloatConst  // floating constant
     |   |   |- CharConst   // character constant
     |   |   |- StringConst // string constant
     |   |   |- BoolConst   // boolean constant
     |   |   |- NamedConst  // Named constant including
     |   |             //  enumeration constant (other than bool).
     |   |- Label  // Statement label class.
     |
     |- Subp  // Subprogram class (procedures, functions,
     |        //  methods, constructors, destructors, etc.)
     |
     |- Type  // Type information class.
     |    |- BaseType    // Base types intrinsic
     |    |              //  to many programming languages.
     |    |- VectorTyepe // Vector (1 dim. array) type.
     |    |- EnumType    // Enumeration type.
     |    |- PtrType     // Pointer type.
     |    |- StructType  // Structure type.
     |    |- UnionType   // Union type.
     |    |- SubpType    // Subprogram type.
     |    |- RegionType  // Region type to define storage area
     |    |              //   shared between subprograms.
     |    |- DefinedType // Types defined in a program (by typedef).
     |
     |- ExpId  // Expression identifier
               //  (generated for data flow analysis, etc.)

 Class of symbols:
   It is assumed that class of a symbol can be fixed before
   recording it in the symbol table. If it is difficult
   to fix its class, then do not record it in the
   symbol table until its class can be fixed, or record temporally
   as some class and when it become clear that the former class is not
   correct, then remove (by remove()) the symbol and record again
   as an instance of the proper class.
   The later approach is not recommended except for the case where
   the former approach is not possible.

 Relations between symbol table and program constructs:
   Several symbol tables (SymTable instance) are constructed
   according to the structure of given source program.
   At first, a global symbol table symTableRoot is created by
   initiate() of SymRoot. Symbols inherent to the HIR and
   source language should be recorded in it.
   When a new scope of symbols is opened, a new symbol table should
   be created and linked to ancestor symbol table that contains
   symbols to be inherited by the new scope (by pushSymTable()).
   When the current scope is to be closed, the current symbol table
   should be closed and the ancestor symbol table should be the
   current symbol table again (by using popSymTable()).
   A new scope may be opened by subprogram definition,
   structure declaration, etc. (BlockStmt may have local symbol
   table but it is not automatically created.)
   Symbols are searched in the current symbol table and its
   ancestors in the reverse order of scope addition.
   Popped symbol table is not discarded unless it is empty but
   made invisible for search procedures so as to make
   inter-procedure optimization and parallelization can be done.
   A symbol table usually has corresponding program construct
   such as subprogram. There are links between such constructs
   and corresponding symbol table to show their correspondence.
   The link to the corresponding construct can be get by getOwner()
   and getOwnerName() applied to the symbol table (see SymTable).
   Anonymous construct may have name generated by the compiler
   (such as , subprogName_2, etc.) Symbol table for
   symbol-declaring block may have owner named as
   subprogName_1, _2, etc.
   Following sequence of statements will make the global symbol
   table symTableRoot and local symbol table lLocalSymTable
   for subprogram "main" to be ready for use.
     symRoot  = new SymRoot(ioRoot);
     hirRoot  = new HirRoot(symRoot);
     symRoot.attachHirRoot(hirRoot);
     symRoot.initiate();
     sym = symRoot.sym;
     lMain = sym.subp("main".intern(), symRoot.typeVoid, null);
        ....
     lLocalSymTable = symRoot.symTableRoot.pushSymTable(lMain);
     (See SimpleMain.java)

 Scope of symbols:
   Source program symbols (symbols appearing in source program)
   have their scope as defined by the grammar of the language.
   Scope of constants is the entire compile unit.
   Scope of temporal variables generated by the compiler
   is the subprogram within which the temporal variables are defined.

 Parameters common to several methods:
  pInternedName:
     Character string that is made as unique object by intern().
     Most String parameters in Sym interface methods should be
     interned name. If such parameter has not intern(), comparison
     operation may fail and causes bug. Extraneous intern() has no
     effect but may decrease compile speed.
   pDefinedIn:
     Upper construct that defines this symbol such as
     subprogram for local variable,
     struct/union tag symbol for struct/union element,
     enum tag symbol for enumeration constant, etc.
     It may be null if there is no upper construct
     (in such case as global variable, global subprogram, etc.).

 Attention:
   Sym and SymTable objects should be created by factory methods
   (methods to create objects) specified in this interface.
   If constructors are invoked directly without using methods
   in this interface, some methods might not work correctly
   because there are several restrictions to keep consistency
   between objects.

 Abstract syntax of Sym

  Sym ->            // Symbol definition.
     NameString     // Name of the string.
     KindWiseAttr   // Attribute that may differ by symbol kind.
     OptionalInf    // Optional information that may be null.
  KindWiseAttr ->
     OperandSymAttr // Attribute of symbol that may be treated as operand.
   | SubpAttr       // Subprogram attribute.
   | TypeAttr       // Type definition attribute.
   | RegionAttr     // Region attribute.
   | ExpIdAttr      // Expression identifier attribute.
  OperandSymAttr ->
     VarAttr ComputedAttr    // Attributes for variable.
   | ConstAttr ComputedAttr  // Attributes for constant.
   | LabelAttr ComputedAttr  // Attributes for label.
   | RegAttr ComputedAttr    // Attributes for register.
  VarAttr ->
     VarType
     StorageClass
     Visibility
     InitialValue
     ParamAttr
     ElemAttr
  StorageClass ->   // Storage class specification.
     VAR_STATIC     // Life time spans entire execution.
   | VAR_AUTO       // Life time begins at entry to a subprogram
                    // and ends at exit from the subprogram.
   | VAR_REGISTER   // Special case of VAR_AUTO, where access to the
                    // variable is desirable to be as first as possible.
  Visibility ->
     SYM_EXTERN         // External symbol not defined but visible
                        // in this compile unit.
   | SYM_PUBLIC         // Symbol defined in this compile unit (or class)
                        // and visible from other compile unit( or class).
   | SYM_PROTECTED      // Symbol that is defined in a class and
                        // visible in the class and its subclasses.
   | SYM_PRIVATE        // Symbol that is visible only in the class
                        // or subprogram defining the symbol.
   | SYM_COMPILE_UNIT;  // Visible only in the compile unit
                        // defining the symbol.
  InitialValue ->
     Exp                // Initial value expression.
   | ConstValue         // Initial value constant
   | null
  ParamAttr ->
     CallByReference
   | null
  CallByReference ->
     true               // Call by reference
   | false              // Call by value
  ElemAttr ->           // Struct or Union element
     BitFieldAttr
   | null
  BitFieldAttr ->       // Bit field attribute if the element is a bit field.
     BitSize BitOffset
  BitSize ->            // Number of bit positions in the bit field.
     intConstValue
  BitOffset ->          // Bit field offset.
     intConstValue
  ConstAttr ->          // Attribute of constant.
     ConstType ConstValue
  ConstValue ->         // Value of the constant.
     intConstValue
   | floatConstValue
   | charConstValue
   | AggregateConstValue // Value for vector, struct, union.
  AggregateConstValue -> // Constant value for aggregate variable.
     ( ConstValueSeq )   // Each constant corresponds to an element
                         // of the aggregate in the same sequence as
                         // the aggregate elements.
  ConstValueSeq ->
     ConstValue ConstValueSeq
   | null
  LabelAttr ->           // Attributes of label.
     LabelKind           // Kind of the label.
     HirPosition         // HIR node to which the label is attached.
     LirPosition         // LIR node to which the label is attached.
     BasicBlock          // Basic block that starts with the label.
  LabelKind ->
     UNCLASSIFIED_LABEL   // Label not yet classified.
   | ENTRY_LABEL          // Label at subprogram entry.
   | THEN_LABEL           // Label at then-part of IfStmt.
   | ELSE_LABEL           // Label at else-part of IfStmt.
   | LOOP_COND_INIT_LABEL // Label at conditional-init-part of loop
   | LOOP_BACK_LABEL      // Loop-back label.
   | LOOP_BODY_LABEL      // Loop-body label.
   | LOOP_STEP_LABEL      // Loop-step label.
   | SWITCH_CASE_LABEL    // Case-selection label of SwitchStmt.
   | SWITCH_DEFAULT_LABEL // Switch-default label.
   | RETURN_POINT_LABEL   // Label at return point from subprogram.
   | JUMP_LABEL           // Jump target label.
   | CONTINUE_LABEL       // Continue without branch  (a kind of join
                          // point or successive LabeledStmt).
   | SOURCE_LABEL         // Label in source program
                          // (may be jump target label).
   | END_IF_LABEL         // End-if label.
   | LOOP_END_LABEL       // Loop-end label.
   | SWITCH_END_LABEL     // Switch-end label.
  HirPosition ->          // HIR defining the corresponding label.
     LabeledStmt
   | null
  LirPosition ->          // LIR defining the corresponding label.
     LIR
   | null
  BasicBlock ->
     BBlock
   | null
  RegAttr ->              // Attributes of register.
     ARegAttr
   | MRegAttr
  ARegAttr ->             // Abstract (pseudo) register.
     implementationDefined
  MRegAttr ->             // Machine register.
     implementationDefined
  SubpAttr ->             // Attributes of subprogram.
     SubpType             // Type of the subprogram.
     Visibility           // Visibility attribute.
     HirBody              // Definition of subprogram operation in HIR.
     LirBody              // Definition of subprogram operation in LIR.
     ComputedAttr         // Attributes that may be computed when
                          // compilation proceeds.
  HirBody ->
     HIR
   | null
  LirBody ->
     LIR
   | null
  VarType ->              // Type attributes of variables.
     BaseType             // Base type.
   | PointerType          // Pointer type.
   | AggregateType        // Aggregate type.
   | EnumType             // Enumeration type.
   | DefinedType          // Defined by type definition.
  ConstType ->
     BaseType
   | PointerType
   | AggregateType
   | EnumType
   | DefinedType
  TypeAttr ->             // Symbol table contains the specifications
     TypeSpecification    // (description) of types.
  TypeSpecification ->    // Type specification.
     BaseType
   | PointerType
   | AggregateType
   | EnumType
   | SubpType             // SubpType is not in VarType, ConstType.
   | DefinedType
  Type ->
     TypeSpecification    // Type specification.
   | TypeReference        // Reference to a type.
  BaseType ->
     int                  // int
   | short                // short int
   | long                 // long int
   | long_long            // long long int
   | u_int                // unsigned int
   | u_short              // unsigned short int
   | u_long               // unsigned long int
   | u_long_long          // unsigned long long int
   | char                 // character
   | u_char               // unsigned character
   | float                // floating point
   | double               // double floating point
   | long_double          // long double floating point
   | bool                 // boolean
   | void                 // void
   | offset               // address offset
  PointerType ->          // Pointer type.
     ( PTR Type )         // Type: type of pointed object.
  AggregateType ->        // Type of aggregate object.
     VectorType           // Vector type.
   | StructType           // Structure type.
   | UnionType            // Union type.
   | RegionType           // Region type.
  VectorType ->
     ( VECT ElemCount LowerBound Type )
  ElemCount ->            // Number of elements in the vector.
     Exp
   | intConstValue
  LowerBound              // Lower bound of subscript index.
     Exp
   | intConstValue
  StructType ->
     ( STRUCT ElemTypeSeq )
  ElemTypeSeq ->          // Element of struct or union.
     ElemType ElemTypeSeq
   | null
  ElemType ->             // Element type specification.
     ( ElemName Type )
  ElemName ->             // Name of struct/union element.
     Identifier
  UnionType ->
     ( UNION ElemTypeSeq )
  EnumType ->
     ( ENUM EnumSpecSeq )
  EnumSpecSeq ->          // Specification of enumeration sequence.
     EnumSpec EnumSpecSeq
   | null
  EnumSpec ->
     ( EnumName EnumValue )
  EnumName ->             // Enumeration name.
     Identifier
  EnumValue ->            // Enumeration value.
     intConstValue
  SubpType ->             // Type specification of subprogram.
     ( SUBP ( ParamTypeSeq ) OptionalParam ReturnValueType )
  ParamTypeSeq ->         // Sequence of formal parameter types.
     Type ParamTypeSeq
   | null
  OptionalParam ->
     true                 // There is optional parameters that may be abbreviated.
   | false                // There is no optional parameter.
  ReturnValueType ->      // Type of value returned by the subprogram.
     Type
  RegionType ->           // Define storage area shared between compile units.
     ( REGION regionSym ) //
  RegionAttr ->           // List of pairs comprising subprogram and
     ( listCode  attr     // symbol table specifying variables in the region.
       list_of_SubpSymTablePair )
  SubpSymTablePair ->     // Subprogram and symbol table specifying
     Subp SymTable        // variables in the region for the subprogram.
  DefinedType ->          // Type defined in the input program.
     ( TYPEDEF DefinedTypeName OriginType ) // Define the DefinedTypeName
                          // as a type same to OriginType.
   | DefinedTypeName      // Type name defined by ( TYPEDEF .... ).
  DefinedTypeName ->
     Identifier           // Name of the defined type.
   | ( STRUCT Tag )       // Struct identified by tag.
   | ( UNION Tag )        // Union  identified by tag.
   | ( ENUM Tag )         // Enumeration identified by tag.
   | LanguageDependentTypeRepresentation
  TypeReference ->        // Reference to a type.
     BasicType
   | DefinedTypeName
  Tag ->
     Identifier           // Tag name.
  OriginType ->           // The defined type has the same attributes
     Type                 // as the specified origin type.
  ExpIdAttr ->            // Attributes of expression identifier.
     NodePosition         // IR node position represented by the identifier.
     IndexValue           // Index value to be used in flow analysis, etc.
  NodePosition ->
     IR
   | null
  IndexValue ->
     intConstValue
   | null
  ComputedAttr ->         // Attributes that may be computed during compilation.
     FlowInf              // Control-flow/data-flow information.
   | ParallelInf          // Information for parallelization.
   | RegAllocInf          // Information for register allocation.
   | CodeGenInf           // Information for code generation.
   | null
  FlowInf ->
     DefList UseList
   | ...
  DefList ->
     List_of_IR           // List of definition point.
   | null
  UseList ->
     List_of_IR           // List of use points.
   | null
  ParallelInf ->
     implementationDefined
   | null
  RegAllocInf ->
     implementationDefined
   | null
  CodeGenInf ->
     implementationDefined
   | null
  OptionalInf ->          // Optional information.
     UniqueName           // Name unique in the current compilation unit.
   | null

  SymTable ->             // Symbol tables in a compilation unit
     NextBrother          // composes a tree by brother and child link
     FirstChild           // corresponding to the scopes of symbols.
     Owner                // Owner of the symbol table.
     SymSeq               // Sequence of symbols registered in the symbol table.
  NextBrother ->          // Symbol table corresponding to the next scope
     SymTable             // in the same nesting level of this symbol table.
   | null                 // Null if there is no such scope.
  FirstChild ->           // Symbol table corresponding to the scope
     SymTable             // nested in the scope of this symbol table.
   | null                 // Null if there is no nested scope.
  Owner ->                // Program construct to which the symbol table
                          // is attached.
     Subp                 // Subprogram for SymTable local to the subprogram.
   | Struct               // Struct for SymTable local to the struct.
   | Union                // Union  for SymTable local to the union.
   | BlockStmt            // BlockStmt for SymTable local to the block.
   | null                 // Top symbol table may have no owner.
  SymSeq ->               // Sequence of symbols.
     Sym SymSeq
   | null

 Symbol kind number:
  public static final int   // Symbol kind number. Keep this order.
    KIND_REMOVED          =  0,  // Symbol removed from the symbol table.
    KIND_OTHER            =  1,  // Symbol other than followings.
    KIND_CONST_FIRST      =  2,  // First number in constant kind.
    KIND_BOOL_CONST       =  2,  // Bool constant
    KIND_CHAR_CONST       =  3,  // Character (char, signed char,
                                 // unsigned char)
    KIND_INT_CONST        =  4,  // Integer constant (int, short, long,
                                 //   u_int, u_short, u_long)
    KIND_FLOAT_CONST      =  5,  // Float constant (float, double,
                                 //   long double)
    KIND_STRING_CONST     =  6,  // String constant.
    KIND_NAMED_CONST      =  7,  // Named constant including enumulation.
    KIND_CONST_LAST       =  7,  // Last number in constant kind.
    KIND_VAR              =  8,  // Variable.
    KIND_PARAM            =  9,  // Parameter.
    KIND_ELEM             = 10,  // struct/union element.
    KIND_TAG              = 11,  // struct/union/enum tag.
    KIND_SUBP             = 12,  // Subprogram.
    KIND_TYPE             = 13,  // Type symbol.
    KIND_LABEL            = 14,  // Label.
    KIND_AREG             = 15,  // Abstract register. // to be DELETED
    KIND_MREG             = 16,  // Machine register.  // to be DELETED
    KIND_EXP_ID           = 17;  // Expression identifier.

 Visibility attribute applied to subprograms and variables.
    SYM_EXTERN    = 1,  // External symbol not defined but visible
                        // in this compile unit.
                        // setVisibility method in Var and Subp will
                        // refuse to change from PUBLIC to EXTERN
                        // but will accept to change from EXTERN to PUBLIC.
    SYM_PUBLIC    = 2,  // Symbol defined in this compile unit or class
                        // and visible from other compile unit or class.
    SYM_PROTECTED = 3,  // Symbol that is defined in a class and
                        // visible in the class and its subclasses.
    SYM_PRIVATE   = 4,  // Symbol that is visible only in the class
                        // or subprogram defining the symbol.
    SYM_COMPILE_UNIT = 5; // Visible only in the compile unit
                          // defining the symbol.
    // See VAR_STATIC, VAR_AUTOMATIC, VAR_REGISTER in Var.java.
    // Note for C language:
    //   A symbol declared as extern and having no definition
    //   in this compile unit has SYM_EXTERN attribute.
    //   A symbol declared as extern but having definition
    //   in this compile unit does not have SYM_EXTERN attribute.

 Flag numbers used for the symbol.
                       //  They should be a number between 1 to 31.
                       //  Flags applicable to all symbols:
    FLAG_DERIVED_SYM       = 1,  // This is a derived symbol.
    FLAG_GENERATED_SYM     = 2,  // This is a generated symbol.
    FLAG_RESERVED_NAME     = 3,  // Reserved name of Sym (.int, .char, ... ).
                                 // Reserved name begins with dot so that
                                 // it does not conflict with identifiers.
                            // Flags applicable to Var:
    FLAG_SIZEOF_TAKEN      = 5,  // true if sizeof operation is applied
    FLAG_ADDRESS_TAKEN     = 6,  // address is taken (& operator is applied)
    FLAG_POINTER_OPERATION = 7,  // true if pointer operation is applied
    FLAG_AREG_ALLOCATED    = 8,  // Abstract register is allocated.
                            // Flags applicable to Type:
    FLAG_INCOMPLETE_TYPE   = 11, // Incomplete type.
    FLAG_UNIFORM_SIZE      = 12; // Type with fixed size other than pointer
                                 // (and other than SubpType) or
                                 // Vector of fixed number of elements
                                 // whose type has FLAG_UNIFORM_SIZE.
      // Flag numbers 24-31 can be used in each phase for arbitrary purpose.
      // They may be destroyed by other phases.

 Coding rules applied to all classes in the sym packege:

 Methods begin with lower case letter.
 Constants (final static int, etc.) are spelled in upper case letters.
 Indentation is 2 characters. Tab is not used for indentation.
 Formal parameters begin with p.
 Local variables begin with l.
 Methods and variables are named so that meaning is easily guessed.
 Short names less than 3 characters are not used except for
 very local purpose.


フィールドの概要
static java.lang.String[] KIND_NAME
          Symbol kind name
static java.lang.String[] VISIBILITY
          Visibility attribute attribute
 
インタフェース coins.sym.Sym0 から継承したフィールド
FLAG_ADDRESS_TAKEN, FLAG_CASTLESS_SUBP, FLAG_COMMON, FLAG_COMPLEX_STRUCT, FLAG_DERIVED_SYM, FLAG_GENERATED_SYM, FLAG_INCOMPLETE_TYPE, FLAG_POINTER_OPERATION, FLAG_REGION_ELEM, FLAG_RESERVED_NAME, FLAG_SIZEOF_TAKEN, FLAG_UNFIXED_SIZE, FLAG_UNIFORM_SIZE, FLAG_VALUE_IS_ASSIGNED, KIND_AREG, KIND_BOOL_CONST, KIND_CHAR_CONST, KIND_CONST_FIRST, KIND_CONST_LAST, KIND_ELEM, KIND_EXP_ID, KIND_FLOAT_CONST, KIND_INT_CONST, KIND_LABEL, KIND_MREG, KIND_NAMED_CONST, KIND_OTHER, KIND_PARAM, KIND_REMOVED, KIND_STRING_CONST, KIND_SUBP, KIND_TAG, KIND_TYPE, KIND_VAR, SYM_COMPILE_UNIT, SYM_EXTERN, SYM_PRIVATE, SYM_PROTECTED, SYM_PUBLIC
 
メソッドの概要
 BaseType baseType(java.lang.String pInternedName, int pTypeKind)
          baseType Create an instance of base type.
 BoolConst boolConst(boolean pBoolConst)
          boolConst Make BoolConst object corresponding to pBoolConst.
 CharConst charConst(java.lang.String pInternedName, Type pType)
          Make constant object corresponding to pInternedName.
 Var defineVar(java.lang.String pInternedName, Type pType, Sym pDefinedIn)
          defineVar with defined-in parameter Define a variable with name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot).
 Sym derivedSym()
          derivedSym Generate a symbol having the same type and kind as that of this symbol in symTableCurrentSubp, or symTableCurrent if symTableCurrentSubp is null.
 FloatConst floatConst(java.lang.String pInternedName, Type pType)
          Make constant object corresponding to pInternedName.
 int getDefinedColumn()
          getDefinedColumn Get the column number of the first declaration for this symbol.
 java.lang.String getDefinedInName()
          getDefinedInName Get the name of getDefinedIn().
 int getDefinedLine()
          getDefinedLine Get the line number of the first declaration for this symbol.
 SymInf getInf()
          getInf Get additional information (for optimization, parallelization, etc.) of this symbol.
 java.lang.String getNameOrNull(Sym pSym)
          getNameOrNull If pSym is not null, return its name, else return null.
 SymInf getOrAddInf()
          getOrAddInf get attached information.
 Sym getOriginalSym()
          Get original symbol corresponding to uniqueNameSym if this is a unique name symbol generated by setUniqueNameToAllSym().
 Sym getOriginalSym(java.lang.String pName)
          Get original symbol corresponding to the symbol named pName.
 java.lang.String getPureName()
          getPureName Get the name of this symbol.
 java.lang.String getSymKindName()
          Get the name of the symbol kind of this symbol to be used for compiler debug, etc.
 java.lang.Object getWork()
          Get phase-wise work used for arbitrary purpose in each phase.
 IntConst intConst(java.lang.String pInternedName, Type pType)
          Make constant object corresponding to pInternedName.
 java.lang.Integer intObject(int pIntValue)
          Make java.lang.Integer object corresponding to pIntValue.
 boolean isRemoved()
          isRemoved
 java.lang.String makeCstring(java.lang.String pStringBody)
          makeCstring Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required.
 java.lang.String makeCstringWithTrailing0(java.lang.String pStringBody)
          makeCstringWithTrailing0 Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required.
 java.lang.String makeEnumTypeName(IrList pElemList)
          Make a string where, name1, name2, ... are the name of enum element 1, element 2, ... , and value1, value2, ... are the value of enum element 1, element 2, ... .
 java.lang.String makeJavaString(java.lang.String pStringBody)
          makeJavaString Change the pure string pStringBody to Java String representation adding heading, trailing quotes and escape characters if required.
 java.lang.String makeStructUnionTypeName(boolean pStruct, IrList pElemList)
          Make a string of or where, Type1, Type2, ... are type name of struct/union element 1, element 2, ... .
 java.lang.String makeSubpTypeName(Type pReturnType, IrList pParamList, boolean pOptionalParam, boolean pPermitAnyParam)
          Make a string optionalParam returnType > where, paramType1, paramType2, ... are the type name of parameter 1, parameter 2, ... , and optionalParam is true or false, and returnType is the type name of return value type.
 java.lang.String makeVectorTypeName(Type pElemType, Exp pElemCountExp, long pElemCount, Exp pLowerBoundExp, long pLowerBound)
          makeVectorTypeName Make a vector type name of the form .
 java.lang.String makeVectorTypeName(Type pElemType, long pElemCount)
          makeVectorTypeName with default lower bound Make a vector type name of the form .
 java.lang.String makeVectorTypeName(Type pElemType, long pElemCount, long pLowerBound)
          makeVectorTypeName Make a vector type name of the form .
 NamedConst namedConst(java.lang.String pInternedName, int pIndex, Type pType)
          Make a constant named as pInternedName.
 PointerType pointerType(Type pPointedType, long pElemCount)
          pointerType with element count Get a PointeType that points to an object of type pPointedType with element count.
 PointerType pointerType(Type pPointedType, long pElemCount, long pLowerBound)
          pointerType with element count Get a PointeType that points to an object of type pPointedType with element count and lower bound.
 PointerType pointerType(Type pPointedType, SymTable pSymTable)
          pointerType specifying symbol table Get the pointer type that points to an object of type pPointedType.
 RegionType regionType(java.lang.String pRegionNameString, int pStorageClass)
          regionType: Make an instance of RegionType in symRoot.symTableRoot.
 void remove()
          remove Remove this symbol.
 void setDefinedFile(java.lang.String pDefinedFile)
          setDefinedFile Set the name of the file defining this symbol.
 void setDefinedIn(Sym pDefiningSym)
          setDefinedIn Set "definedIn" symbol of this symbol if it is not set by defineUnique, Define, and redefine.
 void setDefinedLine(int pDefinedLine)
          setDefinedLine Set the line number of declaration defining this symbol.
 void setRecordedIn(SymTable pSymTable)
          setRecordedIn Link to the symbol table that recorded this symbol.
 void setSymKind(int pSymKind)
          setSymKind Set the symbol kind of this symbol to pSymKind if current kind is not KIND_OTHER, then the kind is not changed.
 void setSymType(Type pSymType)
          setSymType Set the type of this symbol.
 void setUniqueNameSym(Sym pUniqueNameSym)
          setUniqueNameSym Set the UniqueName symbol corresponding to this symbol.
 void setWork(java.lang.Object pWork)
          Set phase-wise work used for arbitrary purpose in each phase.
 StringConst stringConstFromQuotedString(java.lang.String pInternedName)
          stringConstFromQuotedString Make a string constant (StringConst object) from given string pInternedName that has heading and trailing quote '"'.
 Sym symbol(java.lang.String pInternedName, Type pType, Sym pDefinedIn)
          symbol Create a Sym object of pType.
 java.lang.String toStringDetail()
          toStringDetail Get detailed attributes of this symbol in text which is not interned.
 java.lang.String toStringShort()
          toStringShort Get name and index of this symbol in text which is not interned.
 VectorType vectorType(java.lang.String pTypeName, Type pElemType, Exp pElemCountExp, Exp pLowerBoundExp)
          vectorType with element count and lower bound as expression Get the vector type that is composed of element type pElemType and element count pElemCountExp, lower bound pLowerBoundExp.
 VectorType vectorType(java.lang.String pTypeName, Type pElemType, long pElemCount, long pLowerBound)
          vectorType with element count and lower bound given as integer value Get the vector type that is composed of element type pElemType and element count pElemCount, lower bound pLowerBound.
 VectorType vectorType(Type pElemType, Exp pElemCountExp)
          vectorType with element count given as expression Get the vector type that is composed of element type pElemType and element count pElemCountExp.
 VectorType vectorTypeUnfixed(Type pElemType, Exp pLowerBoundExp)
          vectorType having unfixed number of element of pElemType.
 
インタフェース coins.sym.Sym0 から継承したメソッド
charConst, definedType, defineElem, defineLabel, defineParam, defineSubp, defineVar, enumType, floatConst, getDefinedFile, getDefinedIn, getFlag, getName, getNextSym, getRecordedIn, getSymKind, getSymType, getUniqueName, intConst, isGlobal, namedConst, pointerType, setFlag, stringConst, structType, subpType, unionType, vectorType, vectorTypeUnfixed
 

フィールドの詳細

KIND_NAME

public static final java.lang.String[] KIND_NAME
Symbol kind name


VISIBILITY

public static final java.lang.String[] VISIBILITY
Visibility attribute attribute

メソッドの詳細

boolConst

public BoolConst boolConst(boolean pBoolConst)
boolConst Make BoolConst object corresponding to pBoolConst.

パラメータ:
pBoolConst - true or false.
戻り値:
boolConstTrue or boolConstFalse that are the same to those ones in SymRoot corresponding to pInternedName.

charConst

public CharConst charConst(java.lang.String pInternedName,
                           Type pType)
Make constant object corresponding to pInternedName.

パラメータ:
pInternedName - Character string representing the constant.
pType - Type of the constant object to be created; It may be typeChar or typeU_Char of SymRoot.
戻り値:
constant object of the type specified by pType.

intConst

public IntConst intConst(java.lang.String pInternedName,
                         Type pType)
Make constant object corresponding to pInternedName. The string representation of the constant takes the form specified in the source language. As for C language, when the last character of pInternedname is a digit, L is appended for long int, UL for unsigned long int, U for unsigned int, U for unsigned short.

パラメータ:
pInternedName - Character string representing an integer constant.
pType - Type of the constant object to be created; It may be typeShort, typeInt, typeLong, typeLongLong, typeU_short, typeU_int, typeU_Long, typeU_LongLong of SymRoot.
戻り値:
constant object of the type specified by pType.

intObject

public java.lang.Integer intObject(int pIntValue)
Make java.lang.Integer object corresponding to pIntValue.

パラメータ:
pIntValue - Integer representing the constant.
戻り値:
Integer constant object.

floatConst

public FloatConst floatConst(java.lang.String pInternedName,
                             Type pType)
Make constant object corresponding to pInternedName.

パラメータ:
pInternedName - Character string representing the constant.
pType - Type of the constant object to be created; It may be typeFloat, typeDouble, typeLongDouble of SymRoot.
戻り値:
constant object of the type specified by pType.

namedConst

public NamedConst namedConst(java.lang.String pInternedName,
                             int pIndex,
                             Type pType)
Make a constant named as pInternedName.

パラメータ:
pInternedName - Name of Sym whose kind is Sym.KIND_NAMED_CONST to represent the constant.
pIndex - Index to be assigned to the named constant.
pType - Type of the constant to be named; It may be typeChar, typeShort, typeInt, typeU_Char, typeU_short, typeU_int.
戻り値:
the named constant object.

stringConstFromQuotedString

public StringConst stringConstFromQuotedString(java.lang.String pInternedName)
stringConstFromQuotedString Make a string constant (StringConst object) from given string pInternedName that has heading and trailing quote '"'. This method is almost the same as stringConst except that pInternedName has heading and trailing quotes. The string constant is recorded as pure string (peeling off the heading and trailing '"' and processing escape characters by makeStringBody of coins.SourceLanguage) just like stringConst. As for other items, the specifications are the same as stringConst.

パラメータ:
pInternedName - string from which StringConst is to be made; It should have heading and trailing quotes.
戻り値:
the string constant (StringConst object).

makeJavaString

public java.lang.String makeJavaString(java.lang.String pStringBody)
makeJavaString Change the pure string pStringBody to Java String representation adding heading, trailing quotes and escape characters if required.

パラメータ:
pStringBody - String made by makeStringBody of coins.SourceLanguage.
戻り値:
the interned string changed in Java form.

makeCstring

public java.lang.String makeCstring(java.lang.String pStringBody)
makeCstring Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required. Trailing \0 is not added as printable character. See makeCstring of StringConst, and makeCstringWithTrailing0 of Sym.

パラメータ:
pStringBody - String made by makeStringBody of coins.SourceLanguage.
戻り値:
the interned string changed in C form.

makeCstringWithTrailing0

public java.lang.String makeCstringWithTrailing0(java.lang.String pStringBody)
makeCstringWithTrailing0 Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required. Trailing \0 is added as printable character. See makeCstringWithTrailing0 of StringConst.

パラメータ:
pStringBody - String made by makeStringBody of coins.SourceLanguage.
戻り値:
the interned string changed in C form with trailing \0 as printable character; For example, "abc\?d\0" for a pure string abc?d.

defineVar

public Var defineVar(java.lang.String pInternedName,
                     Type pType,
                     Sym pDefinedIn)
defineVar with defined-in parameter Define a variable with name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot). Usage and function are the same as previous defineVar except that this has pDefinedIn parameter.

パラメータ:
pDefinedIn - outer language construct such as subprogram that defines the variable.

baseType

public BaseType baseType(java.lang.String pInternedName,
                         int pTypeKind)
baseType Create an instance of base type. (Usually, it is not necessary to call baseType method because all base types are created in SymRoot.)

パラメータ:
pInternedName - name of the base type ("int", float", etc.).
pTypeKind - type kind defined in Type.java (KIND_INT, KIND_FLOAT, etc.).
戻り値:
the created Type object.

vectorType

public VectorType vectorType(Type pElemType,
                             Exp pElemCountExp)
vectorType with element count given as expression Get the vector type that is composed of element type pElemType and element count pElemCountExp. The lower bound is assumed to be 0. Its name is where, elemCount is integer number represented by pElemCountExp, elemType is the name of type represented by pElemType and 0 is lower bound of index. If a vector type with the same element type, element count and lower bound is found, then it is returned. If not found, then VectorType object is created and returned. The vector type is searched or created in the same symbol table where pElemType is defined.

パラメータ:
pElemType - type of the vector element.
pElemCountExp - expression showing the number of elements; The element count is computed by evaluating this parameter; If the element count is 0 or pElemCountExp is null, FLAG_INCOMPLETE_TYPE is set.
戻り値:
the vector type.

vectorType

public VectorType vectorType(java.lang.String pTypeName,
                             Type pElemType,
                             long pElemCount,
                             long pLowerBound)
vectorType with element count and lower bound given as integer value Get the vector type that is composed of element type pElemType and element count pElemCount, lower bound pLowerBound. Its name is created by makeVectorTypeName in such form as where, elemCount is integer constant represented by pElemCountExp, lowerBound is integer constant represented by pLowerBound, elemType is the name of type represented by pElemType. See makeVectorTypeName below. If a vector type with the same element type, element count and lower bound is found, then it is returned. If not found, then VectorType object is created and returned. The vector type is searched or created in the same symbol table where pElemType is defined.

パラメータ:
pTypeName - Interned name of this vector type; It takes the form where, elemCount is integer number represented by pElemCountExp, lowerBound is integer number represented by pLowerBound, elemType is the name of type represented by pElemType; (See makeVectorTypeName below;) The name may have const or volatile qualifier.
pElemType - type of the vector element.
pElemCount - number of elements in the vector type; If pElemCount is 0, FLAG_INCOMPLETE_TYPE is set.
pLowerBound - Lower bound of the subscript of the vector.
戻り値:
the vector type.

vectorType

public VectorType vectorType(java.lang.String pTypeName,
                             Type pElemType,
                             Exp pElemCountExp,
                             Exp pLowerBoundExp)
vectorType with element count and lower bound as expression Get the vector type that is composed of element type pElemType and element count pElemCountExp, lower bound pLowerBoundExp. Its name is created by makeVectorTypeName in such form as (see makeVecotrTypeName). If a vector type with the same element type and element count is found, then it is returned. If not found, then VectorType object is created and returned. The vector type is searched or created in the same symbol table where pElemType is defined.

パラメータ:
pTypeName - Interned name of this vector type; It takes the form where, elemCount is the expression represented by pElemCountExp, lowerBound is the expression represented by pLowerBound, elemType is the name of type represented by pElemType; (See makeVectorTypeName below;) The name may have const or volatile qualifier.
pElemType - type of the vector element.
pElemCountExp - Expression representing the number of elements in the vector type; The element count is computed by evaluating this parameter; If pElemCount is 0, FLAG_INCOMPLETE_TYPE is set.
pLowerBoundExp - Expression representing the lower bound of the subscript of the vector; The lower bound is computed by evaluating this parameter. If pLowerBoundExp is null, then 0 is assumed as lower bound.
戻り値:
the vector type.

vectorTypeUnfixed

public VectorType vectorTypeUnfixed(Type pElemType,
                                    Exp pLowerBoundExp)
vectorType having unfixed number of element of pElemType. The element count is to be fixed at execution time and at compile time, it is tentatively treated as 0. Its name is . where, elemType is the type represented by pElemType and lowerBound is the expression given by pLowerBoundExp. If a vector type with the same element type, element count and lower bound is found, then it is returned. If not found, then VectorType object is created and returned. The vector type is searched or created in the same symbol table where pElemType is defined. For the VectorType with unfixed element count, getFlag(Sym.FLAG_UNFIXED_SIZE) returns true. If pElemType is unfixed length type, then warning message is issued.

パラメータ:
pElemType - is the type of the vector element.
pLowerBoundExp - is an expression showing the lower bound of subscript.
戻り値:
the vector type.

pointerType

public PointerType pointerType(Type pPointedType,
                               SymTable pSymTable)
pointerType specifying symbol table Get the pointer type that points to an object of type pPointedType. Its name is . If a pointer type with the same pointed type is found, then it is returned. If not found, then PointerType object is created and returned. The pointer type is searched or created in pSymTable.

パラメータ:
pPointedType - type of the object to be pointed.
pSymTable - the symbol table in which the pointer type is searched or created, where, the pointed type should be visible from the symbol table.
戻り値:
the pointer type.

pointerType

public PointerType pointerType(Type pPointedType,
                               long pElemCount)
pointerType with element count Get a PointeType that points to an object of type pPointedType with element count. It represents a an array. This pointer represents a vector whose element count is pElemCount and lower bound is 0. Its name is . Other items are the same to pointerType.

パラメータ:
pPointedType - type of the object to be pointed.
pElemCount - number of elements of the vector represented by the pointer.
戻り値:
the pointer type.

pointerType

public PointerType pointerType(Type pPointedType,
                               long pElemCount,
                               long pLowerBound)
pointerType with element count Get a PointeType that points to an object of type pPointedType with element count and lower bound. It represents a an array. This pointer represents a vector whose element count is pElemCount and lower bound pLowerBound. Its name is . Other items are the same to pointerType.

パラメータ:
pPointedType - type of the object to be pointed.
pElemCount - number of elements of the vector represented by the pointer.
pLowerBound - subscript lower bound of the array represented by the pointer.
戻り値:
the pointer type.

regionType

public RegionType regionType(java.lang.String pRegionNameString,
                             int pStorageClass)
regionType:
  Make an instance of RegionType
     
  in symRoot.symTableRoot.
  Region is a global area shared between subprograms
  and between compile units. A region may have several
  symbol tables containing declarations of variables to be
  allocated in it.
  After all elements has been added to a region in a subprogram,
  finishCurrentRegion of RegionType should be called for the region
  to close the declaration of the region.
  For unnamed region (blank region), regionType is already called in
  SymRoot and can be accessed by symRoot.typeRegion,
  but it is necessary to add elements and call finishCurrentRegion
  when there is unnamed region in given program.
  Processing sequence for defining a region is as follows
    RegionType lRegionType;   // Region type to be defined.
    SymTable lRegionSymTable; // Symbol table to record the
                       // elements declared for the region.
                       // It may be the symbol table local to
                       // the current subprogram.
    Subp lCurrentSubp; // Subprogram that includes the
                       // declaration of the region.
    Var  lRegionVar;   // Aggregate variable that represents
                       // the whole elements declared
                       // in the region.
    Elem lEmem;        // Element declared in the region.
    lRegionType = symRoot.sym.regionType(regionName.intern());
    lRegionSymTable = symRoot.symTableCurrentSubp;
    lRegionType.addSubp(symRoot.subpCurrent, lRegionSymTable);
    // For each declaration of variable to be included in
    // the region do {
      lElem = symRoot.sym.defineElem(....);
      lRegionType.addElemToCurrentRegion(lElem);
    // }
    lRegionType.finishCurrentRegion();
  To use the variables included in the region,
  treat them in the similar way as structure elements:
    lRegionVar = lRegionType.getRegionVar();
    Exp lExp = hirRoot.hir.qualifiedExp(
       hirRoot.hir.varNode(lRegionVar),
       hirRoot.hir.elemNode(lElem));
    // See HIR.java for qualifiedExp.

パラメータ:
pRegionNameString - Interned name of the region;
pStorageClass - give VAR_STATIC or VAR_AUTO of Var interface.
戻り値:
RegionType instance.

symbol

public Sym symbol(java.lang.String pInternedName,
                  Type pType,
                  Sym pDefinedIn)
symbol Create a Sym object of pType. This method is used for creating symbol which can not be created by other factory methods defined in Sym interface. Symbols such as variable, constant, subprogram, label, etc. should not be created by this method but create by other method (corresponding to the class of the symbol) definid in Sym interface.

パラメータ:
pInternedName - name of the symbol to be created.
pType - type of the symbol to be created.
pDefinedIn - owner symbol.
戻り値:
the created symbol object.

derivedSym

public Sym derivedSym()
derivedSym Generate a symbol having the same type and kind as that of this symbol in symTableCurrentSubp, or symTableCurrent if symTableCurrentSubp is null. The name of the generated symbol begins with the name of pSym and ending with one of suffixes _1, _2, _3, ... . The suffix is selected so that the same name does not appear in the symbol table. "this" may be any symbol.

戻り値:
the generated symbol.

makeVectorTypeName

public java.lang.String makeVectorTypeName(Type pElemType,
                                           long pElemCount)
makeVectorTypeName with default lower bound Make a vector type name of the form . where, elemCount is integer number represented by pElemCountExp, elemType is the name of type represented by pElemType. The lower bound is assumed to be 0.

パラメータ:
pElemType - Type of the vector element.
pElemCount - Number of elements in the vector.
戻り値:
the type name interned.

makeVectorTypeName

public java.lang.String makeVectorTypeName(Type pElemType,
                                           long pElemCount,
                                           long pLowerBound)
makeVectorTypeName Make a vector type name of the form . where, elemCount is integer number represented by pElemCount, lowerBound is integer number represented by pLowerBound, elemType is the name of type represented by pElemType.

パラメータ:
pElemType - Type of the vector element.
pElemCount - Number of elements in the vector.
pLowerBound - Lower bound of the subscript of the vector.
戻り値:
the type name interned.

makeVectorTypeName

public java.lang.String makeVectorTypeName(Type pElemType,
                                           Exp pElemCountExp,
                                           long pElemCount,
                                           Exp pLowerBoundExp,
                                           long pLowerBound)
makeVectorTypeName Make a vector type name of the form . If pElemCountExp is ConstNode, then elemCount is a constant value else elemCount is the expression string for pElemCountExp, If pLowerBoundExp is ConstNode, then lowerBound is a constant value else lowerBound is expression string for pLowerBoundExp, elemType is the name of type represented by pElemType. pElemCountExp and pLowerBoundExp may be either VarNode, ConstNode, or (contents VarNode) representing a formal parameter value. // If pElemCountExp/pLowerBoundExp is either VarNode or (contents Varnode) // then elemCountExp/lowerBoundExp take the form of varName_hashCode // where varName is the name string of Var represented by the VarNode, and // hashCode is System.identifyHashCode of the Var.

パラメータ:
pElemType - Type of the vector element.
pElemCountExp - Expression representing the number of elements in the vector, or null.
pElemCount - If pElemCountExp is null, give the number of elements in the vector, else 0 (which is not used).
pLowerBoundExp - Expression representing the lower bound of the subscript of the vector, or null.
pLowerBound - If pLowerBoundExp is null, give the lower bound of the subscript of the vector, else 0 (which is not used).
戻り値:
the type name interned.

makeStructUnionTypeName

public java.lang.String makeStructUnionTypeName(boolean pStruct,
                                                IrList pElemList)
Make a string of or where, Type1, Type2, ... are type name of struct/union element 1, element 2, ... .

パラメータ:
pStruct - true for generating , false for generating
pElemList - list of struct/union elements.
戻り値:
the generated name interned.

makeEnumTypeName

public java.lang.String makeEnumTypeName(IrList pElemList)
Make a string where, name1, name2, ... are the name of enum element 1, element 2, ... , and value1, value2, ... are the value of enum element 1, element 2, ... .

パラメータ:
pElemList - list of enum elements.
戻り値:
the generated string interned.

makeSubpTypeName

public java.lang.String makeSubpTypeName(Type pReturnType,
                                         IrList pParamList,
                                         boolean pOptionalParam,
                                         boolean pPermitAnyParam)
Make a string optionalParam returnType > where, paramType1, paramType2, ... are the type name of parameter 1, parameter 2, ... , and optionalParam is true or false, and returnType is the type name of return value type.

パラメータ:
pReturnType - type of return value.
pParamList - list of parameters.
pOptionalParam - true if optional param is specified, false otherwise.
pPermitAnyParam - is true if any number of parameters of any type are permitted in such case as extern sub(); sub(a); sub(a, b); in old C language style.
戻り値:
the generated string.

getSymKindName

public java.lang.String getSymKindName()
Get the name of the symbol kind of this symbol to be used for compiler debug, etc.

戻り値:
the name of the symbol kind. It may be not interned.

getPureName

public java.lang.String getPureName()
getPureName Get the name of this symbol. If this is a reserved name with preceeding dot ('.'), the dot is also included in the resultant string.

戻り値:
String symbol name.

getNameOrNull

public java.lang.String getNameOrNull(Sym pSym)
getNameOrNull If pSym is not null, return its name, else return null.

パラメータ:
pSym - any symbol or null.
戻り値:
the name of the symbol or "null".intern().

setUniqueNameSym

public void setUniqueNameSym(Sym pUniqueNameSym)
setUniqueNameSym Set the UniqueName symbol corresponding to this symbol.


getOriginalSym

public Sym getOriginalSym()
Get original symbol corresponding to uniqueNameSym if this is a unique name symbol generated by setUniqueNameToAllSym(). If this is not a symbol insymTableUnique, return the symbol itself.

戻り値:
the original symbol.

getOriginalSym

public Sym getOriginalSym(java.lang.String pName)
Get original symbol corresponding to the symbol named pName. pName should be a unique name registered in symTableUnique, if not, then return this.getOriginalSym().

パラメータ:
pName - the name of the symbol (in symTableUnique).
戻り値:
the original symbol.

getDefinedInName

public java.lang.String getDefinedInName()
getDefinedInName Get the name of getDefinedIn(). If getDefinedIn() is null, return "";


remove

public void remove()
remove Remove this symbol. (The symbol instance remains to exist but can not be accessed after removed.)


isRemoved

public boolean isRemoved()
isRemoved

戻り値:
true if this is a remoded symbol, false otherwise.

getInf

public SymInf getInf()
getInf Get additional information (for optimization, parallelization, etc.) of this symbol.

戻り値:
information attached to this symbol, return null if no information is attached.

getOrAddInf

public SymInf getOrAddInf()
getOrAddInf get attached information. If SymInf is not yet attached, blank SymInf is attached and it is returned.


setDefinedFile

public void setDefinedFile(java.lang.String pDefinedFile)
setDefinedFile Set the name of the file defining this symbol. It is not recommended to use this method except in parser.


getDefinedLine

public int getDefinedLine()
getDefinedLine Get the line number of the first declaration for this symbol. The line number is relative within a file defining this symbol.

戻り値:
the line number of statement that defined this symbol; If this is not declared in any source file, then return 0.

setDefinedLine

public void setDefinedLine(int pDefinedLine)
setDefinedLine Set the line number of declaration defining this symbol. The line number is counted within the file get by getDefinedFile(). It is not recommended to use this method except in parser.

パラメータ:
pDefinedLine - line number of declaration defining this symbol.

getDefinedColumn

public int getDefinedColumn()
getDefinedColumn Get the column number of the first declaration for this symbol. The column number indicates the column position of this symbol in the line declaring this symbol.

戻り値:
the name entry of the file that defined this symbol; If this is not declared in any source file, then return 0.

setWork

public void setWork(java.lang.Object pWork)
Set phase-wise work used for arbitrary purpose in each phase. The work may be destroyed by other phases (aliased with others). As for Subp, see getFlowInf(), getOptInf(), getParallelInf(), getRegAllocInf(), getCodeGenInf(), etc. which can hold information that will not be destroyed by other phase.

パラメータ:
pWork - an object to be attached to this symbol; It may contain any information such as Sym, HIR, etc.

getWork

public java.lang.Object getWork()
Get phase-wise work used for arbitrary purpose in each phase. The work may be destroyed by other phases (aliased with others). + @return the object set by setWork.


setDefinedIn

public void setDefinedIn(Sym pDefiningSym)
setDefinedIn Set "definedIn" symbol of this symbol if it is not set by defineUnique, Define, and redefine.

パラメータ:
pDefiningSym - name of the construct that include the definition of this symbol. Anonymous structure or union shuold be named by GenerateVar so as pDefiningSym (and pDefinedIn) can be specified.

setRecordedIn

public void setRecordedIn(SymTable pSymTable)
setRecordedIn Link to the symbol table that recorded this symbol.

パラメータ:
pSymTable - Symbol table that recorded this symbol.

setSymKind

public void setSymKind(int pSymKind)
setSymKind Set the symbol kind of this symbol to pSymKind if current kind is not KIND_OTHER, then the kind is not changed. This method is not recommended to be used execept in the factory methods of Sym.

パラメータ:
pSymKind - kind number to be set. (KIND_TAG, etc.)

setSymType

public void setSymType(Type pSymType)
setSymType Set the type of this symbol. This method is not recommended to be used execept in the factory methods of Sym.

パラメータ:
pSymType - type symbol representing the type of this symbol.

toStringShort

public java.lang.String toStringShort()
toStringShort Get name and index of this symbol in text which is not interned.


toStringDetail

public java.lang.String toStringDetail()
toStringDetail Get detailed attributes of this symbol in text which is not interned.