attregex: lost interpretation.dat, compile regex locally
authorMarko Kreen <markokr@gmail.com>
Wed, 24 Nov 2010 07:37:36 +0000 (09:37 +0200)
committerMarko Kreen <markokr@gmail.com>
Wed, 24 Nov 2010 07:37:36 +0000 (09:37 +0200)
test/attregex/Makefile
test/attregex/data/interpretation.dat [new file with mode: 0644]
test/attregex/run.sh

index 31287f67f69a2a7db79160e6e7116d8fc4d48019..89ab49860fa97728d77e7352c67e431d7a1d3221 100644 (file)
@@ -1,23 +1,29 @@
 
-#CC = i586-mingw32msvc-gcc
-CFLAGS = -O -g
-CPPFLAGS = -I../..
-DEFS = -DUSUAL -DUSE_INTERNAL_REGEX
-LDFLAGS = -g
-LIBS = ../libusual_compat.a
+
+include ../../config.mak
+
+DEFS += -DUSUAL -DUSE_INTERNAL_REGEX
+CPPFLAGS += -I../..
+OBJS = testregex.o regex.o mempool.o
 
 all: testregex.usual testregex.libc
 
-testregex.usual: testregex.o
-       $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+testregex.usual: $(OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJS)
 
 testregex.o: testregex.c
        $(CC) $(DEFS) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
+regex.o: ../../usual/regex.c ../../usual/regex.h
+       $(CC) $(DEFS) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+mempool.o: ../../usual/mempool.c ../../usual/mempool.h
+       $(CC) $(DEFS) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
 testregex.libc: testregex.c
        $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
 
 
 clean:
-       rm -f testregex testregex.o testregex.usual testregex.libc
+       rm -f testregex *.o testregex.usual testregex.libc
 
