Namespace: Consultingwerk.Studio.Refactor.Callgraph
Class 
CallgraphCreateParser Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.Studio.Proparse.NodeWalker.INodeAction

File:CallgraphCreateParser
Purpose:This class implements the INodeAction interface to create an
eCall record for a callgraph, it is used by Callgraph:create.
Author(s):Sebastian Wandel / Consultingwerk Ltd.
Created:Wed Jul 15 16:48:11 CEST 2020



Top Method Summary
Options Name Purpose
- LOGICAL CallAlreadyExists (character, character) Checks whether a call from a routine to another already exists
- CHARACTER EvaluateExpressionType (JPNode) Returns a type for an arithmetic expression
- CHARACTER FindFileByTypename (character, JPNode) Helper method that returns the filename for a given typename, finds USING-statements by JPNode
- CHARACTER FindInSuper (character, logical) Helper method that searches for a procedure name in dsCallgraphSuper and returns its RelativeFileName.
- CHARACTER FindMatchForRoutineWithUnknownArgument (character, character) Helper Method that looks for a routine in a given program and returns its RoutineGuid.
- org.prorefactor.nodetypes.BlockNode FindParentBlockNode (JPNode) Finds the next BlockNode, including poNode
- org.prorefactor.treeparser.Variable FindVariable (character, SymbolScope) Helper method that finds a Variable in a given scope
- CHARACTER GetBlock (integer, character) Returns the guid of the inner-most block containing a given NodeNum
- CHARACTER GetBlockEntry (integer, character) Constructs an entry for eCall.Blocks
- CHARACTER GetBlockEntry (integer, character, character) Adds an entry to eCall.Blocks
# CHARACTER GetHandleValue (JPNode) Looks for the name of the file referenced by a handle for a RUN procedure in handle call
- CHARACTER GetParameterList (JPNode) Constructs and returns a parameterlist for calls, starting at the LEFTPAREN node
- CHARACTER GetParameterType (JPNode) Returns the type of a parameter, given its direction node
- CHARACTER GetReturnType (JPNode) Helper method that returns the filename of the return-type of a method
- CHARACTER GetRoutineParameters (character) Helper method that returns an array with the parameters from a routine-name
- CHARACTER GetRunIn (JPNode) Helpermethod that returns the name of the file a procedure is run in
- CHARACTER GetSuperclass (JPNode) Helper method that returns the name of the superclass to a JPNode's file
- CHARACTER GetTextContent (JPNode) Returns the text of a Node and its children
- CHARACTER GetTopNodeFileName (JPNode) Helper method that returns the filename of a given nodes topmost parent
- org.prorefactor.core.JPNode GetTopSibling (JPNode) Helper method that returns the first sibling of a given JPNode
- CHARACTER GetType (JPNode) Helper method that returns the filename of the type of a Property-Getter-Node
- LOGICAL GetUsing (JPNode, table) Helper method that populates the eUsing temp-table from a given JPNode's tree
- org.prorefactor.treeparser.Variable GetVariable (character, JPNode) Helper method that gets a Variable defined in a JPNodes scope
# org.prorefactor.treeparser.Variable GetVariable (JPNode, character) Looks for a Variable with a given name from a given nodes scope up
+ LOGICAL ProcessNode (JPNode) Implementation of INodeAction:ProcessNode
# LOGICAL ProcessProperty (JPNode, character) Processes an ID-node to find property getter/setter calls
- CHARACTER RoutineNameWithoutParameter (character) Helper method that returns the name part of a given routine-name
- CHARACTER TypeOf (JPNode) Helper method that returns the name of the file for e given node
- CHARACTER Unquote (character) Helper method that removes quotes from strings

Top Constructor Summary
Options Name Purpose
+ CallgraphCreateParser (dataset, dataset) Constructor that receives an object for the callback and the datasets which it binds to its own reference-only datasets.
+ CallgraphCreateParser (dataset, dataset, ICallCallback) Constructor that receives an object for the callback and the datasets which it binds to its own reference-only datasets.
+ CallgraphCreateParser (dataset, dataset, ICallCallback, ICustomRunStatementParser)
+ CallgraphCreateParser (dataset, dataset, ICustomRunStatementParser) Constructor that receives an object for the callback and the datasets which it binds to its own reference-only datasets.


