fmrisc.Syntax
Class ValueDeclIdentifier

java.lang.Object
  extended by fmrisc.Syntax.ASTBase
      extended by fmrisc.Syntax.Identifier
          extended by fmrisc.Syntax.ValueDeclIdentifier
All Implemented Interfaces:
AST

public final class ValueDeclIdentifier
extends Identifier

Handling of identifiers used in value declarations


Constructor Summary
ValueDeclIdentifier(java.lang.String name)
          construct identifier from name
 
Method Summary
 AST accept(ASTVisitor visitor)
          Accept visitor for a visit.
 ValueDeclIdentifier getSubstitution()
          returns substitution identifier for instantiation
 ValueSymbol getSymbol()
          returns value symbol
 java.lang.String getUniqueName()
          returns unique name of identifier
 ValueDeclIdentifier instantiate()
          returns instantiated copy of identifier
 boolean isReferenced()
          check whether substitution was referenced
 void makeNameUnique(UniqueNameTable table)
          Replace name of identifier by unique name derived from table.
 void print(java.io.PrintWriter out)
          Prints text representation on out (without new line termination).
 void printCore(java.io.PrintWriter out)
          Prints text representation on out (without new line termination).
 void resetSubstitution()
          reset substitution field
 void setSubstitution(ValueDeclIdentifier substitution)
          set substitution expression for instantiation
 
Methods inherited from class fmrisc.Syntax.Identifier
getName, printPriority, setName
 
Methods inherited from class fmrisc.Syntax.ASTBase
printParens, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueDeclIdentifier

public ValueDeclIdentifier(java.lang.String name)
construct identifier from name

Parameters:
name - the text representation of the identifier
Method Detail

makeNameUnique

public void makeNameUnique(UniqueNameTable table)
Replace name of identifier by unique name derived from table. This change is automatically propagated to all references to this identifier.

Parameters:
table - the name table to be used for making the name unique

getUniqueName

public java.lang.String getUniqueName()
returns unique name of identifier

Returns:
the unique name of the identifier

getSymbol

public ValueSymbol getSymbol()
returns value symbol

Returns:
the value symbol

getSubstitution

public ValueDeclIdentifier getSubstitution()
returns substitution identifier for instantiation

Returns:
the substitution identifier

setSubstitution

public void setSubstitution(ValueDeclIdentifier substitution)
set substitution expression for instantiation

Parameters:
substitution - the substitution expression

isReferenced

public boolean isReferenced()
check whether substitution was referenced

Returns:
true iff substitution was referenced

resetSubstitution

public void resetSubstitution()
reset substitution field


instantiate

public ValueDeclIdentifier instantiate()
returns instantiated copy of identifier

Returns:
the copy of the identifier

printCore

public void printCore(java.io.PrintWriter out)
Prints text representation on out (without new line termination).

Specified by:
printCore in interface AST
Overrides:
printCore in class Identifier
Parameters:
out - the stream on which the text is written

print

public void print(java.io.PrintWriter out)
Prints text representation on out (without new line termination). Overrides ASTBase.print such that parentheses are never printed around the number.

Specified by:
print in interface AST
Overrides:
print in class Identifier
Parameters:
out - the stream on which the text is written

accept

public AST accept(ASTVisitor visitor)
Accept visitor for a visit.

Parameters:
visitor - the visitor who is accepted by this node.
Returns:
the result of the visit (may be null).