本文整理汇总了C#中Mono.CSharp.PropertyBase.GetSignatureForError方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyBase.GetSignatureForError方法的具体用法?C# PropertyBase.GetSignatureForError怎么用?C# PropertyBase.GetSignatureForError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.PropertyBase
的用法示例。
在下文中一共展示了PropertyBase.GetSignatureForError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: case_197
void case_197()
#line 1766 "cs-parser.jay"
{
var type = (FullNamedExpression) yyVals[-3+yyTop];
current_property = new Property (current_type, type, (Modifiers) yyVals[-4+yyTop],
(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);
if (type.Type != null && type.Type.Kind == MemberKind.Void)
report.Error (547, GetLocation (yyVals[-3+yyTop]), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ());
current_type.AddMember (current_property);
lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));
lexer.PropertyParsing = true;
}
示例2: case_207
void case_207()
#line 1704 "cs-parser.jay"
{
current_property = new Property (current_class, (FullNamedExpression) yyVals[-3+yyTop], (Modifiers) yyVals[-4+yyTop],
(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);
if (current_property.TypeExpression.Type == TypeManager.void_type)
Report.Error (547, GetLocation (yyVals[-3+yyTop]), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ());
current_container.AddProperty ((Property)current_property);
lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));
lexer.PropertyParsing = true;
}
示例3: yyparse
//.........这里部分代码省略.........
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 102:
#line 936 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
--lexer.parsing_declaration;
if (doc_support)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 103:
#line 942 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
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"
示例4: VisitProperty
public void VisitProperty (PropertyBase p)
{
if (p.Get != null)
VisitMethod(p.Get, false); // We don't change the state of getter and setter
if (p.Set != null)
VisitMethod(p.Set, false);
//Do we need to update some state on the property?
switch (CurrentPass) {
case Pass.DiscoverClassesAndMethods:
break;
case Pass.SetVirtualTypes:
break;
case Pass.FinalizeModifierFlags: {
bool hasVirtual = false;
bool hasOverride = false;
if (p.Get != null) {
MethodInfo methodInfo = GetMethodInfoFromCache(p.Get);
if (methodInfo != null) {
switch (methodInfo.Type) {
case VirtualType.NotVirtual:
if (verbose) {
Console.WriteLine("[Auto-sealing] get property {0} is not virtual.", p.Get.GetSignatureForError());
}
break;
case VirtualType.FirstVirtual:
hasVirtual = true;
if (verbose) {
Console.WriteLine("[Auto-sealing] get property {0} is first virtual.", p.Get.GetSignatureForError());
}
break;
case VirtualType.OverrideVirtual:
hasOverride = true;
if (verbose) {
Console.WriteLine("[Auto-sealing] get property {0} is override.", p.Get.GetSignatureForError());
}
break;
default:
if (verbose) {
Console.WriteLine("[Auto-sealing] Unexpected virtual type in get property {0}.", p.Get.GetSignatureForError());
}
break;
}
}
}
if (p.Set != null) {
MethodInfo methodInfo = GetMethodInfoFromCache(p.Set);
if (methodInfo != null) {
switch (methodInfo.Type) {
case VirtualType.NotVirtual:
if (verbose) {
Console.WriteLine("[Auto-sealing] set property {0} is not virtual.", p.Set.GetSignatureForError());
}
break;
case VirtualType.FirstVirtual:
hasVirtual = true;
if (verbose) {
Console.WriteLine("[Auto-sealing] set property {0} is first virtual.", p.Set.GetSignatureForError());
}
break;
case VirtualType.OverrideVirtual:
hasOverride = true;
if (verbose) {
Console.WriteLine("[Auto-sealing] set property {0} is override.", p.Set.GetSignatureForError());
}
break;
default:
if (verbose) {
Console.WriteLine("[Auto-sealing] Unexpected virtual type in set property {0}.", p.Set.GetSignatureForError());
}
break;
}
}
}
if (hasVirtual) {
p.ModFlags &= ~Modifiers.OVERRIDE;
p.ModFlags |= Modifiers.VIRTUAL;
if (verbose) {
Console.WriteLine("[Auto-sealing] Make property {0} virtual.", p.GetSignatureForError());
}
} else if (hasOverride) {
p.ModFlags &= ~Modifiers.VIRTUAL;
p.ModFlags |= Modifiers.OVERRIDE;
if (verbose) {
Console.WriteLine("[Auto-sealing] Make property {0} override.", p.GetSignatureForError());
}
} else {
p.ModFlags &= ~(Modifiers.VIRTUAL | Modifiers.OVERRIDE);
if (verbose) {
Console.WriteLine("[Auto-sealing] Remove virtual and override on property {0}.", p.GetSignatureForError());
}
}
break;
}
}
}
示例5: case_205
void case_205()
#line 1686 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
current_property = new Property (current_class, (FullNamedExpression) yyVals[-3+yyTop], (Modifiers) yyVals[-4+yyTop],
(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);
if (current_property.TypeExpression.Type == TypeManager.void_type)
Report.Error (547, GetLocation (yyVals[-3+yyTop]), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ());
current_container.AddProperty ((Property)current_property);
lbag.AddMember (current_property, mod_locations, GetLocation (yyVals[0+yyTop]));
lexer.PropertyParsing = true;
}