Proparse Group



Parse program which is having table definition

Hi,

i am using a program to parse a 4GL progress code, it works fine when there is no table definition is used but fails if i use a table refrence, gives me below error -

---------------------------
Error (Press HELP to view stack trace)
---------------------------
org.prorefactor.refactor.RefactorException: testparse_table.p:1: Unknown table name: customer
---------------------------
OK Help
---------------------------

i am having sports database connected on editor. below is the code i am using to parse and my pf file is using sports db -


Prolint not loading Proparse.net

Hi,
I need help with using Prolint on Open Edge 11.5 - 64 bit.
I am trying to evaluate Prolint if it can be part of our development system. As I read about it, it looks very promising. Unfortunately I encountered problems with loading propase.net.


Protected

It appears to me that the AST of a subclass does not contain any definitions for protected data members in the superclass.

I am also guessing that there is no Symbol for it either since my version of TokenLister is getting the Symbol for any node of type ID and optionally showing the number of reads and writes and I don't get this with a reference to such a variable or property.

Is there an indication of where it is defined and its properties?


Utilities

BTW, I have documented some of the Proparse utilities which I have been developing as a part of ABL2DB here http://www.oehive.org/node/2294

At present, these are included in the ABL2DB distribution, but they could be packaged separately if there was demand.


Rest of statement

I was thinking that TreeUtils:fullPreproText( mobToken ) might get me the rest of the statement from the specified node forward to the end of the statement, but it seems to only provide the text of the specified token.

Is there some other function that does this or am I going to have to code my own?


Queries

I would expect org.prorefactor.treeparser.Query to have a link to a table(s) that it was a query on, but I don't see that anywhere.

Do I have to get this by parsing the DefineNode?


Blocks, Scope, Buffers, Transactions, Variables, Calls

There are two projects in the queue which I have been looking at and I am having some trouble identifying all the right pieces, so I'm wondering if you can provide some hints.

I have an existing function which reads the block summary at the end of COMPILE LISTING to create tables for the blocks in a compile unit, whether there is a transaction scoped to the block, the buffers scoped to the block, and the frames scoped to the block.


What needs to be fresh?

I have a couple of tools now which were designed to be used on a single compile unit (they are bundled with ABL2DB presently, but I will be documenting and making them separately in the not too distant future). This is helping with James' code base because, when he finds that Proparse has a problem with a particular compile unit, he can just cycle through commenting out blocks of code and running this tool until it parses successfully and thus isolate the problem code (FWIW, at the moment these seem to mostly do with the LIKE and bad table names).


Getting Variable Information from the Symbol table

I am breaking this into a new thread because the issues here are specific to variables. In the same way that I pulled out the buffers from getAllSymbolsDeep(), I have now pulled out the variables and have figured out:
mobSymbol:fullName() and mobSymbol:getName() seem to be the same in all cases.
mobSymbol:getNumReads() and mobSymbol:getNumWrites() are very handy and will save me a lot of work
mobSymbol:isImported() means it is shared, but not new shared
mobSymbol:isExported() means it is new shared or new shared global


Getting summary information without walking the tree

Following up on earlier discussions, I am now trying to get a list of buffers with the following

define variable molBufferList as class java.util.Set no-undo.
define variable mobIterator as class java.util.Iterator no-undo.
define variable mobTableBuffer as class TableBuffer no-undo.

molBufferList = ipobParseUnit:getRootScope():getBufferSet().
mobIterator = molBufferList:iterator().

do while mobIterator:hasNext():
mobTableBuffer = cast( mobIterator:next(), TableBuffer ).

But, this is giving me:


ID => Symbol

John, you have previously suggested in broad terms that when walking the AST and I ran into symbols that linking to the Symbol would provide useful information.

Is it correct that I should expect a node of type ID to have a valid Symbol. i.e.,
if NodeTypes:getTypeName(mobToken:GetType()) = "ID"
then mobCurrentSymbol = mobToken:getSymbol().

Is it also correct that, having obtained such symbol for a shared variable, for example, that
mobCurrentSymbol:getNumReads()
mobCurrentSymbol:getNumWrites()


Another oddity

James has some code:

PROCEDURE DetermineMaximumDemandCharge :
DEFINE INPUT PARAMETER ip-CtpApplicationMeaningType LIKE ICMAS.CtpApplicationMeaningType.CtpApplicationMeaningType NO-UNDO.
DEFINE INPUT PARAMETER ip-Factor AS DECIMAL NO-UNDO.
DEFINE OUTPUT PARAMETER op-Usage AS DECIMAL NO-UNDO.
...
END PROCEDURE.


Proparse Null Pointer Exception

We think we have found a smoking gun for at least some categories of the Null Pointer Exception problem

2 21 FUNCTION fn-SAA-Complete RETURNS LOGICAL
2 22 (BUFFER ib-TIS FOR {&INC-TIS-TABLE}tt-TIS,
2 23 BUFFER ib-SAA FOR {&INC-SAA-TABLE}lb-Inc-SAA-StatusDescID) :

This from the listing to show the resolution of the parameters.

Is buffer arguments to functions something new?


LIKE

We are getting a lot of null pointer exceptions where the call stack points at this code in org.prorefactor.treeparser.Variable.assignAttributesLike(Variable.java:44)

public void assignAttributesLike(Primative likePrim) {
dataType = likePrim.getDataType();
className = likePrim.getClassName();
extent = likePrim.getExtent();
}

where 44 is the call to getDataType(). Does this mean that it is encountering a LIKE definition for a data type that is not defined, i.e., new syntax?


pdbname, ldbname, and alias

From our experience and looking at some of the sample code, it appears to me that Proparse is going to do everything in terms of the ldbname and the pdbname has no significance.

What is not clear to me is what role alias has here. I see the code to define aliases and I am using a modified version of that, but my experience is that aliases are used mostly for things like pointing to multiple DBs as DICTDB.

Does this mean that one should define an alias of DICTDB to the ldbname
which will be DICTDB? Is there a reason to define other aliases?


#
Syndicate content