• AVR Freaks

Hot!Regular Expression Engine

Author
Gort2015
Klaatu Barada Nikto
  • Total Posts : 3984
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
2019/10/10 15:39:29 (permalink)
0

Regular Expression Engine

Regular Expression Engine - test expression #1000
 
Too ugly:
 /Hello|(?'Color'Red|Orange|(?'Sky'Gr[ae]y|(?'Gort'Klat{2}u|Barada|Nikto)+|Green[\\x30-\\x39]|Blue|(?'Shape'Rectangle|Triangle)|Cyan){7..11})|World[A-Z-AEIOU]
 
That's better:
Hello 
<Color>
    Red
    Orange
    <Sky> ;7 to 11
        Gr[ae]y
        <Gort> ;1 to INF
            Klat{2}u
            Barada
            Nikto
        </Gort>
        Green[0-9]
        Blue
        <Shape>
            Rectangle
            Triangle
        </Shape>
    </Sky>
    Cyan
</Color>
World[A TO Z BUT NOT AEIOU]

Looks good.
post edited by Gort2015 - 2019/10/10 15:45:16

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#1

17 Replies Related Threads

    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 16:05:00 (permalink)
    0
    That is output from test code for the regex engine that I have been working on.
     
    Regex is based on groups, if you are not in a group then you are in ROOT.
    ("Person of Interest")
     
    Capture classes can be inspected:
    /(?<Color>RED|ORANGE|(?<Borg>BLACK|(?<Gort>Klattu|Barada|Nikto)|GREEN|BLUE|(?<Shape>Rectangle|Triangle)|CYAN))/
    R:
    C->Name           -
    C->Parent     SELF
    C->Target         -
    C->Body           0
    C->TargetIndex    0
    C->Base           0
    C->End          110
    Siblings      'Color' [1 Child]
    -==-==-==-==-==-
    1:
    C->Name       'Color'
    C->Parent     ROOT
    C->Target     "(?<Borg>BLACK|(?<Gort>Klattu|Barada|Nikto)|GREEN|BLUE|(?<Shape>Rectangle|Triangle)|CYAN))", 21
    C->Body           8
    C->TargetIndex    2
    C->Base           1
    C->End          109
    Siblings      'Borg' [1 Child]
    -==-==-==-==-==-
    2:
    C->Name       'Borg'
    C->Parent     'Color'
    C->Target     "(?<Shape>Rectangle|Triangle)|CYAN)", 75
    C->Body           7
    C->TargetIndex    3
    C->Base          21
    C->End          108
    Siblings      'Gort', 'Shape' [2 Children]
    -==-==-==-==-==-
    3:
    C->Name       'Gort'
    C->Parent     'Borg'
    C->Target     "Triangle", 94
    C->Body           7
    C->TargetIndex    1
    C->Base          35
    C->End           62
    Siblings       [0 Children]
    -==-==-==-==-==-
    4:
    C->Name       'Shape'
    C->Parent     'Borg'
    C->Target         -
    C->Body           8
    C->TargetIndex    0
    C->Base          75
    C->End          102
    Siblings       [0 Children]


    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #2
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 16:12:03 (permalink)
    0
    Also this output:
    R:           (/(?<Color>RED|ORANGE|(?<Borg>BLACK|(?<Gort>Klattu|Barada|Nikto)|GREEN|BLUE|(?<Shape>Rectangle|Triangle)|CYAN))/
    1: <Color>        (RED|ORANGE|(?<Borg>BLACK|(?<Gort>Klattu|Barada|Nikto)|GREEN|BLUE|(?<Shape>Rectangle|Triangle)|CYAN))
    2: <Borg>               (BLACK|(?<Gort>Klattu|Barada|Nikto)|GREEN|BLUE|(?<Shape>Rectangle|Triangle)|CYAN)
    3: <Gort>                     (Klattu|Barada|Nikto)
    4: <Shape>                    (Rectangle|Triangle)

    Therefore you can see that Shape and Gort are Siblings of Borg

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #3
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 16:18:15 (permalink)
    0
    The engine progress can be seen and any errors highlighed
    BTXT: Triangle
    ETXT: ........^
    BREX: (?<Color>RED|ORANGE|(?<Borg>BLACK|(?<Gort>Klattu|Barada|Nikto)|GREEN|BLUE|(?<Shape>Rectangle|Triangle)|CYAN))
    EREX: .............................................................................................................^
    Error #0 OK
    - end -

    post edited by Gort2015 - 2019/10/10 16:21:14

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #4
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 16:34:35 (permalink)
    0
    Testing and formatting output.  This is the part I am working on right now, I need that to work with something else.
     
    If you are going to debug, do it proper job.
     
    Test output from:
     
    ^(?'Gort'Klattu|Barada|Nikto)|(?<Shape>Rectangle|Triangle)$
     
    to:
     
    ^ (? 'Gort' Klattu | Barada | Nikto ) | (? 'Shape' Rectangle | Triangle ) $
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #5
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 16:39:51 (permalink)
    0
    I did not have the structures in place when I first started on this.
     
    I will be adding conditions soon:
    IF THEN ELSE
     
    It will be a simple matter of moving between classes.  Links to quantify structs. can exist in capture classes including ROOT.
     
    ( ( ( a ) {3} ) {5} ) {7} )
     
    for x = 1 to 7
        for y = 1 to 5
           for z = 1 to 3
                 a
           
     
    That looks easy enough except the loop is entered at a
    It took a while getting the logic correct, hardly any Math involved.

     
    Just thinking this out loud.
    Why MC could not release PK4 fully functional on day one and they have Teams.
    post edited by Gort2015 - 2019/10/10 17:14:06

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #6
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 17:18:31 (permalink)
    0
    All collections can be maintained and linked by this structure.
    typedef struct{
        char                   *Target;         // element match or NULL
        const char             *Name;           // name of this object
        unsigned int            TargetIndex;    // container: element match index
        const int               Base;           // object start in sting
        const int               End;            // object end   in sting
        const struct Capture_t *Parent;         // owner
        const unsigned int      Body;           // relative from header
    }Capture_t;


    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #7
    Aussie Susan
    Super Member
    • Total Posts : 3735
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 18:10:11 (permalink)
    +3 (3)
    I've been working with REs for many years (decades???) and the old adage is still true:
    "if you have a problem and think that the solution is a regex then you have 2 problems"
    Susan
    #8
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/10 18:44:09 (permalink)
    0
    The pre-processor creates the capture classes before the engine runs.
     
    There's C code to produce the formatted output and the ultra small pre-processor can be used for many other tasks.
     
    Entering a regex expression into the pre-processor renders the class objects and the output can be formatted without even using regex.
     
    46 instructions without names.
    64 instructions when using names.
     
    Process keywords with regex:
     
    "for (int x =0 ; x < 10 ; x ++) {"
    capture:
    keyword: for
           type:  int
           begin: 0
           end: <10
           step: 1
           compound: true
     
    OR:
     
    mov x, y
     
    mnemonic: mov
         src: Ws
         dst: Wd
     
    And further an opcode can be produced by setting the correct bits via an regex extension.
    0111 1www wBhh hddd dggg ssss
     
    You could even convert 6502 to 16bit code.
     
     
    I needed to find a word that occurred in many places including comments but I only wanted to see that word in code only, handy now that regex is part of mplab x rather than searching all files in project properties.    That one:     .*
     
     
     
     
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #9
    pcbbc
    Super Member
    • Total Posts : 1703
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/11 06:16:33 (permalink)
    +1 (1)
    Seems to be you've just introduced a whole load of ambiguities around white space.  Not only in the indentation in the pseudo-XML layout, but also in a regex like "[A TO Z]" which then conflicts with the expansion for "[A-Z]".
     
    Also where's the consistency in handling {} quantifiers? Sometimes as a postfix to the tag as in <Sky> ;7 to 11, and sometimes just unmodified as in Klat{2}u
     
    But there you go. Just my 2 pence worth.
    #10
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/10/11 09:28:48 (permalink)
    0
    It is not xml and no consistency, it is test output after running the pre-processor (not regex), one of my test strings.
    '<' and '>' highlights the name if I want to view the capture classes in tree view.
    If a class has a quantifier, it creates a comment with atleast and atmost quantifiers.
     
    I run tests like these with regex and compare the results with https://regex101.com/r/cO8lqs/2
     
    A | B | C | (? 'Choice' (? 'Scifi' Discovery | The_Orville ) | ( Z_Nation | TWD ) | (? 'Fantasy' GOT | Vikings ) )
     
    Vikings matches, ROOT, Choice and Fantasy.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #11
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/09 18:42:26 (permalink)
    0
    Good progress on regex.  Produces regex compiled code and a fancy visual for class views. (Got to be seen)
    Colorizing that later.  23.19us pre-processor, 79.02us compile time.
    Midrange 8bit instruction set:
    err=regex("",  "(?DEFINE"
                               "(?<BField>\\s*(bcf|bsf|btfsc|btfss)\\s+(?<BAddr>\\w+)\\s+,\\s+(?<Bit>[0..7])\\K'CMT')"
                               "(?<CMT>\\s*(?:/\\*.*\\*/|;.*)\\Z)"
                           ")");


    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #12
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/09 19:19:36 (permalink)
    0
    It took some time to get that far. Days went into months.
     
    It is divided up into 3 parts.
    1. Pre-Processor: Syntax check and creates capture classes.
    2. Compiler: Generates code and fills in any links.
    3. Runtime: no error checking, luts or math.  Most of it is logic.
    Still working on that since it started as an interpreter but now a compiler.
    Looking at the source coded produced, a class always has an exit point.
     
    Memory can be saved by creating strings that link straight into the source string.
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #13
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/09 19:35:36 (permalink)
    0
    To view this 115 characters per line are needed.
    Container Class View

    0    5    10   15   20   25   30   35   40   45   50   55   60   65   70   75   80   85   90   95   100  105  110  115
    (?DEFINE(?<BFIELD>(bcf|bsf|btfsc|btfss)\s+(?<BFILE>\w+)\s+,\s+(?<BIT>[0..7])\K'CMT')(?<CMT>\s*(?:/\*.*\*/|;.*)\Z))
                      |_________1_________|   |_____3_____|       |_____4______|
            |____________________________________2_____________________________________||_____________5_____________|
    |_______________________________________________________R________________________________________________________|

    1, 3 and 4 are siblings of class 2.
    2 (bitfield) and 5 (comment)are siblings of the root class.
    DEFINE is not a capturing class.
    post edited by Gort2015 - 2019/12/09 19:38:55

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #14
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/11 10:41:26 (permalink)
    0
    "\\s+(?(?=G)Gort|Data)"
    Dissembler v2.0

    0000  03                   SPACE
    0001  27 00 01 FF FF       QUANTIFY At Least 1, At Most 65535
    0006  30 0C 00             IFTHEN
    0009  2A 04 00             LKHDP
    000C  C7                   LITERAL  'G'
    000D  2E                   LKEND
    000E  26 88 D0 04          STRING   "Gort"
    0012  31 07 00             ELSE
    0015  26 88 D5 04          STRING   "Data"
    0019  32                   ENDIF
    001A  37                   END
    Dissemble Complete

    In English:
    skip white spaces
    if
        look ahead positive == 'G'
    then
        match, "Gort"
    else
        match, "Data"
    endif
    end
     
     
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #15
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/14 09:56:03 (permalink)
    0
    Latest test:
    err = regex("", "(?(?<![^a-z-aeiou])abc|def)"); //Pass
    Produces:
    Dissembler v2.0

    0000  30 1A 00                IFTHEN
    0003  2D 12 00 00 00          LKBDN
    0008  1C 05                   LISTN     5
    000A  1E E1 7A                RANGE    'a' - 'z'
    000D  1F 07                   EXCL     7
    000F  E1                      LITERAL  'a'
    0010  E5                      LITERAL  'e'
    0011  E9                      LITERAL  'i'
    0012  EF                      LITERAL  'o'
    0013  F5                      LITERAL  'u'
    0014  25                      LISTEND
    0015  2E                      LKEND
    0016  26 88 D9 03             STRING   "abc"
    001A  31 07 00                ELSE
    001D  26 88 DD 03             STRING   "def"
    0021  32                      ENDIF
    0022  37                      END
    Dissembly Complete


    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #16
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/14 11:17:37 (permalink)
    0
    Big test on 8bit pic instructions with destination.
    err=regex("", "(?DEFINE(?<FileWF>   (?<Mnemonic>addwf|andwf|comf|decf|decfsz|incf|incfsz|iorwf|movf|"
    "rlf|rrf|subwf|swapf|xorwf)"
    "\\s+(?<File>\\w+)"
    "(?:\\s+,\\s*(?<Dest>[0Ww1Ff]))?"
    "\\K'Comment'"
    ")"
    "(?<Comment>\\s*(?:/\\*.*\\*/|;.*)\\Z)"
    ")"
    );

    Dissembler v2.0

    0000  33 DA 00                DEFINE
    0003  19 AC 00 00 00 02       ENTER    #1
    0009  19 65 00 0A 00 04       ENTER    #2
    000F  26 88 E4 05             STRING   "addwf"
    0013  16 07 00                ||ALT||
    0016  26 88 EA 05             STRING   "andwf"
    001A  16 07 00                ||ALT||
    001D  26 88 F0 04             STRING   "comf"
    0021  16 07 00                ||ALT||
    0024  26 88 F5 04             STRING   "decf"
    0028  16 07 00                ||ALT||
    002B  26 88 FA 06             STRING   "decfsz"
    002F  16 07 00                ||ALT||
    0032  26 89 01 04             STRING   "incf"
    0036  16 07 00                ||ALT||
    0039  26 89 06 06             STRING   "incfsz"
    003D  16 07 00                ||ALT||
    0040  26 89 0D 05             STRING   "iorwf"
    0044  16 07 00                ||ALT||
    0047  26 89 13 04             STRING   "movf"
    004B  16 07 00                ||ALT||
    004E  26 89 18 03             STRING   "rlf"
    0052  16 07 00                ||ALT||
    0055  26 89 1C 03             STRING   "rrf"
    0059  16 07 00                ||ALT||
    005C  26 89 20 05             STRING   "subwf"
    0060  16 07 00                ||ALT||
    0063  26 89 26 05             STRING   "swapf"
    0067  16 00 00                ||ALT||
    006A  26 89 2C 05             STRING   "xorwf"
    006E  1A 02                   LEAVE    #1
    0070  03                      SPACE
    0071  27 00 01 FF FF          QUANTIFY At Least 1, At Most 65535
    0076  19 0C 00 00 00 06       ENTER    #3
    007C  05                      WORD
    007D  27 00 01 FF FF          QUANTIFY At Least 1, At Most 65535
    0082  1A 02                   LEAVE    #1
    0084  1D 23 00 00 00          NC
    0089  03                      SPACE
    008A  27 00 01 FF FF          QUANTIFY At Least 1, At Most 65535
    008F  AC                      LITERAL  ','
    0090  03                      SPACE
    0091  27 00 00 FF FF          QUANTIFY At Least 0, At Most 65535
    0096  19 0F 00 00 00 08       ENTER    #4
    009C  1B 08                   LISTP     8
    009E  B0                      LITERAL  '0'
    009F  D7                      LITERAL  'W'
    00A0  F7                      LITERAL  'w'
    00A1  B1                      LITERAL  '1'
    00A2  C6                      LITERAL  'F'
    00A3  E6                      LITERAL  'f'
    00A4  25                      LISTEND
    00A5  1A 02                   LEAVE    #1
    00A7  2F                      EXITNC
    00A8  27 00 00 00 01          QUANTIFY At Least 0, At Most 1
    00AD  28 0A                   REF      #5
    00AF  1A 00                   LEAVE    #R
    00B1  19 27 00 00 00 0A       ENTER    #5
    00B7  03                      SPACE
    00B8  27 00 00 FF FF          QUANTIFY At Least 0, At Most 65535
    00BD  1D 19 00 0F 00          NC
    00C2  AF                      LITERAL  '/'
    00C3  AA                      LITERAL  '*'
    00C4  15                      PERIOD
    00C5  27 00 00 FF FF          QUANTIFY At Least 0, At Most 65535
    00CA  AA                      LITERAL  '*'
    00CB  AF                      LITERAL  '/'
    00CC  16 00 00                ||ALT||
    00CF  BB                      LITERAL  ';'
    00D0  15                      PERIOD
    00D1  27 00 00 FF FF          QUANTIFY At Least 0, At Most 65535
    00D6  2F                      EXITNC
    00D7  0F                      ANCZ
    00D8  1A 00                   LEAVE    #R
    00DA  34                      ENDDEF
    00DB  37                      END
    Dissembly Complete



    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #17
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Regular Expression Engine 2019/12/15 06:31:48 (permalink)
    0
    It would take 200 characters to display a graphical output.
    The pre-precessor took 39.82us to produce these capture class objects.
    --------------------------------------------------
    Name              -
    IDX               -
    Parent            -
    Target            -
    TargetIndex       -
    Body              0
    TextBase          0
    TextEnd         197
    Siblings      'FileWF', 'Comment' [2 Children]
    Alternatives      0
    Func @           1234
    Text          (?DEFINE(?<FileWF>(?<Mnemonic>addwf|andwf|comf|decf|decfsz|incf|incfsz|iorwf|movf|rlf|rrf|subwf|swapf|xorwf)\s+(?<File>\w+)(?:\s+,\s*(?<Dest>[0Ww1Ff]))?\K'Comment')(?<Comment>\s*(?:/\*.*\*/|;.*)\Z))
    --------------------------------------------------
    Name          'FileWF'
    IDX           '1'
    Parent        ROOT
    Target            -
    TargetIndex       -
    Body              9
    TextBase          8
    TextEnd         163
    Siblings      'Mnemonic', 'File', 'Dest' [3 Children]
    Alternatives      0
    Func @            -
    Text          (?<FileWF>(?<Mnemonic>addwf|andwf|comf|decf|decfsz|incf|incfsz|iorwf|movf|rlf|rrf|subwf|swapf|xorwf)\s+(?<File>\w+)(?:\s+,\s*(?<Dest>[0Ww1Ff]))?\K'Comment')
    --------------------------------------------------
    Name          'Mnemonic'
    IDX           '2'
    Parent        'FileWF'
    Target            -
    TargetIndex       -
    Body             11
    TextBase         18
    TextEnd         107
    Siblings      [0 Children]
    Alternatives     13
    Func @            -
    Text          (?<Mnemonic>addwf|andwf|comf|decf|decfsz|incf|incfsz|iorwf|movf|rlf|rrf|subwf|swapf|xorwf)
    --------------------------------------------------
    Name          'File'
    IDX           '3'
    Parent        'FileWF'
    Target            -
    TargetIndex       -
    Body              7
    TextBase        111
    TextEnd         122
    Siblings      [0 Children]
    Alternatives      0
    Func @            -
    Text          (?<File>\w+)
    --------------------------------------------------
    Name          'Dest'
    IDX           '4'
    Parent        'FileWF'
    Target            -
    TargetIndex       -
    Body              7
    TextBase        133
    TextEnd         149
    Siblings      [0 Children]
    Alternatives      0
    Func @            -
    Text          (?<Dest>[0Ww1Ff])
    --------------------------------------------------
    Name          'Comment'
    IDX           '5'
    Parent        ROOT
    Target            -
    TargetIndex       -
    Body             10
    TextBase        164
    TextEnd         196
    Siblings      [0 Children]
    Alternatives      1
    Func @            -
    Text          (?<Comment>\s*(?:/\*.*\*/|;.*)\Z)
    --------------------------------------------------


    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #18
    Jump to:
    © 2020 APG vNext Commercial Version 4.5