Menu

#2 System.out still occurs after errClear

Unstable_(example)
closed-fixed
nobody
None
5
2017-12-26
2017-11-25
Adam Retter
No

I have found that System.out.println is still called in BaseParser#closeParser(...) even after I have tried to follow the instructions for 18.7 Own diagnostic output in the PDF manual.

My PEG looks like:

regularExpression   = regExp !_ {result} ~{failure} ;

regExp              = branch ( "|" branch )* {} ;

branch              = piece* ;

...

My Semantics Class looks like:

    void result() {
        javaRegularExpression = Right(lhs().text());
    }

    void failure() {
        javaRegularExpression = Left(lhs().errMsg());
        lhs().errClear();
    }

However at run time, when the regex does not match I still see via System.out, At start: expected regularExpression, which comes from closeParser.

Is this a bug? If so I could attempt to send a patch. If not, what am I doing wrong?

Related

Patches: #2

Discussion

  • Roman Redz

    Roman Redz - 2017-12-12

    Hello Adam,

    Thanks for your report. Seems to be a bug, and I start looking at it.
    Sorry for reacting so late, but I have been away for a while.

    Best regards
    Roman

    On 2017-11-25 20:36, Adam Retter wrote:


    [patches:#2] https://sourceforge.net/p/mousepeg/patches/2/
    System.out still occurs after errClear

    Status: open
    Group: Unstable_(example)
    Created: Sat Nov 25, 2017 07:36 PM UTC by Adam Retter
    Last Updated: Sat Nov 25, 2017 07:36 PM UTC
    Owner: nobody

    I have found that |System.out.println| is still called in
    |BaseParser#closeParser(...)| even after I have tried to follow the
    instructions for |18.7 Own diagnostic output| in the PDF manual.

    My PEG looks like:

    regularExpression = regExp !_ {result} ~{failure} ;

    regExp = branch ( "|" branch )* {} ;

    branch = piece* ;

    ...

    My Semantics Class looks like:

     void result() {
         javaRegularExpression = Right(lhs().text());
     }
    
     void failure() {
         javaRegularExpression = Left(lhs().errMsg());
         lhs().errClear();
     }
    

    However at run time, when the regex does not match I still see via
    System.out, |At start: expected regularExpression|, which comes from
    |closeParser|.

    Is this a bug? If so I could attempt to send a patch. If not, what am
    I doing wrong?


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/mousepeg/patches/2/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #2

  • Roman Redz

    Roman Redz - 2017-12-12

    On 2017-11-25 20:36, Adam Retter wrote:


    [patches:#2] https://sourceforge.net/p/mousepeg/patches/2/
    System.out still occurs after errClear

    Status: open
    Group: Unstable_(example)
    Created: Sat Nov 25, 2017 07:36 PM UTC by Adam Retter
    Last Updated: Sat Nov 25, 2017 07:36 PM UTC
    Owner: nobody

    I have found that |System.out.println| is still called in
    |BaseParser#closeParser(...)| even after I have tried to follow the
    instructions for |18.7 Own diagnostic output| in the PDF manual.

    My PEG looks like:

    regularExpression = regExp !_ {result} ~{failure} ;

    regExp = branch ( "|" branch )* {} ;

    branch = piece* ;

    ...

    My Semantics Class looks like:

     void result() {
         javaRegularExpression = Right(lhs().text());
     }
    
     void failure() {
         javaRegularExpression = Left(lhs().errMsg());
         lhs().errClear();
     }
    

    However at run time, when the regex does not match I still see via
    System.out, |At start: expected regularExpression|, which comes from
    |closeParser|.

    Is this a bug? If so I could attempt to send a patch. If not, what am
    I doing wrong?


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/mousepeg/patches/2/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #2

  • Roman Redz

    Roman Redz - 2017-12-12

    This is a bug in the logic.
    The reject() called after failure() cancels the effect of errClear().
    Working on a solution.

    (My two preceding entries result from an attemp to use e-mail; can be ignored.)

     
  • Roman Redz

    Roman Redz - 2017-12-13

    Temporary fix: modify top parsing procedure in the generated parser.
    (In this case "RegularExpression".)
    Replace "return accept()" by "return true" and "return reject()" by "return false".

     
  • Roman Redz

    Roman Redz - 2017-12-26

    Fixed in version 1.9.2.

     
  • Roman Redz

    Roman Redz - 2017-12-26
    • status: open --> closed-fixed
     
  • Adam Retter

    Adam Retter - 2017-12-26

    Hey Roman, thanks for fixing so quickly :-)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.