本文整理汇总了C#中ObjCParser.translation_unit方法的典型用法代码示例。如果您正苦于以下问题:C# ObjCParser.translation_unit方法的具体用法?C# ObjCParser.translation_unit怎么用?C# ObjCParser.translation_unit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjCParser
的用法示例。
在下文中一共展示了ObjCParser.translation_unit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCodeBehindForHeader
private IList<FilePath> GenerateCodeBehindForHeader(ProjectTypeCache cache, CodeBehindWriter writer, FilePath file)
{
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- Parsing {0}", file);
// Parse and collect information from the document
AntlrFileStream stream = new AntlrFileStream (file);
ObjCLexer lexer = new ObjCLexer (stream);
CommonTokenStream tokenStream = new CommonTokenStream (lexer);
ObjCParser parser = new ObjCParser (tokenStream);
ObjCParser.Translation_unitContext context = parser.translation_unit ();
NativeClassDescriptionCollector<int> visitor = new NativeClassDescriptionCollector<int> ();
context.Accept (visitor);
/*
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- Dump classes");
foreach (NativeClassDescriptor classDescriptor in visitor.Descriptors) {
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- ClassName={0}", classDescriptor.ClassName);
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- SuperClassName={0}", classDescriptor.SuperClassName);
foreach (NativeMethodDescriptor descriptor in classDescriptor.Methods) {
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- {0}", descriptor);
}
foreach (NativeInstanceVariableDescriptor descriptor in classDescriptor.InstanceVariables) {
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- {0}", descriptor);
}
}
*/
List<FilePath> designerFiles = new List<FilePath> ();
foreach (NativeClassDescriptor classDescriptor in visitor.Descriptors) {
// Check if the class should be generated
if (!ShouldGenerateForHeader (classDescriptor)) {
IDELogger.Log ("CodeBehindHandler::GenerateCodeBehindForHeader -- Skipping {0} (no outlets or no actions)", classDescriptor.ClassName);
continue;
}
// Generate the designer part
FilePath designerFile = this.CodeGenerator.GenerateCodeBehindCode (cache, writer, classDescriptor.ClassName, new []{ classDescriptor });
if (designerFile != FilePath.Null) {
designerFiles.Add (designerFile);
}
}
return designerFiles;
}