• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TokenKind类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TokenSet类代码示例发布时间:2022-05-24
下一篇:
C# TokenInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap