org.prorefactor.treeparser
Class SymbolScopeRoot

java.lang.Object
  extended by org.prorefactor.treeparser.SymbolScope
      extended by org.prorefactor.treeparser.SymbolScopeRoot
All Implemented Interfaces:
Xferable
Direct Known Subclasses:
SymbolScopeSuper

public class SymbolScopeRoot
extends SymbolScope

A ScopeRoot object is created for each compile unit, and it represents the program (topmost) scope. For classes, it is the class scope, but it may also have a super class scope by way of inheritance.


Field Summary
 
Fields inherited from class org.prorefactor.treeparser.SymbolScope
allSymbols, bufferMap, callList, childScopes, fieldLevelWidgetMap, parentScope, rootBlock, rootScope, routineMap, typeMap, unnamedBuffers, variableMap
 
Constructor Summary
SymbolScopeRoot()
           
 
Method Summary
 void addTableDefinitionIfNew(Table table)
           
 void assignSuper(SymbolScopeRoot superScope)
          Assign a super (inherited) class scope to this class scope.
 TableBuffer defineTable(java.lang.String name, int type)
          Define a temp or work table.
 FieldBuffer defineTableField(java.lang.String name, TableBuffer buffer)
          Define a temp or work table field
 FieldBuffer defineTableFieldDelayedAttach(java.lang.String name, TableBuffer buffer)
          Define a temp or work table field.
 SymbolScopeSuper generateSymbolScopeSuper()
          Generate "bare" symbols and SymbolScopeSuper from this scope's PUBLIC|PROTECTED members.
 java.lang.String getClassName()
          Valid only if the parse unit is a CLASS.
 TableBuffer getLocalTableBuffer(Table table)
           
 java.util.Map getRoutineMap()
           
 Table lookupTableDefinition(java.lang.String name)
          Lookup a temp or work table definition in this scope.
protected  Field lookupUnqualifiedField(java.lang.String name)
          Lookup an unqualified temp/work table field name.
 void setClassName(java.lang.String s)
           
 void writeXferBytes(DataXferStream out)
          Implement Xferable.
 void writeXferSchema(DataXferStream out)
          Implement Xferable.
 
Methods inherited from class org.prorefactor.treeparser.SymbolScope
add, add, add, add, add, addScope, defineBuffer, depth, getAllSymbols, getAllSymbols, getAllSymbolsDeep, getAllSymbolsDeep, getBufferSet, getBufferSymbol, getCallList, getChildScopes, getChildScopesDeep, getParentScope, getRootBlock, getRootScope, getUnnamedBuffer, getVariables, hasRoutine, isActiveIn, lookupBuffer, lookupDataset, lookupDatasource, lookupFieldLevelWidget, lookupQuery, lookupRoutine, lookupStream, lookupSymbol, lookupSymbolLocally, lookupTableOrBufferSymbol, lookupTempTable, lookupVariable, lookupWidget, registerCall, setRootBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolScopeRoot

public SymbolScopeRoot()
Method Detail

addTableDefinitionIfNew

public void addTableDefinitionIfNew(Table table)

assignSuper

public void assignSuper(SymbolScopeRoot superScope)
Assign a super (inherited) class scope to this class scope.


defineTable

public TableBuffer defineTable(java.lang.String name,
                               int type)
Define a temp or work table.

Parameters:
name - The name, with mixed case as in DEFINE node.
type - IConstants.ST_TTABLE or IConstants.ST_WTABLE.
Returns:
A newly created BufferSymbol for this temp/work table.

defineTableField

public FieldBuffer defineTableField(java.lang.String name,
                                    TableBuffer buffer)
Define a temp or work table field


defineTableFieldDelayedAttach

public FieldBuffer defineTableFieldDelayedAttach(java.lang.String name,
                                                 TableBuffer buffer)
Define a temp or work table field. Does not attach the field to the table. That is expected to be done in a separate step.


generateSymbolScopeSuper

public SymbolScopeSuper generateSymbolScopeSuper()
Generate "bare" symbols and SymbolScopeSuper from this scope's PUBLIC|PROTECTED members.


getClassName

public java.lang.String getClassName()
Valid only if the parse unit is a CLASS. Returns null otherwise.


getLocalTableBuffer

public TableBuffer getLocalTableBuffer(Table table)

lookupTableDefinition

public Table lookupTableDefinition(java.lang.String name)
Lookup a temp or work table definition in this scope. Unlike most other lookup functions, this one has nothing to do with 4gl semantics, buffers, scopes, etc. This just looks up the raw Table definition for a temp or work table.

Returns:
null if not found

lookupUnqualifiedField

protected Field lookupUnqualifiedField(java.lang.String name)
Lookup an unqualified temp/work table field name. Does not test for uniqueness. That job is left to the compiler. (In fact, anywhere this is run, the compiler would check that the field name is also unique against schema tables.) Returns null if nothing found.


getRoutineMap

public java.util.Map getRoutineMap()
Returns:
a Collection containing all Routine objects defined in this RootSymbolScope.

setClassName

public void setClassName(java.lang.String s)

writeXferBytes

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

Specified by:
writeXferBytes in interface Xferable
Overrides:
writeXferBytes in class SymbolScope
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 SymbolScope
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.