• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Ast.ExpressionStatement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICSharpCode.NRefactory.Ast.ExpressionStatement的典型用法代码示例。如果您正苦于以下问题:C# ExpressionStatement类的具体用法?C# ExpressionStatement怎么用?C# ExpressionStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExpressionStatement类属于ICSharpCode.NRefactory.Ast命名空间,在下文中一共展示了ExpressionStatement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TrackedVisitConstructorDeclaration

        public override object TrackedVisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data)
        {
            const string initializerBlock = "InitializerBlock";
            if (constructorDeclaration.Name == initializerBlock)
            {
                TypeDeclaration type = (TypeDeclaration) constructorDeclaration.Parent;
                string initName = "Init" + type.Name;
                MethodDeclaration initMethod = GetInitMethod(type);
                initMethod.Body.Children.AddRange(constructorDeclaration.Body.Children);
                Expression initInvocation = new InvocationExpression(new IdentifierExpression(initName));
                ExpressionStatement initInvocationStatement = new ExpressionStatement(initInvocation);

                IList constructors = AstUtil.GetChildrenWithType(type, typeof(ConstructorDeclaration));
                if (constructors.Count > 1)
                {
                    foreach (ConstructorDeclaration constructor in constructors)
                    {
                        if (constructor.Name != initializerBlock && !HasInitInvocation(constructor))
                            constructor.Body.Children.Insert(0, initInvocationStatement);
                    }
                }
                else if (((ConstructorDeclaration) constructors[0]).Name == initializerBlock)
                {
                    ConstructorDeclaration constructor = new ConstructorDeclaration(type.Name, Modifiers.Public, null, null);
                    constructor.Body = new BlockStatement();
                    constructor.Body.AddChild(initInvocationStatement);
                    type.AddChild(constructor);
                }
                RemoveCurrentNode();
            }
            return base.TrackedVisitConstructorDeclaration(constructorDeclaration, data);
        }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:32,代码来源:InitializerBlockTransformer.cs


示例2: TrackedVisitExpressionStatement

 public override object TrackedVisitExpressionStatement(ExpressionStatement expressionStatement, object data)
 {
     IList list = new ArrayList();
     base.TrackedVisitExpressionStatement(expressionStatement, list);
     if (list.Count > 0)
         RemoveCurrentNode();
     return null;
 }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:8,代码来源:MemberExcludeTransformer.cs


示例3: TrackedVisitExpressionStatement

 public override object TrackedVisitExpressionStatement(ExpressionStatement ExpressionStatement, object data)
 {
     IList removeStatement = new ArrayList();
     base.TrackedVisitExpressionStatement(ExpressionStatement, removeStatement);
     if (removeStatement.Count > 0 && data != null && data is IList)
         ((IList) data).Add(ExpressionStatement);
     return null;
 }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:8,代码来源:MemberMapper.cs


示例4: VisitExpressionStatement

        public override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
        {
            tw.WriteStartElement("ExpressionStatement");

            base.VisitExpressionStatement(expressionStatement, data);
            tw.WriteEndElement();
            return null;
        }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:8,代码来源:AstXmlOutputVisitor.cs


示例5: VisitExpressionStatement

        public override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
        {
            Contract.Requires(expressionStatement != null);

            // Visit the expression of the expression statement (E.g InnvocationExpression)
            expressionStatement.Expression.AcceptVisitor(this, null);

            return null;
        }
开发者ID:chinaniit,项目名称:KnockoutGenerator,代码行数:9,代码来源:AstVisitor.cs


示例6: GetConstructor

 private ConstructorDeclaration GetConstructor(ExpressionStatement expression, TypeDeclaration typeDeclaration)
 {
     ConstructorDeclaration constructorDeclaration;
     constructorDeclaration = new ConstructorDeclaration(typeDeclaration.Name, Modifiers.Public, null, null);
     constructorDeclaration.Body = new BlockStatement();
     constructorDeclaration.Body.Children.Add(expression);
     typeDeclaration.Children.Add(constructorDeclaration);
     return constructorDeclaration;
 }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:9,代码来源:FieldInitializerTransformer.cs


