coins.ffront
Class Token
java.lang.Object
coins.ffront.Token
- All Implemented Interfaces:
- HasConstValue, Node
- public class Token
- extends java.lang.Object
- implements Node, HasConstValue
|
Constructor Summary |
(package private) |
Token(int n,
java.lang.String s)
|
(package private) |
Token(int n,
java.lang.String s,
FirToHir pfHir)
|
(package private) |
Token(int n,
java.lang.String s,
int k)
|
(package private) |
Token(int n,
java.lang.String s,
int k,
FirToHir pfHir)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
fHir
FirToHir fHir
fDeclMgr
DeclManager fDeclMgr
fHirUtil
HirUtility fHirUtil
fTypeUtil
TypeUtility fTypeUtil
Token
Token(int n,
java.lang.String s,
FirToHir pfHir)
Token
Token(int n,
java.lang.String s)
Token
Token(int n,
java.lang.String s,
int k,
FirToHir pfHir)
Token
Token(int n,
java.lang.String s,
int k)
addFHir
public Token addFHir(FirToHir pfHir)
setKind
public Token setKind(int k)
changeLexem
public java.lang.String changeLexem()
copy
public Token copy()
copy
public Token copy(java.lang.String l)
toString
public java.lang.String toString()
- Specified by:
toString in interface Node
print
public void print(int level,
java.lang.String spaces)
- Specified by:
print in interface Node
getKind
public int getKind()
getLexem
public java.lang.String getLexem()
kindName
public java.lang.String kindName()
makeIdentExp
public Exp makeIdentExp()
- Make HIR Exp node from this token which is ident.
- Returns:
- exp
makeExp
public Exp makeExp()
- Make HIR Exp node from this token.
case IDENT: (thisVar = defined var of this token)
case Param:
case complex: complexExp(contentsExp(thisVar))
default: contentsExp(thisVar)
case StmtFuncParam: actual parameter of StmtFuncCall
case complex: complexExp(thisVar)
case ENTRY name: returnVar of this subprogram
default: thisVar
case CONST: ConstNode
- Specified by:
makeExp in interface Node
- Returns:
- HIR Exp.
makeArgAddr
public Exp makeArgAddr(FStmt pCallStmt)
- Make HIR Exp node from this token as a call-by-address parameter in pCallStmt.
case IDENT: (thisVar = defined var of this token)
case Param: thisVar
default: address of thisVar
case LABEL: add this to pCallStmt's label list and return null.
case CONST: address of temp ( temp = this )
- Specified by:
makeArgAddr in interface Node
- Parameters:
pCallStmt - a call statement or a function call expression
- Returns:
- call-by-address parameter.
dp
void dp(java.lang.String str)
getConstValue
public FNumber getConstValue()
- Return this token value as integer if it's enable
ex) int_const node, real_const node, and so on.
- Specified by:
getConstValue in interface HasConstValue
getLineNo
public int getLineNo()
- Returns:
- line no of this token.