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


C# TokenKind类代码示例

本文整理汇总了C#中TokenKind的典型用法代码示例。如果您正苦于以下问题:C# TokenKind类的具体用法?C# TokenKind怎么用?C# TokenKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TokenKind类属于命名空间,在下文中一共展示了TokenKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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