]> pd.if.org Git - pccts/blobdiff - support/rexpr/test.c
auto commit for import
[pccts] / support / rexpr / test.c
diff --git a/support/rexpr/test.c b/support/rexpr/test.c
new file mode 100755 (executable)
index 0000000..e159cc4
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include "rexpr.h"
+
+/*
+ * test for rexpr().
+ * To make this test:
+ *     cc -o rexpr test.c rexpr.c
+ * Then from command line type:
+ *     rexpr r string
+ * where r is the regular expression that decribes a language
+ * and string is the string to verify.
+ */
+main(argc,argv)
+int argc;
+char *argv[];
+{
+       if ( argc!=3 ) fprintf(stderr,"rexpr: expr s\n");
+       else printf("%d\n", rexpr(argv[1], argv[2]));
+}