diff options
Diffstat (limited to 'autodoc/source/exes')
-rw-r--r-- | autodoc/source/exes/adc_uni/adc_cl.cxx | 169 | ||||
-rw-r--r-- | autodoc/source/exes/adc_uni/cmd_run.cxx | 334 |
2 files changed, 0 insertions, 503 deletions
diff --git a/autodoc/source/exes/adc_uni/adc_cl.cxx b/autodoc/source/exes/adc_uni/adc_cl.cxx index 23d6db8a9029..45c98b7c7548 100644 --- a/autodoc/source/exes/adc_uni/adc_cl.cxx +++ b/autodoc/source/exes/adc_uni/adc_cl.cxx @@ -86,175 +86,6 @@ const char * const C_sUserGuide = "\n" "\n"; - -#if 0 // FUTURE -"\n\n\n" -" Use of Autodoc\n" -" --------------\n" -"\n" -" Basics:\n" -"\n" -" Autodoc may perform different tasks.\n" -"\n" -" Possible tasks are\n" -" - parsing source code\n" -" - creating HTML-output.\n" -" On the command line each task starts with a specific\n" -" option:\n" -" '-parse' for parsing source code,\n" -" '-html' for creating HTML.\n" -" All command line options, related to one task, have to follow before\n" -" the starting option of the next task.\n" -"\n" -" Within the task '-parse', there may be defined different projects.\n" -" A project definition is started with '-p'.\n" -" All not project specific options within the task '-parse' have to\n" -" appear in front of the first '-p'.\n" -" There can be no project at all. Then all options, available for\n" -" projects, can be used like for one nameless default project, without using\n" -" '-p', but these options still have to appear behind all other\n" -" options of the task '-parse'.\n" -"\n" -"\n" -" Legend:\n" -"\n" -" <SomeText> Describes an argument.\n" -" 'SomeText' Within '...' is the literal value of an argument.\n" -" + There can be multiple arguments.\n" -" | Separator for alternative literal values of an argument.\n" -"\n" -"\n" -" Syntax:\n" -"\n" -" -parse\n" -" -name <RepositoryName>]\n" -" -lg 'c++'|'idl'\n" -" -extg <AdditonalExtensions>+\n" -" -docg 'usehtml'\n" -" -p <ProjectName> <ProjectRootDir>\n" -" -l 'c++'|'idl'\n" -" -ext <AdditonalExtensions>+\n" -" -doc 'usehtml'\n" -" -d <SourceDir_relative2ProjectRootDir_nosubdirs>+\n" -" -t <SourceTree_relative2ProjectRootDir>+\n" -" -f <SourceFile_relative2ProjectRootDir>+\n" -" -html <OutputDir>\n" -" -xlinks <Namespace> <ExternLinksRootDir>\n" -" -i <CommandFilePath>\n" -" -v <VerboseNr>\n" -"\n" -"\n" -" Detailed Options Description:\n" -"\n" -" Option Arguments\n" -" ----------------------------------------------------------\n" -"\n" -" -parse \n\n" -" Starts the task \"Parse source code\".\n" -" May be omitted, if it would be the first option on the\n" -" command line.\n" -"\n" -" -name <RepositoryName>\n\n" -" This name is used for naming the repository in\n" -" human readable output. In future it may be used also for\n" -" identifiing a repository in searches.\n" -"\n" -" -lg 'c++|'idl'\n\n" -" Identifies the programming language to be parsed.\n" -" 'c++': C++\n" -" Files with extensions '.h', '.hxx' are parsed.\n" -" 'idl': UNO-IDL\n" -" Files with extensions '.idl' are parsed.\n" -" Here the language is set globally for all projects.\n" -" A project can override this by using '-l'.\n" -"\n" -" -extg <.AdditionalExtension>+\n\n" -" Has to follow immediately behind '-lg'.\n" -" Specifies additional extensions, that will be recognised as\n" -" source code files of the previously specified programming\n" -" language. Each extension has to start with '.'.\n" -" It is possible to include extensionless files, too,\n" -" by the argument '.'\n" -" Here these extensions are set globally for all projects.\n" -" A project can override this by using '-l' and '-ext'.\n" -"\n" -" -docg 'html'|'nohtml'\n\n" -" Specifies the default for all comments in source code, so \n" -" that HTML-tags are interpreted as such or else treated as\n" -" regular text.\n" -" Without this option, the default is 'nohtml'.\n" -" Here the default is set globally for all projects.\n" -" A project can override this by using '-doc'.\n" -"\n" -" -p <ProjectName> <ProjectRootDirectory>\n\n" -" ProjectName is used in output as human readable identifier\n" -" for the project. ProjectRootDirectory is the path,\n" -" where the arguments of '-d', '-t' and '-f' are relative to.\n" -" This option can be omitted, then there is no project name\n" -" and all paths are relative to the current working directory.\n" -"\n" -" -l 'c++|'idl'\n\n" -" Overrides -lg and -extg for the current project, which is\n" -" specified by the last previous '-p'.\n" -" For details see at option '-lg'.\n" -"\n" -" -ext <.AdditionalExtension>+\n\n" -" Can be used only immediately behind '-l'.\n" -" Overrides -extg for the current project, which is\n" -" specified by the last previous '-p'.\n" -" For details see at option '-extg'.\n" -"\n" -" -doc 'html'|'nohtml'\n\n" -" Overrides -docg for the current project, which is\n" -" specified by the last previous '-p'.\n" -" For details see at option '-docg'.\n" -"\n" -" -d <SourceDir_relative2ProjectRootDir_nosubdirs>+\n\n" -" For the current project all files in the given\n" -" directories are parsed, which have valid extensions.\n" -" Subdirectories are NOT parsed.\n" -"\n" -" -t <SourceTree_relative2ProjectRootDir>+\n\n" -" For the current project all files in the given\n" -" directories AND its subdirectories are parsed, which\n" -" have valid extensions.\n" -"\n" -" -f <SourceFile_relative2ProjectRootDir>+\n\n" -" For the current project and language the given files\n" -" are parsed. It doesn't matter, if their extensions match\n" -" the valid extensions.\n" -"\n" -" -html <OutputRootDir>\n\n" -" Starts the task \"Create HTML output\".\n" -"\n" -" -xlinks <Namespace> <ExternLinksRootDir>\n\n" -" This option allows, to create links to external\n" -" HTML-documents.\n" -" For all source code objects (like classes or functions)\n" -" which belong in the given namespace, the given root\n" -" directory is used as a base for links to them.\n" -" Presently, this works only for C++-mappings of IDL-items.\n" -" The given namespace has to be absolute.\n" -"\n" -" -i <CommandFilePath>\n\n" -" This option is replaced by the contents of the given\n" -" file. The file has to be ASCII and each option\n" -" has to start in the first column of a new line.\n" -" So each valid line starts with a '-'.\n" -" Empty lines are allowed.\n" -" Comment lines have to start with '#'\n" -"\n" -" -v <VerboseNumber>\n\n" -" Show details during parsing:\n" -" 2 shows each parsed letter,\n" -" 4 shows stored objects.\n" -" 1 shows recognised tokens.\n" -" These bit-values can be combined.\n" -" This option suppresses errors, because of\n" -" missing output options (no '-html').\n"; -#endif // 0, FUTURE - - CommandLine::CommandLine() : nDebugStyle(0), pSinceTransformator(new command::SinceTagTransformationData), diff --git a/autodoc/source/exes/adc_uni/cmd_run.cxx b/autodoc/source/exes/adc_uni/cmd_run.cxx index c26b15e30177..5b79de482114 100644 --- a/autodoc/source/exes/adc_uni/cmd_run.cxx +++ b/autodoc/source/exes/adc_uni/cmd_run.cxx @@ -273,340 +273,6 @@ Parser::GatherFiles( FileCollector_Ifc & o_rFiles, } // namespace run } // namespace command - - -#if 0 -inline const ParseToolsFactory_Ifc & -CommandRunner::ParseToolsFactory() - { return ParseToolsFactory_Ifc::GetIt_(); } - - -inline const command::S_LanguageInfo & -CommandRunner::Get_ProjectLanguage( const command::Parse & i_rCommand, - const command::S_ProjectData & i_rProject ) -{ - if ( i_rProject.pLanguage ) - return *i_rProject.pLanguage; - return *i_rCommand.GlobalLanguageInfo(); -} - -inline bool -CommandRunner::HasParsedCpp() const - { return pCppParser; } -inline bool -CommandRunner::HasParsedIdl() const - { return pIdlParser; } - - - - - -CommandRunner::CommandRunner() - : pCommandLine(0), - pReposy(0), - pNewReposy(0), - nResultCode(0) -{ - Cout() << "\nAutodoc version 2.2.1" - << "\n-------------------" - << "\n" << Endl(); -} - -CommandRunner::~CommandRunner() -{ - ary::Repository::Destroy_(); - Cout() << "\n" << Endl(); -} - -void -CommandRunner::Run( const CommandLine & i_rCL ) -{ - ary::Repository::Destroy_(); -// ary::Repository::Destroy_(); - pReposy = 0; - pNewReposy = 0; - nResultCode = 0; - pCommandLine = &i_rCL; - - pCommandLine->Run(); -} - -void -CommandRunner::Parse() -{ - try - { - - csv_assert( pCommandLine->Cmd_Parse() != 0 ); - const command::Parse & - rCmd = *pCommandLine->Cmd_Parse(); - - Cout() << "Parsing the repository " - << rCmd.ReposyName() - << " ..." - << Endl(); - - if ( pReposy == 0 ) - pReposy = & ary::Repository::Create_( rCmd.ReposyName(), 0 ); - if ( pNewReposy == 0 ) - pNewReposy = & ary::Repository::Create_( rCmd.ReposyName() ); - - Dyn< FileCollector_Ifc > pFiles; - pFiles = ParseToolsFactory().Create_FileCollector(6000); - - bool bCpp = false; - bool bIDL = false; - - command::Parse::ProjectIterator itEnd = rCmd.ProjectsEnd(); - for ( command::Parse::ProjectIterator it = rCmd.ProjectsBegin(); - it != itEnd; - ++it ) - { - - uintt nCount = GatherFiles( *pFiles, rCmd, *(*it) ); - Cout() << nCount - << " files found to parse in project " - << (*it)->Name() - << "." - << Endl(); - - - switch ( Get_ProjectLanguage(rCmd, *(*it)).eLanguage ) - { - case command::S_LanguageInfo::cpp: - { - Get_CppParser().Run( (*it)->Name(), - (*it)->RootDirectory(), - *pFiles ); - bCpp = true; - } break; - case command::S_LanguageInfo::idl: - { - Get_IdlParser().Run(*pFiles); - bIDL = true; - } break; - default: - Cerr() << "Project in yet unimplemented language skipped." - << Endl(); - } - } // end for - - if (bCpp) - pReposy->RwGate_Cpp().Connect_AllTypes_2_TheirRelated_CodeEntites(); - if (bIDL) - { - pNewReposy->Gate_Idl().Secondaries().Connect_Types2Ces(); - pNewReposy->Gate_Idl().Secondaries().Gather_CrossReferences(); - } - - } // end try - catch (csv::Exception & xx) - { - xx.GetInfo(Cerr()); - Cerr() << " program will exit." << Endl(); - nResultCode = 1; - } - catch (...) - { - Cerr() << "Unknown exception - program will exit." << Endl(); - nResultCode = 1; - } -} - -void -CommandRunner::Load() -{ - Cout() << "This would load the repository from the directory " - << pCommandLine->Cmd_Load()->ReposyDir() - << "." - << Endl(); -} - - -void -CommandRunner::Save() -{ - Cout() << "This would save the repository into the directory " - << pCommandLine->Cmd_Save()->ReposyDir() - << "." - << Endl(); -} - - -void -CommandRunner::CreateHtml() -{ - Cout() << "Creating HTML-output into the directory " - << pCommandLine->Cmd_CreateHtml()->OutputDir() - << "." - << Endl(); - - if ( HasParsedCpp() ) - CreateHtml_NewStyle(); - if ( HasParsedIdl() ) - CreateHtml_OldIdlStyle(); -} - - - -void -CommandRunner::CreateXml() -{ - Cout() << "This would create the XML-output into the directory " - << pCommandLine->Cmd_CreateXml()->OutputDir() - << "." - << Endl(); -} - -CodeParser_Ifc & -CommandRunner::Get_CppParser() -{ - if ( NOT pCppParser ) - Create_CppParser(); - return *pCppParser; -} - -IdlParser & -CommandRunner::Get_IdlParser() -{ - if ( NOT pIdlParser ) - Create_IdlParser(); - return *pIdlParser; -} - -void -CommandRunner::Create_CppParser() -{ - pCppParser = ParseToolsFactory().Create_Parser_Cplusplus(); - pCppDocuInterpreter = ParseToolsFactory().Create_DocuParser_AutodocStyle(); - - pCppParser->Setup( *pReposy, - *pCppDocuInterpreter ); -} - -void -CommandRunner::Create_IdlParser() -{ - pIdlParser = new IdlParser(*pNewReposy); -} - -uintt -CommandRunner::GatherFiles( FileCollector_Ifc & o_rFiles, - const command::Parse & i_rCommand, - const command::S_ProjectData & i_rProject ) -{ - uintt ret = 0; - o_rFiles.EraseAll(); - - typedef StringVector StrVector; - typedef StrVector::const_iterator StrIterator; - const command::S_Sources & - rSources = i_rProject.aFiles; - const StrVector & - rExtensions = Get_ProjectLanguage(i_rCommand,i_rProject).aExtensions; - - StrIterator it; - StrIterator itDirsEnd = rSources.aDirectories.end(); - StrIterator itTreesEnd = i_rProject.aFiles.aTrees.end(); - StrIterator itFilesEnd = i_rProject.aFiles.aFiles.end(); - StrIterator itExt; - StrIterator itExtEnd = rExtensions.end(); - - csv::StreamStr aDir(500); - i_rProject.aRootDirectory.Get( aDir ); - - uintt nProjectDir_AddPosition = - ( strcmp(aDir.c_str(),".\\") == 0 OR strcmp(aDir.c_str(),"./") == 0 ) - ? 0 - : uintt( aDir.tellp() ); - - for ( it = rSources.aDirectories.begin(); - it != itDirsEnd; - ++it ) - { - aDir.seekp( nProjectDir_AddPosition ); - aDir << *it; - - for ( itExt = rExtensions.begin(); - itExt != itExtEnd; - ++itExt ) - { - ret += o_rFiles.AddFilesFrom( aDir.c_str(), - *itExt, - FileCollector_Ifc::flat ); - } // end for itExt - } // end for it - for ( it = rSources.aTrees.begin(); - it != itTreesEnd; - ++it ) - { - aDir.seekp( nProjectDir_AddPosition ); - aDir << *it; - - for ( itExt = rExtensions.begin(); - itExt != itExtEnd; - ++itExt ) - { - ret += o_rFiles.AddFilesFrom( aDir.c_str(), - *itExt, - FileCollector_Ifc::recursive ); - } // end for itExt - } // end for it - for ( it = rSources.aFiles.begin(); - it != itFilesEnd; - ++it ) - { - aDir.seekp( nProjectDir_AddPosition ); - aDir << *it; - - o_rFiles.AddFile( aDir.c_str() ); - } // end for it - ret += rSources.aFiles.size(); - - return ret; -} - -void -CommandRunner::CreateHtml_NewStyle() -{ - const ary::cpp::DisplayGate & - rGate = pReposy->DisplayGate_Cpp(); - - Dyn< autodoc::HtmlDisplay_UdkStd > pHtmlDisplay; - pHtmlDisplay = DisplayToolsFactory_Ifc::GetIt_() - .Create_HtmlDisplay_UdkStd(); - - pHtmlDisplay->Run( pCommandLine->Cmd_CreateHtml()->OutputDir(), - rGate, - DisplayToolsFactory_Ifc::GetIt_().Create_StdFrame() ); -} - -void -CommandRunner::CreateHtml_OldIdlStyle() -{ - ary::idl::Gate & - rAryGate = pNewReposy->Gate_Idl(); - - // Read DevManualLinkFile: - // KORR_FUTURE - csv::File - aFile("devmanref.txt", csv::CFM_READ); - if ( aFile.open() ) - { - rAryGate.Secondaries().Read_Links2DevManual(aFile); - aFile.close(); - } - - // New Style Output - Dyn<autodoc::HtmlDisplay_Idl_Ifc> pNewDisplay; - pNewDisplay = DisplayToolsFactory_Ifc::GetIt_() - .Create_HtmlDisplay_Idl(); - pNewDisplay->Run( pCommandLine->Cmd_CreateHtml()->OutputDir(), - rAryGate, - DisplayToolsFactory_Ifc::GetIt_().Create_StdFrame() ); -} -#endif // 0 - } // namespace autodoc |