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

C# CSharp.Fixed类代码示例

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

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



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

示例1: Visit

			public override object Visit(Fixed fixedStatement)
			{
				var result = new FixedStatement();
				var location = LocationsBag.GetLocations(fixedStatement);
				
				result.AddChild(new CSharpTokenNode(Convert(fixedStatement.loc), FixedStatement.FixedKeywordRole), FixedStatement.FixedKeywordRole);
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
				
				if (fixedStatement.Variables != null) {
					var blockVariableDeclaration = fixedStatement.Variables;
					result.AddChild(ConvertToType(blockVariableDeclaration.TypeExpression), Roles.Type);
					var varInit = new VariableInitializer();
					var initLocation = LocationsBag.GetLocations(blockVariableDeclaration);
					varInit.AddChild(Identifier.Create(blockVariableDeclaration.Variable.Name, Convert(blockVariableDeclaration.Variable.Location)), Roles.Identifier);
					if (blockVariableDeclaration.Initializer != null) {
						if (initLocation != null)
							varInit.AddChild(new CSharpTokenNode(Convert(initLocation [0]), Roles.Assign), Roles.Assign);
						varInit.AddChild((Expression)blockVariableDeclaration.Initializer.Accept(this), Roles.Expression);
					}
					
					result.AddChild(varInit, Roles.Variable);
					
					if (blockVariableDeclaration.Declarators != null) {
						foreach (var decl in blockVariableDeclaration.Declarators) {
							var loc = LocationsBag.GetLocations(decl);
							var init = new VariableInitializer();
							if (loc != null && loc.Count > 0)
								result.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);
							init.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);
							if (decl.Initializer != null) {
								if (loc != null && loc.Count > 1)
									init.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Assign), Roles.Assign);
								init.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);
							}
							result.AddChild(init, Roles.Variable);
						}
					}
				}
				
				if (location != null && location.Count > 1)
					result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
				if (fixedStatement.Statement != null)
					result.AddChild((Statement)fixedStatement.Statement.Accept(this), Roles.EmbeddedStatement);
				return result;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:46,代码来源:CSharpParser.cs


示例2: Visit

			public override object Visit (Fixed fixedStatement)
			{
				var result = new FixedStatement ();
				var location = LocationsBag.GetLocations (fixedStatement);
				
				result.AddChild (new CSharpTokenNode (Convert (fixedStatement.loc), "fixed".Length), FixedStatement.FixedKeywordRole);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), FixedStatement.Roles.LPar);
				
				result.AddChild ((INode)fixedStatement.Type.Accept (this), FixedStatement.PointerDeclarationRole);
				
				foreach (KeyValuePair<LocalInfo, Expression> declarator in fixedStatement.Declarators) {
					result.AddChild ((INode)declarator.Value.Accept (this), FixedStatement.DeclaratorRole);
				}
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), FixedStatement.Roles.RPar);
				result.AddChild ((INode)fixedStatement.Statement.Accept (this), FixedStatement.Roles.EmbeddedStatement);
				return result;
			}
开发者ID:pgoron,项目名称:monodevelop,代码行数:19,代码来源:CSharpParser.cs


示例3: Visit

		public virtual object Visit (Fixed fixedStatement)
		{
			return null;
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs


示例4: case_932

void case_932()
#line 6246 "cs-parser.jay"
{
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		Fixed f = new Fixed ((Fixed.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));
		current_block.AddStatement (f);
		lbag.AddStatement (f, GetLocation (yyVals[-8+yyTop]), GetLocation (yyVals[-2+yyTop]));
		yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:11,代码来源:cs-parser.cs


示例5: yyparse


//.........这里部分代码省略.........
	  }
  break;
case 135:
#line 1076 "cs-parser.jay"
  { 
		FullNamedExpression type = (FullNamedExpression) yyVals[-2+yyTop];
		if (type == TypeManager.system_void_expr)
			Report.Error (670, GetLocation (yyVals[-2+yyTop]), "Fields cannot have void type");
		
		var mod = (Modifiers) yyVals[-3+yyTop];

		foreach (VariableMemberDeclaration var in (List<object>) yyVals[-1+yyTop]){
			Field field = new Field (current_class, type, mod, var.MemberName, (Attributes) yyVals[-4+yyTop]);

			field.Initializer = var.GetInitializer (type);

			if (RootContext.Documentation != null) {
				field.DocComment = Lexer.consume_doc_comment ();
				Lexer.doc_state = XmlCommentState.Allowed;
			}
			current_container.AddField (field);
			yyVal = field; /* FIXME: might be better if it points to the top item*/
		}
	  }
  break;
case 136:
#line 1102 "cs-parser.jay"
  { 
			FullNamedExpression type = (FullNamedExpression) yyVals[-2+yyTop];
			
			var mod = (Modifiers) yyVals[-4+yyTop];

			foreach (VariableDeclaration var in (List<VariableDeclaration>) yyVals[-1+yyTop]) {
				FixedField field = new FixedField (current_class, type, mod, var.identifier,
					var.GetInitializer (type), (Attributes) yyVals[-5+yyTop], var.Location);
					
				if (RootContext.Version < LanguageVersion.ISO_2)
					Report.FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "fixed size buffers");

				if (RootContext.Documentation != null) {
					field.DocComment = Lexer.consume_doc_comment ();
					Lexer.doc_state = XmlCommentState.Allowed;
				}
				current_container.AddField (field);
				yyVal = field; /* FIXME: might be better if it points to the top item*/
			}
	  }
  break;
