本文整理汇总了C#中AsExpression类的典型用法代码示例。如果您正苦于以下问题:C# AsExpression类的具体用法?C# AsExpression怎么用?C# AsExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AsExpression类属于命名空间,在下文中一共展示了AsExpression类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VisitAsExpression
public override void VisitAsExpression (AsExpression asExpression)
{
base.VisitAsExpression (asExpression);
VisitTypeCastExpression (asExpression, ctx.Resolve (asExpression.Expression).Type,
ctx.ResolveType (asExpression.Type));
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:7,代码来源:CastExpressionOfIncompatibleTypeIssue.cs
示例2: VisitAsExpression
public override void VisitAsExpression (AsExpression asExpression)
{
base.VisitAsExpression (asExpression);
CheckTypeCast (asExpression, asExpression.Expression, asExpression.Expression.EndLocation,
asExpression.EndLocation);
}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:7,代码来源:RedundantTypeCastIssue.cs
示例3: VisitAsExpression
public override void VisitAsExpression(AsExpression asExpression)
{
if (InsertParenthesesForReadability) {
// few people know the precedence of 'as', so always put parentheses in nice-looking mode.
ParenthesizeIfRequired(asExpression.Expression, Primary);
} else {
ParenthesizeIfRequired(asExpression.Expression, RelationalAndTypeTesting);
}
base.VisitAsExpression(asExpression);
}
开发者ID:artifexor,项目名称:NRefactory,代码行数:10,代码来源:InsertParenthesesVisitor.cs
示例4: VisitAsExpression
public void VisitAsExpression(AsExpression asExpression)
{
StartNode(asExpression);
asExpression.Expression.AcceptVisitor(this);
Space();
WriteKeyword(AsExpression.AsKeywordRole);
Space();
asExpression.Type.AcceptVisitor(this);
EndNode(asExpression);
}
开发者ID:x-strong,项目名称:ILSpy,代码行数:10,代码来源:CSharpOutputVisitor.cs
示例5: Visit
public override object Visit (As asExpression)
{
var result = new AsExpression ();
result.AddChild ((INode)asExpression.Expr.Accept (this), AsExpression.Roles.Expression);
result.AddChild (new CSharpTokenNode (Convert (asExpression.Location), "as".Length), AsExpression.Roles.Keyword);
result.AddChild ((INode)asExpression.ProbeType.Accept (this), AsExpression.Roles.ReturnType);
return result;
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:8,代码来源:CSharpParser.cs
示例6: VisitAsExpression
public virtual void VisitAsExpression (AsExpression asExpression)
{
VisitChildren (asExpression);
}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs
示例7: Visit
public override object Visit(As asExpression)
{
var result = new AsExpression();
if (asExpression.Expr != null)
result.AddChild((Expression)asExpression.Expr.Accept(this), Roles.Expression);
result.AddChild(new CSharpTokenNode(Convert(asExpression.Location), AsExpression.AsKeywordRole), AsExpression.AsKeywordRole);
if (asExpression.ProbeType != null)
result.AddChild(ConvertToType(asExpression.ProbeType), Roles.Type);
return result;
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:10,代码来源:CSharpParser.cs
示例8: VisitAsExpression
public virtual void VisitAsExpression(AsExpression asExpression)
{
if (this.ThrowException)
{
throw (Exception)this.CreateException(asExpression);
}
}
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs
示例9: GetAsExpression
/// <summary>
/// Reads an as expression.
/// </summary>
/// <param name="leftHandSide">The expression on the left hand side of the operator.</param>
/// <param name="previousPrecedence">The precedence of the expression just before this one.</param>
/// <param name="unsafeCode">Indicates whether the code being parsed resides in an unsafe code block.</param>
/// <returns>Returns the expression.</returns>
private AsExpression GetAsExpression(
Expression leftHandSide, ExpressionPrecedence previousPrecedence, bool unsafeCode)
{
Param.AssertNotNull(leftHandSide, "leftHandSide");
Param.Ignore(previousPrecedence);
Param.Ignore(unsafeCode);
AsExpression expression = null;
// Check the previous precedence to see if we are allowed to gather up the as expression.
if (this.CheckPrecedence(previousPrecedence, ExpressionPrecedence.Relational))
{
// Make sure the left hand side has at least one token.
Debug.Assert(leftHandSide.Tokens.First != null, "The left hand side should not be empty");
// Get the as symbol.
this.tokens.Add(this.GetToken(CsTokenType.As, SymbolType.As));
// The next token must be the type.
this.GetNextSymbol(SymbolType.Other);
// Get the expression representing the type.
LiteralExpression rightHandSide = this.GetTypeTokenExpression(unsafeCode, true, true);
if (rightHandSide == null || rightHandSide.Tokens.First == null)
{
throw this.CreateSyntaxException();
}
// Create the partial token list for the expression.
CsTokenList partialTokens = new CsTokenList(this.tokens, leftHandSide.Tokens.First, this.tokens.Last);
// Create and return the expression.
expression = new AsExpression(partialTokens, leftHandSide, rightHandSide);
}
return expression;
}
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:44,代码来源:LargeTestFile.cs
示例10: VisitAsExpression
public StringBuilder VisitAsExpression(AsExpression asExpression, int data)
{
throw new SLSharpException("SL# does not have reflection-supported casts.");
}
开发者ID:hach-que,项目名称:SLSharp,代码行数:4,代码来源:VisitorBase.Illegal.cs
示例11: CastBlock
public CastBlock(IEmitter emitter, AsExpression asExpression)
: base(emitter, asExpression)
{
this.Emitter = emitter;
this.AsExpression = asExpression;
}
开发者ID:Cestbienmoi,项目名称:Bridge,代码行数:6,代码来源:CastBlock.cs
示例12: VisitAsExpression
public void VisitAsExpression(AsExpression asExpression)
{
StartNode(asExpression);
LPar ();
LPar ();
asExpression.Expression.AcceptVisitor(this);
Space();
WriteKeyword("instanceof", AsExpression.AsKeywordRole);
Space();
asExpression.Type.AcceptVisitor(this);
EndNode(asExpression);
RPar ();
WriteToken ("?<", Roles.Expression);
asExpression.Type.AcceptVisitor(this);
WriteToken (">", Roles.Expression);
asExpression.Expression.AcceptVisitor(this);
WriteToken (":null", Roles.Expression);
RPar ();
}
开发者ID:cbsistem,项目名称:Netjs,代码行数:19,代码来源:TsOutputVisitor.cs
示例13: VisitAsExpression
public override void VisitAsExpression(AsExpression asExpression)
{
new CastBlock(this, asExpression).Emit();
}
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:4,代码来源:Emitter.Visitor.cs
示例14: VisitAsExpression
public void VisitAsExpression(AsExpression asExpression)
{
JsonObject expression = CreateJsonExpression(asExpression);
AddKeyword(expression, AsExpression.AsKeywordRole);
expression.AddJsonValue("type-info", GenTypeInfo(asExpression.Type));
Push(expression);
}
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:7,代码来源:AstCsToJson.cs
示例15: VisitAsExpression
public void VisitAsExpression(AsExpression node)
{
NotSupported(node);
}
开发者ID:evanw,项目名称:minisharp,代码行数:4,代码来源:Lower.cs
示例16: VisitAsExpression
public override object VisitAsExpression(AsExpression asExpression, object data)
{
UnlockWith(asExpression);
return base.VisitAsExpression(asExpression, data);
}
开发者ID:cohenw,项目名称:strokes,代码行数:5,代码来源:UseAsKeyword.cs
注:本文中的AsExpression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论