// // Roles.cs // // Author: // Mike Krüger // // Copyright (c) 2012 Xamarin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace ICSharpCode.NRefactory.CSharp { public static class Roles { public static readonly Role Root = AstNode.RootRole; // some pre defined constants for common roles public static readonly Role Identifier = new Role ("Identifier", CSharp.Identifier.Null); public static readonly Role Body = new Role ("Body", CSharp.BlockStatement.Null); public static readonly Role Parameter = new Role ("Parameter"); public static readonly Role Argument = new Role ("Argument", CSharp.Expression.Null); public static readonly Role Type = new Role ("Type", CSharp.AstType.Null); public static readonly Role Expression = new Role ("Expression", CSharp.Expression.Null); public static readonly Role TargetExpression = new Role ("Target", CSharp.Expression.Null); public readonly static Role Condition = new Role ("Condition", CSharp.Expression.Null); public static readonly Role TypeParameter = new Role ("TypeParameter"); public static readonly Role TypeArgument = new Role ("TypeArgument", CSharp.AstType.Null); public readonly static Role Constraint = new Role ("Constraint"); public static readonly Role Variable = new Role ("Variable", VariableInitializer.Null); public static readonly Role EmbeddedStatement = new Role ("EmbeddedStatement", CSharp.Statement.Null); public readonly static Role TypeMemberRole = new Role ("TypeMember"); // public static readonly TokenRole Keyword = new TokenRole ("Keyword", CSharpTokenNode.Null); // public static readonly TokenRole InKeyword = new TokenRole ("InKeyword", CSharpTokenNode.Null); // some pre defined constants for most used punctuation public static readonly TokenRole LPar = new TokenRole ("("); public static readonly TokenRole RPar = new TokenRole (")"); public static readonly TokenRole LBracket = new TokenRole ("["); public static readonly TokenRole RBracket = new TokenRole ("]"); public static readonly TokenRole LBrace = new TokenRole ("{"); public static readonly TokenRole RBrace = new TokenRole ("}"); public static readonly TokenRole LChevron = new TokenRole ("<"); public static readonly TokenRole RChevron = new TokenRole (">"); public static readonly TokenRole Comma = new TokenRole (","); public static readonly TokenRole Dot = new TokenRole ("."); public static readonly TokenRole Semicolon = new TokenRole (";"); public static readonly TokenRole Assign = new TokenRole ("="); public static readonly TokenRole Colon = new TokenRole (":"); public static readonly TokenRole DoubleColon = new TokenRole ("::"); public static readonly Role Comment = new Role ("Comment"); public static readonly Role NewLine = new Role ("NewLine"); public static readonly Role Whitespace = new Role ("Whitespace"); public static readonly Role Text = new Role ("Text"); public static readonly Role PreProcessorDirective = new Role ("PreProcessorDirective"); public static readonly Role Error = new Role ("Error"); public readonly static Role BaseType = new Role ("BaseType", AstType.Null); public static readonly Role Attribute = new Role ("Attribute"); public static readonly Role AttributeTargetRole = new Role ("AttributeTarget", CSharpTokenNode.Null); public readonly static TokenRole WhereKeyword = new TokenRole ("where"); public readonly static Role ConstraintTypeParameter = new Role ("TypeParameter", SimpleType.Null); public readonly static TokenRole DelegateKeyword = new TokenRole ("delegate"); public static readonly TokenRole ExternKeyword = new TokenRole ("extern"); public static readonly TokenRole AliasKeyword = new TokenRole ("alias"); public static readonly TokenRole NamespaceKeyword = new TokenRole ("namespace"); public static readonly TokenRole EnumKeyword = new TokenRole ("enum"); public static readonly TokenRole InterfaceKeyword = new TokenRole ("interface"); public static readonly TokenRole StructKeyword = new TokenRole ("struct"); public static readonly TokenRole ClassKeyword = new TokenRole ("class"); } }