Forums for Groups

IMPORTANT! You can read every forum, but you can only post in a forum if you are member of the 'Organic Group' that owns the forum. See groups for a complete list of Organic Groups on the Hive. Content (forums, pages, blogs, etc) on OE Hive is all organized using a module called 'Organic Groups'. Every Group has its own forum.


Adverts and Commercial Forum

This Forum is for the posting of adverts and commercial materials. This is the only Forum on the Hive where this is allowed. Posting commercial material here is currently free, as long as it is obvious to the Hive editors exactly why the commercial material is of concern to Progress users.


Book Corner discussion

Forum for the Book Corner Group. Review and recommend software industry books.


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