Method Detail
Top

PRIVATE LOGICAL CallAlreadyExists (character, character)

Purpose: Checks whether a call from a routine to another already exists
Notes:

Parameters:
pcRoutineGuid CHARACTER
Guid for the routine with the eCall record
pcTargetGuid CHARACTER
Guid for the called routine
Returns LOGICAL
TRUE/FALSE whether the call exists
Top

PRIVATE CHARACTER EvaluateExpressionType (JPNode)

Purpose: Returns a type for an arithmetic expression
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
Node with the first element (number or operator) of the expression
Returns CHARACTER
Type (INTEGER, INT64 or DECIMAL) of the returned value
Top

PRIVATE CHARACTER FindFileByTypename (character, JPNode)

Purpose: Helper method that returns the filename for a given typename, finds USING-statements by JPNode
Notes:

Parameters:
pcTypename CHARACTER
The name of the type whose filename is sought
poNode org.prorefactor.core.JPNode
JPNode in whose tree's the USING-statements are used
Returns CHARACTER
The filename of pcTypename or ? if not found
Top

PRIVATE CHARACTER FindInSuper (character, logical)

Purpose: Helper method that searches for a procedure name in dsCallgraphSuper and returns its RelativeFileName.
Notes: The eProgramSuper record and its children can optionally be copied to dsCallgraph.

Parameters:
pcName CHARACTER
Name of a routine call that may be defined in a super procedure
plCopyToDS LOGICAL
TRUE to also copy records from dsCallgraphSuper to dsCallgraph, FALSE to just find the superprocedure
Returns CHARACTER
RelativeFileName of the super-procedure or ? if none is found
Top

PRIVATE CHARACTER FindMatchForRoutineWithUnknownArgument (character, character)

Purpose: Helper Method that looks for a routine in a given program and returns its RoutineGuid.
Notes: The sought method is also found if any of the parameters are unknown (set to _?_ to avoid
parameters of unknown type).

Parameters:
pcInternalName CHARACTER
Name of the routine being called with the parameterlist
pcExternalName CHARACTER
Name of the file that the routine is called in
Returns CHARACTER
The found eRoutine.RoutineGuid
Top

PRIVATE org.prorefactor.nodetypes.BlockNode FindParentBlockNode (JPNode)

Purpose: Finds the next BlockNode, including poNode
Notes: If poNode is a block node poNode is returned.

Parameters:
poNode org.prorefactor.core.JPNode
The node from which the search starts
Returns org.prorefactor.nodetypes.BlockNode
The next BlockNode
Top

PRIVATE org.prorefactor.treeparser.Variable FindVariable (character, SymbolScope)

Purpose: Helper method that finds a Variable in a given scope
Notes:

Parameters:
pcName CHARACTER
The name of the sought variable
poScope org.prorefactor.treeparser.SymbolScope
The scope in which the variable is sought
Returns org.prorefactor.treeparser.Variable
The Variable or ? if it was not found
Top

PRIVATE CHARACTER GetBlock (integer, character)

Purpose: Returns the guid of the inner-most block containing a given NodeNum
Notes:

Parameters:
piNodeNum INTEGER
The given NodeNum
pcBlockGuid CHARACTER
Guid of the block from which the search starts
Returns CHARACTER
The guid of the inner-most block containing piNodeNum
Top

PRIVATE CHARACTER GetBlockEntry (integer, character)

Purpose: Constructs an entry for eCall.Blocks
Notes:

Parameters:
piNodeNum INTEGER
The NodeNum of the call
pcRoutineGuid CHARACTER
The guid of the routine from which this call came
Returns CHARACTER
An entry for eCall.Blocks with NodeNum, guid for a record and the name of the table the guid belongs to
Top

PRIVATE CHARACTER GetBlockEntry (integer, character, character)

Purpose: Adds an entry to eCall.Blocks
Notes:

Parameters:
piNodeNum INTEGER
The NodeNum of the call
pcRoutineGuid CHARACTER
The guid of the routine from which this call came
pcBlocks CHARACTER
The current eCall.Blocks content
Returns CHARACTER
The appended eCall.Blocks
Top

