coins.sym
Class ParamImpl

java.lang.Object
  extended bycoins.sym.SymImpl
      extended bycoins.sym.VarImpl
          extended bycoins.sym.ParamImpl
All Implemented Interfaces:
java.lang.Cloneable, FlowAnalSym, HasStringObject, Param, Sym, Sym0, Var

public class ParamImpl
extends VarImpl
implements Param

Param Class Param class (formal parameter class) interface. Anonymous parameter should be assigned a generated name.


Field Summary
protected  boolean fCallByReference
          fCallByReference true if call-by-reference, false if call-by-value.
protected  int fIndex
          Parameter index number
protected  boolean fOptional
          Optional parameter generated for "..." specification
 
Fields inherited from class coins.sym.VarImpl
fDefList, fDefUseList, fOperandSet, fUseList
 
Fields inherited from class coins.sym.SymImpl
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot
 
Fields inherited from interface coins.sym.Var
STORAGECLASS, VAR_AUTO, VAR_REGISTER, VAR_STATIC
 
Fields inherited from interface coins.sym.Sym
KIND_NAME, VISIBILITY
 
Fields inherited from interface 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
 
Constructor Summary
ParamImpl(SymRoot pSymRoot)
           
ParamImpl(SymRoot pSymRoot, java.lang.String pParamName, int pIndex, Sym pDefinedIn)
           