示例7: GetArrayInitStatements

 private List<Statement> GetArrayInitStatements(ArrayCreateExpression arrayCreateExpression, string variableName, List<Expression> initializerList)
 {
     List<Statement> list = new List<Statement>();
     for (int idx = 0; idx < initializerList.Count; idx++)
     {
         AssignmentExpression assignment = InitArrayStatement(arrayCreateExpression, variableName, ((CollectionInitializerExpression) initializerList[idx]).CreateExpressions, idx);
         ExpressionStatement expressionStatement = new ExpressionStatement(assignment);
         list.Add(expressionStatement);
     }
     return list;
 }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:11,代码来源:ArrayInitializerTransformer.cs


示例8: GenerateCode

		protected override string GenerateCode(LanguageProperties language, IClass currentClass)
		{
			StringBuilder builder = new StringBuilder();
			IDocumentLine line = editor.Document.GetLineForOffset(anchor.Offset);
			string indent = DocumentUtilitites.GetWhitespaceAfter(editor.Document, line.Offset);
			bool implementInterface = this.implementInterface.IsChecked == true;
			bool hasOnPropertyChanged = HasOnPropertyChanged(currentClass);
			bool useEventArgs = false;
			
			if (implementInterface && !currentClass.IsStatic) {
				if (!hasOnPropertyChanged) {
					var nodes = new List<AbstractNode>();
					var rt = new GetClassReturnType(currentClass.ProjectContent, "System.ComponentModel.INotifyPropertyChanged", 0);
					if (!currentClass.ClassInheritanceTree.Any(bt => bt.FullyQualifiedName == "System.ComponentModel.INotifyPropertyChanged")) {
						int insertion = editor.Document.PositionToOffset(currentClass.BodyRegion.BeginLine, currentClass.BodyRegion.BeginColumn);
						if (currentClass.BaseTypes.Count > 0)
							editor.Document.Insert(insertion, ", INotifyPropertyChanged");
						else
							editor.Document.Insert(insertion, " : INotifyPropertyChanged");
					}
					language.CodeGenerator.ImplementInterface(nodes, rt, false, currentClass);
					var ev = rt.GetEvents().First(e => e.Name == "PropertyChanged");
					MethodDeclaration onEvent = language.CodeGenerator.CreateOnEventMethod(new DefaultEvent(ev.Name, ev.ReturnType, ev.Modifiers, ev.Region, ev.BodyRegion, currentClass));
					nodes.Add(onEvent);
					onEvent.Parameters[0].TypeReference = new TypeReference("string", true);
					onEvent.Parameters[0].ParameterName = "propertyName";
					((RaiseEventStatement)onEvent.Body.Children[0]).Arguments[1] = new ObjectCreateExpression(new TypeReference("PropertyChangedEventArgs"), new List<Expression> { new IdentifierExpression("propertyName") });
					foreach (var node in nodes)
						builder.AppendLine(language.CodeGenerator.GenerateCode(node, indent));
					useEventArgs = false;
				} else {
					useEventArgs = currentClass.DefaultReturnType.GetMethods().First(m => m.Name == "OnPropertyChanged").Parameters[0].ReturnType.FullyQualifiedName != "System.String";
				}
			}
			
			foreach (FieldWrapper field in listBox.SelectedItems) {
				var prop = language.CodeGenerator.CreateProperty(field.Field, true, field.AddSetter);
				if (!field.Field.IsStatic && !currentClass.IsStatic && field.AddSetter && implementInterface) {
					var invocation = new ExpressionStatement(CreateInvocation(field.PropertyName, useEventArgs));
					var assignment = prop.SetRegion.Block.Children[0];
					prop.SetRegion.Block.Children.Clear();
					prop.SetRegion.Block.AddChild(
						new IfElseStatement(
							new BinaryOperatorExpression(new IdentifierExpression(field.MemberName), BinaryOperatorType.InEquality, new IdentifierExpression("value")),
							new BlockStatement { Children = { assignment, invocation } }
						)
					);
				}
				builder.AppendLine(language.CodeGenerator.GenerateCode(prop, indent));
			}
			
			return builder.ToString().Trim();
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:53,代码来源:CreatePropertiesDialog.xaml.cs


示例9: TrackedVisitFieldDeclaration

        public override object TrackedVisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data)
        {
            VariableDeclaration field = (VariableDeclaration) fieldDeclaration.Fields[0];
            TypeDeclaration typeDeclaration = (TypeDeclaration) fieldDeclaration.Parent;

            NodeTypeExistenceVisitor nodeTypeExistenceVisitor = new NodeTypeExistenceVisitor(typeof(ThisReferenceExpression));
            NodeTypeExistenceVisitor indexerNodeExistenceVisitor = new NodeTypeExistenceVisitor(typeof(IndexerExpression));
            field.Initializer.AcceptVisitor(nodeTypeExistenceVisitor, null);
            field.Initializer.AcceptVisitor(indexerNodeExistenceVisitor, null);
            if (field.Initializer != null && (field.Initializer is InvocationExpression || IsArrayCreation(fieldDeclaration) || nodeTypeExistenceVisitor.Contains || indexerNodeExistenceVisitor.Contains)
                && !AstUtil.ContainsModifier(fieldDeclaration, Modifiers.Static))
            {
                IList constructors = AstUtil.GetChildrenWithType(typeDeclaration, typeof(ConstructorDeclaration));

                IdentifierExpression left = new IdentifierExpression(field.Name);
                Expression right = field.Initializer;
                AssignmentExpression assignmentExpression = new AssignmentExpression(left, AssignmentOperatorType.Assign, right);
                ExpressionStatement ExpressionStatement = new ExpressionStatement(assignmentExpression);
                field.Initializer = null;
                ConstructorDeclaration constructorDeclaration = null;
                ExpressionStatement.Parent = constructorDeclaration;

                foreach (ConstructorDeclaration consDec in constructors)
                {
                    if (!AstUtil.ContainsModifier(consDec, Modifiers.Static))
                    {
                        if (consDec.Parameters.Count == 0)
                        {
                            constructorDeclaration = consDec;
                            constructorDeclaration.Body.Children.Add(ExpressionStatement);
                            constructorDeclaration.Parent = typeDeclaration;
                            return base.TrackedVisitFieldDeclaration(fieldDeclaration, data);
                        }
                        else
                        {
                            consDec.ConstructorInitializer = new ConstructorInitializer();
                            consDec.ConstructorInitializer.ConstructorInitializerType = ConstructorInitializerType.This;
                        }
                    }
                }
                constructorDeclaration = GetConstructor(ExpressionStatement, typeDeclaration);
                constructorDeclaration.Parent = typeDeclaration;
                return base.TrackedVisitFieldDeclaration(fieldDeclaration, data);
            }
            return base.TrackedVisitFieldDeclaration(fieldDeclaration, data);
        }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:46,代码来源:FieldInitializerTransformer.cs


