Buffer handle parse error

Project:Proparse Project
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

/* Sample code, parsed with errors */
DEFINE VARIABLE hCustomer AS HANDLE NO-UNDO.
DEFINE VARIABLE hQry AS HANDLE NO-UNDO.

CREATE QUERY hQry.
hQry:ADD-BUFFER(BUFFER customer:HANDLE). /* parsing error: Expecting RIGHTPAREN, found : */
hQry:QUERY-PREPARE("For each customer no-lock":U).
hQry:QUERY-OPEN.
hQry:GET-FIRST.

/* Sample code, parsed with NO errors */

DEFINE VARIABLE hCustomer AS HANDLE NO-UNDO.
DEFINE VARIABLE hQry AS HANDLE NO-UNDO.

CREATE QUERY hQry.
hCustomer = BUFFER customer:HANDLE.
hQry:ADD-BUFFER(hCustomer). /* no parsing error */
hQry:QUERY-PREPARE("For each customer no-lock":U).
hQry:QUERY-OPEN.
hQry:GET-FIRST.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
john's picture

Could not reproduce. Which version?

Hi Marcel, thanks for submitting the bug report.

Can you tell us which version of Proparse (and which operating system)?

Using version 3.1b01 on Windows, I was unable to reproduce the problem. I pasted your first snippet into c:/temp/test2.p, and then ran the following:

def var parser as handle.
run proparse/api/proparse.p persistent set parser.
{proparse/api/proparse.i parser}

parserParse("c:/temp/test2.p").
message
  parserGetVersion() SKIP
  parserErrorGetStatus() SKIP
  parserErrorGetText()
  view-as alert-box.

The error status came up 0 (no error).

Running the 'Tokenlister', here is the syntax tree I get for the hQry:ADD-BUFFER(BUFFER customer:HANDLE). statement:

    Expr_statement    
        Widget_ref    
            Field_ref    
                ID    hQry
            OBJCOLON    :
            ID    ADD-BUFFER
            Method_param_list    
                LEFTPAREN    (
                INPUT    
                    Widget_ref    
                        BUFFER    BUFFER
                        ID    customer
                        OBJCOLON    :
                        HANDLE    HANDLE
                RIGHTPAREN    )
        PERIOD    .

Re: Could not reproduce. Which version?

I'm sorry, to create a sample program to the sports database (instead of our company database) i forgot the database name reference:

DEFINE VARIABLE hCustomer AS HANDLE NO-UNDO.
DEFINE VARIABLE hQry AS HANDLE NO-UNDO.

CREATE QUERY hQry.
hQry:ADD-BUFFER(BUFFER sports.customer:HANDLE). /* parsing error: Expecting RIGHTPAREN, found : */
hQry:QUERY-PREPARE("For each customer no-lock":U).
hQry:QUERY-OPEN.
hQry:GET-FIRST.

If i run your program i get the following message:
---------------------------
Message (Press HELP to view stack trace)
---------------------------
3.1b01
-2
c:/tmp/test.p:5:39: expecting RIGHTPAREN, found ':'
---------------------------
OK Help
---------------------------


john's picture

Thanks, now I see it

Thanks for the clarification Marcel. Now I'm able to see the error in action. I'll see what I can do about creating a patch, at the very least I'll make sure it's fixed before the next release. Cheers.


john's picture

Fixed

Hi Marcel, I implemented a fix and the test code seems to parse OK now. Can you install this build:
http://www.joanju.com/proparse/proparse_3.1b02.exe
and let me know if your code all parses OK now? If yes, then I'll update the link on my download page.


RE: Fixed

The source code parses now. Thanks!