1 classmap HttpClassMap;
2
3 tokens HttpTokens
4 {
5 (DIGIT, "'digit'"), (HEX, "'hex'"), (ALPHA, "'alpha'"), (HT, "'\t'"), (DQ, "'dq'"), (CR, "'\r'"), (LF, "'\n'"), (CTL, "'ctl'"), (SP, "' '"),
6 (COLON, "'colon'"), (SEMICOLON, "';'"), (AT, "'@'"), (COMMA, "','"), (DOT, "'.'"), (LPAREN, "'('"), (RPAREN, "')'"), (LANGLE, "'<'"),
7 (RANGLE, "'>'"), (LBRACKET, "'['"), (RBRACKET, "']'"), (LBRACE, "'{'"), (RBRACE, "'}'"), (SLASH, "'/'"), (BACKSLASH, "'\\'"), (QUEST, "'?'"), (EQ, "'='"),
8 (CHAR, "'char'"), (TEXT, "'text'"), (OCTET, "'octet'")
9 }
10
11 expressions
12 {
13 digit = "[0-9]";
14 hex = "{digit}|[a-fA-F]";
15 alpha = "[a-zA-Z]";
16 ht = "\t";
17 dq = "\"";
18 cr = "\r";
19 lf = "\n";
20 ctl = "[\x0-\x1f\x7f]";
21 sp = " ";
22 colon = ":";
23 semicolon = ";";
24 at = "@";
25 comma = ",";
26 dot = "\.";
27 lparen = "\(";
28 rparen = "\)";
29 langle = "<";
30 rangle = ">";
31 lbracket = "\[";
32 rbracket = "\]";
33 lbrace = "\{";
34 rbrace = "\}";
35 slash = "/";
36 backslash = "\\";
37 quest = "\?";
38 eq = "=";
39 chr = "[\x0-\x7f]";
40 text = "[\20-\xff]";
41 octet = "[\x0-\xff]";
42 }
43
44 lexer HttpLexer
45 {
46 "{digit}"{ return DIGIT; }
47 "{hex}"{ return HEX; }
48 "{alpha}"{ return ALPHA; }
49 "{ht}"{ return HT; }
50 "{dq}"{ return DQ; }
51 "{cr}"{ return CR; }
52 "{lf}"{ return LF; }
53 "{ctl}"{ return CTL; }
54 "{sp}"{ return SP; }
55 "{colon}"{ return COLON; }
56 "{semicolon}"{ return SEMICOLON; }
57 "{at}"{ return AT; }
58 "{comma}"{ return COMMA; }
59 "{dot}"{ return DOT; }
60 "{lparen}"{ return LPAREN; }
61 "{rparen}"{ return RPAREN; }
62 "{langle}"{ return LANGLE; }
63 "{rangle}"{ return RANGLE; }
64 "{lbracket}"{ return LBRACKET; }
65 "{rbracket}"{ return RBRACKET; }
66 "{lbrace}"{ return LBRACE; }
67 "{rbrace}"{ return RBRACE; }
68 "{slash}"{ return SLASH; }
69 "{backslash}"{ return BACKSLASH; }
70 "{quest}"{ return QUEST; }
71 "{eq}"{ return EQ; }
72 "{chr}"{ return CHAR; }
73 "{text}"{ return TEXT; }
74 "{octet}"{ return OCTET; }
75 }