org.prorefactor.treeparser03
Class TP03Support

java.lang.Object
  extended by org.prorefactor.treeparser03.TP03Support
All Implemented Interfaces:
IConstants

public class TP03Support
extends java.lang.Object
implements IConstants

Provides all functions called by TreeParser03. TreeParser03 does not, itself, define any actions. Instead, it only makes calls to the functions defined in this class.


Field Summary
protected  ProparseLdr parser
           
 java.util.TreeSet targetSet
          The result set - a sorted set of RefactorTarget objects.
 
Fields inherited from interface org.prorefactor.core.IConstants
ABBREVIATED, CONTEXT_QUALIFIER, FALSE, FROM_USER_DICT, FULLTEXT, INLINE_VAR_DEF, NODE_TYPE_KEYWORD, OPERATOR, PROPARSEDIRECTIVE, QUALIFIED_CLASS_INT, QUALIFIED_CLASS_STRING, SOURCENUM, ST_DBTABLE, ST_TTABLE, ST_VAR, ST_WTABLE, STATE2, STATEHEAD, STORETYPE, TO_BE_CUT, TRUE, UNQUALIFIED_FIELD
 
Constructor Summary
TP03Support()
          Construct TP03Support
 
Method Summary
 void blockBegin()
          Called when a Code_block begins.
 void blockEnd()
          Called when a Code_block ends.
 void blockWithLabel(AST theNode)
          Called when a labelled block's BLOCK_LABEL node is encountered.
 void cleanUp()
          Release all Proparse node handles held in "targetSet".
 void define(AST defNode, AST idNode)
          Called when certain types of DEFINE nodes are found.
 void defineEnd()
          Called at the end of a DEFINE statement.
 void fieldRef(AST refAST, AST idNode)
          Called at a Field_ref node.
 void noundo()
          Called when a NO-UNDO node is found.
 void noundoUndoCheck(AST undoNode, org.prorefactor.treeparser03.TP03Support.Block theBlock)
          Raise a warning for variables and parameters which are targetted for refactoring (add NO-UNDO) but which are also assigned within a block which has an UNDO statement after it was assigned.
 void procedure(AST theNode)
          Called when a PROCEDURE statement is encountered.
 void procedureEnd()
          Called at the end of any PROCEDURE.
 void procedureExternal()
          Called if the current procedure is EXTERNAL.
 void proparsedirective(AST ast)
          Deal with PROPARSEDIRECTIVE nodes Only throws antlr RecognitionException for benefit of working with Antlr generated tree parser.
 void statementEnd()
          Deal with end-of-statement.
 void undo()
          Called when an UNDO node is found as an option to DEFINE TEMP-TABLE.
 void undoState(AST undoNode, AST blockLabel)
          Called when an UNDO statement is found.
 void updating(boolean inIsUpdating)
          Called when in an ASSIGN, SET, IMPORT etc, where field assignment is done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetSet

public java.util.TreeSet targetSet
The result set - a sorted set of RefactorTarget objects.


parser

protected ProparseLdr parser
Constructor Detail

TP03Support

public TP03Support()
Construct TP03Support

Method Detail

blockBegin

public void blockBegin()
Called when a Code_block begins.


blockEnd

public void blockEnd()
Called when a Code_block ends.


blockWithLabel

public void blockWithLabel(AST theNode)
Called when a labelled block's BLOCK_LABEL node is encountered.

Parameters:
theNode - The BLOCK_LABEL node.

cleanUp

public void cleanUp()
Release all Proparse node handles held in "targetSet".


define

public void define(AST defNode,
                   AST idNode)
Called when certain types of DEFINE nodes are found.

Parameters:
defNode - The DEFINE node.
idNode - The ID node.

defineEnd

public void defineEnd()
Called at the end of a DEFINE statement.


fieldRef

public void fieldRef(AST refAST,
                     AST idNode)
Called at a Field_ref node.

Parameters:
refAST - The Field_ref node.
idNode - The ID node.

noundo

public void noundo()
Called when a NO-UNDO node is found.


noundoUndoCheck

public void noundoUndoCheck(AST undoNode,
                            org.prorefactor.treeparser03.TP03Support.Block theBlock)
Raise a warning for variables and parameters which are targetted for refactoring (add NO-UNDO) but which are also assigned within a block which has an UNDO statement after it was assigned. We remove the target from the targetSet.

Parameters:
undoNode - The UNDO node.
theBlock - The block which is the subject of the UNDO statement.

procedure

public void procedure(AST theNode)
Called when a PROCEDURE statement is encountered.

Parameters:
theNode - is the PROCEDURE node.

procedureEnd

public void procedureEnd()
Called at the end of any PROCEDURE.


procedureExternal

public void procedureExternal()
Called if the current procedure is EXTERNAL.


proparsedirective

public void proparsedirective(AST ast)
Deal with PROPARSEDIRECTIVE nodes Only throws antlr RecognitionException for benefit of working with Antlr generated tree parser. We parse prolint-nowarn directives the same as Prolint does.


statementEnd

public void statementEnd()
Deal with end-of-statement.


undo

public void undo()
Called when an UNDO node is found as an option to DEFINE TEMP-TABLE.


undoState

public void undoState(AST undoNode,
                      AST blockLabel)
Called when an UNDO statement is found.

Parameters:
undoNode - The UNDO node.
blockLabel - The block label node - might be null.

updating

public void updating(boolean inIsUpdating)
Called when in an ASSIGN, SET, IMPORT etc, where field assignment is done.

Parameters:
inIsUpdating - True at start of updating, false at end of updating.


Copyright © 2008 Joanju Software. All Rights Reserved.