本文整理汇总了C#中TokenKind.GetTraits方法的典型用法代码示例。如果您正苦于以下问题:C# TokenKind.GetTraits方法的具体用法?C# TokenKind.GetTraits怎么用?C# TokenKind.GetTraits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TokenKind
的用法示例。
在下文中一共展示了TokenKind.GetTraits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignmentStatementAst
public AssignmentStatementAst(IScriptExtent extent, ExpressionAst left, TokenKind @operator, StatementAst right, IScriptExtent errorPosition) : base(extent)
{
if (((left == null) || (right == null)) || (errorPosition == null))
{
throw PSTraceSource.NewArgumentNullException((left == null) ? "left" : ((right == null) ? "right" : "errorPosition"));
}
if ((@operator.GetTraits() & TokenFlags.AssignmentOperator) == TokenFlags.None)
{
throw PSTraceSource.NewArgumentException("operator");
}
PipelineAst ast = right as PipelineAst;
if ((ast != null) && (ast.PipelineElements.Count == 1))
{
CommandExpressionAst ast2 = ast.PipelineElements[0] as CommandExpressionAst;
if (ast2 != null)
{
right = ast2;
right.ClearParent();
}
}
this.Operator = @operator;
this.Left = left;
base.SetParent(left);
this.Right = right;
base.SetParent(right);
this.ErrorPosition = errorPosition;
}
示例2: BinaryExpressionAst
public BinaryExpressionAst(IScriptExtent extent, ExpressionAst left, TokenKind @operator, ExpressionAst right, IScriptExtent errorPosition) : base(extent)
{
if ((@operator.GetTraits() & TokenFlags.BinaryOperator) == TokenFlags.None)
{
throw PSTraceSource.NewArgumentException("operator");
}
if (((left == null) || (right == null)) || (errorPosition == null))
{
throw PSTraceSource.NewArgumentNullException((left == null) ? "left" : ((right == null) ? "right" : "errorPosition"));
}
this.Left = left;
base.SetParent(left);
this.Operator = @operator;
this.Right = right;
base.SetParent(right);
this.ErrorPosition = errorPosition;
}
示例3: Token
internal Token(InternalScriptExtent scriptExtent, TokenKind kind, TokenFlags tokenFlags)
{
_scriptExtent = scriptExtent;
_kind = kind;
_tokenFlags = tokenFlags | kind.GetTraits();
}
示例4: Token
internal Token(InternalScriptExtent scriptExtent, TokenKind kind, System.Management.Automation.Language.TokenFlags tokenFlags)
{
this._scriptExtent = scriptExtent;
this._kind = kind;
this._tokenFlags = tokenFlags | kind.GetTraits();
}