当前位置: 首页>>代码示例>>C#>>正文


C# VariableDeclarationStatement.GetChildrenByRole方法代码示例

本文整理汇总了C#中VariableDeclarationStatement.GetChildrenByRole方法的典型用法代码示例。如果您正苦于以下问题:C# VariableDeclarationStatement.GetChildrenByRole方法的具体用法?C# VariableDeclarationStatement.GetChildrenByRole怎么用?C# VariableDeclarationStatement.GetChildrenByRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VariableDeclarationStatement的用法示例。


在下文中一共展示了VariableDeclarationStatement.GetChildrenByRole方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitVariableDeclarationStatement

		public void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)
		{
			StartNode(variableDeclarationStatement);
			foreach (var v in variableDeclarationStatement.Variables) {
				WriteModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));
				WriteKeyword ("var");
				v.NameToken.AcceptVisitor (this);
				if (!variableDeclarationStatement.Type.IsNull) {
					WriteToken (Roles.Colon);
					Space ();
					variableDeclarationStatement.Type.AcceptVisitor (this);
				}
				if (!v.Initializer.IsNull) {
					Space(policy.SpaceAroundAssignment);
					WriteToken(Roles.Assign);
					Space(policy.SpaceAroundAssignment);
					v.Initializer.AcceptVisitor(this);
				}
				Semicolon();
			}
			EndNode(variableDeclarationStatement);
		}
开发者ID:cbsistem,项目名称:Netjs,代码行数:22,代码来源:TsOutputVisitor.cs

示例2: VisitVariableDeclarationStatement

		public void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)
		{
			StartNode(variableDeclarationStatement);
			WriteModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));
			variableDeclarationStatement.Type.AcceptVisitor(this);
			Space();
			WriteCommaSeparatedList(variableDeclarationStatement.Variables);
			Semicolon();
			EndNode(variableDeclarationStatement);
		}
开发者ID:x-strong,项目名称:ILSpy,代码行数:10,代码来源:CSharpOutputVisitor.cs

示例3: VisitVariableDeclarationStatement

 public void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)
 {
     JsonObject statement = CreateJsonStatement(variableDeclarationStatement);
     JsonValue modifier = GetModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));
     if (modifier != null && modifier.ValueType != JsonValueType.Null)
     {
         statement.AddJsonValue("modifier", modifier);
     }
     statement.AddJsonValue("declaration-type-info", GenTypeInfo(variableDeclarationStatement.Type));
     statement.AddJsonValue("variables-list", GetCommaSeparatedList(variableDeclarationStatement.Variables));
     Push(statement);
 }
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:12,代码来源:AstCsToJson.cs


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