org.prorefactor.treeparser01
Class TP01Action

java.lang.Object
  extended by org.prorefactor.treeparser01.TP01Action
Direct Known Subclasses:
TP01Support

public class TP01Action
extends java.lang.Object

Superclass of empty actions methods for TreeParser01. Subclasses can override and implement any of these methods, which are all called directly by TreeParser01. TP01Support is the default implementation.


Field Summary
protected  ParseUnit parseUnit
           
 
Constructor Summary
TP01Action()
           
 
Method Summary
protected  void addToSymbolScope(java.lang.Object o)
          Called by the tree parser at the end of a DEFINE statement, passing in the new Variable object which is expected now to be added to the current scope.
protected  void blockBegin(AST blockAST)
          Beginning of a block.
protected  void blockEnd()
          End of a block.
protected  void browseRef(AST idAST)
          The ID node in a BROWSE ID pair.
protected  void callBegin(AST callAST)
          Node where a call occurs, such as USER_FUNC or LOCAL_METHOD_REF.
protected  void callEnd()
          Triggered once the call's parameters have been processed.
protected  void canFindBegin(AST canfindAST, AST recordAST)
          The tree parser calls this at the start of a can-find, because it needs to have its own buffer and buffer scope.
protected  void canFindEnd(AST canfindAST)
          Called by the tree parser at the end of a can-find.
protected  void classState(AST classAST)
          Called by the tree parser at the CLASS node.
protected  void clearState(AST headAST)
          Called at the end of a CLEAR statement.
protected  void datasetTable(AST tableAST)
          The RECORD_NAME node for a buffer in a DATASET definition.
protected  void defAs(AST asAST)
          The tree parser calls this at an AS node
protected  void defExtent(AST extentAST)
          Called at an EXTENT node, first child is an expression.
protected  Browse defineBrowse(AST defAST, AST idAST)
          Called at the start of a DEFINE BROWSE statement.
protected  void defineBuffer(AST defAST, AST idAST, AST recAST, boolean init)
          Define a buffer.
protected  void defineBufferForTrigger(AST recAST)
          Define an unnamed buffer which is scoped (symbol and buffer) to the trigger scope/block.
protected  Symbol defineSymbol(int symbolType, AST defAST, AST idAST)
          Called by the tree parser to define anything other than buffers, temp/work tables, and variables/parameters.
protected  void defineTableFieldFinalize(java.lang.Object obj)
          Called by the tree parser at the end of a temp or work table field definition.
protected  java.lang.Object defineTableFieldInitialize(AST idNode)
          Called by the tree parser at the beginning of a temp or work table field definition.
protected  void defineTableLike(AST recNode)
          Called by the tree parser if a LIKE node is encountered in a temp/work table definition.
protected  void defineTemptable(AST defAST, AST idNode)
          Called by the tree parser when a temp-table is defined.
protected  Variable defineVariable(AST defAST, AST idNode)
          Called by the tree parser when a variable is defined.
protected  Variable defineVariable(AST defAST, AST idAST, int dataType)
          Some syntaxes imply a data type without LIKE/AS.
protected  void defineWorktable(AST defAST, AST idNode)
          Called by the tree parser when a work-table is defined.
protected  void defLike(AST likeAST)
          The tree parser calls this at a LIKE node
protected  void field(AST refAST, AST idAST, int contextQualifier, int whichTable)
          Process a Field_ref node.
protected  void fnvExpression(AST exp)
          Action taken in: filenameorvalue: ...
protected  void fnvFilename(AST fn)
          Action taken in: filenameorvalue: FILENAME production
protected  void formItem(AST ast)
          Called from Form_item node
protected  void frameBlockCheck(AST ast)
          Called from DO|REPEAT|FOR blocks.
protected  void frameDef(AST defAST, AST idAST)
          Called at tree parser DEFINE FRAME statement.
protected  void frameEnablingStatement(AST ast)
          This is a specialization of frameInitializingStatement, called for ENABLE|UPDATE|PROMPT-FOR.
protected  void frameInitializingStatement(AST ast)
          This is called at the beginning of a frame affecting statement, with the statement head node.
protected  void frameRef(AST idAST)
          Called for the ID node in a #(FRAME ID) pair.
protected  void frameStatementEnd()
          This is called at the end of a frame affecting statement.
protected  void funcBegin(AST funcAST, AST idAST)
          Called immediately after the ID node in a FUNCTION statement/block.
protected  void funcDef(AST funcAST, AST idAST)
          Called by the tree parser in a function definition immediately before the code block begins.
protected  void funcEnd(AST funcAST)
           
protected  void funcForward(AST idAST)
          Called by the tree parser if a FUNCTION statement is found to be any sort of a function FORWARD, IN, or MAP TO.
 ParseUnit getParseUnit()
           
protected  void lexat(AST fieldRefAST)
          Called at the Field_ref node after a lexical '@' sign in a frame phrase.
protected  void methodBegin(AST methodAST, AST idAST)
          Called by the tree parser at METHOD statement, after method's scope has been created.
protected  void methodEnd(AST methodAST)
           
protected  void paramBind()
          Called if there is a BIND keyword for a parameter.
protected  void paramEnd()
          Called at the end of the syntax for a formal arg or a Call's parameter.
protected  void paramExpression(AST exprAST)
          An expression being passed as a parameter (as part of a call).
protected  void paramForCall(AST directionAST)
          Called with the direction node (BUFFER|INPUT|OUTPUT|INPUTOUTPUT) for a new call arg.
protected  void paramForRoutine(AST directionAST)
          Called with the direction node (BUFFER|INPUT|OUTPUT|INPUTOUTPUT) for a new formal arg.
protected  void paramNoName(AST datatypeAST)
          Called for an unnamed parameter, with the datatype or CLASS node.
protected  void paramProgressType(int progressType)
          Called by the treeparser to set the parameter progressType from default VARIABLE to either TEMPTABLE or DATASET.
protected  void paramSymbol(AST symbolAST)
          Called with the node that is linked to the Symbol for the current WIP parameter.
protected  void procedureBegin(AST p, AST id)
          Called by the tree parser at the beginning of a PROCEDURESTATE rule.
protected  void procedureEnd(AST p)
          Called by the tree parser at the end of a PROCEDURESTATE rule.
protected  void programRoot(AST rootAST)
          Called by the tree parser right off the bat, at the Program_root node
protected  void programTail()
          Called by the tree parser at the end of the program, after Program_tail.
protected  void recordNameNode(AST anode, int contextQualifier)
          Action to take at RECORD_NAME nodes.
protected  void routineReturnDatatype(AST datatypeAST)
          The datatype node or CLASS node for the return of a FUNCTION or METHOD.
protected  void runBegin(AST t)
          Action to take at the start of RUNSTATE.
protected  void runEnd(AST node)
          Action to take at the end of RUNSTATE.
protected  void runInHandle(AST hn)
          Action to take in a RUNSTATE of the form run
protected  void runPersistentSet(AST fld)
          Action to take in RUNSTATE of the form run
protected  void scopeAdd(AST anode)
          Called by the tree parser where a symbol scope needs to be added, in other words, in functions, procedures, and triggers.
protected  void scopeClose(AST scopeRootNode)
          Called by the tree parser immediately after the end of a function, procedure, or trigger block (a symbol scope).
 void setParseUnit(ParseUnit parseUnit)
          It would be unusual to already have a ParseUnit before calling TP01, since TP01 is usually the first tree parser and it (by default) creates its own ParseUnit.
protected  void setSymbol(int symbolType, AST idAST)
          Lookup and assign a symbol to an ID node.
protected  void strongScope(AST anode)
          Create a "strong" buffer scope.
protected  void structorBegin(AST blockAST)
          Constructor or destructor node.
protected  void structorEnd(AST blockAST)
          End of a constructor or destructor.
protected  void viewState(AST headAST)
          Called with the VIEW statement head, after the VIEW branch has been traversed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parseUnit

protected ParseUnit parseUnit
Constructor Detail

TP01Action

public TP01Action()
Method Detail

addToSymbolScope

protected void addToSymbolScope(java.lang.Object o)
Called by the tree parser at the end of a DEFINE statement, passing in the new Variable object which is expected now to be added to the current scope.


blockBegin

protected void blockBegin(AST blockAST)
Beginning of a block.


blockEnd

protected void blockEnd()
End of a block.


browseRef

protected void browseRef(AST idAST)
The ID node in a BROWSE ID pair.


callBegin

protected void callBegin(AST callAST)
Node where a call occurs, such as USER_FUNC or LOCAL_METHOD_REF.


callEnd

protected void callEnd()
Triggered once the call's parameters have been processed.


canFindBegin

protected void canFindBegin(AST canfindAST,
                            AST recordAST)
The tree parser calls this at the start of a can-find, because it needs to have its own buffer and buffer scope.


canFindEnd

protected void canFindEnd(AST canfindAST)
Called by the tree parser at the end of a can-find.


classState

protected void classState(AST classAST)
Called by the tree parser at the CLASS node.


clearState

protected void clearState(AST headAST)
Called at the end of a CLEAR statement.


datasetTable

protected void datasetTable(AST tableAST)
The RECORD_NAME node for a buffer in a DATASET definition.


defAs

protected void defAs(AST asAST)
The tree parser calls this at an AS node


defExtent

protected void defExtent(AST extentAST)
Called at an EXTENT node, first child is an expression.


defLike

protected void defLike(AST likeAST)
The tree parser calls this at a LIKE node


defineBuffer

protected void defineBuffer(AST defAST,
                            AST idAST,
                            AST recAST,
                            boolean init)
Define a buffer. If the buffer is initialized at the same time it is defined (as in a buffer parameter), then parameter init should be true.


defineBrowse

protected Browse defineBrowse(AST defAST,
                              AST idAST)
Called at the start of a DEFINE BROWSE statement.


defineBufferForTrigger

protected void defineBufferForTrigger(AST recAST)
Define an unnamed buffer which is scoped (symbol and buffer) to the trigger scope/block.

Parameters:
anode - The RECORD_NAME node. Must already have the Table symbol linked to it.

defineSymbol

protected Symbol defineSymbol(int symbolType,
                              AST defAST,
                              AST idAST)
Called by the tree parser to define anything other than buffers, temp/work tables, and variables/parameters.


defineTableFieldInitialize

protected java.lang.Object defineTableFieldInitialize(AST idNode)
Called by the tree parser at the beginning of a temp or work table field definition.


defineTableFieldFinalize

protected void defineTableFieldFinalize(java.lang.Object obj)
Called by the tree parser at the end of a temp or work table field definition.


defineTableLike

protected void defineTableLike(AST recNode)
Called by the tree parser if a LIKE node is encountered in a temp/work table definition.


defineTemptable

protected void defineTemptable(AST defAST,
                               AST idNode)
Called by the tree parser when a temp-table is defined.


defineVariable

protected Variable defineVariable(AST defAST,
                                  AST idNode)
Called by the tree parser when a variable is defined.


defineVariable

protected Variable defineVariable(AST defAST,
                                  AST idAST,
                                  int dataType)
Some syntaxes imply a data type without LIKE/AS.


defineWorktable

protected void defineWorktable(AST defAST,
                               AST idNode)
Called by the tree parser when a work-table is defined.


field

protected void field(AST refAST,
                     AST idAST,
                     int contextQualifier,
                     int whichTable)
Process a Field_ref node.

Parameters:
refAST - The Field_ref node.
idAST - The ID node.
contextQualifier - What sort of reference is this? Read? Update? Etc.
-
whichTable - For name resolution - which table must this be a field of? Input 0 for any table, 1 for the lastTableReferenced, 2 for the prevTableReferenced.

fnvFilename

protected void fnvFilename(AST fn)
Action taken in: filenameorvalue: FILENAME production


fnvExpression

protected void fnvExpression(AST exp)
Action taken in: filenameorvalue: ... expression ... production


formItem

protected void formItem(AST ast)
Called from Form_item node


frameBlockCheck

protected void frameBlockCheck(AST ast)
Called from DO|REPEAT|FOR blocks.


frameDef

protected void frameDef(AST defAST,
                        AST idAST)
Called at tree parser DEFINE FRAME statement.


frameEnablingStatement

protected void frameEnablingStatement(AST ast)
This is a specialization of frameInitializingStatement, called for ENABLE|UPDATE|PROMPT-FOR.


frameInitializingStatement

protected void frameInitializingStatement(AST ast)
This is called at the beginning of a frame affecting statement, with the statement head node.


frameStatementEnd

protected void frameStatementEnd()
This is called at the end of a frame affecting statement.


frameRef

protected void frameRef(AST idAST)
Called for the ID node in a #(FRAME ID) pair.


funcBegin

protected void funcBegin(AST funcAST,
                         AST idAST)
Called immediately after the ID node in a FUNCTION statement/block.


funcDef

protected void funcDef(AST funcAST,
                       AST idAST)
Called by the tree parser in a function definition immediately before the code block begins.

Parameters:
funcAST - The FUNCTION node.
idAST - The ID node (the function name).

