本文整理汇总了C#中TokenId类的典型用法代码示例。如果您正苦于以下问题:C# TokenId类的具体用法?C# TokenId怎么用?C# TokenId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TokenId类属于命名空间,在下文中一共展示了TokenId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Token
public Token(TokenId tokenId, string data, Location startLocation, Location endLocation)
{
_tokenId = tokenId;
_data = data;
_startLocation = startLocation;
_endLocation = endLocation;
}
示例2: BinaryExpression
public BinaryExpression(TokenId op, ExpressionNode left, ExpressionNode right)
: base(left.RelatedToken)
{
_op = op;
_left = left;
_right = right;
}
示例3: Token
public Token(string text, TokenId tokenId, int pos, SourceRange range)
{
_text = text;
_tokenId = tokenId;
_pos = pos;
_range = range;
}
示例4: MemberAccessExpression
public MemberAccessExpression(ExpressionNode left, ExpressionNode right, TokenId qualifierKind, bool isMember)
: base(left.RelatedToken)
{
_left = left;
_right = right;
_isMember = isMember;
}
示例5: Token
/// <summary>
/// Initializes an instance of the Token class.
/// </summary>
/// <param name="obj">The object.</param>
/// <param name="col">The column.</param>
/// <param name="line">The line.</param>
/// <param name="pos">The position.</param>
/// <param name="type">The type.</param>
public Token(dynamic obj, int col, int line, int pos, TokenId type)
{
Object = obj;
Column = col;
Line = line;
Position = pos;
Type = type;
}
示例6: Match
private bool Match(TokenId tokenID)
{
if (_token.Id == tokenID)
{
NextToken();
return true;
}
_errorReporter.TokenExpected(_token.Range, _token.Text, tokenID);
return false;
}
示例7: EvalBooleanOperator
private object EvalBooleanOperator(TokenId op, object lValue)
{
bool v = Util.ToBool(lValue);
switch (op)
{
case TokenId.Not: return !v;
}
throw new ParseException(string.Format("Unary not support, tokenId: '{0}', value: {1} at line: {2} column:{3}", RelatedToken.TokenId, lValue, RelatedToken.StartLocation.LineIndex + 1, RelatedToken.StartLocation.CharacterIndex + 1));
}
示例8: EvalDecimalOperator
private object EvalDecimalOperator(TokenId op, decimal value)
{
switch (op)
{
case TokenId.Plus:
return value;
case TokenId.Minus:
return -value;
case TokenId.PlusPlus:
return ++value;
case TokenId.MinusMinus:
return --value;
default:
throw new ParseException(string.Format("Unary not support, tokenId: '{0}', value: {1} at line: {2} column:{3}", RelatedToken.TokenId, value, RelatedToken.StartLocation.LineIndex + 1, RelatedToken.StartLocation.CharacterIndex + 1));
}
}
示例9: ValidateToken
void ValidateToken(TokenId t)
{
if (token.id != t) throw ParseError(ErrorMessages.SyntaxError);
}
示例10: ValidateToken
/// <summary>Validates the current token is of the specified kind.</summary>
/// <param name="t">Expected token kind.</param>
internal void ValidateToken(TokenId t)
{
if (this.token.Id != t)
{
throw ParseError(Strings.RequestQueryParser_SyntaxError(this.textPos));
}
}
示例11: ValidateToken
private void ValidateToken(TokenId t, string errorMessage)
{
if (token.id != t) throw ParseError(errorMessage);
}
示例12: FromTokenId
public static TokenInfo FromTokenId(TokenId tokenId)
{
return _infosById[tokenId];
}
示例13: ValidateToken
private void ValidateToken(TokenId t)
{
if (this._token.Id != t)
throw this.ParseError("Syntax error", new object[0]);
}
示例14: Token
/// <summary>
/// Initializes a new instance of the <see cref="Token"/> class with the specified ID and extension data.
/// </summary>
/// <remarks>
/// <para>This constructor is typically used for authentication requests which specified a <see cref="Token"/>
/// as the credentials.</para>
/// </remarks>
/// <param name="id">The unique ID of the token.</param>
/// <param name="extensionData">The extension data.</param>
/// <exception cref="ArgumentNullException">If <paramref name="extensionData"/> is <see langword="null"/>.</exception>
public Token(TokenId id, ImmutableDictionary<string, JToken> extensionData)
: base(extensionData)
{
_id = id;
}
示例15: HandleError
void IErrorReporter.TokenExpected(SourceRange sourceRange, string foundTokenText, TokenId expected)
{
string message = String.Format(CultureInfo.CurrentCulture, Resources.TokenExpected, foundTokenText, TokenInfo.FromTokenId(expected).Text);
HandleError(sourceRange, ErrorId.TokenExpected, message);
}