1
2
3
4
5
6 classmap ProjectFileClassMap;
7
8 tokens ProjectFileTokens
9 {
10 (PROJECT, "'project'"), (SOURCE, "'source'"), (ID, "identifier"), (FILEPATH, "file path"), (DOT, "'.'"), (SEMICOLON, "';'"), (RULES, "'rules'")
11 }
12
13 keywords ProjectFileKeywords
14 {
15 ("project", PROJECT), ("source", SOURCE), ("rules", RULES)
16 }
17
18 expressions
19 {
20 ws = "[\n\r\t ]";
21 newline = "\r\n|\n|\r";
22 linecomment = "//[^\n\r]*{newline}";
23 blockcomment = "/\*([^*]|\*[^/])*\*/";
24 comment = "{linecomment}|{blockcomment}";
25 separators = "({ws}|{comment})+";
26 id = "{idstart}{idcont}*";
27 filepath = "<[^\n>]*>";
28 }
29
30 lexer ProjectFileLexer
31 {
32 "{separators}" {}
33 "{id}" { int kw = GetKeywordToken(token.match); if (kw == INVALID_TOKEN) return ID; else return kw; }
34 "{filepath}" { filePath = soulcm.scmpg.MakeFilePath(FileName(), token); return FILEPATH; }
35 "\." { return DOT; }
36 ";" { return SEMICOLON; }
37
38 variables
39 {
40 string filePath;
41 }
42 }