本文整理汇总了C#中Mono.CSharp.Is类的典型用法代码示例。如果您正苦于以下问题:C# Is类的具体用法?C# Is怎么用?C# Is使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Is类属于Mono.CSharp命名空间,在下文中一共展示了Is类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Visit
public override object Visit (Is isExpression)
{
var result = new IsExpression ();
result.AddChild ((INode)isExpression.Expr.Accept (this), IsExpression.Roles.Expression);
result.AddChild (new CSharpTokenNode (Convert (isExpression.Location), "is".Length), IsExpression.Roles.Keyword);
result.AddChild ((INode)isExpression.ProbeType.Accept (this), IsExpression.Roles.ReturnType);
return result;
}
示例2: case_594
void case_594()
#line 4247 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new Is ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
示例3: Visit
public override object Visit(Is isExpression)
{
var result = new IsExpression();
if (isExpression.Expr != null)
result.AddChild((Expression)isExpression.Expr.Accept(this), Roles.Expression);
result.AddChild(new CSharpTokenNode(Convert(isExpression.Location), IsExpression.IsKeywordRole), IsExpression.IsKeywordRole);
if (isExpression.ProbeType != null)
result.AddChild(ConvertToType(isExpression.ProbeType), Roles.Type);
return result;
}
示例4: Visit
public virtual object Visit (Is isExpression)
{
return null;
}
示例5: yyparse
//.........这里部分代码省略.........
case 580:
case_580();
break;
case 581:
case_581();
break;
case 582:
case_582();
break;
case 583:
case_583();
break;
case 584:
case_584();
break;
case 585:
case_585();
break;
case 587:
case_587();
break;
case 588:
case_588();
break;
case 589:
#line 4221 "cs-parser.jay"
{
yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 590:
#line 4225 "cs-parser.jay"
{
yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 591:
case_591();
break;
case 592:
case_592();
break;
case 593:
case_593();
break;
case 594:
case_594();
break;
case 596:
case_596();
break;
case 597:
case_597();
break;
case 598:
case_598();
break;
case 599:
case_599();
break;
case 601:
case_601();
break;
case 602:
case_602();
break;
示例6: yyparse
//.........这里部分代码省略.........
yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 565:
case_565();
break;
case 566:
case_566();
break;
case 567:
case_567();
break;
case 569:
case_569();
break;
case 570:
#line 3871 "cs-parser.jay"
{
yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 571:
case_571();
break;
case 572:
#line 3880 "cs-parser.jay"
{
yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 573:
#line 3884 "cs-parser.jay"
{
yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 575:
case_575();
break;
case 576:
case_576();
break;
case 578:
case_578();
break;
case 579:
case_579();
break;
case 580:
case_580();
break;
case 581:
case_581();
break;
case 583:
case_583();
break;
case 584:
case_584();
break;
case 586:
case_586();
break;
case 588:
case_588();
break;
示例7: yyparse
//.........这里部分代码省略.........
yyToken = -1;
goto continue_yyDiscarded; // leave stack alone
}
}
int yyV = yyTop + 1-yyLen[yyN];
if (debug != null)
debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);
yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
switch (yyN) {
case 5:
#line 379 "cs-parser.jay"
{ Lexer.CompleteOnEOF = false; }
break;
case 7:
#line 384 "cs-parser.jay"
{
Lexer.check_incorrect_doc_comment ();
}
break;
case 8:
#line 388 "cs-parser.jay"
{
Lexer.check_incorrect_doc_comment ();
}
break;
case 16:
#line 411 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "alias"){
syntax_error (lt.Location, "`alias' expected");
} else if (RootContext.Version == LanguageVersion.ISO_1) {
Report.FeatureIsNotAvailable (lt.Location, "external alias");
} else {
lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
current_namespace.AddUsingExternalAlias (lt.Value, lt.Location, Report);
}
}
break;
case 17:
#line 424 "cs-parser.jay"
{
syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/
}
break;
case 20:
#line 436 "cs-parser.jay"
{
if (RootContext.Documentation != null)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 21:
#line 441 "cs-parser.jay"
{
if (RootContext.Documentation != null)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 22:
#line 449 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
current_namespace.AddUsingAlias (lt.Value, (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
}
示例8: case_599
void case_599()
#line 4278 "cs-parser.jay"
{
var lt = (LocatedToken) yyVals[-2+yyTop];
yyVal = new Is (new SimpleName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
示例9: yyparse
//.........这里部分代码省略.........
case 6:
#line 401 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] != null) {
Attributes attrs = (Attributes) yyVals[0+yyTop];
report.Error (1730, attrs.Attrs [0].Location,
"Assembly and module attributes must precede all other elements except using clauses and extern alias declarations");
}
}
break;
case 7:
#line 409 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
module.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace);
}
break;
case 8:
#line 413 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyToken == Token.EXTERN_ALIAS)
report.Error (439, lexer.Location, "An extern alias declaration must precede all other elements");
else
Error_SyntaxError (yyToken);
}
break;
case 13:
#line 433 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "alias"){
syntax_error (lt.Location, "`alias' expected");
} else if (lang_version == LanguageVersion.ISO_1) {
FeatureIsNotAvailable (lt.Location, "external alias");
} else {
lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
current_namespace.AddUsingExternalAlias (lt.Value, lt.Location, report);
}
}
break;
case 14:
#line 446 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/
}
break;
case 17:
#line 458 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (doc_support)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 18:
#line 463 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (doc_support)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 19:
#line 471 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
if (lang_version != LanguageVersion.ISO_1 && lt.Value == "global") {
report.Warning (440, 2, lt.Location,
示例10: case_613
void case_613()
#line 4395 "cs-parser.jay"
{
var is_expr = new Is ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
if (yyVals[0+yyTop] != null) {
if (lang_version != LanguageVersion.Experimental)
FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "type pattern matching");
var lt = (LocatedToken) yyVals[0+yyTop];
is_expr.Variable = new LocalVariable (current_block, lt.Value, lt.Location);
current_block.AddLocalName (is_expr.Variable);
}
yyVal = is_expr;
}