1
2
3
4
5
6 classmap AssemblyClassMap;
7
8 tokens AssemblyTokens
9 {
10 (DECIMAL_CONSTANT, "'decimal constant'"), (HEX_CONSTANT, "'hex constant'"), (CHAR_CONSTANT, "'char constant'"), (STRING_CONSTANT, "'string constant'"), (CLSID_CONSTANT, "'clsid constant'"),
11 (LOCAL_SYMBOL, "'local symbol'"), (SYMBOL, "'symbol'"), (AT, "'at'"), (PLUS, "'plus'"), (MINUS, "'minus'"), (TILDE, "'tilde'"), (DOLLAR, "'$'"), (AMP, "'amp'"), (AST, "'ast'"),
12 (SLASHSLASH, "'slashslash'"), (SLASH, "'slash'"), (PERCENT, "'percent'"), (SHIFT_LEFT, "'shift left'"), (SHIFT_RIGHT, "'shift right'"), (BAR, "'bar'"), (CARET, "'caret'"), (DOT, "'dot'"),
13 (SPACE, "'space'"), (NEWLINE, "'newline'"), (LPAREN, "'('"), (RPAREN, "')'"), (SEMICOLON, "';'"), (COMMA, "','"), (CHAR, "'char'")
14 }
15
16 expressions
17 {
18 space = "[ \t]+";
19 newline = "\n\r|\n|\r";
20 digit = "[0-9]";
21 decimalConstant = "{digit}+";
22 hexdigit = "[0-9a-fA-F]";
23 hexConstant = "#{hexdigit}+";
24 charConstant = "'[^'\n\r]'";
25 stringConstant = "\"[^\"\n\r]*\"";
26 clsIdConstant = "$CLSID\({hexdigit}+\)";
27 localSymbol = "@{digit}+";
28 symbol = "({idstart}|:|_)({idcont}|:|_|@)*";
29 at = "@";
30 plus = "\+";
31 minus = "-";
32 tilde = "~";
33 dollar = "$";
34 amp = "&";
35 ast = "\*";
36 slashSlash = "//";
37 slash = "/";
38 percent = "%";
39 shiftLeft = "<<";
40 shiftRight = ">>";
41 bar = "\|";
42 caret = "^";
43 dot = "\.";
44 lparen = "\(";
45 rparen = "\)";
46 semicolon = ";";
47 comma = ",";
48 }
49
50 lexer AssemblyLexer
51 {
52 "{space}" { return SPACE; }
53 "{newline}" { return NEWLINE; }
54 "{decimalConstant}" { return DECIMAL_CONSTANT; }
55 "{hexConstant}" { return HEX_CONSTANT; }
56 "{charConstant}" { return CHAR_CONSTANT; }
57 "{stringConstant}" { return STRING_CONSTANT; }
58 "{clsIdConstant}" { return CLSID_CONSTANT; }
59 "{localSymbol}" { return LOCAL_SYMBOL; }
60 "{symbol}" { return SYMBOL; }
61 "{at}" { return AT; }
62 "{plus}" { return PLUS; }
63 "{minus}" { return MINUS; }
64 "{tilde}" { return TILDE; }
65 "{dollar}" { return DOLLAR; }
66 "{amp}" { return AMP; }
67 "{ast}" { return AST; }
68 "{slashSlash}" { return SLASHSLASH; }
69 "{slash}" { return SLASH; }
70 "{percent}" { return PERCENT; }
71 "{shiftLeft}" { return SHIFT_LEFT; }
72 "{shiftRight}" { return SHIFT_RIGHT; }
73 "{bar}" { return BAR; }
74 "{caret}" { return CARET; }
75 "{dot}" { return DOT; }
76 "{lparen}" { return LPAREN; }
77 "{rparen}" { return RPAREN; }
78 "{semicolon}" { return SEMICOLON; }
79 "{comma}" { return COMMA; }
80 "." { return CHAR; }
81 }