1 using System;
2
3
4
5 namespace MdbKeywords
6 {
7 internal class Keywords
8 {
9 static Keywords() :
10 instance(new Keywords())
11 {
12 }
13 public static Keywords& Instance()
14 {
15 return *instance;
16 }
17 public System.Lex.KeywordMap* GetKeywordMap()
18 {
19 return keywordMap.Get();
20 }
21 private Keywords()
22 {
23 System.Lex.Keyword keyword0(u"print", MdbTokens.PRINT);
24 keywordList.Add(keyword0);
25 System.Lex.Keyword keyword1(u"trace", MdbTokens.TRACE);
26 keywordList.Add(keyword1);
27 System.Lex.Keyword keyword2(u"p", MdbTokens.PRINT);
28 keywordList.Add(keyword2);
29 System.Lex.Keyword keyword3(u"t", MdbTokens.TRACE);
30 keywordList.Add(keyword3);
31 System.Lex.Keyword nullKeyword(null, -1);
32 keywordList.Add(nullKeyword);
33 keywordMap.Reset(new System.Lex.KeywordMap(keywordList.CBegin().Ptr()));
34 }
35 private static System.UniquePtr<Keywords> instance;
36 private System.Collections.List<System.Lex.Keyword> keywordList;
37 private System.UniquePtr<System.Lex.KeywordMap> keywordMap;
38 }
39
40 public System.Lex.KeywordMap* GetKeywordMap()
41 {
42 return Keywords.Instance().GetKeywordMap();
43 }
44 }