fmrisc.Syntax
Class TypedIdentifier

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

public final class TypedIdentifier
extends ASTBase

Handling of typed identifiers.


Constructor Summary
TypedIdentifier(ValueDeclIdentifier identifier, Type type)
          construct typed identifier from identifier and type.
 
Method Summary
 AST accept(ASTVisitor visitor)
          Accept visitor for a visit.
 ValueDeclIdentifier getIdentifier()
          returns identifier name
 Type getType()
          returns identifier type
 TypedIdentifier instantiate()
          create instantiated copy of identifier
 void print(java.io.PrintWriter out)
          Prints text representation.
 void printCore(java.io.PrintWriter out)
          Prints text representation on out (without new line termination).
 void resetSubstitution()
          reset substitution field in identifier
 void setSubstitution(TypedIdentifier substitution)
          set substitution expression for instantiation
 
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

TypedIdentifier

public TypedIdentifier(ValueDeclIdentifier identifier,
                       Type type)
construct typed identifier from identifier and type.

Parameters:
identifier - the identifier
type - its type
Method Detail

getIdentifier

public ValueDeclIdentifier getIdentifier()
returns identifier name

Returns:
the identifier name

getType

public Type getType()
returns identifier type

Returns:
the identifier type

instantiate

public TypedIdentifier instantiate()
create instantiated copy of identifier

Returns:
the substitution

setSubstitution

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

Parameters:
substitution - the substitution expression

resetSubstitution

public void resetSubstitution()
reset substitution field in identifier


printCore

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

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

print

public void print(java.io.PrintWriter out)
Prints text representation. Overrides ASTBase.print such that parentheses are never printed around typed identifiers.

Specified by:
print in interface AST
Overrides:
print in class ASTBase
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).