// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using ICSharpCode.SharpDevelop.Dom; namespace ICSharpCode.SharpDevelop.Dom.CSharp { public static class CSharpExpressionContext { /// The context is the body of a property declaration. /// string Name { *expr* } public readonly static ExpressionContext PropertyDeclaration = new ExpressionContext.DefaultExpressionContext("PropertyDeclaration"); /// The context is the body of a property declaration inside an interface. /// string Name { *expr* } public readonly static ExpressionContext InterfacePropertyDeclaration = new ExpressionContext.DefaultExpressionContext("InterfacePropertyDeclaration"); /// The context is the body of a event declaration. /// event EventHandler NameChanged { *expr* } public readonly static ExpressionContext EventDeclaration = new ExpressionContext.DefaultExpressionContext("EventDeclaration"); /// The context is after the type parameters of a type/method declaration. /// The only valid keyword is "where" /// class <T> *expr* public readonly static ExpressionContext ConstraintsStart = new ExpressionContext.DefaultExpressionContext("ConstraintsStart"); /// The context is after the 'where' of a constraints list. /// class <T> where *expr* public readonly static ExpressionContext Constraints = new ExpressionContext.NonStaticTypeExpressionContext("Constraints", false); /// The context is the body of an interface declaration. public readonly static ExpressionContext InterfaceDeclaration = new ExpressionContext.NonStaticTypeExpressionContext("InterfaceDeclaration", true); /// Context expects "base" or "this". /// public ClassName() : *expr* public readonly static ExpressionContext BaseConstructorCall = new ExpressionContext.DefaultExpressionContext("BaseConstructorCall"); /// The first parameter /// void MethodName(*expr*) public readonly static ExpressionContext FirstParameterType = new ExpressionContext.NonStaticTypeExpressionContext("FirstParameterType", false); /// Another parameter /// void MethodName(..., *expr*) public readonly static ExpressionContext ParameterType = new ExpressionContext.NonStaticTypeExpressionContext("ParameterType", false); /// Context expects a fully qualified type name. /// using Alias = *expr*; public readonly static ExpressionContext FullyQualifiedType = new ExpressionContext.DefaultExpressionContext("FullyQualifiedType"); /// Context expects is a property name in an object initializer. /// new *type* [(args)] { *expr* = ... } public readonly static ExpressionContext ObjectInitializer = new ExpressionContext.DefaultExpressionContext("ObjectInitializer"); } }