5
// Mike Krüger <mkrueger@xamarin.com>
7
// Copyright (c) 2012 Xamarin <http://xamarin.com>
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
// of this software and associated documentation files (the "Software"), to deal
11
// in the Software without restriction, including without limitation the rights
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
// copies of the Software, and to permit persons to whom the Software is
14
// furnished to do so, subject to the following conditions:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
namespace ICSharpCode.NRefactory.CSharp
31
public static class Roles
33
public static readonly Role<AstNode> Root = AstNode.RootRole;
35
// some pre defined constants for common roles
36
public static readonly Role<Identifier> Identifier = new Role<Identifier> ("Identifier", CSharp.Identifier.Null);
37
public static readonly Role<BlockStatement> Body = new Role<BlockStatement> ("Body", CSharp.BlockStatement.Null);
38
public static readonly Role<ParameterDeclaration> Parameter = new Role<ParameterDeclaration> ("Parameter");
39
public static readonly Role<Expression> Argument = new Role<Expression> ("Argument", CSharp.Expression.Null);
40
public static readonly Role<AstType> Type = new Role<AstType> ("Type", CSharp.AstType.Null);
41
public static readonly Role<Expression> Expression = new Role<Expression> ("Expression", CSharp.Expression.Null);
42
public static readonly Role<Expression> TargetExpression = new Role<Expression> ("Target", CSharp.Expression.Null);
43
public readonly static Role<Expression> Condition = new Role<Expression> ("Condition", CSharp.Expression.Null);
44
public static readonly Role<TypeParameterDeclaration> TypeParameter = new Role<TypeParameterDeclaration> ("TypeParameter");
45
public static readonly Role<AstType> TypeArgument = new Role<AstType> ("TypeArgument", CSharp.AstType.Null);
46
public readonly static Role<Constraint> Constraint = new Role<Constraint> ("Constraint");
47
public static readonly Role<VariableInitializer> Variable = new Role<VariableInitializer> ("Variable", VariableInitializer.Null);
48
public static readonly Role<Statement> EmbeddedStatement = new Role<Statement> ("EmbeddedStatement", CSharp.Statement.Null);
49
public readonly static Role<EntityDeclaration> TypeMemberRole = new Role<EntityDeclaration> ("TypeMember");
52
// public static readonly TokenRole Keyword = new TokenRole ("Keyword", CSharpTokenNode.Null);
53
// public static readonly TokenRole InKeyword = new TokenRole ("InKeyword", CSharpTokenNode.Null);
55
// some pre defined constants for most used punctuation
56
public static readonly TokenRole LPar = new TokenRole ("(");
57
public static readonly TokenRole RPar = new TokenRole (")");
58
public static readonly TokenRole LBracket = new TokenRole ("[");
59
public static readonly TokenRole RBracket = new TokenRole ("]");
60
public static readonly TokenRole LBrace = new TokenRole ("{");
61
public static readonly TokenRole RBrace = new TokenRole ("}");
62
public static readonly TokenRole LChevron = new TokenRole ("<");
63
public static readonly TokenRole RChevron = new TokenRole (">");
64
public static readonly TokenRole Comma = new TokenRole (",");
65
public static readonly TokenRole Dot = new TokenRole (".");
66
public static readonly TokenRole Semicolon = new TokenRole (";");
67
public static readonly TokenRole Assign = new TokenRole ("=");
68
public static readonly TokenRole Colon = new TokenRole (":");
69
public static readonly TokenRole DoubleColon = new TokenRole ("::");
70
public static readonly Role<Comment> Comment = new Role<Comment> ("Comment");
71
public static readonly Role<NewLineNode> NewLine = new Role<NewLineNode> ("NewLine");
72
public static readonly Role<WhitespaceNode> Whitespace = new Role<WhitespaceNode> ("Whitespace");
73
public static readonly Role<TextNode> Text = new Role<TextNode> ("Text");
74
public static readonly Role<PreProcessorDirective> PreProcessorDirective = new Role<PreProcessorDirective> ("PreProcessorDirective");
75
public static readonly Role<ErrorNode> Error = new Role<ErrorNode> ("Error");
77
public readonly static Role<AstType> BaseType = new Role<AstType> ("BaseType", AstType.Null);
79
public static readonly Role<Attribute> Attribute = new Role<Attribute> ("Attribute");
80
public static readonly Role<CSharpTokenNode> AttributeTargetRole = new Role<CSharpTokenNode> ("AttributeTarget", CSharpTokenNode.Null);
82
public readonly static TokenRole WhereKeyword = new TokenRole ("where");
83
public readonly static Role<SimpleType> ConstraintTypeParameter = new Role<SimpleType> ("TypeParameter", SimpleType.Null);
84
public readonly static TokenRole DelegateKeyword = new TokenRole ("delegate");
85
public static readonly TokenRole ExternKeyword = new TokenRole ("extern");
86
public static readonly TokenRole AliasKeyword = new TokenRole ("alias");
87
public static readonly TokenRole NamespaceKeyword = new TokenRole ("namespace");
89
public static readonly TokenRole EnumKeyword = new TokenRole ("enum");
90
public static readonly TokenRole InterfaceKeyword = new TokenRole ("interface");
91
public static readonly TokenRole StructKeyword = new TokenRole ("struct");
92
public static readonly TokenRole ClassKeyword = new TokenRole ("class");