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


C# Token类代码示例

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


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

示例1: ImportStatement

 public ImportStatement(Token importToken, IList<Token> importChain, IList<Token> fromChain, Token asValue)
     : base(importToken)
 {
     this.ImportChain = importChain.ToArray();
     this.FromChain = fromChain == null ? null : fromChain.ToArray();
     this.AsValue = asValue;
 }
开发者ID:blakeohare,项目名称:pyweek-sentientstorage,代码行数:7,代码来源:ImportStatement.cs

示例2: Build

        public override Token Build(Token lastToken, ScriptEngine engine, Script script, ref SourceCode sourceCode)
        {
            while ((++sourceCode).SpecialChar)
            {
            }
            if (sourceCode.Peek() != '{')
            {
                sourceCode.Throw(String.Format("Error parsing a 'do' statement, expected a '{' but got '{0}' instead.",
                                               sourceCode.Peek()));
            }
            List<List<List<Token>>> code = engine.BuildLongTokens(ref sourceCode, ref script, new[] {'}'});

            if (!sourceCode.SeekToNext("while"))
            {
                sourceCode.Throw("Error parsing a 'do' statement, was expecting a 'while' after the { } block.");
            }

            if (!sourceCode.SeekToNext('('))
            {
                sourceCode.Throw("Error parsing a 'do' statement, was expecting a '(' after 'while'.");
            }

            List<List<Token>> exitCondition = engine.BuildTokensAdvanced(ref sourceCode, ref script, new[] {')'});

            return new DoWhileToken(code, exitCondition);
        }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:26,代码来源:DoWhileBlockBuilder.cs

示例3: HttpParameter

 public HttpParameter(Token name,
                      string value)
     : this()
 {
     Name = name;
     Value = value;
 }
开发者ID:KarlDirck,项目名称:cavity,代码行数:7,代码来源:HttpParameter.cs

示例4: Expect

 void Expect(Token tok)
 {
     if(Next() == tok)
         Consume();
     else
         Error();
 }
开发者ID:RaptorOne,项目名称:SmartDevelop,代码行数:7,代码来源:ShuntingYardExpressionParser.cs

示例5: GenericParamRow

 /// <summary>
 /// Initializes a new instance of the <see cref="GenericParamRow" /> struct.
 /// </summary>
 /// <param name="number">The number.</param>
 /// <param name="flags">The flags.</param>
 /// <param name="owner">The owner.</param>
 /// <param name="nameString">The name string.</param>
 public GenericParamRow(ushort number, GenericParameterAttributes flags, Token owner, HeapIndexToken nameString)
 {
     Number = number;
     Flags = flags;
     Owner = owner;
     NameString = nameString;
 }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:14,代码来源:GenericParamRow.cs

示例6: AppendAnythingElse

 public override void AppendAnythingElse(TreeConstruction tree, Token token)
 {
     OnMessageRaised(new UnexpectedTokenAfterHtmlError(token.Name));
     tree.ChangeInsertionMode<InBodyInsertionMode>();
     tree.ReprocessFlag = true;
     return;
 }
开发者ID:bakera,项目名称:Test,代码行数:7,代码来源:AfterBodyInsertionMode.cs

示例7: ScriptForEachStatement

 public ScriptForEachStatement(AstNodeArgs args)
     : base(args)
 {
     name = (Token)ChildNodes[1];
       expr = (ScriptExpr)ChildNodes[3];
       statement = (ScriptStatement)ChildNodes[4];
 }
开发者ID:2yangk23,项目名称:MapleShark,代码行数:7,代码来源:ScriptForEachStatement.cs

示例8: BracketIndex

		public BracketIndex(Expression root, Token bracketToken, Expression index, Executable owner)
			: base(root.FirstToken, owner)
		{
			this.Root = root;
			this.BracketToken = bracketToken;
			this.Index = index;
		}
开发者ID:geofrey,项目名称:crayon,代码行数:7,代码来源:BracketIndex.cs