funcForward

protected void funcForward(AST idAST)
Called by the tree parser if a FUNCTION statement is found to be any sort of a function FORWARD, IN, or MAP TO.

Parameters:
idAST - The ID node (name of the function).

funcEnd

protected void funcEnd(AST funcAST)

getParseUnit

public ParseUnit getParseUnit()

lexat

protected void lexat(AST fieldRefAST)
Called at the Field_ref node after a lexical '@' sign in a frame phrase.


methodBegin

protected void methodBegin(AST methodAST,
                           AST idAST)
Called by the tree parser at METHOD statement, after method's scope has been created.


methodEnd

protected void methodEnd(AST methodAST)

paramBind

protected void paramBind()
Called if there is a BIND keyword for a parameter.


paramEnd

protected void paramEnd()
Called at the end of the syntax for a formal arg or a Call's parameter.


paramExpression

protected void paramExpression(AST exprAST)
An expression being passed as a parameter (as part of a call).


paramForCall

protected void paramForCall(AST directionAST)
Called with the direction node (BUFFER|INPUT|OUTPUT|INPUTOUTPUT) for a new call arg.


paramForRoutine

protected void paramForRoutine(AST directionAST)
Called with the direction node (BUFFER|INPUT|OUTPUT|INPUTOUTPUT) for a new formal arg.


paramNoName

protected void paramNoName(AST datatypeAST)
Called for an unnamed parameter, with the datatype or CLASS node.


paramProgressType

protected void paramProgressType(int progressType)
Called by the treeparser to set the parameter progressType from default VARIABLE to either TEMPTABLE or DATASET.


paramSymbol

protected void paramSymbol(AST symbolAST)
Called with the node that is linked to the Symbol for the current WIP parameter.


procedureBegin

protected void procedureBegin(AST p,
                              AST id)
Called by the tree parser at the beginning of a PROCEDURESTATE rule.


procedureEnd

protected void procedureEnd(AST p)
Called by the tree parser at the end of a PROCEDURESTATE rule.


programRoot

protected void programRoot(AST rootAST)
Called by the tree parser right off the bat, at the Program_root node


programTail

protected void programTail()
Called by the tree parser at the end of the program, after Program_tail.


recordNameNode

protected void recordNameNode(AST anode,
                              int contextQualifier)
Action to take at RECORD_NAME nodes.


routineReturnDatatype

protected void routineReturnDatatype(AST datatypeAST)
The datatype node or CLASS node for the return of a FUNCTION or METHOD.


runBegin

protected void runBegin(AST t)
Action to take at the start of RUNSTATE.


runEnd

protected void runEnd(AST node)
Action to take at the end of RUNSTATE.


runInHandle

protected void runInHandle(AST hn)
Action to take in a RUNSTATE of the form run

in .

Parameters:
hn - - the node for .

runPersistentSet

protected void runPersistentSet(AST fld)
Action to take in RUNSTATE of the form run

persistent set .

Parameters:
fld - - the field node for .

scopeAdd

protected void scopeAdd(AST anode)
Called by the tree parser where a symbol scope needs to be added, in other words, in functions, procedures, and triggers.

Parameters:
anode - The function, procedure, triggers, or on node.

scopeClose

protected void scopeClose(AST scopeRootNode)
Called by the tree parser immediately after the end of a function, procedure, or trigger block (a symbol scope).

Parameters:
scopeRootNode - The function, procedure, triggers, or on node.

setParseUnit

public void setParseUnit(ParseUnit parseUnit)
It would be unusual to already have a ParseUnit before calling TP01, since TP01 is usually the first tree parser and it (by default) creates its own ParseUnit. However, after instantiating TP01, you can assign your own ParseUnit before executing the tree parse.


setSymbol

protected void setSymbol(int symbolType,
                         AST idAST)
Lookup and assign a symbol to an ID node.


strongScope

protected void strongScope(AST anode)
Create a "strong" buffer scope. This is called within a DO FOR or REPEAT FOR statement.

Parameters:
anode - Is the RECORD_NAME node. It must already have the BufferSymbol linked to it.

structorBegin

protected void structorBegin(AST blockAST)
Constructor or destructor node.


structorEnd

protected void structorEnd(AST blockAST)
End of a constructor or destructor.


viewState

protected void viewState(AST headAST)
Called with the VIEW statement head, after the VIEW branch has been traversed.



Copyright © 2008 Joanju Software. All Rights Reserved.