PROTECTED CHARACTER GetHandleValue (JPNode)

Purpose: Looks for the name of the file referenced by a handle for a RUN procedure in handle call
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The Run-node
Returns CHARACTER
The filename if available or '?'
Top

PRIVATE CHARACTER GetParameterList (JPNode)

Purpose: Constructs and returns a parameterlist for calls, starting at the LEFTPAREN node
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The LEFTPAREN node of the parameterlist
Returns CHARACTER
The parameterlist with direction and type enclosed by () or just () if there were no parameters
Top

PRIVATE CHARACTER GetParameterType (JPNode)

Purpose: Returns the type of a parameter, given its direction node
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The direction node of the parameter (INPUT, OUTPUT, INPUTOUTPUT)
Returns CHARACTER
The type of the parameter
Top

PRIVATE CHARACTER GetReturnType (JPNode)

Purpose: Helper method that returns the filename of the return-type of a method
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
JPNode with a method-call
Returns CHARACTER
Name of the file in which the method is defined or ? if it was not found
Top

PRIVATE CHARACTER GetRoutineParameters (character)

Purpose: Helper method that returns an array with the parameters from a routine-name
Notes:

Parameters:
pcRoutine CHARACTER
The routine name
Returns CHARACTER
Array of parameters from the routine-name, with directions
Top

PRIVATE CHARACTER GetRunIn (JPNode)

Purpose: Helpermethod that returns the name of the file a procedure is run in
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
JPNode of the RUN statement
Returns CHARACTER
The filename or ? if it was not found
Top

PRIVATE CHARACTER GetSuperclass (JPNode)

Purpose: Helper method that returns the name of the superclass to a JPNode's file
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The JPNode in whose tree the INHERITS node is sought
Returns CHARACTER
The filename of the superclass or ? if none was found
Top

PRIVATE CHARACTER GetTextContent (JPNode)

Purpose: Returns the text of a Node and its children
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The JPNode whose text is returned
Returns CHARACTER
The Text of poNode and its children
Top

PRIVATE CHARACTER GetTopNodeFileName (JPNode)

Purpose: Helper method that returns the filename of a given nodes topmost parent
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The node from where to start
Returns CHARACTER
The filename of poNodes topmost parent
Top

PRIVATE org.prorefactor.core.JPNode GetTopSibling (JPNode)

Purpose: Helper method that returns the first sibling of a given JPNode
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
JPNode whose first sibling is sought
Returns org.prorefactor.core.JPNode
The first sibling of poNode
Top

PRIVATE CHARACTER GetType (JPNode)

Purpose: Helper method that returns the filename of the type of a Property-Getter-Node
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
JPNode in which a Property is read
Returns CHARACTER
Name of the file for the type of property or ? if it was not found
Top

PRIVATE LOGICAL GetUsing (JPNode, table)

Purpose: Helper method that populates the eUsing temp-table from a given JPNode's tree
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
JPNode whose tree is used to populate the temp-table
eUsing TEMP-TABLE eUsing
The temp-table being populated
Returns LOGICAL
True if successful, else false
Top

PRIVATE org.prorefactor.treeparser.Variable GetVariable (character, JPNode)

Purpose: Helper method that gets a Variable defined in a JPNodes scope
Notes:

Parameters:
pcName CHARACTER
The name of the sought variable
poNode org.prorefactor.core.JPNode
The JPNode whose scope the variable is sought in
Returns org.prorefactor.treeparser.Variable
The Variable or ? if it was not found
Top

PROTECTED org.prorefactor.treeparser.Variable GetVariable (JPNode, character)

Purpose: Looks for a Variable with a given name from a given nodes scope up
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
The node used to find the scope
pcName CHARACTER
The name of the sought variable
Returns org.prorefactor.treeparser.Variable
The Variable if it was found
Top

PUBLIC LOGICAL ProcessNode (JPNode)

Purpose: Implementation of INodeAction:ProcessNode
Notes: If the current Node has a call object an eCall row is created for it

Parameters:
poNode org.prorefactor.core.JPNode
The JPNode to process
Returns LOGICAL
Logical value indicating if the process should be cancelled
Top

PROTECTED LOGICAL ProcessProperty (JPNode, character)

