本文整理汇总了C#中TokenType类的典型用法代码示例。如果您正苦于以下问题:C# TokenType类的具体用法?C# TokenType怎么用?C# TokenType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TokenType类属于命名空间,在下文中一共展示了TokenType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegexLexerContext
/// <summary>
/// Initializes a new isntance of the <see cref="RegexLexerContext"/> class
/// </summary>
/// <param name="position">the position into the source file</param>
/// <param name="match">the regular expression match data</param>
/// <param name="stateStack">The stack of states</param>
/// <param name="ruleTokenType">The token type the rule specified to emit</param>
public RegexLexerContext(int position, Match match, Stack<string> stateStack, TokenType ruleTokenType)
{
Position = position;
Match = match;
StateStack = stateStack;
RuleTokenType = ruleTokenType;
}
示例2: VxSqlToken
public VxSqlToken(TokenType t, string n, string l)
{
type = t;
name = n;
leading_space = l;
trailing_space = "";
}
示例3: Token
public Token(TokenType type, string text, int offset, int length)
{
m_Type = type;
m_Text = text;
m_Offset = offset;
m_Length = length;
}
示例4: Equals
public bool Equals(TokenType tokenType, string value)
{
Debug.Assert(Enum.IsDefined(typeof(TokenType), tokenType));
Debug.Assert(value != null);
return (this.type == tokenType) && string.Equals(this.value, value, StringComparison.Ordinal);
}
示例5: Token
public Token(TokenType type, string text, int start, int length)
{
this.type = type;
this.text = text;
this.start = start;
this.length = length;
}
示例6: GetOperatorType
internal static OperatorType GetOperatorType(TokenType type)
{
if (type == TokenType.OP_UMINUS) return OperatorType.UNARY;
if (type == TokenType.OP_UPLUS) return OperatorType.UNARY;
if (type == TokenType.OP_UNOT) return OperatorType.UNARY;
return OperatorType.BINARY;
}
示例7: UnaryExpression
public UnaryExpression(TokenType op, Expression operand)
{
if (operand != null)
AddChild (operand, OperandRole);
Operator = op;
}
示例8: BinaryExpression
public BinaryExpression(int line, int column, Expression lhs, TokenType op, Expression rhs)
: base(line, column)
{
this.lhs = lhs;
this.op = op;
this.rhs = rhs;
}
示例9: DiscardToken
private void DiscardToken(TokenType tokenType)
{
if (_lookaheadFirst.TokenType != tokenType)
throw new LqlParserException(string.Format("Expected {0} but found: {1}", tokenType.ToString().ToUpper(), _lookaheadFirst.Value));
DiscardToken();
}
示例10: MonadicExpression
protected MonadicExpression(TextPosition tp, TokenType op, Element exp)
: base(tp)
{
Operator = op;
Exp = exp;
AppendChild(Exp);
}
示例11: Token
public Token(string name, TokenType t, int line, int column)
{
this.Text = name;
this.Type = t;
this.Line = line;
this.Column = column;
}
示例12: _get
/// <summary>
/// Gets the value of the next token of a certain type
/// </summary>
/// <param name="type">The type of token to retrieve</param>
/// <returns>The token's value</returns>
private string _get(TokenType type)
{
var token = _read();
if (token.Type != type)
throw new InvalidDataException(token.Type.ToString());
return token.Value;
}
示例13: Token
public Token(DateTimeOffset created, Guid tokenGuid, string tokenName, TokenType tokenType)
{
this.Created = created;
this.TokenGuid = tokenGuid;
this.TokenName = tokenName;
this.TokenType = tokenType;
}
示例14: DuplicateTokenEx
public static extern bool DuplicateTokenEx(
SafeFileHandle hExistingToken,
uint dwDesiredAccess,
SecurityAttributes lpTokenAttributes,
SecurityImpersonationLevel impersonationLevel,
TokenType tokenType,
out IntPtr hNewToken);
示例15: Token
public Token(TokenType type, string term, int start, int length)
{
Start = start;
Length = length;
Type = type;
Term = term;
}