示例10: VisitExpressionStatement

 public override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
 {
     UnaryOperatorExpression uoe = expressionStatement.Expression as UnaryOperatorExpression;
     if (uoe != null) {
         switch (uoe.Op) {
             case UnaryOperatorType.Increment:
             case UnaryOperatorType.PostIncrement:
                 expressionStatement.Expression = new AssignmentExpression(uoe.Expression, AssignmentOperatorType.Add, new PrimitiveExpression(1, "1"));
                 break;
             case UnaryOperatorType.Decrement:
             case UnaryOperatorType.PostDecrement:
                 expressionStatement.Expression = new AssignmentExpression(uoe.Expression, AssignmentOperatorType.Subtract, new PrimitiveExpression(1, "1"));
                 break;
         }
     }
     return base.VisitExpressionStatement(expressionStatement, data);
 }
开发者ID:pusp,项目名称:o2platform,代码行数:17,代码来源:CSharpConstructsConvertVisitor.cs


示例11: VisitExpressionStatement

		public override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
		{
			base.VisitExpressionStatement(expressionStatement, data);
			AssignmentExpression ass = expressionStatement.Expression as AssignmentExpression;
			if (ass != null && ass.Right is AddressOfExpression) {
				if (ass.Op == AssignmentOperatorType.Add) {
					ReplaceCurrentNode(new AddHandlerStatement(ass.Left, ass.Right));
				} else if (ass.Op == AssignmentOperatorType.Subtract) {
					ReplaceCurrentNode(new RemoveHandlerStatement(ass.Left, ass.Right));
				}
			}
			return null;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:13,代码来源:ToVBNetConvertVisitor.cs


示例12: ResourceAcquisition

	void ResourceAcquisition(
#line  1783 "cs.ATG" 
out Statement stmt) {

#line  1785 "cs.ATG" 
		stmt = null;
		Expression expr;
		
		if (
#line  1790 "cs.ATG" 
IsLocalVarDecl()) {
			LocalVariableDecl(
#line  1790 "cs.ATG" 
out stmt);
		} else if (StartOf(6)) {
			Expr(
#line  1791 "cs.ATG" 
out expr);

#line  1795 "cs.ATG" 
			stmt = new ExpressionStatement(expr); 
		} else SynErr(204);
	}
开发者ID:pluraldj,项目名称:SharpDevelop,代码行数:23,代码来源:Parser.cs


示例13: PerformChanges

		public override List<Change> PerformChanges (RefactoringOptions options, object prop)
		{
			List<Change> result = new List<Change> ();
			ExtractMethodParameters param = (ExtractMethodParameters)prop;
			TextEditorData data = options.GetTextEditorData ();
			INRefactoryASTProvider provider = options.GetASTProvider ();
			IResolver resolver = options.GetResolver ();
			ICSharpCode.NRefactory.Ast.INode node = Analyze (options, param, false);
			if (param.VariablesToGenerate.Count > 0) {
				TextReplaceChange varGen = new TextReplaceChange ();
				varGen.Description = GettextCatalog.GetString ("Generate some temporary variables");
				varGen.FileName = options.Document.FileName;
				LineSegment line = data.Document.GetLine (Math.Max (0, data.Document.OffsetToLineNumber (data.SelectionRange.Offset) - 1));
				varGen.Offset = line.Offset + line.EditableLength;
				varGen.InsertedText = Environment.NewLine + options.GetWhitespaces (line.Offset);
				foreach (VariableDescriptor var in param.VariablesToGenerate) {
					TypeReference tr = options.ShortenTypeName (var.ReturnType).ConvertToTypeReference ();
					varGen.InsertedText += provider.OutputNode (options.Dom, new LocalVariableDeclaration (new VariableDeclaration (var.Name, null, tr))).Trim ();
				}
				result.Add (varGen);
			}
			InvocationExpression invocation = new InvocationExpression (new IdentifierExpression (param.Name));
			foreach (VariableDescriptor var in param.Parameters) {
				if (!param.OneChangedVariable && param.ChangedVariables.Contains (var.Name)) {
					FieldDirection fieldDirection = FieldDirection.Ref;
					VariableDescriptor outsideVar = null;
					if (param.VariablesOutside.TryGetValue (var.Name, out outsideVar) && (var.GetsAssigned || param.VariablesToGenerate.Where (v => v.Name == var.Name).Any ())) {
						if (!outsideVar.GetsAssigned)
							fieldDirection = FieldDirection.Out;
					}
					invocation.Arguments.Add (new DirectionExpression (fieldDirection, new IdentifierExpression (var.Name)));
				} else {
					invocation.Arguments.Add (new IdentifierExpression (var.Name));
				}
			}
			//	string mimeType = DesktopService.GetMimeTypeForUri (options.Document.FileName);
			TypeReference returnType = new TypeReference ("System.Void", true);
			ICSharpCode.NRefactory.Ast.INode outputNode;
			if (param.OneChangedVariable) {
				string name = param.ChangedVariables.First ();
				returnType = options.ShortenTypeName (param.Variables.Find (v => v.Name == name).ReturnType).ConvertToTypeReference ();
				if (param.OutsideVariableList.Any (v => v.Name == name && !v.IsDefined)) {
					LocalVariableDeclaration varDecl = new LocalVariableDeclaration (returnType);
					varDecl.Variables.Add (new VariableDeclaration (name, invocation));
					outputNode = varDecl;
				} else {
					outputNode = new ExpressionStatement (new AssignmentExpression (new IdentifierExpression (name), ICSharpCode.NRefactory.Ast.AssignmentOperatorType.Assign, invocation));
				}
			} else {
				outputNode = node is BlockStatement ? (ICSharpCode.NRefactory.Ast.INode)new ExpressionStatement (invocation) : invocation;
			}
			TextReplaceChange replacement = new TextReplaceChange ();
			replacement.Description = string.Format (GettextCatalog.GetString ("Substitute selected statement(s) with call to {0}"), param.Name);
			replacement.FileName = options.Document.FileName;
			replacement.Offset = options.Document.Editor.SelectionRange.Offset;
			replacement.RemovedChars = options.Document.Editor.SelectionRange.Length;
			replacement.MoveCaretToReplace = true;
			
			LineSegment line1 = data.Document.GetLineByOffset (options.Document.Editor.SelectionRange.EndOffset);
			if (options.Document.Editor.SelectionRange.EndOffset == line1.Offset) {
				if (line1.Offset > 0) {
					LineSegment line2 = data.Document.GetLineByOffset (line1.Offset - 1);
					replacement.RemovedChars -= line2.DelimiterLength;
				}
			}
			
			replacement.InsertedText = options.GetWhitespaces (options.Document.Editor.SelectionRange.Offset) + provider.OutputNode (options.Dom, outputNode).Trim ();
			
			result.Add (replacement);

			TextReplaceChange insertNewMethod = new TextReplaceChange ();
			insertNewMethod.FileName = options.Document.FileName;
			insertNewMethod.Description = string.Format (GettextCatalog.GetString ("Create new method {0} from selected statement(s)"), param.Name);
			insertNewMethod.RemovedChars = param.InsertionPoint.LineBefore == NewLineInsertion.Eol ? 0 : param.InsertionPoint.Location.Column;
			insertNewMethod.Offset = data.Document.LocationToOffset (param.InsertionPoint.Location) - insertNewMethod.RemovedChars;
			
			ExtractMethodAstTransformer transformer = new ExtractMethodAstTransformer (param.VariablesToGenerate);
			node.AcceptVisitor (transformer, null);
			if (!param.OneChangedVariable && node is Expression) {
				ResolveResult resolveResult = resolver.Resolve (new ExpressionResult ("(" + provider.OutputNode (options.Dom, node) + ")"), new DomLocation (options.Document.Editor.Caret.Line, options.Document.Editor.Caret.Column));
				if (resolveResult.ResolvedType != null)
					returnType = options.ShortenTypeName (resolveResult.ResolvedType).ConvertToTypeReference ();
			}
			
			MethodDeclaration methodDecl = new MethodDeclaration ();
			methodDecl.Name = param.Name;
			methodDecl.Modifier = param.Modifiers;
			methodDecl.TypeReference = returnType;
			
			if (!param.ReferencesMember)
				methodDecl.Modifier |= ICSharpCode.NRefactory.Ast.Modifiers.Static;
			if (node is BlockStatement) {
				methodDecl.Body = new BlockStatement ();
				methodDecl.Body.AddChild (new EmptyStatement ());
				if (param.OneChangedVariable)
					methodDecl.Body.AddChild (new ReturnStatement (new IdentifierExpression (param.ChangedVariables.First ())));
			} else if (node is Expression) {
				methodDecl.Body = new BlockStatement ();
				methodDecl.Body.AddChild (new ReturnStatement (node as Expression));
			}
//.........这里部分代码省略.........
开发者ID:pgoron,项目名称:monodevelop,代码行数:101,代码来源:ExtractMethodRefactoring.cs


示例14: VisitForeachStatement

		public override object VisitForeachStatement(ForeachStatement foreachStatement, object data)
		{
			base.VisitForeachStatement(foreachStatement, data);
			
			if (resolver.CompilationUnit == null)
				return null;
			
			if (foreachStatement.TypeReference.IsNull) {
				ResolveResult rr = resolver.ResolveIdentifier(foreachStatement.VariableName, foreachStatement.StartLocation, ExpressionContext.Default);
				if (rr != null && rr.ResolvedType != null) {
					BlockStatement blockStatement = foreachStatement.EmbeddedStatement as BlockStatement;
					if (blockStatement == null) {
						blockStatement = new BlockStatement();
						blockStatement.AddChild(foreachStatement.EmbeddedStatement);
						foreachStatement.EmbeddedStatement = blockStatement;
					}
					
					string newVariableName = foreachStatement.VariableName + "_loopVariable";
					
					ExpressionStatement st = new ExpressionStatement(
						new AssignmentExpression(
							new IdentifierExpression(foreachStatement.VariableName),
							AssignmentOperatorType.Assign,
							new IdentifierExpression(newVariableName)));
					blockStatement.Children.Insert(0, st);
					st.Parent = blockStatement;
					
					foreachStatement.VariableName = newVariableName;
					foreachStatement.TypeReference = ConvertType(rr.ResolvedType);
				}
			}
			return null;
		}
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Projects,代码行数:33,代码来源:VBNetToCSharpConvertVisitor.cs


示例15: StatementExpr

	void StatementExpr(
#line  1799 "cs.ATG" 
out Statement stmt) {

#line  1800 "cs.ATG" 
		Expression expr; 
		Expr(
#line  1802 "cs.ATG" 
out expr);

#line  1805 "cs.ATG" 
		stmt = new ExpressionStatement(expr); 
	}
开发者ID:pluraldj,项目名称:SharpDevelop,代码行数:13,代码来源:Parser.cs


示例16: EmbeddedStatement


//.........这里部分代码省略.........
			ResumeStatement(
#line  2522 "VBNET.ATG" 
out resumeStatement);

#line  2522 "VBNET.ATG" 
			statement = resumeStatement; 
			break;
		}
		case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 24: case 43: case 47: case 49: case 50: case 51: case 52: case 54: case 59: case 60: case 61: case 62: case 63: case 64: case 65: case 66: case 68: case 69: case 70: case 72: case 73: case 74: case 75: case 76: case 77: case 82: case 84: case 95: case 96: case 102: case 111: case 117: case 119: case 124: case 125: case 127: case 130: case 133: case 134: case 144: case 159: case 160: case 165: case 169: case 173: case 175: case 176: case 177: case 191: case 192: case 193: case 194: case 195: case 196: case 197: case 198: case 199: case 200: case 205: {

#line  2525 "VBNET.ATG" 
			Expression val = null;
			AssignmentOperatorType op;
			
			bool mustBeAssignment = la.kind == Tokens.Plus  || la.kind == Tokens.Minus ||
			                        la.kind == Tokens.Not   || la.kind == Tokens.Times;
			
			SimpleExpr(
#line  2531 "VBNET.ATG" 
out expr);
			if (StartOf(37)) {
				AssignmentOperator(
#line  2533 "VBNET.ATG" 
out op);
				Expr(
#line  2533 "VBNET.ATG" 
out val);

#line  2533 "VBNET.ATG" 
				expr = new AssignmentExpression(expr, op, val); 
			} else if (la.kind == 1 || la.kind == 13 || la.kind == 86) {

#line  2534 "VBNET.ATG" 
				if (mustBeAssignment) Error("error in assignment."); 
			} else SynErr(259);

#line  2537 "VBNET.ATG" 
			// a field reference expression that stands alone is a
			// invocation expression without parantheses and arguments
			if(expr is MemberReferenceExpression || expr is IdentifierExpression) {
				expr = new InvocationExpression(expr);
			}
			statement = new ExpressionStatement(expr);
			
			break;
		}
		case 56: {
			lexer.NextToken();
			SimpleExpr(
#line  2544 "VBNET.ATG" 
out expr);

#line  2544 "VBNET.ATG" 
			statement = new ExpressionStatement(expr); 
			break;
		}
		case 189: {
			lexer.NextToken();

#line  2546 "VBNET.ATG" 
			Statement block;  
			if (
#line  2547 "VBNET.ATG" 
Peek(1).kind == Tokens.As) {

#line  2548 "VBNET.ATG" 
				LocalVariableDeclaration resourceAquisition = new LocalVariableDeclaration(Modifiers.None); 
				VariableDeclarator(
#line  2549 "VBNET.ATG" 
resourceAquisition.Variables);
				while (la.kind == 12) {
					lexer.NextToken();
					VariableDeclarator(
#line  2551 "VBNET.ATG" 
resourceAquisition.Variables);
				}
				Block(
#line  2553 "VBNET.ATG" 
out block);

#line  2554 "VBNET.ATG" 
				statement = new UsingStatement(resourceAquisition, block); 
			} else if (StartOf(27)) {
				Expr(
#line  2555 "VBNET.ATG" 
out expr);
				Block(
#line  2556 "VBNET.ATG" 
out block);

#line  2557 "VBNET.ATG" 
				statement = new UsingStatement(new ExpressionStatement(expr), block); 
			} else SynErr(260);
			Expect(88);
			Expect(189);
			break;
		}
		default: SynErr(261); break;
		}
	}
