本文整理匯總了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) {