Menu

#142 An option to disable pattern superset check

open
5
2012-10-02
2011-08-15
Jiri Marsik
No

I use machine-generated Quex programs as input for Quex. I use it to detect points of interest in a stream of text which are defined by two regular expressions: one describing the prefix leading to the point of interest and one describing the suffix following it. I register three different kinds of POI and it is possible for more than 1 kind of POI to occur at one position within the text. I solve this in Quex by matching the suffix while having the prefix as a precondition. On matching one of the suffixes, I return to the previous position (the one from which I matched the suffix) and I continue looking for the other POI. To avoid an infinite loop, I change to a mode which does not allow me to match any of the regular expressions associated with the kinds of POI I have already found at the position.

My problem is that with my use of Quex it is possible to have a pattern which is a subset of another pattern. This would be a redundancy, and most likely an error in hand-written code, and Quex accordingly reports it as an error and quits. In my case it is a byproduct of the way the code is generated. The pattern-action pair may be redundant and useless in the one specific mode Quex examined, but in the modes in which the competing superset pattern is no longer allowed, the pattern-action pair becomes useful again.

I have patched my own copy of Quex 0.59.6 to use an option which skipped the pattern superset check in input/files/mode.py:470. Would you like to add this option to Quex or should I distribute my patched version?

Discussion

  • Jiri Marsik

    Jiri Marsik - 2011-08-15

    Example Quex program causing the error. The problem is with SPLIT 1 and JOIN 4 in modes like FIND_SPLITS_JOINS

     
  • Frank-Rene Schäfer

    Thanks, a lot for your input.

    Could we agree to have a '--disable-error YourCase' command
    line flag? Please, post a feature request on this regard and provide
    a diff as a patch in the patch section. This way things remain traceable.

     
  • Jiri Marsik

    Jiri Marsik - 2011-08-15

    The --disable-error flag looks very nice.

    Should I start another feature request describing it?
    The patch is supposed to be a diff from the SVN trunk version to the version defining the new --disable-error list flag and using its contents to check whether to skip the pattern superset check or the simple --no-pattern-superset-check flag patch I already did on my 0.59.6 Quex?

     
  • Frank-Rene Schäfer

    Maybe, the feature request is enough, let me do the rest.
    BTW: ollydb recently wrote a Wikepedia entry on Quex in Chinese; would
    you like to publish one in Russian--to help promote Quex a bit?
    You may use google translate to get a first draft.

    Best Regards

    Frank

     
  • Jiri Marsik

    Jiri Marsik - 2011-08-15

    The feature request has been filed.
    As for the Wikipedia entry, I am afraid the result would not be quite up to standards as I do not speak Russian. I could, however, write a Czech translation as Czech is my native language. Other that that, I know some French but I have no experience writing longer formal texts.

     

Log in to post a comment.