ParamImpl(SymRoot pSymRoot, java.lang.String pParamName, Sym pDefinedIn)
           
 
Method Summary
 Param generateOptionalParam()
           
 long getArrayParamSize()
          get array parameter size.
 int getParamIndex()
          getParamIndex Get parameter index.
 Subp getSubp()
          getSubp
 boolean isCallByReference()
          true if this parameter is call-by-reference, false otherwise.
 boolean isCallByValue()
          true if this parameter is call-by-value, false otherwise.
 boolean isOptionalParam()
          isOptionalParam (##2) See if this is optional parameter generated for "..." specification.
 void markAsCallByReference()
          Mark this parameter as call-by-reference
 void markAsCallByValue()
          Mark this parameter as call-by-value
 void markAsOptional()
          markAsOptional Mark this parameter as optional.
 void setArrayParamSize(long s)
          set array parameter size.
 void setParamIndex(int pIndex)
          setParamIndex Set parameter index.
 
Methods inherited from class coins.sym.VarImpl
addOperand, evaluateAsObject, getDimension, getIndex, getInitialValue, getNext, getOperandSet, getSize, getStorageClass, getVisibility, isSizeEvaluable, resetFlowAnalInf, setIndex, setInitialValue, setNext, setStorageClass, setVisibility, toStringDetail
 
Methods inherited from class coins.sym.SymImpl
bareStringConst, baseType, boolConst, charConst, charConst, charConst, definedType, definedType, defineElem, defineLabel, defineParam, defineRegionVar, defineSubp, defineVar, defineVar, derivedSym, enumType, enumType, floatConst, floatConst, getDefinedColumn, getDefinedFile, getDefinedIn, getDefinedInName, getDefinedLine, getFlag, getInf, getName, getNameOrNull, getNextSym, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getRecordedIn, getSourceInf, getSymKind, getSymKindName, getSymType, getUniqueName, getWork, intConst, intConst, intObject, isGlobal, isHIR, isRemoved, isSym, linkSym, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeExpString, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, namedConst, pointerType, pointerType, pointerType, pointerType, pointerType, print, print, regionType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setFlag, setOriginalSym, setParameters, setRecordedIn, setSourceInf, setSymKind, setSymType, setUniqueNameSym, setWork, stringConst, stringConstFromQuotedString, structType, structType, subpType, subpType, symbol, toString, toStringShort, unionType, unionType, vectorType, vectorType, vectorType, vectorType, vectorTypeUnfixed, vectorTypeUnfixed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface coins.sym.Var
evaluateAsObject, getDimension, getInitialValue, getNext, getSize, getStorageClass, getVisibility, isSizeEvaluable, setInitialValue, setNext, setStorageClass, setVisibility
 
Methods inherited from interface coins.sym.Sym
baseType, boolConst, charConst, defineVar, derivedSym, floatConst, getDefinedColumn, getDefinedInName, getDefinedLine, getInf, getNameOrNull, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getSymKindName, getWork, intConst, intObject, isRemoved, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, pointerType, pointerType, pointerType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setRecordedIn, setSymKind, setSymType, setUniqueNameSym, setWork, stringConstFromQuotedString, symbol, toStringDetail, toStringShort, vectorType, vectorType, vectorType, vectorTypeUnfixed
 
Methods inherited from interface 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
 

Field Detail

fIndex

protected int fIndex
Parameter index number


fOptional

protected boolean fOptional
Optional parameter generated for "..." specification


fCallByReference

protected boolean fCallByReference
fCallByReference true if call-by-reference, false if call-by-value.

Constructor Detail

ParamImpl

public ParamImpl(SymRoot pSymRoot)

ParamImpl

public ParamImpl(SymRoot pSymRoot,
                 java.lang.String pParamName,
                 Sym pDefinedIn)

ParamImpl

public ParamImpl(SymRoot pSymRoot,
                 java.lang.String pParamName,
                 int pIndex,
                 Sym pDefinedIn)
Method Detail

getParamIndex

public int getParamIndex()
getParamIndex Get parameter index. "this" should be a Param (parameter) symbol. See setNextVar(...), DefinedIn( ) which will set the index value.

Specified by:
getParamIndex in interface Param
Returns:
parameter index (1: first parameter, 2: second parameter, 3: third parameter, etc. in DefinedIn( ) subprogram).

setParamIndex

public void setParamIndex(int pIndex)
Description copied from interface: Param
setParamIndex Set parameter index. See setNextVar(...), DefinedIn( ).

Specified by:
setParamIndex in interface Param
Parameters:
pIndex - index value to be set to this parameter.
Returns:
parameter index (1: first parameter, 2: second parameter, : third parameter, etc. in DefinedIn( ) subprogram).

generateOptionalParam

public Param generateOptionalParam()

isOptionalParam

public boolean isOptionalParam()
isOptionalParam (##2) See if this is optional parameter generated for "..." specification. "this" should be a Param (parameter) symbol.

Specified by:
isOptionalParam in interface Param
Returns:
true if this is an optional paramater generated by setOptionalParam in SubpInterface, false otherwise.

markAsOptional

public void markAsOptional()
Description copied from interface: Param
markAsOptional Mark this parameter as optional.

Specified by:
markAsOptional in interface Param

markAsCallByReference

public void markAsCallByReference()
Description copied from interface: Param
Mark this parameter as call-by-reference

Specified by:
markAsCallByReference in interface Param

markAsCallByValue

public void markAsCallByValue()
Description copied from interface: Param
Mark this parameter as call-by-value

Specified by:
markAsCallByValue in interface Param

isCallByReference

public boolean isCallByReference()
Description copied from interface: Param
true if this parameter is call-by-reference, false otherwise.

Specified by:
isCallByReference in interface Param

isCallByValue

public boolean isCallByValue()
Description copied from interface: Param
true if this parameter is call-by-value, false otherwise.

Specified by:
isCallByValue in interface Param

getSubp

public Subp getSubp()
Description copied from interface: Param
getSubp

Specified by:
getSubp in interface Param
Returns:
the subprogram defining this parameter.

getArrayParamSize

public long getArrayParamSize()
Description copied from interface: Param
get array parameter size.

Specified by:
getArrayParamSize in interface Param
Returns:
array parameter size

setArrayParamSize

public void setArrayParamSize(long s)
Description copied from interface: Param
set array parameter size.

Specified by:
setArrayParamSize in interface Param
Parameters:
s - array parameter size