当前位置: 首页>>代码示例>>C#>>正文


C# TokenId类代码示例

本文整理汇总了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;
 }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:Token.cs

示例2: BinaryExpression

 public BinaryExpression(TokenId op, ExpressionNode left, ExpressionNode right)
     : base(left.RelatedToken)
 {
     _op = op;
     _left = left;
     _right = right;
 }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:BinaryExpression.cs

示例3: Token

 public Token(string text, TokenId tokenId, int pos, SourceRange range)
 {
     _text = text;
     _tokenId = tokenId;
     _pos = pos;
     _range = range;
 }
开发者ID:chenzuo,项目名称:nquery,代码行数:7,代码来源:Token.cs

示例4: MemberAccessExpression

 public MemberAccessExpression(ExpressionNode left, ExpressionNode right, TokenId qualifierKind, bool isMember)
     : base(left.RelatedToken)
 {
     _left = left;
     _right = right;
     _isMember = isMember;
 }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:MemberAccessExpression.cs

示例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;
 }
开发者ID:Nacorpio,项目名称:cparser,代码行数:16,代码来源:Token.cs

示例6: Match

        private bool Match(TokenId tokenID)
        {
            if (_token.Id == tokenID)
            {
                NextToken();
                return true;
            }

            _errorReporter.TokenExpected(_token.Range, _token.Text, tokenID);
            return false;
        }
开发者ID:chenzuo,项目名称:nquery,代码行数:11,代码来源:Parser.cs

示例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));
        }
开发者ID:yslib,项目名称:minimvc,代码行数:11,代码来源:UnaryExpression.cs

示例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));
     }
 }
开发者ID:yslib,项目名称:minimvc,代码行数:16,代码来源:UnaryExpression.cs

示例9: ValidateToken

 void ValidateToken(TokenId t)
 {
     if (token.id != t) throw ParseError(ErrorMessages.SyntaxError);
 }
开发者ID:kornarakis,项目名称:DynamicExpresso,代码行数:4,代码来源:ExpressionParser.cs

示例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));
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:ExpressionLexer.cs

示例11: ValidateToken

 private void ValidateToken(TokenId t, string errorMessage)
 {
     if (token.id != t) throw ParseError(errorMessage);
 }
开发者ID:timbooker,项目名称:dotObjects,代码行数:4,代码来源:ExpressionParser.cs

示例12: FromTokenId

 public static TokenInfo FromTokenId(TokenId tokenId)
 {
     return _infosById[tokenId];
 }
开发者ID:chenzuo,项目名称:nquery,代码行数:4,代码来源:TokenInfo.cs

示例13: ValidateToken

 private void ValidateToken(TokenId t)
 {
     if (this._token.Id != t)
         throw this.ParseError("Syntax error", new object[0]);
 }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:5,代码来源:ExpressionParser.cs

示例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;
 }
开发者ID:sharwell,项目名称:openstack.net,代码行数:15,代码来源:Token.cs

示例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);
 }
开发者ID:chenzuo,项目名称:nquery,代码行数:5,代码来源:ErrorProvider.cs


注:本文中的TokenId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。