30 using System.Collections.Generic;
32 namespace OpenSim.
Region.ScriptEngine.Shared.CodeTools
40 internal class CSReservedWords
42 private static List<string> reservedWords =
new List<string>(
new string[] {
44 "base",
"bool",
"break",
"byte",
45 "case",
"catch",
"char",
"checked",
"class",
"const",
"continue",
46 "decimal",
"default",
"delegate",
53 "false",
"finally",
"fixed",
58 "implicit",
"in",
"int",
"interface",
"internal",
"is",
60 "namespace",
"new",
"null",
61 "object",
"operator",
"out",
"override",
62 "params",
"private",
"protected",
"public",
65 "sbyte",
"sealed",
"short",
"sizeof",
"stackalloc",
"static",
68 "this",
"throw",
"true",
"try",
"typeof",
69 "uint",
"ulong",
"unchecked",
"unsafe",
"ushort",
"using",
70 "virtual",
"void",
"volatile",
78 internal static bool IsReservedWord(
string word)
82 if (
String.IsNullOrEmpty(word))
return false;
83 if (word.Length < 2)
return false;
84 if (word.StartsWith(
"ll"))
return false;
85 char first = word.ToCharArray(0,1)[0];
86 if (first >=
'A' && first <=
'Z')
return false;
88 return (reservedWords.BinarySearch(word) >= 0);