Debian Codegraph @

terps/tads/tads3/test/data/gram_or2.t

raw
1 #include "dict.h"
2 #include "gramprod.h"
3 #include "tads.h"
4 #include "t3.h"
5 #include "tok.h"
6
7 main(args)
8 {
9 "Test. Type 'quit' to exit.\b";
10
11 for (;;)
12 {
13 local str, toks, matches;
14
15 ">";
16 str = inputLine();
17 try { toks = Tokenizer.tokenize(str); }
18 catch (TokErrorNoMatch e) { continue; }
19
20 if (toks.length() == 1 && toks[1][1] == 'quit') break;
21
22 matches = command.parseTokens(toks, nil);
23 "Matches: <<matches.length()>>\b";
24 }
25 }
26
27 grammar command: 'a' | 'b' ('c' | 'd'): object;
28