本文整理汇总了C#中TokenKind类的典型用法代码示例。如果您正苦于以下问题:C# TokenKind类的具体用法?C# TokenKind怎么用?C# TokenKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TokenKind类属于命名空间,在下文中一共展示了TokenKind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UnexpectedTokenException
public UnexpectedTokenException(Token current, TokenKind[] tokenKinds)
: base(string.Format("On line {0} expected {1} but got {2}.",
current.Line, string.Join(",",tokenKinds), current.Kind ))
{
EncounteredToken = current;
ExpectedTokenKinds = tokenKinds;
}
开发者ID:Ancestry,项目名称:Daisy,代码行数:7,代码来源:UnexpectedTokenException.cs
示例2: BinaryExpression
public BinaryExpression(int line, int col, Expression lhs, TokenKind op, Expression rhs)
: base(line, col)
{
this.lhs = lhs;
this.rhs = rhs;
this.op = op;
}
开发者ID:refinedKing,项目名称:WeiXin--Vs2010-,代码行数:7,代码来源:BinaryExpression.cs
示例3: BinaryOperatorTerminal
public BinaryOperatorTerminal(string @operator, TokenKind tokenKind)
: base("-" + @operator, "(?<_operator_" + @operator + ">" + dash_pattern + @operator + ")")
{
this.Operator = @operator;
this.TokenKind = tokenKind;
Priority = TerminalPriority.ReservedWords;
}
开发者ID:mauve,项目名称:Pash,代码行数:7,代码来源:PowerShellGrammar.BinaryOperatorTerminal.cs
示例4: Token
public Token(TokenKind kind, string text, int line, int column)
{
this.kind = kind;
this.line = line;
this.column = column;
this.text = text;
}
开发者ID:deveel,项目名称:dtplengine,代码行数:7,代码来源:Token.cs
示例5: Token
public Token(TokenKind kind, string value, int line, int column)
{
this.kind = kind;
this.value = value;
this.line = line;
this.column = column;
}
开发者ID:hackestyy,项目名称:study,代码行数:7,代码来源:Token.cs
示例6: Reset
public void Reset()
{
this.kind = TokenKind.EOF;
this.text = string.Empty;
this.value = -1L;
this.pos = -1;
}
开发者ID:pulb,项目名称:basenji,代码行数:7,代码来源:Token.cs
示例7: 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;
}
开发者ID:nickchal,项目名称:pash,代码行数:27,代码来源:AssignmentStatementAst.cs
示例8: Match
private Token Match(TokenKind kind)
{
if (_lookahead.Kind == kind)
return ReadToken();
throw new ParserError(_lookahead.Position, "Expected '" + kind.ToString() + "', found '" + _lookahead.ToString() + "'");
}
开发者ID:bencz,项目名称:Beryl,代码行数:7,代码来源:Parser.cs
示例9: SetIsCommandArgument
internal void SetIsCommandArgument()
{
if (this._kind != TokenKind.Identifier)
{
this._kind = TokenKind.Generic;
}
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:Token.cs
示例10: TokenKindTests
public TokenKindTests()
{
lower = new Pattern("Lowercase", @"[a-z]+");
upper = new Pattern("Uppercase", @"[A-Z]+");
caseInsensitive = new Pattern("Case Insensitive", @"[a-z]+", RegexOptions.IgnoreCase);
abcDEF = new Text("abcDEF");
}
开发者ID:plioi,项目名称:parsley,代码行数:7,代码来源:TokenKindTests.cs
示例11: Token
/// <summary>
/// 初始化 Token 对象。
/// </summary>
/// <param name="kind">指定 Token 类型。</param>
/// <param name="data">指定 Token 内容。</param>
/// <param name="line">指定 Token 所在的行数</param>
/// <param name="col">指定 Token 所在的列数</param>
public Token(TokenKind kind, string data, int line, int col)
{
_TokenKind = kind;
_Line = line;
_Col = col;
_Data = data;
}
开发者ID:nkaluva,项目名称:helper,代码行数:14,代码来源:Token.cs
示例12: Token
public Token(TokenKind kind, string data, int line, int col)
{
_tokenKind = kind;
_line = line;
_col = col;
_data = data;
}
开发者ID:windygu,项目名称:sunrisetpl,代码行数:7,代码来源:Token.cs
示例13: Token
public Token(TokenKind kind, string data, int line, int col)
{
this.TokenKind = kind;
this.Data = data;
this.Line = line;
this.Col = col;
}
开发者ID:tomfang678,项目名称:SmartWeb,代码行数:7,代码来源:Token.cs
示例14: Token
public Token(int line, int col, string data,TokenKind tokenKind)
{
this.Line = line;
this.Col = col;
this.Text = data;
this.Kind = tokenKind;
}
开发者ID:Jeremaihloo,项目名称:FreeRoo,代码行数:7,代码来源:Token.cs
示例15: Ensure
public void Ensure(TokenKind kind, string readerName)
{
if (current.Kind != kind)
{
throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}.");
}
}
开发者ID:carbon,项目名称:Data,代码行数:7,代码来源:TokenReader.cs
示例16: BinaryExpression
/// <summary>
/// 初始化预定义运算符表达式。
/// </summary>
/// <param name="line">指定预定义运算符表达式所在位置的行数。</param>
/// <param name="col">指定预定义运算符表达式所在位置的列数。</param>
/// <param name="lhs">指定预定义运算符表达式的左侧值。</param>
/// <param name="op">指定预定义运算符表达式的运算符。</param>
/// <param name="rhs">指定预定义运算符表达式的右侧值。</param>
public BinaryExpression(int line, int col, Expression lhs, TokenKind op, Expression rhs)
: base(line, col)
{
_Lhs = lhs;
_Rhs = rhs;
_op = op;
}
开发者ID:nkaluva,项目名称:helper,代码行数:15,代码来源:BinaryExpression.cs
示例17: Token
public Token(TokenKind kind, string value, int line, int column)
{
_kind = kind;
_value = value;
_line = line;
_column = column;
}
开发者ID:lucaslin,项目名称:CodeClassifier,代码行数:7,代码来源:Token.cs
示例18: BinaryExpression
public BinaryExpression(TokenKind type, Expression left, Expression right)
{
ContractUtils.RequiresNotNull(left, "left");
ContractUtils.RequiresNotNull(right, "right");
switch (type)
{
case TokenKind.Add: _op = MSAst.ExpressionType.Add; break;
case TokenKind.Subtract: _op = MSAst.ExpressionType.Subtract; break;
case TokenKind.Mod: _op = MSAst.ExpressionType.Modulo; break;
case TokenKind.Multiply: _op = MSAst.ExpressionType.Multiply; break;
case TokenKind.Divide: _op = MSAst.ExpressionType.Divide; break;
case TokenKind.LessThan: _op = MSAst.ExpressionType.LessThan; break;
case TokenKind.LessThanOrEqual: _op = MSAst.ExpressionType.LessThanOrEqual; break;
case TokenKind.GreaterThan: _op = MSAst.ExpressionType.GreaterThan; break;
case TokenKind.GreaterThanOrEqual: _op = MSAst.ExpressionType.GreaterThanOrEqual; break;
case TokenKind.Equals: _op = MSAst.ExpressionType.Equal; break;
case TokenKind.NotEquals: _op = MSAst.ExpressionType.NotEqual; break;
case TokenKind.LogicalAnd: _op = MSAst.ExpressionType.And; break;
case TokenKind.LogicalOr: _op = MSAst.ExpressionType.Or; break;
default: throw Assert.Unreachable;
}
_left = left;
_right = right;
StartIndex = left.StartIndex;
EndIndex = right.EndIndex;
}
开发者ID:Alxandr,项目名称:IronTotem,代码行数:28,代码来源:BinaryExpression.cs
示例19: Token
public Token(TokenKind kind, string data, int line, int col)
{
this.tokenKind = kind;
this.line = line;
this.col = col;
this.data = data;
}
开发者ID:refinedKing,项目名称:WeiXin--Vs2010-,代码行数:7,代码来源:Token.cs
示例20: Token
public Token(TokenKind kind, string value, int line, int column)
{
this.Kind = kind;
this.Value = value;
this.Line = line;
this.Column = column;
}
开发者ID:htien,项目名称:nsn,代码行数:7,代码来源:Token.cs
注:本文中的TokenKind类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论