开发者ID:almazik,项目名称:ILSpy,代码行数:101,代码来源:Parser.cs


示例17: VisitExpressionStatement

		public virtual object VisitExpressionStatement(ExpressionStatement expressionStatement, object data) {
			Debug.Assert((expressionStatement != null));
			Debug.Assert((expressionStatement.Expression != null));
			nodeStack.Push(expressionStatement.Expression);
			expressionStatement.Expression.AcceptVisitor(this, data);
			expressionStatement.Expression = ((Expression)(nodeStack.Pop()));
			return null;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:8,代码来源:AbstractAstTransformer.cs


示例18: VisitExpressionStatement

 public virtual object VisitExpressionStatement(ExpressionStatement expressionStatement, object data) {
     throw CreateException(expressionStatement);
 }
开发者ID:hallvar,项目名称:Joddes.CS,代码行数:3,代码来源:JsVisitor.cs


示例19: ResourceAcquisition

	void ResourceAcquisition(
//#line  1763 "cs.ATG" 
out Statement stmt) {

//#line  1765 "cs.ATG" 
		stmt = null;
		Expression expr;
		
		if (
//#line  1770 "cs.ATG" 
IsLocalVarDecl()) {
			LocalVariableDecl(
//#line  1770 "cs.ATG" 
out stmt);
		} else if (StartOf(6)) {
			Expr(
//#line  1771 "cs.ATG" 
out expr);

//#line  1775 "cs.ATG" 
			stmt = new ExpressionStatement(expr); 
		} else SynErr(202);
	}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:23,代码来源:Parser.cs


示例20: TrackedVisitExpressionStatement

 public override object TrackedVisitExpressionStatement(ExpressionStatement expressionStatement, object data)
 {
     this.AppendIndented(string.Empty);
     expressionStatement.Expression.AcceptVisitor(this, data);
     this.AppendLine();
     return null;
 }
开发者ID:L3tum,项目名称:BesiegeScriptingMod,代码行数:7,代码来源:NRefactoryToPythonConverter.cs



注:本文中的ICSharpCode.NRefactory.Ast.ExpressionStatement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ast.FieldDeclaration类代码示例发布时间:2022-05-26
下一篇:
C# Ast.Expression类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap