本文整理汇总了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;
}
示例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);
}
示例3: HttpParameter
public HttpParameter(Token name,
string value)
: this()
{
Name = name;
Value = value;
}
示例4: Expect
void Expect(Token tok)
{
if(Next() == tok)
Consume();
else
Error();
}
示例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;
}
示例6: AppendAnythingElse
public override void AppendAnythingElse(TreeConstruction tree, Token token)
{
OnMessageRaised(new UnexpectedTokenAfterHtmlError(token.Name));
tree.ChangeInsertionMode<InBodyInsertionMode>();
tree.ReprocessFlag = true;
return;
}
示例7: ScriptForEachStatement
public ScriptForEachStatement(AstNodeArgs args)
: base(args)
{
name = (Token)ChildNodes[1];
expr = (ScriptExpr)ChildNodes[3];
statement = (ScriptStatement)ChildNodes[4];
}
示例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;
}
示例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>();
}
示例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
}
};
}
示例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();
}
示例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;
}
示例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));
}
示例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;
}