示例9: GenericRCDATAElementParsingAlgorithm

 // Text Parsing
 protected void GenericRCDATAElementParsingAlgorithm(TreeConstruction tree, Token token)
 {
     tree.InsertElementForToken((TagToken)token);
     tree.Parser.ChangeTokenState<RCDATAState>();
     tree.OriginalInsertionMode = tree.CurrentInsertionMode;
     tree.ChangeInsertionMode<TextInsertionMode>();
 }
开发者ID:bakera,项目名称:Test,代码行数:8,代码来源:InsertionMode.cs

示例10: Create

        public static AuthRequest Create(Token token, Trust trust)
        {
            Scope scope = null;

            if (trust != null)
            {
                scope = new Scope()
                {
                    Trust = trust,
                };
            }

            return new AuthRequest()
            {
                Auth = new Auth()
                {
                    Identity = new Identity()
                    {
                        Methods = new[] { "token" },
                        Token = token
                    },
                    Scope = scope
                }
            };
        }
开发者ID:skyquery,项目名称:graywulf-plugins,代码行数:25,代码来源:AuthRequest.cs

示例11: LiteralExpression

        public LiteralExpression(ScriptLoadingContext lcontext, Token t)
            : base(lcontext)
        {
            switch (t.Type)
            {
                case TokenType.Number:
                case TokenType.Number_Hex:
                case TokenType.Number_HexFloat:
                    Value = DynValue.NewNumber(t.GetNumberValue()).AsReadOnly();
                    break;
                case TokenType.String:
                case TokenType.String_Long:
                    Value = DynValue.NewString(t.Text).AsReadOnly();
                    break;
                case TokenType.True:
                    Value = DynValue.True;
                    break;
                case TokenType.False:
                    Value = DynValue.False;
                    break;
                case TokenType.Nil:
                    Value = DynValue.Nil;
                    break;
                default:
                    throw new InternalErrorException("type mismatch");
            }

            if (Value == null)
                throw new SyntaxErrorException(t, "unknown literal format near '{0}'", t.Text);

            lcontext.Lexer.Next();
        }
开发者ID:eddy5641,项目名称:moonsharp,代码行数:32,代码来源:LiteralExpression.cs

示例12: CreateTokenAsync

        public virtual async Task<string> CreateTokenAsync(Token token)
        {
            var header = await CreateHeaderAsync(token);
            var payload = await CreatePayloadAsync(token);

            return await SignAsync(new JwtSecurityToken(header, payload));
        }
开发者ID:FranceConnectSamples,项目名称:franceconnect-identity-provider-dotnet-webapi-aspnetcore,代码行数:7,代码来源:FranceConnectTokenCreationService.cs

示例13: ControlInvokation

 public ControlInvokation(Token Source, Control Control, List<Node> Arguments, Node Body)
     : base(Source)
 {
     this.Control = Control;
     this.Arguments = Arguments;
     this.Body = Body;
 }
开发者ID:Blecki,项目名称:EtcScript,代码行数:7,代码来源:ControlInvokation.cs

示例14: ValidateToken

 internal static void ValidateToken(Token token)
 {
     if (ReferenceEquals(token, null))
         throw new ArgumentNullException(nameof(token));
     if (String.IsNullOrEmpty(token.Value))
         throw new ArgumentException(nameof(token.Value));
 }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:7,代码来源:BaseSecureStore.cs

示例15: GenericParamRow

 /// <summary>
 /// Initializes a new instance of the <see cref="GenericParamRow"/> struct.
 /// </summary>
 /// <param name="number">The number.</param>
 /// <param name="flags">The flags.</param>
 /// <param name="owner">The owner table idx.</param>
 /// <param name="nameStringIdx">The name string idx.</param>
 public GenericParamRow(ushort number, GenericParameterAttributes flags, Token owner, HeapIndexToken nameStringIdx)
 {
     this.number = number;
     this.flags = flags;
     this.owner = owner;
     this.nameStringIdx = nameStringIdx;
 }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:14,代码来源:GenericParamRow.cs


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