cfad47cfa3/t3compiler/tads3/test/data/gram_or2.t

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
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