simple.cc - generated code example
[prop.git] / tools / test / test2.pcc
blobd28670390e544caa50c6d2cae3a8c682ee919b34
1 //
2 //  Testing the ability of the preprocessor to locate
3 //  regular expression syntax errors
4 //
6 #include <iostream.h>
7 int f()
9    matchscan (cin) {
10       case /[0-9]+/:                 return 0;
11       case /[a-zA-Z_][a-zA-Z0-9_]*/: return 1;
12       case /[0-9 +/:                 return 2;  // error
13    }
14    matchscan (cin) {
15       case /?abcde/:                 return 4;  // error
16    } 
17    matchscan (cin) {
18       case /[a-zA-Z_][a-zZ-A0-9_]*/: return 3;  // error
19    }