本文整理汇总了C#中Mono.CSharp.TypeContainer.AddOperator方法的典型用法代码示例。如果您正苦于以下问题:C# TypeContainer.AddOperator方法的具体用法?C# TypeContainer.AddOperator怎么用?C# TypeContainer.AddOperator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.TypeContainer
的用法示例。
在下文中一共展示了TypeContainer.AddOperator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: yyparse
//.........这里部分代码省略.........
{
Report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors");
}
break;
case 238:
#line 1936 "cs-parser.jay"
{
Report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations");
}
break;
case 239:
#line 1943 "cs-parser.jay"
{
}
break;
case 240:
#line 1946 "cs-parser.jay"
{
if (yyVals[-2+yyTop] == null)
break;
OperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop];
Operator op = new Operator (
current_class, decl.optype, decl.ret_type, (Modifiers) yyVals[-3+yyTop],
current_local_parameters,
(ToplevelBlock) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop], decl.location);
if (RootContext.Documentation != null) {
op.DocComment = tmpComment;
Lexer.doc_state = XmlCommentState.Allowed;
}
/* Note again, checking is done in semantic analysis*/
current_container.AddOperator (op);
current_local_parameters = null;
}
break;
case 242:
#line 1970 "cs-parser.jay"
{ yyVal = null; }
break;
case 244:
#line 1976 "cs-parser.jay"
{
Report.Error (590, GetLocation (yyVals[0+yyTop]), "User-defined operators cannot return void");
yyVal = TypeManager.system_void_expr;
}
break;
case 245:
#line 1984 "cs-parser.jay"
{
valid_param_mod = ParameterModifierType.DefaultValue;
}
break;
case 246:
#line 1988 "cs-parser.jay"
{
valid_param_mod = 0;
Location loc = GetLocation (yyVals[-5+yyTop]);
Operator.OpType op = (Operator.OpType) yyVals[-4+yyTop];
current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop];
int p_count = current_local_parameters.Count;
if (p_count == 1) {