本文整理汇总了C#中TokenType类的典型用法代码示例。如果您正苦于以下问题:C# TokenType类的具体用法?C# TokenType怎么用?C# TokenType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TokenType类属于命名空间,在下文中一共展示了TokenType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:akatakritos,项目名称:PygmentSharp,代码行数:14,代码来源:RegexLexer.cs
示例2: VxSqlToken
public VxSqlToken(TokenType t, string n, string l)
{
type = t;
name = n;
leading_space = l;
trailing_space = "";
}
开发者ID:apenwarr,项目名称:versaplex,代码行数:7,代码来源:vxsqltokenizer.cs
示例3: Token
public Token(TokenType type, string text, int offset, int length)
{
m_Type = type;
m_Text = text;
m_Offset = offset;
m_Length = length;
}
开发者ID:alfar,项目名称:WordBuilder,代码行数:7,代码来源:Token.cs
示例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);
}
开发者ID:davidlblake,项目名称:WPFConverters,代码行数:7,代码来源:Token.cs
示例5: Token
public Token(TokenType type, string text, int start, int length)
{
this.type = type;
this.text = text;
this.start = start;
this.length = length;
}
开发者ID:ajlopez,项目名称:Acquarella,代码行数:7,代码来源:Token.cs
示例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;
}
开发者ID:sekcheong,项目名称:graphdemo,代码行数:7,代码来源:Lexer.cs
示例7: UnaryExpression
public UnaryExpression(TokenType op, Expression operand)
{
if (operand != null)
AddChild (operand, OperandRole);
Operator = op;
}
开发者ID:yudhitech,项目名称:xamarin-macios,代码行数:7,代码来源:UnaryExpression.cs
示例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;
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:7,代码来源:BinaryExpression.cs
示例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();
}
开发者ID:Vanlightly,项目名称:Logari,代码行数:7,代码来源:LqlParser.cs
示例10: MonadicExpression
protected MonadicExpression(TextPosition tp, TokenType op, Element exp)
: base(tp)
{
Operator = op;
Exp = exp;
AppendChild(Exp);
}
开发者ID:B-head,项目名称:Dreit-prototype,代码行数:7,代码来源:MonadicExpression.cs
示例11: Token
public Token(string name, TokenType t, int line, int column)
{
this.Text = name;
this.Type = t;
this.Line = line;
this.Column = column;
}
开发者ID:7shi,项目名称:cs2fs,代码行数:7,代码来源:Token.cs
示例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;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:12,代码来源:Parser.cs
示例13: Token
public Token(DateTimeOffset created, Guid tokenGuid, string tokenName, TokenType tokenType)
{
this.Created = created;
this.TokenGuid = tokenGuid;
this.TokenName = tokenName;
this.TokenType = tokenType;
}
开发者ID:jroberts-iii,项目名称:TechnicalInterview_FeedReader,代码行数:7,代码来源:Token.cs
示例14: DuplicateTokenEx
public static extern bool DuplicateTokenEx(
SafeFileHandle hExistingToken,
uint dwDesiredAccess,
SecurityAttributes lpTokenAttributes,
SecurityImpersonationLevel impersonationLevel,
TokenType tokenType,
out IntPtr hNewToken);
开发者ID:stefanschneider,项目名称:IronFrame,代码行数:7,代码来源:DuplicateTokenEx.cs
示例15: Token
public Token(TokenType type, string term, int start, int length)
{
Start = start;
Length = length;
Type = type;
Term = term;
}
开发者ID:vetterd,项目名称:CSBuild,代码行数:7,代码来源:Token.cs
示例16: Token
public Token(Regex match, TokenType tokenType, OperationType operationType = OperationType.Operator, TokenDiscardPolicy discardPolicy = TokenDiscardPolicy.Keep)
{
m_TokenType = tokenType;
m_DiscardPolicy = discardPolicy;
m_OperationType = operationType;
m_Regex = match;
}
开发者ID:JoshuaSmyth,项目名称:SimpleExpressionParser,代码行数:7,代码来源:Token.cs
示例17: XmlTokens
static XmlTokens()
{
StartComment = new TokenType("StartComment", "<!--");
EndComment = new TokenType("EndComment", "-->");
CloseElement = new TokenType("CloseElement", "/>");
ComplexCloseElement = new TokenType("ComplexCloseElement", "</");
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:XmlTokens.cs
示例18: Compute
public override ScriptObject Compute(TokenType type, ScriptObject value) {
if (type != TokenType.Plus) { return base.Compute(type, value); }
ScriptTable table = value as ScriptTable;
if (table == null) throw new ExecutionException(m_Script, this, "table [+] 操作只限两个[table]之间,传入数据类型:" + value.Type);
ScriptTable ret = m_Script.CreateTable();
ScriptObject obj = null;
ScriptScriptFunction func = null;
foreach (KeyValuePair<object, ScriptObject> pair in m_listObject) {
obj = pair.Value.Clone();
if (obj is ScriptScriptFunction) {
func = (ScriptScriptFunction)obj;
if (!func.IsStaticFunction) func.SetTable(ret);
}
ret.m_listObject[pair.Key] = obj;
}
foreach (KeyValuePair<object, ScriptObject> pair in table.m_listObject) {
obj = pair.Value.Clone();
if (obj is ScriptScriptFunction) {
func = (ScriptScriptFunction)obj;
if (!func.IsStaticFunction) func.SetTable(ret);
}
ret.m_listObject[pair.Key] = obj;
}
return ret;
}
开发者ID:qingfeng346,项目名称:Scorpio-CSharp,代码行数:25,代码来源:ScriptTable.cs
示例19: CLexer
public CLexer()
{
m_strExpr = "";
m_nNextPos = 0;
m_PreviousTokenType = TokenType.T_EOL;
m_currToken = new Token();
}
开发者ID:Vincenzo1968,项目名称:OperatorPrecedenceParsing,代码行数:7,代码来源:Lexer.cs
示例20: Token
// Constructor
public Token(TokenType type, int startOffset, int length, object data = null)
{
this.type = type;
this.startOffset = startOffset;
this.length = length;
this.data = data;
}
开发者ID:pazof,项目名称:markdowndeep,代码行数:8,代码来源:Token.cs
注:本文中的TokenType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论