Purpose: Processes an ID-node to find property getter/setter calls
Notes:

Parameters:
poNode org.prorefactor.core.JPNode
JPNode of type ID
pcParentGuid CHARACTER
Guid of the routine in which the call resides
Returns LOGICAL
Logical value indicating if the process should be cancelled
Top

PRIVATE CHARACTER RoutineNameWithoutParameter (character)

Purpose: Helper method that returns the name part of a given routine-name
Notes:

Parameters:
pcName CHARACTER
Routine name
Returns CHARACTER
Name of the routine without parameter-list
Top

PRIVATE CHARACTER TypeOf (JPNode)

Purpose: Helper method that returns the name of the file for e given node
Notes: Recognizes CASTs, variables, method-invocations, properties and THIS-OBJECT

Parameters:
poNode org.prorefactor.core.JPNode
JPNode whose type is sought
Returns CHARACTER
Name of the file for or Typename
Top

PRIVATE CHARACTER Unquote (character)

Purpose: Helper method that removes quotes from strings
Notes:

Parameters:
pcText CHARACTER
Quoted string
Returns CHARACTER
Unquoted string


Constructor Detail
Top

PUBLIC CallgraphCreateParser (dataset, dataset)

Purpose: Constructor that receives an object for the callback and the datasets which it binds to its own reference-only datasets.
Notes:

Parameters:
dsCallgraph DATASET dsCallgraph
ProDataSet containing the populated eProgram and eRoutine tables, for which the eCall rows are created
dsCallgraphSuper DATASET dsCallgraphSuper
ProDataSet populated with the known session-super-procedures
Top

PUBLIC CallgraphCreateParser (dataset, dataset, ICallCallback)

Purpose: Constructor that receives an object for the callback and the datasets which it binds to its own reference-only datasets.
Notes:

Parameters:
dsCallgraph DATASET dsCallgraph
ProDataSet containing the populated eProgram and eRoutine tables, for which the eCall rows are created
dsCallgraphSuper DATASET dsCallgraphSuper
ProDataSet populated with the known session-super-procedures
poCallback Consultingwerk.Studio.Refactor.Callgraph.ICallCallback
Object that implements the ICallCallback interface
Top

PUBLIC CallgraphCreateParser (dataset, dataset, ICallCallback, ICustomRunStatementParser)

Purpose:
Notes:

Parameters:
dsCallgraph DATASET dsCallgraph
ProDataSet containing the populated eProgram and eRoutine tables, for which the eCall rows are created
dsCallgraphSuper DATASET dsCallgraphSuper
ProDataSet populated with the known session-super-procedures
poCallback Consultingwerk.Studio.Refactor.Callgraph.ICallCallback
Object that implements the ICallCallback interface
poCustomParser Consultingwerk.Studio.Refactor.Callgraph.ICustomRunStatementParser
Custom parser for RUN statements
Top

PUBLIC CallgraphCreateParser (dataset, dataset, ICustomRunStatementParser)

Purpose: Constructor that receives an object for the callback and the datasets which it binds to its own reference-only datasets.
Notes:

Parameters:
dsCallgraph DATASET dsCallgraph
ProDataSet containing the populated eProgram and eRoutine tables, for which the eCall rows are created
dsCallgraphSuper DATASET dsCallgraphSuper
ProDataSet populated with the known session-super-procedures
poCustomParser Consultingwerk.Studio.Refactor.Callgraph.ICustomRunStatementParser
Custom parser for RUN statements


ProDataset Detail

ProDataset dsCallgraph

Member tables: eProgram, eRoutine, eBlock, eCall

ProDataset dsCallgraphSuper

Member tables: eProgramSuper, eRoutineSuper, eBlockSuper, eCallSuper


Temp-Table Detail

Temp-Table eBlock

Defined in:

Temp-Table eBlockSuper

Defined in:

Temp-Table eCall

Defined in:

Temp-Table eCallSuper

Defined in:

Temp-Table eProgram

Defined in:

Temp-Table eProgramSuper

Defined in:

Temp-Table eRoutine

Defined in:

Temp-Table eRoutineSuper

Defined in:

Temp-Table eUsing

Defined in:


©2006-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       15.04.2024 06:16:11