Proparse discussion


Statement in else missing End Statement

This parses OK using OpenEdge 11.5 but seems to hang ProParse, likely due to the missing '.' in the else?:

------- begin --------

/* an if statement with a missing end of statement marker in the else */
if vSharedVariable = “Some value” then
run program1.p.
else
run program2.p

------- end --------

Regards,

-djm


CAN-FIND

I'm not quite certain why this particular variation of CAN-FIND doesn't parse, but I get:

org.prorefactor.refactor.RefactorException: can-find.
p:7:8: unexpected token: CAN-FIND

However a lot of other instances of can-find do seem to parse just fine.
Corresponding sample below & as an attachment.

================ can-find.p ================

/*------------------------------------------------------------------------
File : can-find.p
Purpose : demonstrate a parsing error using CAN-FIND


nested include with {&*}

This one is a little esoteric but impacts a large number of programs here.
An include file has itself an include that looks like this:

{{&programname}{&*}}

to optionally include another file at this point in the include (I.e. as a kind of primitive template method).
This appears to work fine, but programname is optionally included, and in a case where programname is undefined AND one of the cascading arguments is a multi-line argument, the value of the multiline argument does not have its newlines escaped in the program listing file causing a parse error.


down 1 stream

I'm using ProParse to parse a large number of OpenEdge programs, a number of which use 'down 1 stream' when generating reports. ProParse doesn't seem to care for this, I'm getting a org.prorefactor.refactor.RefactorException: down-one-stream.p:39:17: unexpected token: stream

Here's a sample .p created to demonstrate this using the sports2k database (also attached):

===================== snip ============================

/*------------------------------------------------------------------------
File : down-one-stream.p


Indirect Define Node

I understand that Indirect Define Nodes can be parameter definitions, but what else might they be?


Program_root block

Given the code:

mobBlockNode = cast( ipobNode, BlockNode ).
mobBlock = mobBlockNode:getBlock().
mlgIsMethod = mobBlock:isMethodBlock().
mlgIsProgram = mobBlock:isProgramBlock().

for a node which is a block node, I would expect the Program_root node to give IsProgramBlock, but instead it gives IsMethodBlock. Why?

Curious too why the CLASS node is not considered a BLOCK.


Remote method calls

Given a call to a remote method call:

obNominal = new Nominal().
chTest = obNominal:SayHi( chTest ).

which tokenizes as:

ASSIGN        0:0    
    EQUAL    =    66:66    
        Field_ref        0:0    
            ID    chTest    66:66    
        Widget_ref        0:0    
            Field_ref        0:0    
                ID    obNominal    66:66    
            OBJCOLON    :    66:66    
            ID    SayHi    66:66    
            Method_param_list        0:0    
                LEFTPAREN    (    66:66    
                INPUT        0:0

JPNode:getBlockBuffers

OK, trying another path, if I do, on nodes of type BlockNode:

define variable mobBlock as class Block no-undo.
define variable mobBlockNode as class BlockNode no-undo.
define variable mobTableBuffer as class TableBuffer extent 20 no-undo.

mobBlockNode = cast( ipobNode, BlockNode ).
mobBlock = mobBlockNode:getBlock().
mobTableBuffer = mobBlock:getBlockBuffers().

It compiles, but I get a run time error
Error: Uninitialized array used as source of assignment. (14906)
on the last line, whether I provide an number for extent or not.


Includes

PareseUnit:getMarcroGraph returns an object of type IncludeRef which seems like it would be a link to an Include file ... but shouldn't it them be an array?


JPNode:getLink()

I am trying to use this to get from a statement to the block for the statement. The doc says:

java.lang.Object getLink(java.lang.Integer key)

in the code I see things like

public Call getCall() { return (Call) getLink(CALL); }

but, if I try in ABL to say

mobBlockNode = cast(ipobNode:getLink(JPNode:BLOCK), BlockNode).

it tells me

Parameter 1 for METHOD getLink is not type compatible with its definition. (12905)

I have tried a bunch of things for JPNode:BLOCK including -214

So, what does it want?


Syndicate content