org.prorefactor.treeparser
Class Routine

java.lang.Object
  extended by org.prorefactor.treeparser.Symbol
      extended by org.prorefactor.treeparser.Routine
All Implemented Interfaces:
Xferable, SymbolI

public class Routine
extends Symbol

Represents the definition of a Routine. Is a Symbol - used as an entry in the symbol table. A Routine is a Program_root, PROCEDURE, FUNCTION, or METHOD.


Field Summary
 
Fields inherited from interface org.prorefactor.treeparser.SymbolI
NAME_ORDER
 
Constructor Summary
Routine()
          Only to be used for persistence/serialization.
Routine(java.lang.String name, SymbolScope definingScope, SymbolScope routineScope)
           
 
Method Summary
 void addParameter(Parameter p)
          Called by the tree parser.
 Symbol copyBare(SymbolScope scope)
          Generate a bare-bones copy of this symbol.
 java.lang.String fullName()
          Get the "full" name for this symbol.
 java.util.ArrayList<Parameter> getParameters()
           
 int getProgressType()
          Return TokenTypes: Program_root, PROCEDURE, FUNCTION, or METHOD.
 JPNode getReturnDatatypeNode()
          Null for PROCEDURE, node of the datatype for FUNCTION or METHOD.
 SymbolScope getRoutineScope()
           
 Routine setProgressType(int t)
           
 void setReturnDatatypeNode(JPNode n)
          Set by TreeParser01 for functions and methods.
 void writeXferBytes(DataXferStream out)
          Implement Xferable.
 void writeXferSchema(DataXferStream out)
          Implement Xferable.
 
Methods inherited from class org.prorefactor.treeparser.Symbol
getAllRefsCount, getAsNode, getDefineNode, getIndirectDefineIdNode, getLikeNode, getName, getNumReads, getNumWrites, getScope, isExported, isImported, noteReference, setAsNode, setDefOrIdNode, setLikeNode, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Routine

public Routine()
Only to be used for persistence/serialization.


Routine

public Routine(java.lang.String name,
               SymbolScope definingScope,
               SymbolScope routineScope)
Method Detail

addParameter

public void addParameter(Parameter p)
Called by the tree parser.


copyBare

public Symbol copyBare(SymbolScope scope)
Description copied from class: Symbol
Generate a bare-bones copy of this symbol. Requires the scope to attach it to as the argument.

Specified by:
copyBare in class Symbol

fullName

public java.lang.String fullName()
Description copied from interface: SymbolI
Get the "full" name for this symbol. This is expected to be overridden in subclasses. For example, we might expect "database.buffer.field" to be the return for a field buffer.

Specified by:
fullName in interface SymbolI
Specified by:
fullName in class Symbol
See Also:
Symbol.fullName()

getParameters

public java.util.ArrayList<Parameter> getParameters()

getProgressType

public int getProgressType()
Return TokenTypes: Program_root, PROCEDURE, FUNCTION, or METHOD.

Specified by:
getProgressType in interface SymbolI
Specified by:
getProgressType in class Symbol

getReturnDatatypeNode

public JPNode getReturnDatatypeNode()
Null for PROCEDURE, node of the datatype for FUNCTION or METHOD. For a Class return value, won't be the CLASS node, but the TYPE_NAME node. TODO For 10.1B, anything that uses this might want to look up the fully qualified class name.


getRoutineScope

public SymbolScope getRoutineScope()

setProgressType

public Routine setProgressType(int t)

setReturnDatatypeNode

public void setReturnDatatypeNode(JPNode n)
Set by TreeParser01 for functions and methods.


writeXferBytes

public void writeXferBytes(DataXferStream out)
                    throws java.io.IOException
Implement Xferable.

Specified by:
writeXferBytes in interface Xferable
Overrides:
writeXferBytes in class Symbol
Throws:
java.io.IOException

writeXferSchema

public void writeXferSchema(DataXferStream out)
                     throws java.io.IOException
Implement Xferable.

Specified by:
writeXferSchema in interface Xferable
Overrides:
writeXferSchema in class Symbol
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.