fmrisc.Syntax
Class TypeDeclaration

java.lang.Object
  extended by fmrisc.Syntax.ASTBase
      extended by fmrisc.Syntax.DeclarationBase
          extended by fmrisc.Syntax.TypeDeclaration
All Implemented Interfaces:
AST, Declaration

public final class TypeDeclaration
extends DeclarationBase

Handling of type declarations.


Constructor Summary
TypeDeclaration(TypeDeclIdentifier name, Type type)
          construct type declaration with denoted name and type.
 
Method Summary
 AST accept(ASTVisitor visitor)
          Accept visitor for a visit.
 Identifier getIdentifier()
          returns declaration name
 Symbol getSymbol()
          returns symbol
 Type getType()
          returns declaration type
 TypeDeclIdentifier getTypeDeclIdentifier()
          returns declaration name
 TypeDeclaration instantiate()
          create instantiated copy of declaration
 void printCore(java.io.PrintWriter out)
          Prints text representation of tree on out (without new line termination).
 
Methods inherited from class fmrisc.Syntax.DeclarationBase
print
 
Methods inherited from class fmrisc.Syntax.ASTBase
printParens, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fmrisc.Syntax.AST
printParens, toString
 

Constructor Detail

TypeDeclaration

public TypeDeclaration(TypeDeclIdentifier name,
                       Type type)
construct type declaration with denoted name and type.

Parameters:
name - the declared name
type - the type associated to the name (may be null)
Method Detail

getTypeDeclIdentifier

public TypeDeclIdentifier getTypeDeclIdentifier()
returns declaration name

Returns:
the name

getIdentifier

public Identifier getIdentifier()
returns declaration name

Returns:
the name

getType

public Type getType()
returns declaration type

Returns:
the type (may be null)

instantiate

public TypeDeclaration instantiate()
create instantiated copy of declaration

Returns:
the instantiated copy

printCore

public void printCore(java.io.PrintWriter out)
Prints text representation of tree 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

getSymbol

public Symbol getSymbol()
returns symbol

Returns:
the symbol (null, if not yet determined)

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)