1 using System;
 2 
 3 namespace XPathKeywords
 4 {
 5     internal class Keywords
 6     {
 7         static Keywords() : 
 8             instance(new Keywords())
 9         {
10         }
11         public static Keywords& Instance()
12         {
13             return *instance;
14         }
15         public System.Lex.KeywordMap* GetKeywordMap()
16         {
17             return keywordMap.Get();
18         }
19         private Keywords()
20         {
21             System.Lex.Keyword keyword0(u"or"XPathTokens.OR);
22             keywordList.Add(keyword0);
23             System.Lex.Keyword keyword1(u"and"XPathTokens.AND);
24             keywordList.Add(keyword1);
25             System.Lex.Keyword keyword2(u"div"XPathTokens.DIV);
26             keywordList.Add(keyword2);
27             System.Lex.Keyword keyword3(u"mod"XPathTokens.MOD);
28             keywordList.Add(keyword3);
29             System.Lex.Keyword keyword4(u"ancestor"XPathTokens.ANCESTOR);
30             keywordList.Add(keyword4);
31             System.Lex.Keyword keyword5(u"ancestor-or-self"XPathTokens.ANCESTOR_OR_SELF);
32             keywordList.Add(keyword5);
33             System.Lex.Keyword keyword6(u"attribute"XPathTokens.ATTRIBUTE);
34             keywordList.Add(keyword6);
35             System.Lex.Keyword keyword7(u"child"XPathTokens.CHILD);
36             keywordList.Add(keyword7);
37             System.Lex.Keyword keyword8(u"descendant"XPathTokens.DESCENDANT);
38             keywordList.Add(keyword8);
39             System.Lex.Keyword keyword9(u"descendant-or-self"XPathTokens.DESCENDANT_OR_SELF);
40             keywordList.Add(keyword9);
41             System.Lex.Keyword keyword10(u"following"XPathTokens.FOLLOWING);
42             keywordList.Add(keyword10);
43             System.Lex.Keyword keyword11(u"following-sibling"XPathTokens.FOLLOWING_SIBLING);
44             keywordList.Add(keyword11);
45             System.Lex.Keyword keyword12(u"namespace"XPathTokens.NAMESPACE);
46             keywordList.Add(keyword12);
47             System.Lex.Keyword keyword13(u"parent"XPathTokens.PARENT);
48             keywordList.Add(keyword13);
49             System.Lex.Keyword keyword14(u"preceding"XPathTokens.PRECEDING);
50             keywordList.Add(keyword14);
51             System.Lex.Keyword keyword15(u"preceding-sibling"XPathTokens.PRECEDING_SIBLING);
52             keywordList.Add(keyword15);
53             System.Lex.Keyword keyword16(u"self"XPathTokens.SELF);
54             keywordList.Add(keyword16);
55             System.Lex.Keyword keyword17(u"processing-instruction"XPathTokens.PROCESSING_INSTRUCTION);
56             keywordList.Add(keyword17);
57             System.Lex.Keyword keyword18(u"comment"XPathTokens.COMMENT);
58             keywordList.Add(keyword18);
59             System.Lex.Keyword keyword19(u"text"XPathTokens.TEXT);
60             keywordList.Add(keyword19);
61             System.Lex.Keyword keyword20(u"node"XPathTokens.NODE);
62             keywordList.Add(keyword20);
63             System.Lex.Keyword nullKeyword(null-1);
64             keywordList.Add(nullKeyword);
65             keywordMap.Reset(new System.Lex.KeywordMap(keywordList.CBegin().Ptr()));
66         }
67         private static System.UniquePtr<Keywords> instance;
68         private System.Collections.List<System.Lex.Keyword> keywordList;
69         private System.UniquePtr<System.Lex.KeywordMap> keywordMap;
70     }
71     public System.Lex.KeywordMap* GetKeywordMap()
72     {
73         return Keywords.Instance().GetKeywordMap();
74     }
75 } // namespace XPathKeywords