當前位置: 首頁>>代碼示例>>C#>>正文


C# CSharp.ConstInitializer類代碼示例

本文整理匯總了C#中Mono.CSharp.ConstInitializer的典型用法代碼示例。如果您正苦於以下問題:C# ConstInitializer類的具體用法?C# ConstInitializer怎麽用?C# ConstInitializer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ConstInitializer類屬於Mono.CSharp命名空間,在下文中一共展示了ConstInitializer類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Const

        public Const(DeclSpace parent, FullNamedExpression type, string name,
            Expression expr, Modifiers mod_flags, Attributes attrs, Location loc)
            : base(parent, type, mod_flags, AllowedModifiers,
				new MemberName (name, loc), attrs)
        {
            if (expr != null)
                initializer = new ConstInitializer (this, expr);

            ModFlags |= Modifiers.STATIC;
        }
開發者ID:speier,項目名稱:shake,代碼行數:10,代碼來源:const.cs

示例2: Visit

			public override object Visit (ConstInitializer constInitializer)
			{
				return new Identifier (constInitializer.Name, Convert (constInitializer.Location));
			}
開發者ID:pgoron,項目名稱:monodevelop,代碼行數:4,代碼來源:CSharpParser.cs

示例3: Visit

			public override object Visit(ConstInitializer constInitializer)
			{
				return constInitializer.Expr.Accept(this);
			}
開發者ID:0xb1dd1e,項目名稱:NRefactory,代碼行數:4,代碼來源:CSharpParser.cs

示例4: case_144

void case_144()
#line 1253 "cs-parser.jay"
{
		--lexer.parsing_block;
		yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
		lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
	  }
開發者ID:segaman,項目名稱:NRefactory,代碼行數:7,代碼來源:cs-parser.cs

示例5: Visit

		public virtual object Visit (ConstInitializer constInitializer)
		{
			return null;
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:4,代碼來源:visit.cs

示例6: case_132

void case_132()
#line 1061 "cs-parser.jay"
{
		--lexer.parsing_block;
		yyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));
	  }
開發者ID:Ein,項目名稱:monodevelop,代碼行數:6,代碼來源:cs-parser.cs

示例7: FixedField

 public FixedField(DeclSpace parent, FullNamedExpression type, Modifiers mod, string name,
     Expression size_expr, Attributes attrs, Location loc)
     : base(parent, type, mod, AllowedModifiers, new MemberName (name, loc), attrs)
 {
     initializer = new ConstInitializer (this, size_expr);
 }
開發者ID:speier,項目名稱:shake,代碼行數:6,代碼來源:field.cs

示例8: case_138

void case_138()
{
		--lexer.parsing_block;
		yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
		lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
	  }
開發者ID:animaonline,項目名稱:Portable-Mono.CSharp,代碼行數:6,代碼來源:cs-parser.cs

示例9: case_113

void case_113()
{
		--lexer.parsing_block;
		yyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));
	  }
開發者ID:animaonline,項目名稱:Portable-Mono.CSharp,代碼行數:5,代碼來源:cs-parser.cs

示例10: yyparse


//.........這裏部分代碼省略.........
		lbag.AppendToMember (current_class, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
		yyVal = pop_current_class ();
	  }
  break;
case 104:
#line 947 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		Error_SyntaxError (yyToken);
	  }
  break;
case 105:
#line 956 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
		var mod = (Modifiers) yyVals[-3+yyTop];
		current_field = new Const (current_class, (FullNamedExpression) yyVals[-1+yyTop], mod, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
		current_container.AddConstant ((Const) current_field);
		
		if ((mod & Modifiers.STATIC) != 0) {
			report.Error (504, current_field.Location, "The constant `{0}' cannot be marked static", current_field.GetSignatureForError ());
		}
		
		yyVal = current_field;
	  }
  break;
case 106:
#line 969 "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[-6+yyTop]), GetLocation (yyVals[0+yyTop]));
		current_field = null;
	  }
  break;
case 117:
#line 1003 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
         yyVal = yyVals[0+yyTop];
      }
  break;
case 118:
#line 1007 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
        yyVal = new SimpleName("dynamic",new Location(0,0));
      }
  break;
case 119:
#line 1013 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	  	lexer.parsing_generic_declaration = false;
	  	var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
		FullNamedExpression type = yyVals[0+yyTop] as FullNamedExpression;
        if(type == null){
           report.Error (10008, GetLocation (yyVals[0+yyTop]), "Could not resolve type expression");
        }

		current_field = new RoleField (current_class, type, Modifiers.PRIVATE | Modifiers.ROLE, new MemberName (lt.Value, lt.Location),null);
		current_container.AddField (current_field);
		yyVal = current_field;
	  
		if (doc_support) {
			current_field.DocComment = Lexer.consume_doc_comment ();
開發者ID:runefs,項目名稱:Marvin,代碼行數:67,代碼來源:cs-parser.cs

示例11: case_155

void case_155()
#line 1209 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
		--lexer.parsing_block;
		yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
		lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
	  }
開發者ID:RainsSoft,項目名稱:MonoCompilerAsAService,代碼行數:7,代碼來源:cs-parser.cs


注:本文中的Mono.CSharp.ConstInitializer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。