~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/NRefactory/Project/Src/Lexer/CSharp/Keywords.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// this file was autogenerated by a tool.
2
 
using System;
3
 
 
4
 
namespace ICSharpCode.OldNRefactory.Parser.CSharp
5
 
{
6
 
        public static class Keywords
7
 
        {
8
 
                static readonly string[] keywordList = {
9
 
                        "abstract",
10
 
                        "as",
11
 
                        "base",
12
 
                        "bool",
13
 
                        "break",
14
 
                        "byte",
15
 
                        "case",
16
 
                        "catch",
17
 
                        "char",
18
 
                        "checked",
19
 
                        "class",
20
 
                        "const",
21
 
                        "continue",
22
 
                        "decimal",
23
 
                        "default",
24
 
                        "delegate",
25
 
                        "do",
26
 
                        "double",
27
 
                        "else",
28
 
                        "enum",
29
 
                        "event",
30
 
                        "explicit",
31
 
                        "extern",
32
 
                        "false",
33
 
                        "finally",
34
 
                        "fixed",
35
 
                        "float",
36
 
                        "for",
37
 
                        "foreach",
38
 
                        "goto",
39
 
                        "if",
40
 
                        "implicit",
41
 
                        "in",
42
 
                        "int",
43
 
                        "interface",
44
 
                        "internal",
45
 
                        "is",
46
 
                        "lock",
47
 
                        "long",
48
 
                        "namespace",
49
 
                        "new",
50
 
                        "null",
51
 
                        "object",
52
 
                        "operator",
53
 
                        "out",
54
 
                        "override",
55
 
                        "params",
56
 
                        "private",
57
 
                        "protected",
58
 
                        "public",
59
 
                        "readonly",
60
 
                        "ref",
61
 
                        "return",
62
 
                        "sbyte",
63
 
                        "sealed",
64
 
                        "short",
65
 
                        "sizeof",
66
 
                        "stackalloc",
67
 
                        "static",
68
 
                        "string",
69
 
                        "struct",
70
 
                        "switch",
71
 
                        "this",
72
 
                        "throw",
73
 
                        "true",
74
 
                        "try",
75
 
                        "typeof",
76
 
                        "uint",
77
 
                        "ulong",
78
 
                        "unchecked",
79
 
                        "unsafe",
80
 
                        "ushort",
81
 
                        "using",
82
 
                        "virtual",
83
 
                        "void",
84
 
                        "volatile",
85
 
                        "while",
86
 
                        "partial",
87
 
                        "where",
88
 
                        "get",
89
 
                        "set",
90
 
                        "add",
91
 
                        "remove",
92
 
                        "yield",
93
 
                        "select",
94
 
                        "group",
95
 
                        "by",
96
 
                        "into",
97
 
                        "from",
98
 
                        "ascending",
99
 
                        "descending",
100
 
                        "orderby",
101
 
                        "let",
102
 
                        "join",
103
 
                        "on",
104
 
                        "equals"
105
 
                };
106
 
                
107
 
                static LookupTable keywords = new LookupTable(true);
108
 
                
109
 
                static Keywords()
110
 
                {
111
 
                        for (int i = 0; i < keywordList.Length; ++i) {
112
 
                                keywords[keywordList[i]] = i + Tokens.Abstract;
113
 
                        }
114
 
                }
115
 
                
116
 
                public static int GetToken(string keyword)
117
 
                {
118
 
                        return keywords[keyword];
119
 
                }
120
 
                
121
 
                public static bool IsNonIdentifierKeyword(string word)
122
 
                {
123
 
                        int token = GetToken(word);
124
 
                        if (token < 0)
125
 
                                return false;
126
 
                        return !Tokens.IdentifierTokens[token];
127
 
                }
128
 
        }
129
 
}