本文整理汇总了C#中TokenTypes.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TokenTypes.ToString方法的具体用法?C# TokenTypes.ToString怎么用?C# TokenTypes.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TokenTypes
的用法示例。
在下文中一共展示了TokenTypes.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatchGet
public LexerToken MatchGet(TokenTypes expected)
{
LexerToken t = buffer.ElementAt(consumeOffset);
if(!t.IsType(expected))
throw new Exceptions.ParsingException(string.Format(
Config.UserCulture, Properties.Resources.ex_Parsing_Failed_TokenMismatch, expected.ToString(), t.Text, CurrentTokenNeighbourhood()));
Consume();
return t;
}
示例2: Match
public void Match(TokenTypes expected, string content)
{
if(!buffer.ElementAt(consumeOffset).IsType(expected) || !buffer.ElementAt(consumeOffset).Text.Equals(content))
throw new Exceptions.ParsingException(string.Format(
Config.UserCulture, Properties.Resources.ex_Parsing_Failed_TokenMismatchEx, expected.ToString(), buffer.ElementAt(consumeOffset).Text, CurrentTokenNeighbourhood(), content));
Consume();
}
示例3: switch
/// <summary>
/// Retrieves the field definition identified by the given token in the scope.
/// </summary>
/// <param name="token">The token of the field to retrieve.</param>
/// <returns></returns>
RuntimeField IModuleTypeSystem.GetField(TokenTypes token)
{
switch (TokenTypes.TableMask & token)
{
case TokenTypes.Field:
return fields[(int)(token & TokenTypes.RowIndexMask) - 1];
case TokenTypes.MemberRef:
return GetFieldForMemberReference(token);
default:
throw new NotSupportedException(@"Can't get method for token " + token.ToString("x"));
}
}
示例4: Match
public void Match(TokenTypes expected)
{
if(!buffer.ElementAt(consumeOffset).IsType(expected))
throw new ParsingException(string.Format(MathNet.Symbolics.Properties.Resources.ex_Parsing_Failed_TokenMismatch, expected.ToString(), buffer.ElementAt(consumeOffset).Text, CurrentTokenNeighbourhood()));
Consume();
}