diff options
Diffstat (limited to 'autodoc/source/parser/adoc')
-rw-r--r-- | autodoc/source/parser/adoc/a_rdocu.cxx | 92 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/adoc_tok.cxx | 49 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/cx_a_std.cxx | 518 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/cx_a_sub.cxx | 184 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/docu_pe.cxx | 405 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/makefile.mk | 62 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/prs_adoc.cxx | 59 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/tk_attag.cxx | 86 | ||||
-rw-r--r-- | autodoc/source/parser/adoc/tk_docw.cxx | 130 |
9 files changed, 1585 insertions, 0 deletions
diff --git a/autodoc/source/parser/adoc/a_rdocu.cxx b/autodoc/source/parser/adoc/a_rdocu.cxx new file mode 100644 index 000000000000..212541a2f535 --- /dev/null +++ b/autodoc/source/parser/adoc/a_rdocu.cxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/a_rdocu.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <adoc/docu_pe.hxx> +#include <adoc/adoc_tok.hxx> +#include <ary/doc/d_oldcppdocu.hxx> +#include <doc_deal.hxx> + + + +namespace adoc +{ + + +DocuExplorer::DocuExplorer() + : pDocuDistributor(0), + pPE(new Adoc_PE), + bIsPassedFirstDocu(false) +{ +} + +DocuExplorer::~DocuExplorer() +{ +} + +void +DocuExplorer::StartNewFile( DocuDealer & o_rDocuDistributor ) +{ + pDocuDistributor = &o_rDocuDistributor; + bIsPassedFirstDocu = false; +} + + +void +DocuExplorer::Process_Token( DYN adoc::Token & let_drToken ) +{ + csv_assert(pDocuDistributor != 0); + + let_drToken.Trigger(*pPE); + if ( pPE->IsComplete() ) + { + ary::doc::OldCppDocu * + pDocu = pPE->ReleaseJustParsedDocu(); + if ( pDocu != 0 ) + { + if (bIsPassedFirstDocu) + pDocuDistributor->TakeDocu( *pDocu ); + else + { + delete pDocu; + bIsPassedFirstDocu = true; + } + } + } + + delete &let_drToken; +} + + +} // namespace adoc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/adoc_tok.cxx b/autodoc/source/parser/adoc/adoc_tok.cxx new file mode 100644 index 000000000000..4a63c2d0dc8f --- /dev/null +++ b/autodoc/source/parser/adoc/adoc_tok.cxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/adoc_tok.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <adoc/atokdeal.hxx> +#include <../cpp/c_dealer.hxx> + + +namespace adoc { + +void +Token::DealOut( ::TokenDealer & o_rDealer ) +{ + o_rDealer.AsDistributor()->Deal_AdcDocu(*this); +} + + +} // namespace adoc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/cx_a_std.cxx b/autodoc/source/parser/adoc/cx_a_std.cxx new file mode 100644 index 000000000000..18d11b560ab0 --- /dev/null +++ b/autodoc/source/parser/adoc/cx_a_std.cxx @@ -0,0 +1,518 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/cx_a_std.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <adoc/cx_a_sub.hxx> +#include <x_parse.hxx> +#include <tools/tkpchars.hxx> +#include <adoc/tk_attag.hxx> +#include <adoc/tk_docw.hxx> +#include <tokens/tokdeal.hxx> + + + +namespace adoc { + + +const intt C_nStatusSize = 128; +const intt C_nCppInitialNrOfStati = 400; + + +const uintt nF_fin_Error = 1; +const uintt nF_fin_Ignore = 2; +const uintt nF_fin_LineStart = 3; +const uintt nF_fin_Eol = 4; +const uintt nF_fin_Eof = 5; +const uintt nF_fin_AnyWord = 6; +const uintt nF_fin_Whitespace = 7; + +const uintt nF_goto_AtTag = 20; +const uintt nF_goto_CheckStar = 21; + +DYN TextToken * TCF_DocWord(const char * text) { return new Tok_DocWord(text); } + +DYN TextToken * TCF_atstd_ATT(const char * ) { return new Tok_at_std(ary::info::atid_ATT); } +DYN TextToken * TCF_atstd_author(const char * ) { return new Tok_at_std(ary::info::atid_author); } +DYN TextToken * TCF_atstd_change(const char * ) { return new Tok_at_std(ary::info::atid_change); } +DYN TextToken * TCF_atstd_collab(const char * ) { return new Tok_at_std(ary::info::atid_collab); } +DYN TextToken * TCF_atstd_contact(const char * ) { return new Tok_at_std(ary::info::atid_contact); } +DYN TextToken * TCF_atstd_copyright(const char * ) { return new Tok_at_std(ary::info::atid_copyright); } +DYN TextToken * TCF_atstd_descr(const char * ) { return new Tok_at_std(ary::info::atid_descr); } +DYN TextToken * TCF_atstd_docdate(const char * ) { return new Tok_at_std(ary::info::atid_docdate); } +DYN TextToken * TCF_atstd_derive(const char * ) { return new Tok_at_std(ary::info::atid_derive); } +DYN TextToken * TCF_atstd_instance(const char * ) { return new Tok_at_std(ary::info::atid_instance); } +DYN TextToken * TCF_atstd_life(const char * ) { return new Tok_at_std(ary::info::atid_life); } +DYN TextToken * TCF_atstd_multi(const char * ) { return new Tok_at_std(ary::info::atid_multi); } +DYN TextToken * TCF_atstd_onerror(const char * ) { return new Tok_at_std(ary::info::atid_onerror); } +DYN TextToken * TCF_atstd_persist(const char * ) { return new Tok_at_std(ary::info::atid_persist); } +DYN TextToken * TCF_atstd_postcond(const char * ) { return new Tok_at_std(ary::info::atid_postcond); } +DYN TextToken * TCF_atstd_precond(const char * ) { return new Tok_at_std(ary::info::atid_precond); } +DYN TextToken * TCF_atstd_responsibility(const char * ) { return new Tok_at_std(ary::info::atid_resp); } +DYN TextToken * TCF_atstd_return(const char * ) { return new Tok_at_std(ary::info::atid_return); } +DYN TextToken * TCF_atstd_short(const char * ) { return new Tok_at_std(ary::info::atid_short); } +DYN TextToken * TCF_atstd_todo(const char * ) { return new Tok_at_std(ary::info::atid_todo); } +DYN TextToken * TCF_atstd_version(const char * ) { return new Tok_at_std(ary::info::atid_version); } + +DYN TextToken * TCF_at_base(const char *) { return new Tok_at_base; } +DYN TextToken * TCF_at_exception(const char *) { return new Tok_at_exception; } +DYN TextToken * TCF_at_impl(const char *) { return new Tok_at_impl; } +DYN TextToken * TCF_at_interface(const char *) { return new Tok_at_interface; } +DYN TextToken * TCF_at_key(const char *) { return new Tok_at_key; } +DYN TextToken * TCF_at_param(const char *) { return new Tok_at_param; } +DYN TextToken * TCF_at_see(const char *) { return new Tok_at_see; } +DYN TextToken * TCF_at_template(const char *) { return new Tok_at_template; } +DYN TextToken * TCF_at_internal(const char *) { return new Tok_at_internal; } +DYN TextToken * TCF_at_obsolete(const char *) { return new Tok_at_obsolete; } +DYN TextToken * TCF_at_module(const char *) { return new Tok_at_module; } +DYN TextToken * TCF_at_file(const char *) { return new Tok_at_file; } +DYN TextToken * TCF_at_gloss(const char *) { return new Tok_at_gloss; } +DYN TextToken * TCF_at_global(const char *) { return new Tok_at_global; } +DYN TextToken * TCF_at_include(const char *) { return new Tok_at_include; } +DYN TextToken * TCF_at_label(const char *) { return new Tok_at_label; } +DYN TextToken * TCF_at_since(const char *) { return new Tok_at_since; } +DYN TextToken * TCF_at_HTML(const char *) { return new Tok_at_HTML; } +DYN TextToken * TCF_at_NOHTML(const char *) { return new Tok_at_NOHTML; } +DYN TextToken * TCF_Whitespace(const char * i_sText); +DYN TextToken * TCF_EoDocu(const char *) { return new Tok_EoDocu; } +DYN TextToken * TCF_EoLine(const char *) { return new Tok_Eol; } +DYN TextToken * TCF_Eof(const char *) { return new Tok_Eof; } + + + + +Context_AdocStd::Context_AdocStd() + : aStateMachine(C_nStatusSize, C_nCppInitialNrOfStati), + pDealer(0), + pParentContext(0), + pFollowUpContext(0), + pCx_LineStart(0), + pCx_CheckStar(0), + pCx_AtTagCompletion(0), + pNewToken(0), + bIsMultiline(false) +{ + pCx_LineStart = new Cx_LineStart(*this); + pCx_CheckStar = new Cx_CheckStar(*this); + pCx_AtTagCompletion = new Cx_AtTagCompletion(*this); + + SetupStateMachine(); +} + +void +Context_AdocStd::SetParentContext( TkpContext & io_rParentContext, + const char * ) +{ + pFollowUpContext = pParentContext = &io_rParentContext; + pCx_CheckStar->Set_End_FollowUpContext(io_rParentContext); +} + +Context_AdocStd::~Context_AdocStd() +{ +} + +void +Context_AdocStd::AssignDealer( TokenDealer & o_rDealer ) +{ + pDealer = &o_rDealer; + pCx_LineStart->AssignDealer(o_rDealer); + pCx_CheckStar->AssignDealer(o_rDealer); + pCx_AtTagCompletion->AssignDealer(o_rDealer); +} + +void +Context_AdocStd::ReadCharChain( CharacterSource & io_rText ) +{ + csv_assert(pParentContext != 0); + pNewToken = 0; + + TextToken::F_CRTOK fTokenCreateFunction = 0; + StmBoundsStatus & rBound = aStateMachine.GetCharChain(fTokenCreateFunction, io_rText); + + // !!! + // The order of the next two lines is essential, because + // pFollowUpContext may be changed by PerformStatusFunction() also, + // which then MUST override the previous assignment. + pFollowUpContext = rBound.FollowUpContext(); + PerformStatusFunction(rBound.StatusFunctionNr(), fTokenCreateFunction, io_rText); +} + +bool +Context_AdocStd::PassNewToken() +{ + if (pNewToken) + { + pNewToken.Release()->DealOut(*pDealer); + return true; + } + return false; +} + +TkpContext & +Context_AdocStd::FollowUpContext() +{ + csv_assert(pFollowUpContext != 0); + return *pFollowUpContext; +} + +void +Context_AdocStd::PerformStatusFunction( uintt i_nStatusSignal, + F_CRTOK i_fTokenCreateFunction, + CharacterSource & io_rText ) +{ + switch (i_nStatusSignal) + { + case nF_fin_Error: + { + char cCC = io_rText.CurChar(); + String sChar( &cCC, 1 ); + throw X_Parser(X_Parser::x_InvalidChar, sChar, String ::Null_(), 0); + } // no break, because of throw + case nF_fin_Ignore: + io_rText.CutToken(); + pNewToken = 0; + break; + case nF_fin_LineStart: + csv_assert(i_fTokenCreateFunction != 0); + pNewToken = (*i_fTokenCreateFunction)(io_rText.CutToken()); + break; + case nF_fin_Eol: + io_rText.CutToken(); + pDealer->Deal_Eol(); + if ( bIsMultiline ) + { + pNewToken = TCF_EoLine(0); + pFollowUpContext = pCx_LineStart.Ptr(); + } + else + { + pNewToken = TCF_EoDocu(0); + pFollowUpContext = pParentContext; + } + break; + case nF_fin_Eof: + pNewToken = TCF_Eof(0); + break; + case nF_fin_AnyWord: + if (i_fTokenCreateFunction != 0) + pNewToken = (*i_fTokenCreateFunction)(io_rText.CutToken()); + else + pNewToken = TCF_DocWord(io_rText.CutToken()); + break; + case nF_fin_Whitespace: + pNewToken = TCF_Whitespace(io_rText.CutToken()); + break; + case nF_goto_AtTag: + pNewToken = 0; + pCx_AtTagCompletion->SetCurToken(i_fTokenCreateFunction); + break; + case nF_goto_CheckStar: + pNewToken = 0; + pCx_CheckStar->SetCanBeEnd( bIsMultiline ); + break; + default: + { + char cCC = io_rText.CurChar(); + String sChar( &cCC, 1 ); + throw X_Parser(X_Parser::x_InvalidChar, sChar, String::Null_(), 0); + } + } // end switch (i_nStatusSignal) +} + +void +Context_AdocStd::SetupStateMachine() +{ + // Besondere Array-Stati (kein Tokenabschluss oder Kontextwechsel): +// const INT16 bas = 0; // Base-Status + const INT16 wht = 1; // Whitespace-Status + const INT16 awd = 2; // Any-Word-Read-Status + + // Kontextwechsel-Stati: + const INT16 goto_CheckStar = 3; + const INT16 goto_AtTag = 4; + + // Tokenfinish-Stati: + const INT16 finError = 5; +// const INT16 finIgnore = 6; + const INT16 finEol = 7; + const INT16 finEof = 8; + const INT16 finAnyWord = 9; + const INT16 finWhitespace = 10; + + // Konstanten zur Benutzung in der Tabelle: + const INT16 fof = finEof; + const INT16 err = finError; + const INT16 faw = finAnyWord; +// const INT16 fig = finIgnore; + const INT16 fwh = finWhitespace; + + /// The '0's will be replaced by calls of AddToken(). + + const INT16 A_nTopStatus[C_nStatusSize] = + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + {fof,err,err,err,err,err,err,err,err,wht, 0,wht,wht, 0,err,err, + err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31 + wht,awd,awd,awd,awd,awd,awd,awd,awd,awd, 0,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 63 + 0,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95 + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd // ... 127 + }; + + const INT16 A_nWhitespaceStatus[C_nStatusSize] = + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + {fof,err,err,err,err,err,err,err,err,wht,fwh,wht,wht,fwh,err,err, + err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31 + wht,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, + fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 63 + fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, + fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 95 + fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, + fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh // ... 127 + }; + + const INT16 A_nWordStatus[C_nStatusSize] = + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + {faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err, + err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31 + faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 63 + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95 + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd // ... 127 + }; + + const INT16 A_nAtTagDefStatus[C_nStatusSize] = + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + {faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err, + err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31 + faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 63 + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95 + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, + awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd // ... 127 + }; + + const INT16 A_nPunctDefStatus[C_nStatusSize] = + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + {err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 16 ... + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 48 ... + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 80 ... + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, + err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err // 112 ... + }; + + DYN StmArrayStatus * dpStatusTop + = new StmArrayStatus( C_nStatusSize, A_nTopStatus, 0, true); + DYN StmArrayStatus * dpStatusWhite + = new StmArrayStatus( C_nStatusSize, A_nWhitespaceStatus, 0, true); + DYN StmArrayStatus * dpStatusWord + = new StmArrayStatus( C_nStatusSize, A_nWordStatus, TCF_DocWord, true); + + DYN StmBoundsStatus * dpBst_goto_CheckStar + = new StmBoundsStatus( *this, *pCx_CheckStar, nF_goto_CheckStar, true ); + DYN StmBoundsStatus * dpBst_goto_AtTag + = new StmBoundsStatus( *this, *pCx_AtTagCompletion, nF_goto_AtTag, true ); + + DYN StmBoundsStatus * dpBst_finError + = new StmBoundsStatus( *this, TkpContext::Null_(), nF_fin_Error, true ); + DYN StmBoundsStatus * dpBst_finIgnore + = new StmBoundsStatus( *this, *this, nF_fin_Ignore, true); + DYN StmBoundsStatus * dpBst_finEol + = new StmBoundsStatus( *this, *pCx_LineStart, nF_fin_Eol, false); + DYN StmBoundsStatus * dpBst_finEof + = new StmBoundsStatus( *this, TkpContext::Null_(), nF_fin_Eof, false); + DYN StmBoundsStatus * dpBst_finAnyWord + = new StmBoundsStatus( *this, *this, nF_fin_AnyWord, true); + DYN StmBoundsStatus * dpBst_finWhitespace + = new StmBoundsStatus( *this, *this, nF_fin_Whitespace, true); + + // dpMain aufbauen: + aStateMachine.AddStatus(dpStatusTop); + aStateMachine.AddStatus(dpStatusWhite); + aStateMachine.AddStatus(dpStatusWord); + + aStateMachine.AddStatus(dpBst_goto_CheckStar); + aStateMachine.AddStatus(dpBst_goto_AtTag); + + aStateMachine.AddStatus(dpBst_finError); + aStateMachine.AddStatus(dpBst_finIgnore); + aStateMachine.AddStatus(dpBst_finEol); + aStateMachine.AddStatus(dpBst_finEof); + aStateMachine.AddStatus(dpBst_finAnyWord); + aStateMachine.AddStatus(dpBst_finWhitespace); + + aStateMachine.AddToken( "*", 0, A_nPunctDefStatus, goto_CheckStar ); + aStateMachine.AddToken( "@ATT", TCF_atstd_ATT, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@att", TCF_atstd_ATT, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@ATTENTION", + TCF_atstd_ATT, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@attention", + TCF_atstd_ATT, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@author", TCF_atstd_author, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@change", TCF_atstd_change, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@collab", TCF_atstd_collab, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@collaborator", + TCF_atstd_collab, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@contact", TCF_atstd_contact, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@copyright",TCF_atstd_copyright, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@descr", TCF_atstd_descr, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@docdate", TCF_atstd_docdate, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@derive", TCF_atstd_derive, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@instance",TCF_atstd_instance, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@life", TCF_atstd_life, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@lifecycle", + TCF_atstd_life, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@multi", TCF_atstd_multi, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@multiplicity", + TCF_atstd_multi, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@onerror", TCF_atstd_onerror, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@persist", TCF_atstd_persist, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@postcond",TCF_atstd_postcond,A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@precond", TCF_atstd_precond, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@resp", TCF_atstd_responsibility, + A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@responsibility", + TCF_atstd_return, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@return", TCF_atstd_return, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@short", TCF_atstd_short, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@todo", TCF_atstd_todo, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@version", TCF_atstd_version, A_nAtTagDefStatus, goto_AtTag ); + + aStateMachine.AddToken( "@base", TCF_at_base, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@exception",TCF_at_exception, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@impl", TCF_at_impl, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@key", TCF_at_key, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@param", TCF_at_param, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@see", TCF_at_see, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@seealso", TCF_at_see, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@since", TCF_at_since, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@tpl", TCF_at_template, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@tplparam", + TCF_at_template, A_nAtTagDefStatus, goto_AtTag ); + + aStateMachine.AddToken( "@interface",TCF_at_interface, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@internal",TCF_at_internal, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@obsolete",TCF_at_obsolete, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@deprecated",TCF_at_obsolete, A_nAtTagDefStatus, goto_AtTag ); + + aStateMachine.AddToken( "@module", TCF_at_module, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@file", TCF_at_file, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@gloss", TCF_at_gloss, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@global#", TCF_at_global, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@include#",TCF_at_include, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@#", TCF_at_label, A_nAtTagDefStatus, goto_AtTag ); + + aStateMachine.AddToken( "@HTML", TCF_at_HTML, A_nAtTagDefStatus, goto_AtTag ); + aStateMachine.AddToken( "@NOHTML", TCF_at_NOHTML, A_nAtTagDefStatus, goto_AtTag ); + + aStateMachine.AddToken( "\r\n", 0, A_nPunctDefStatus, finEol ); + aStateMachine.AddToken( "\n", 0, A_nPunctDefStatus, finEol ); + aStateMachine.AddToken( "\r", 0, A_nPunctDefStatus, finEol ); +}; + +void +Context_AdocStd::SetMode_IsMultiLine( bool i_bTrue ) +{ + bIsMultiline = i_bTrue; +} + +DYN TextToken * +TCF_Whitespace(const char * i_sText) +{ + UINT8 nSize = static_cast<UINT8>(strlen(i_sText)); + for ( const char * pTab = strchr(i_sText,'\t'); + pTab != 0; + pTab = strchr(pTab+1,'\t') ) + { + nSize += 3; + } + + return new Tok_Whitespace(nSize); +} + + +} // namespace adoc + + +/* +@ATT[ENTION] +@author +@change[s] +@collab[orators] +@contact +@copyright +@descr +@devstat[e] +@docdate +@derive +@instance +@life[cycle] +@multi[plicity] +@onerror +@persist[ence] +@postcond +@precond +@return +@short +@todo + +@module +@file +@gloss[ary] + + +@base <BasisklassenName> +@exception <ExceptionName> +@impl[ements] <IDL-Construct> +@key[words]|[s] +@param <FunctionParameterName> [<Range of valid values>] +@see[also] +@templ[ate] <FormalTemplateParameterName> + +@internal +@obsolete + +@#<Label> + +@global#<Label> Global comment. +@include#<Label> + + +*/ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/cx_a_sub.cxx b/autodoc/source/parser/adoc/cx_a_sub.cxx new file mode 100644 index 000000000000..335e2adbc6a1 --- /dev/null +++ b/autodoc/source/parser/adoc/cx_a_sub.cxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/cx_a_sub.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <tokens/parseinc.hxx> +#include <x_parse.hxx> +#include <adoc/tk_docw.hxx> + + +namespace adoc { + +//************************ Cx_LineStart ************************// + +Cx_LineStart::Cx_LineStart( TkpContext & i_rFollowUpContext ) + : pDealer(0), + pFollowUpContext(&i_rFollowUpContext) +{ +} + +void +Cx_LineStart::ReadCharChain( CharacterSource & io_rText ) +{ + uintt nCount = 0; + for ( char cNext = io_rText.CurChar(); cNext == 32 OR cNext == 9; cNext = io_rText.MoveOn() ) + { + if (cNext == 32) + nCount++; + else if (cNext == 9) + nCount += 4; + } + io_rText.CutToken(); + + if (nCount < 50) + pNewToken = new Tok_LineStart(UINT8(nCount)); + else + pNewToken = new Tok_LineStart(0); +} + +bool +Cx_LineStart::PassNewToken() +{ + if (pNewToken) + { + pNewToken.Release()->DealOut(*pDealer); + return true; + } + return false; +} + +TkpContext & +Cx_LineStart::FollowUpContext() +{ + return *pFollowUpContext; +} + + +//************************ Cx_CheckStar ************************// + +Cx_CheckStar::Cx_CheckStar( TkpContext & i_rFollowUpContext ) + : pDealer(0), + pFollowUpContext(&i_rFollowUpContext), + pEnd_FollowUpContext(0), + bCanBeEnd(false), + bEndTokenFound(false) +{ +} + + +void +Cx_CheckStar::ReadCharChain( CharacterSource & io_rText ) +{ + bEndTokenFound = false; + if (bCanBeEnd) + { + char cNext = jumpOver(io_rText,'*'); + if ( NULCH == cNext ) + throw X_Parser(X_Parser::x_UnexpectedEOF, "", String::Null_(), 0); + if (cNext == '/') + { + io_rText.MoveOn(); + pNewToken = new Tok_EoDocu; + bEndTokenFound = true; + } + else + { + pNewToken = new Tok_DocWord(io_rText.CutToken()); + } + } + else + { + jumpToWhite(io_rText); + pNewToken = new Tok_DocWord(io_rText.CutToken()); + } +} + +bool +Cx_CheckStar::PassNewToken() +{ + if (pNewToken) + { + pNewToken.Release()->DealOut(*pDealer); + return true; + } + return false; +} + +TkpContext & +Cx_CheckStar::FollowUpContext() +{ + if (bEndTokenFound) + return *pEnd_FollowUpContext; + else + return *pFollowUpContext; +} + + +//************************ Cx_AtTagCompletion ************************// + +Cx_AtTagCompletion::Cx_AtTagCompletion( TkpContext & i_rFollowUpContext ) + : pDealer(0), + pFollowUpContext(&i_rFollowUpContext) +{ +} + +void +Cx_AtTagCompletion::ReadCharChain( CharacterSource & io_rText ) +{ + jumpToWhite(io_rText); + csv_assert(fCur_TokenCreateFunction != 0); + pNewToken = (*fCur_TokenCreateFunction)(io_rText.CutToken()); +} + +bool +Cx_AtTagCompletion::PassNewToken() +{ + if (pNewToken) + { + pNewToken.Release()->DealOut(*pDealer); + return true; + } + return false; +} + +TkpContext & +Cx_AtTagCompletion::FollowUpContext() +{ + return *pFollowUpContext; +} + + + + +} // namespace adoc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/docu_pe.cxx b/autodoc/source/parser/adoc/docu_pe.cxx new file mode 100644 index 000000000000..d54e0295f38e --- /dev/null +++ b/autodoc/source/parser/adoc/docu_pe.cxx @@ -0,0 +1,405 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/docu_pe.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/doc/d_oldcppdocu.hxx> +#include <ary/info/ci_attag.hxx> +#include <ary/info/ci_text.hxx> +#include <adoc/adoc_tok.hxx> +#include <adoc/tk_attag.hxx> +#include <adoc/tk_docw.hxx> + + +namespace adoc +{ + + +inline bool +Adoc_PE::UsesHtmlInDocuText() +{ + return bUsesHtmlInDocuText; +} + + + + +Adoc_PE::Adoc_PE() + : pCurDocu(0), + pCurAtTag(0), + nLineCountInDocu(0), + nCurSpecialMeaningTokens(0), + nCurSubtractFromLineStart(0), + eCurTagState(ts_new), + eDocuState(ds_wait_for_short), + bIsComplete(false), + bUsesHtmlInDocuText(false) +{ +} + +Adoc_PE::~Adoc_PE() +{ +} + +void +Adoc_PE::Hdl_at_std( const Tok_at_std & i_rTok ) +{ + InstallAtTag( + CurDocu().Create_StdTag(i_rTok.Id()) ); +} + +void +Adoc_PE::Hdl_at_base( const Tok_at_base & ) +{ + InstallAtTag( + CurDocu().CheckIn_BaseTag() ); +} + +void +Adoc_PE::Hdl_at_exception( const Tok_at_exception & ) +{ + InstallAtTag( + CurDocu().CheckIn_ExceptionTag() ); +} + +void +Adoc_PE::Hdl_at_impl( const Tok_at_impl & ) +{ + InstallAtTag( + CurDocu().Create_ImplementsTag() ); +} + +void +Adoc_PE::Hdl_at_key( const Tok_at_key & ) +{ + InstallAtTag( + CurDocu().Create_KeywordTag() ); +} + +void +Adoc_PE::Hdl_at_param( const Tok_at_param & ) +{ + InstallAtTag( + CurDocu().CheckIn_ParameterTag() ); +} + +void +Adoc_PE::Hdl_at_see( const Tok_at_see & ) +{ + InstallAtTag( + CurDocu().CheckIn_SeeTag() ); +} + +void +Adoc_PE::Hdl_at_template( const Tok_at_template & ) +{ + InstallAtTag( + CurDocu().CheckIn_TemplateTag() ); +} + +void +Adoc_PE::Hdl_at_interface( const Tok_at_interface & ) +{ + CurDocu().Set_Interface(); +} + +void +Adoc_PE::Hdl_at_internal( const Tok_at_internal & ) +{ + CurDocu().Set_Internal(); +} + +void +Adoc_PE::Hdl_at_obsolete( const Tok_at_obsolete & ) +{ + CurDocu().Set_Obsolete(); +} + +void +Adoc_PE::Hdl_at_module( const Tok_at_module & ) +{ + // KORR_FUTURE + +// pCurAtTag = CurDocu().Assign2_ModuleTag(); +// nCurSpecialMeaningTokens = pCurAtTag->NrOfSpecialMeaningTokens(); +} + +void +Adoc_PE::Hdl_at_file( const Tok_at_file & ) +{ + // KORR_FUTURE + +// pCurAtTag = CurDocu().Assign2_FileTag(); +// nCurSpecialMeaningTokens = pCurAtTag->NrOfSpecialMeaningTokens(); +} + +void +Adoc_PE::Hdl_at_gloss( const Tok_at_gloss & ) +{ + // KORR_FUTURE + +// Create_GlossaryEntry(); +} + +void +Adoc_PE::Hdl_at_global( const Tok_at_global & ) +{ + // KORR_FUTURE +// Create_GlobalTextComponent(); +} + +void +Adoc_PE::Hdl_at_include( const Tok_at_include & ) +{ + // KORR_FUTURE +} + +void +Adoc_PE::Hdl_at_label( const Tok_at_label & ) +{ + InstallAtTag( + CurDocu().Create_LabelTag() ); +} + +void +Adoc_PE::Hdl_at_since( const Tok_at_since & ) +{ + InstallAtTag( + CurDocu().Create_SinceTag() ); +} + +void +Adoc_PE::Hdl_at_HTML( const Tok_at_HTML & ) +{ + bUsesHtmlInDocuText = true; +} + +void +Adoc_PE::Hdl_at_NOHTML( const Tok_at_NOHTML & ) +{ + bUsesHtmlInDocuText = false; +} + +void +Adoc_PE::Hdl_DocWord( const Tok_DocWord & i_rTok ) +{ + bool bIsSpecial = false; + if ( nCurSpecialMeaningTokens > 0 ) + { + bIsSpecial = CurAtTag().Add_SpecialMeaningToken( + i_rTok.Text(), + CurAtTag().NrOfSpecialMeaningTokens() + - (--nCurSpecialMeaningTokens) ); + } + + if ( NOT bIsSpecial ) + { + if ( eDocuState == ds_wait_for_short OR eDocuState == ds_1newline_after_short ) + eDocuState = ds_in_short; + if (nLineCountInDocu == 0) + nLineCountInDocu = 1; + + uintt nLength = i_rTok.Length(); + if ( nLength > 2 ) + { + bool bMaybeGlobalLink = strncmp( "::", i_rTok.Text(), 2 ) == 0; + bool bMayBeFunction = *(i_rTok.Text() + nLength - 2) == '(' + AND *(i_rTok.Text() + nLength - 1) == ')'; + if ( bMaybeGlobalLink OR bMayBeFunction ) + { + CurAtTag().Add_PotentialLink( i_rTok.Text(), + bMaybeGlobalLink, + bMayBeFunction ); + return; + } + } + + CurAtTag().Add_Token( i_rTok.Text() ); + eCurTagState = ts_std; + } +} + +void +Adoc_PE::Hdl_Whitespace( const Tok_Whitespace & i_rTok ) +{ + if ( eCurTagState == ts_std ) + { + + CurAtTag().Add_Whitespace(i_rTok.Size()); + } +} + +void +Adoc_PE::Hdl_LineStart( const Tok_LineStart & i_rTok ) +{ + if ( pCurAtTag == 0 ) + return; + + if ( nLineCountInDocu == 2 ) + { + nCurSubtractFromLineStart = i_rTok.Size(); + eCurTagState = ts_std; + } + else if ( nLineCountInDocu > 2 ) + { + if ( i_rTok.Size() > nCurSubtractFromLineStart ) + { + CurAtTag().Add_Whitespace( i_rTok.Size() + - nCurSubtractFromLineStart ); + } + // else do nothing, because there is no whitespace. + } +} + +void +Adoc_PE::Hdl_Eol( const Tok_Eol & ) +{ + if ( pCurAtTag == 0 ) + return; + + nLineCountInDocu++; + + if ( nCurSpecialMeaningTokens == 0 ) + { + CurAtTag().Add_Eol(); + + switch ( eDocuState ) + { + case ds_wait_for_short: break; + case ds_in_short: if ( nLineCountInDocu < 4 ) + eDocuState = ds_1newline_after_short; + else + { + RenameCurShortTag(); + eDocuState = ds_in_descr; + } + break; + case ds_1newline_after_short: FinishCurShortTag(); + eDocuState = ds_in_descr; + break; + default: + ; // Do noting. + } + } + else + { + nCurSpecialMeaningTokens = 0; + } + + +} + +void +Adoc_PE::Hdl_EoDocu( const Tok_EoDocu & ) +{ + bIsComplete = true; +} + +DYN ary::doc::OldCppDocu * +Adoc_PE::ReleaseJustParsedDocu() +{ + pCurAtTag = 0; + nLineCountInDocu = 0; + nCurSpecialMeaningTokens = 0; + nCurSubtractFromLineStart = 0; + eCurTagState = ts_new; + eDocuState = ds_wait_for_short; + bIsComplete = false; + return pCurDocu.Release(); +} + +void +Adoc_PE::InstallAtTag( DYN ary::info::AtTag * let_dpTag, + bool i_bImplicit ) +{ + pCurAtTag = let_dpTag; + if ( pCurAtTag != 0 ) + { + nCurSpecialMeaningTokens = pCurAtTag->NrOfSpecialMeaningTokens(); + pCurAtTag->Set_HtmlUseInDocuText( bUsesHtmlInDocuText ); + } + + eCurTagState = ts_new; + if ( NOT i_bImplicit ) + eDocuState = ds_std; +} + +ary::doc::OldCppDocu & +Adoc_PE::CurDocu() +{ + if (NOT pCurDocu) + pCurDocu = new ary::doc::OldCppDocu; + return *pCurDocu; +} + +ary::info::AtTag & +Adoc_PE::CurAtTag() +{ + if (NOT pCurAtTag) + { + if ( int(eDocuState) < int(ds_in_descr) ) + { + InstallAtTag( + CurDocu().Create_StdTag(ary::info::atid_short), + true ); + } + else + { + InstallAtTag( + CurDocu().Create_StdTag(ary::info::atid_descr), + true ); + } + } + return *pCurAtTag; +} + +void +Adoc_PE::RenameCurShortTag() +{ + CurDocu().Replace_AtShort_By_AtDescr(); +} + +void +Adoc_PE::FinishCurShortTag() +{ + InstallAtTag( + CurDocu().Create_StdTag(ary::info::atid_descr), + true ); +} + + +} // namespace adoc + + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/makefile.mk b/autodoc/source/parser/adoc/makefile.mk new file mode 100644 index 000000000000..48e4084ee401 --- /dev/null +++ b/autodoc/source/parser/adoc/makefile.mk @@ -0,0 +1,62 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=parser_adoc + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/adoc_tok.obj \ + $(OBJ)$/a_rdocu.obj \ + $(OBJ)$/cx_a_std.obj \ + $(OBJ)$/cx_a_sub.obj \ + $(OBJ)$/docu_pe.obj \ + $(OBJ)$/prs_adoc.obj \ + $(OBJ)$/tk_attag.obj \ + $(OBJ)$/tk_docw.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/parser/adoc/prs_adoc.cxx b/autodoc/source/parser/adoc/prs_adoc.cxx new file mode 100644 index 000000000000..f2e48f7ee75d --- /dev/null +++ b/autodoc/source/parser/adoc/prs_adoc.cxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/prs_adoc.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <adoc/cx_a_std.hxx> + + + +namespace adoc +{ + +DocuParser_AutodocStyle::DocuParser_AutodocStyle() +{ +} + +DocuParser_AutodocStyle::~DocuParser_AutodocStyle() +{ +} + +DYN autodoc::TkpDocuContext * +DocuParser_AutodocStyle::Create_DocuContext() const +{ + return new Context_AdocStd; +} + +} // namespace adoc + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/tk_attag.cxx b/autodoc/source/parser/adoc/tk_attag.cxx new file mode 100644 index 000000000000..6c9b500d4740 --- /dev/null +++ b/autodoc/source/parser/adoc/tk_attag.cxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/tk_attag.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <adoc/tokintpr.hxx> + + + +namespace adoc { + +void +Tok_at_std::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Hdl_at_std(*this); +} + +const char * +Tok_at_std::Text() const +{ + // KORR_FUTURE + return "A Tag"; + +// return eId.Text(); +} + + +#define DEFINE_TOKEN_CLASS(name, text) \ +void \ +Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \ +{ io_rInterpreter.Hdl_##name(*this); } \ +const char * \ +Tok_##name::Text() const \ +{ return text; } + +DEFINE_TOKEN_CLASS(at_base, "Base Classes") +DEFINE_TOKEN_CLASS(at_exception, "Exceptions") +DEFINE_TOKEN_CLASS(at_impl, "Implements") +DEFINE_TOKEN_CLASS(at_key, "Keywords") +DEFINE_TOKEN_CLASS(at_param, "Parameters") +DEFINE_TOKEN_CLASS(at_see, "See Also") +DEFINE_TOKEN_CLASS(at_template, "Template Parameters") +DEFINE_TOKEN_CLASS(at_interface, "Interface") +DEFINE_TOKEN_CLASS(at_internal, "[ INTERNAL ]") +DEFINE_TOKEN_CLASS(at_obsolete, "[ DEPRECATED ]") +DEFINE_TOKEN_CLASS(at_module, "Module") +DEFINE_TOKEN_CLASS(at_file, "File") +DEFINE_TOKEN_CLASS(at_gloss, "Glossary") +DEFINE_TOKEN_CLASS(at_global, "<global doc text>") +DEFINE_TOKEN_CLASS(at_include, "<included text>") +DEFINE_TOKEN_CLASS(at_label, "Label") +DEFINE_TOKEN_CLASS(at_HTML, "") +DEFINE_TOKEN_CLASS(at_NOHTML, "") +DEFINE_TOKEN_CLASS(at_since, "Since"); + +} // namespace adoc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser/adoc/tk_docw.cxx b/autodoc/source/parser/adoc/tk_docw.cxx new file mode 100644 index 000000000000..f7c3adb55761 --- /dev/null +++ b/autodoc/source/parser/adoc/tk_docw.cxx @@ -0,0 +1,130 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/tk_docw.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <adoc/tokintpr.hxx> + + + +namespace adoc { + + + static const char C_sSpace[300] = + " " + " " + " " + " " + " " + " "; + + +//*********************** Tok_DocWord ******************// + +void +Tok_DocWord::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Hdl_DocWord(*this); +} + +const char * +Tok_DocWord::Text() const +{ + return sText; +} + +//*********************** Tok_Whitespace ******************// + + +void +Tok_Whitespace::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Hdl_Whitespace(*this); +} + +const char * +Tok_Whitespace::Text() const +{ + return C_sSpace + 299 - nSize; +} + + + +//*********************** Tok_LineStart ******************// + + +void +Tok_LineStart::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Hdl_LineStart(*this); +} + +const char * +Tok_LineStart::Text() const +{ + return C_sSpace + 299 - nSize; +} + + +//*********************** Tok_Eol ******************// + +void +Tok_Eol::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Hdl_Eol(*this); +} + +const char * +Tok_Eol::Text() const +{ + return "\n"; +} + + + +//*********************** Tok_EoDocu ******************// + +void +Tok_EoDocu::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Hdl_EoDocu(*this); +} + +const char * +Tok_EoDocu::Text() const +{ + return "*/"; +} + +} // namespace adoc + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |