Is there a programatic way to identify c# reserved words?
I'm looking for a function like public bool IsAReservedWord(string TestWord) I know I could roll my own by grabbing a reserve word list from MSDN. However I was hoping there was something built into either the language or .NET reflection that could be relied upon so I wouldn't have to revisit the function when I move to newer versions of C#/.NET. The reason I'm looking for this is I'm looking for a safeguard in .tt file code generation. CSharpCodeProvider cs = new CSharpCodeProvider(); var test = cs.IsValidIdentifier("new"); // returns false var test2 = cs.IsValidIdentifier("new1"); // returns