本文整理汇总了C#中Tokenizer.SyncWithEndBrace方法的典型用法代码示例。如果您正苦于以下问题:C# Tokenizer.SyncWithEndBrace方法的具体用法?C# Tokenizer.SyncWithEndBrace怎么用?C# Tokenizer.SyncWithEndBrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokenizer
的用法示例。
在下文中一共展示了Tokenizer.SyncWithEndBrace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseMembers
//.........这里部分代码省略.........
do {
if (tokenizer.Accept (Token2Type.Identifier, "virtual")) {
is_virtual = true;
continue;
}
if (tokenizer.Accept (Token2Type.Identifier, "static")) {
is_static = true;
continue;
}
if (tokenizer.Accept (Token2Type.Identifier, "const")) {
is_const = true;
continue;
}
if (tokenizer.Accept (Token2Type.Identifier, "extern")) {
is_extern = true;
continue;
}
if (tokenizer.Accept (Token2Type.Identifier, "volatile")) {
continue;
}
if (tokenizer.Accept (Token2Type.Identifier, "G_GNUC_INTERNAL")) {
continue;
}
break;
} while (true);
if (is_extern && tokenizer.Accept (Token2Type.Literal, "C")) {
tokenizer.SyncWithEndBrace ();
continue;
}
if (tokenizer.Accept (Token2Type.Punctuation, "~")) {
is_dtor = true;
if (!is_virtual) {
TypeInfo ti = parent as TypeInfo;
if (ti != null && ti.Base != null)
Console.WriteLine ("The class {0} has a non-virtual destructor, and it's base class is {2} ({1}).", parent.Name, parent.Header, ti != null && ti.Base != null ? ti.Base.Value : "<none>");
}
}
if (is_dtor) {
name = "~" + tokenizer.GetIdentifier ();
returntype = new TypeReference ("void");
} else {
returntype = ParseTypeReference (tokenizer);
if (tokenizer.CurrentToken.value == "<") {
tokenizer.Advance (true);
while (!tokenizer.Accept (Token2Type.Punctuation, ">"))
tokenizer.Advance (true);
}
if (returntype.Value == parent.Name && tokenizer.CurrentToken.value == "(") {
is_ctor = true;
name = returntype.Value;
returntype.Value += "*";
} else {
name = tokenizer.GetIdentifier ();
}
}