fmrisc.Syntax
Class Identifier

java.lang.Object
  extended by fmrisc.Syntax.ASTBase
      extended by fmrisc.Syntax.Identifier
All Implemented Interfaces:
AST
Direct Known Subclasses:
FormulaDeclIdentifier, Reference, TypeDeclIdentifier, ValueDeclIdentifier

public abstract class Identifier
extends ASTBase

Handling of identifiers.


Constructor Summary
Identifier(java.lang.String name)
          construct identifier from name
 
Method Summary
 java.lang.String getName()
          returns name of identifier
 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 printPriority(int treshold, java.io.PrintWriter out)
          print expression, use parentheses if priority is greater than treshold
 void setName(java.lang.String name)
          set name of identifier
 
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
accept
 

Constructor Detail

Identifier

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

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

getName

public java.lang.String getName()
returns name of identifier

Returns:
the identifier name

setName

public void setName(java.lang.String name)
set name of identifier

Parameters:
name - the identifier name

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 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 ASTBase
Parameters:
out - the stream on which the text is written

printPriority

public void printPriority(int treshold,
                          java.io.PrintWriter out)
print expression, use parentheses if priority is greater than treshold

Parameters:
treshold - priority level of enclosing expression
out - writer to print expression on