diff --git a/test/attregex/data/interpretation.dat b/test/attregex/data/interpretation.dat
new file mode 100644 (file)
index 0000000..72e186e
--- /dev/null
@@ -0,0 +1,93 @@
+:RE#01:E       a+                      xaax    (1,3)
+:RE#02:B       .\(a*\).                xaax    (0,4)(1,3)
+:RE#03:E       (a?)((ab)?)             ab      (0,2)(0,0)(0,2)(0,2)
+:RE#04:E       (a?)((ab)?)(b?)         ab      (0,2)(0,1)(1,1)(?,?)(1,2)
+:RE#05:E       ((a?)((ab)?))(b?)       ab      (0,2)(0,2)(0,0)(0,2)(0,2)(2,2)
+:RE#06:E       (a?)(((ab)?)(b?))       ab      (0,2)(0,1)(1,2)(1,1)(?,?)(1,2)
+:RE#07:E       (.?)                    x       (0,1)(0,1)
+:RE#08:E       (.?){1}                 x       (0,1)(0,1)
+:RE#09:E       (.?)(.?)                x       (0,1)(0,1)(1,1)
+:RE#10:E       (.?){2}                 x       (0,1)(1,1)
+:RE#11:E       (.?)*                   x       (0,1)(0,1)
+:RE#12:E       (.?.?)                  xxx     (0,2)(0,2)
+:RE#13:E       (.?.?){1}               xxx     (0,2)(0,2)
+:RE#14:E       (.?.?)(.?.?)            xxx     (0,3)(0,2)(2,3)
+:RE#15:E       (.?.?){2}               xxx     (0,3)(2,3)
+:RE#16:E       (.?.?)(.?.?)(.?.?)      xxx     (0,3)(0,2)(2,3)(3,3)
+:RE#17:E       (.?.?){3}               xxx     (0,3)(3,3)
+:RE#18:E       (.?.?)*                 xxx     (0,3)(2,3)
+:RE#19:E       a?((ab)?)(b?)           ab      (0,2)(1,1)(?,?)(1,2)
+:RE#20:E       (a?)((ab)?)b?           ab      (0,2)(0,1)(1,1)(?,?)
+:RE#21:E       a?((ab)?)b?             ab      (0,2)(1,1)(?,?)
+:RE#22:E       (a*){2}                 xxxxx   (0,0)(0,0)
+:RE#23:E       (ab?)(b?a)              aba     (0,3)(0,2)(2,3)
+:RE#24:E       (a|ab)(ba|a)            aba     (0,3)(0,2)(2,3)
+:RE#25:E       (a|ab|ba)               aba     (0,2)(0,2)
+:RE#26:E       (a|ab|ba)(a|ab|ba)      aba     (0,3)(0,2)(2,3)
+:RE#27:E       (a|ab|ba)*              aba     (0,3)(2,3)
+:RE#28:E       (aba|a*b)               ababa   (0,3)(0,3)
+:RE#29:E       (aba|a*b)(aba|a*b)      ababa   (0,5)(0,2)(2,5)
+:RE#30:E       (aba|a*b)*              ababa   (0,5)(2,5)
+:RE#31:E       (aba|ab|a)              ababa   (0,3)(0,3)
+:RE#32:E       (aba|ab|a)(aba|ab|a)    ababa   (0,5)(0,2)(2,5)
+:RE#33:E       (aba|ab|a)*             ababa   (0,5)(2,5)
+:RE#34:E       (a(b)?)                 aba     (0,2)(0,2)(1,2)
+:RE#35:E       (a(b)?)(a(b)?)          aba     (0,3)(0,2)(1,2)(2,3)(?,?)
+:RE#36:E       (a(b)?)+                aba     (0,3)(2,3)(?,?)
+:RE#37:E       (.*)(.*)                xx      (0,2)(0,2)(2,2)
+:RE#38:E       .*(.*)                  xx      (0,2)(2,2)
+:RE#39:E       (a.*z|b.*y)             azbazby (0,5)(0,5)
+:RE#40:E       (a.*z|b.*y)(a.*z|b.*y)  azbazby (0,7)(0,5)(5,7)
+:RE#41:E       (a.*z|b.*y)*            azbazby (0,7)(5,7)
+:RE#42:E       (.|..)(.*)              ab      (0,2)(0,2)(2,2)
+:RE#43:E       ((..)*(...)*)                   xxx             (0,3)(0,3)(?,?)(0,3)
+:RE#44:E       ((..)*(...)*)((..)*(...)*)      xxx             (0,3)(0,3)(?,?)(0,3)(3,3)(?,?)
+:RE#45:E       ((..)*(...)*)*                  xxx             (0,3)(0,3)(?,?)(0,3)
+:RE#46:B       \(a\{0,1\}\)*b\1        ab      (0,2)(1,1)
+:RE#47:B       \(a*\)*b\1              ab      (0,2)(1,1)
+:RE#48:B       \(a*\)b\1*              ab      (0,2)(0,1)
+:RE#49:B       \(a*\)*b\1*             ab      (0,2)(1,1)
+:RE#50:B       \(a\{0,1\}\)*b\(\1\)    ab      (0,2)(1,1)(2,2)
+:RE#51:B       \(a*\)*b\(\1\)          ab      (0,2)(1,1)(2,2)
+:RE#52:B       \(a*\)b\(\1\)*          ab      (0,2)(0,1)(?,?)
+:RE#53:B       \(a*\)*b\(\1\)*         ab      (0,2)(1,1)(2,2)
+:RE#54:B       \(a\{0,1\}\)*b\1        aba     (0,3)(0,1)
+:RE#55:B       \(a*\)*b\1              aba     (0,3)(0,1)
+:RE#56:B       \(a*\)b\1*              aba     (0,3)(0,1)
+:RE#57:B       \(a*\)*b\1*             aba     (0,3)(0,1)
+:RE#58:B       \(a*\)*b\(\1\)*         aba     (0,3)(0,1)(2,3)
+:RE#59:B       \(a\{0,1\}\)*b\1        abaa    (0,3)(0,1)
+:RE#60:B       \(a*\)*b\1              abaa    (0,3)(0,1)
+:RE#61:B       \(a*\)b\1*              abaa    (0,4)(0,1)
+:RE#62:B       \(a*\)*b\1*             abaa    (0,4)(0,1)
+:RE#63:B       \(a*\)*b\(\1\)*         abaa    (0,4)(0,1)(3,4)
+:RE#64:B       \(a\{0,1\}\)*b\1        aab     (0,3)(2,2)
+:RE#65:B       \(a*\)*b\1              aab     (0,3)(2,2)
+:RE#66:B       \(a*\)b\1*              aab     (0,3)(0,2)
+:RE#67:B       \(a*\)*b\1*             aab     (0,3)(2,2)
+:RE#68:B       \(a*\)*b\(\1\)*         aab     (0,3)(2,2)(3,3)
+:RE#69:B       \(a\{0,1\}\)*b\1        aaba    (0,4)(1,2)
+:RE#70:B       \(a*\)*b\1              aaba    (0,4)(1,2)
+:RE#71:B       \(a*\)b\1*              aaba    (0,3)(0,2)
+:RE#72:B       \(a*\)*b\1*             aaba    (0,4)(1,2)
+:RE#73:B       \(a*\)*b\(\1\)*         aaba    (0,4)(1,2)(3,4)
+:RE#74:B       \(a\{0,1\}\)*b\1        aabaa   (0,4)(1,2)
+:RE#75:B       \(a*\)*b\1              aabaa   (0,5)(0,2)
+:RE#76:B       \(a*\)b\1*              aabaa   (0,5)(0,2)
+:RE#77:B       \(a*\)*b\1*             aabaa   (0,5)(0,2)
+:RE#78:B       \(a*\)*b\(\1\)*         aabaa   (0,5)(0,2)(3,5)
+:RE#79:B       \(x\)*a\1               a       NOMATCH
+:RE#80:B       \(x\)*a\1*              a       (0,1)(?,?)
+:RE#81:B       \(x\)*a\(\1\)           a       NOMATCH
+:RE#82:B       \(x\)*a\(\1\)*          a       (0,1)(?,?)(?,?)
+:RE#83:E       (aa(b(b))?)+            aabbaa  (0,6)(4,6)(?,?)(?,?)
+:RE#84:E       (a(b)?)+                aba     (0,3)(2,3)(?,?)
+:RE#85:E       ([ab]+)([bc]+)([cd]*)           abcd            (0,4)(0,2)(2,3)(3,4)
+:RE#86:B       \([ab]*\)\([bc]*\)\([cd]*\)\1   abcdaa          (0,5)(0,1)(1,3)(3,4)
+:RE#87:B       \([ab]*\)\([bc]*\)\([cd]*\)\1   abcdab          (0,6)(0,2)(2,3)(3,4)
+:RE#88:B       \([ab]*\)\([bc]*\)\([cd]*\)\1*  abcdaa          (0,6)(0,1)(1,3)(3,4)
+:RE#89:B       \([ab]*\)\([bc]*\)\([cd]*\)\1*  abcdab          (0,6)(0,2)(2,3)(3,4)
+:RE#90:E       ^(A([^B]*))?(B(.*))?            Aa              (0,2)(0,2)(1,2)
+:RE#91:E       ^(A([^B]*))?(B(.*))?            Bb              (0,2)(?,?)(?,?)(0,2)(1,2)
+:RE#92:B       .*\([AB]\).*\1                  ABA             (0,3)(0,1)
+:RE#93:B$      [^A]*A                          \nA             (0,2)
index 4da6e59e8fd308357ad3f4e0eba80140f4577933..b02753d8d817b9db252d07aec7831fe3427faab8 100755 (executable)
@@ -8,11 +8,12 @@ tests="$tests rightassoc.dat"
 #tests="$tests leftassoc.dat"
 tests="$tests forcedassoc.dat"
 tests="$tests repetition.dat"
+tests="$tests interpretation.dat"
 
 for t in $tests; do
-  #printf "%-16s" "$t"
+  printf "%-20s" "$t"
   #$rxtest < data/$t | grep -vE '(NOTE|Research)'
-  $rxtest < data/$t | tail -n +5 | grep -vE 'haskell|mimi'
+  $rxtest < data/$t | tail -n +4 | grep -vE 'haskell|mimi|NOTE'
 done
 
 #$rxtest < data/categorize.dat | tail -n +4