case 137:
#line 1127 "cs-parser.jay"
  {
		Report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name");
	  }
  break;
case 138:
#line 1134 "cs-parser.jay"
  {
		var decl = new List<VariableDeclaration> (2);
		decl.Add ((VariableDeclaration)yyVals[0+yyTop]);
		yyVal = decl;
  	  }
  break;
case 139:
#line 1140 "cs-parser.jay"
  {
		var decls = (List<VariableDeclaration>) yyVals[-2+yyTop];
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs


示例6: Visit

			public override object Visit (Fixed fixedStatement)
			{
				var result = new FixedStatement ();
				var location = LocationsBag.GetLocations (fixedStatement);
				
				result.AddChild (new CSharpTokenNode (Convert (fixedStatement.loc), "fixed".Length), FixedStatement.FixedKeywordRole);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), FixedStatement.Roles.LPar);
				
				if (fixedStatement.Variables != null) {
					result.AddChild ((INode)fixedStatement.Variables.TypeExpression.Accept (this), UsingStatement.Roles.ReturnType);
					result.AddChild (new Identifier (fixedStatement.Variables.Variable.Name, Convert (fixedStatement.Variables.Variable.Location)), UsingStatement.Roles.Identifier);
					var loc = LocationsBag.GetLocations (fixedStatement.Variables);
					if (loc != null)
						result.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), ContinueStatement.Roles.Assign);
					if (fixedStatement.Variables.Initializer != null)
						result.AddChild ((INode)fixedStatement.Variables.Initializer.Accept (this), UsingStatement.Roles.Initializer);
				}
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), FixedStatement.Roles.RPar);
				result.AddChild ((INode)fixedStatement.Statement.Accept (this), FixedStatement.Roles.EmbeddedStatement);
				return result;
			}
开发者ID:silk,项目名称:monodevelop,代码行数:24,代码来源:CSharpParser.cs


示例7: case_881

void case_881()
{
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		Fixed f = new Fixed ((Fixed.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));
		current_block.AddStatement (f);
		yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
	  }
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:9,代码来源:cs-parser.cs


示例8: yyparse


//.........这里部分代码省略.........
  {
	  	lexer.parsing_generic_declaration = false;

		FullNamedExpression type = (FullNamedExpression) yyVals[-1+yyTop];
		if (type.Type != null && type.Type.Kind == MemberKind.Void)
			report.Error (670, GetLocation (yyVals[-1+yyTop]), "Fields cannot have void type");
			
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
		current_field = new Field (current_class, type, (Modifiers) yyVals[-2+yyTop], new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-3+yyTop]);
		current_container.AddField (current_field);
		yyVal = current_field;
	  }
  break;
case 133:
#line 1163 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  { 
		if (doc_support) {
			current_field.DocComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.Allowed;
		}
			
		lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[0+yyTop]));
		yyVal = current_field;
		current_field = null;
	  }
  break;
case 134:
#line 1176 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  { 
		if (lang_version < LanguageVersion.ISO_2)
			FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers");

		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
		current_field = new FixedField (current_class, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop],
			new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
			
		current_container.AddField (current_field);
	  }
  break;
case 135:
#line 1187 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		if (doc_support) {
			current_field.DocComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.Allowed;
	    }

		current_field.Initializer = (ConstInitializer) yyVals[-2+yyTop];	    
		lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[0+yyTop]));
		yyVal = current_field;
	    current_field = null;
	  }
  break;
case 136:
#line 1202 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name");
	  }
  break;
case 138:
#line 1210 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	  	++lexer.parsing_block;
		current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;
	  	start_block (GetLocation (yyVals[0+yyTop]));
	  }
开发者ID:runefs,项目名称:Marvin,代码行数:67,代码来源:cs-parser.cs


示例9: case_849

void case_849()
#line 5398 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		Fixed f = new Fixed ((Fixed.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));
		current_block.AddStatement (f);
		yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
	  }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:10,代码来源:cs-parser.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CSharp.FixedField类代码示例发布时间:2022-05-26
下一篇:
C# CSharp.FieldSpec类代码示例发布时间: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