summaryrefslogtreecommitdiff
path: root/autodoc/source/parser
diff options
context:
space:
mode:
Diffstat (limited to 'autodoc/source/parser')
-rw-r--r--autodoc/source/parser/adoc/a_rdocu.cxx93
-rw-r--r--autodoc/source/parser/adoc/adoc_tok.cxx50
-rw-r--r--autodoc/source/parser/adoc/cx_a_std.cxx519
-rw-r--r--autodoc/source/parser/adoc/cx_a_sub.cxx185
-rw-r--r--autodoc/source/parser/adoc/docu_pe.cxx406
-rw-r--r--autodoc/source/parser/adoc/makefile.mk66
-rw-r--r--autodoc/source/parser/adoc/prs_adoc.cxx60
-rw-r--r--autodoc/source/parser/adoc/tk_attag.cxx114
-rw-r--r--autodoc/source/parser/adoc/tk_docw.cxx131
-rw-r--r--autodoc/source/parser/cpp/all_toks.cxx154
-rw-r--r--autodoc/source/parser/cpp/all_toks.hxx222
-rw-r--r--autodoc/source/parser/cpp/c_dealer.cxx152
-rw-r--r--autodoc/source/parser/cpp/c_dealer.hxx111
-rw-r--r--autodoc/source/parser/cpp/c_rcode.cxx185
-rw-r--r--autodoc/source/parser/cpp/c_rcode.hxx107
-rw-r--r--autodoc/source/parser/cpp/cpp_pe.cxx81
-rw-r--r--autodoc/source/parser/cpp/cpp_pe.hxx84
-rw-r--r--autodoc/source/parser/cpp/cpp_tok.hxx66
-rw-r--r--autodoc/source/parser/cpp/cx_base.cxx80
-rw-r--r--autodoc/source/parser/cpp/cx_base.hxx99
-rw-r--r--autodoc/source/parser/cpp/cx_c_pp.cxx183
-rw-r--r--autodoc/source/parser/cpp/cx_c_pp.hxx98
-rw-r--r--autodoc/source/parser/cpp/cx_c_std.cxx532
-rw-r--r--autodoc/source/parser/cpp/cx_c_std.hxx95
-rw-r--r--autodoc/source/parser/cpp/cx_c_sub.cxx160
-rw-r--r--autodoc/source/parser/cpp/cx_c_sub.hxx106
-rw-r--r--autodoc/source/parser/cpp/cxt2ary.cxx360
-rw-r--r--autodoc/source/parser/cpp/cxt2ary.hxx201
-rw-r--r--autodoc/source/parser/cpp/defdescr.cxx228
-rw-r--r--autodoc/source/parser/cpp/defdescr.hxx100
-rw-r--r--autodoc/source/parser/cpp/fevnthdl.hxx108
-rw-r--r--autodoc/source/parser/cpp/icprivow.cxx195
-rw-r--r--autodoc/source/parser/cpp/icprivow.hxx126
-rw-r--r--autodoc/source/parser/cpp/makefile.mk91
-rw-r--r--autodoc/source/parser/cpp/pe_base.cxx227
-rw-r--r--autodoc/source/parser/cpp/pe_base.hxx126
-rw-r--r--autodoc/source/parser/cpp/pe_class.cxx506
-rw-r--r--autodoc/source/parser/cpp/pe_class.hxx259
-rw-r--r--autodoc/source/parser/cpp/pe_defs.cxx183
-rw-r--r--autodoc/source/parser/cpp/pe_defs.hxx97
-rw-r--r--autodoc/source/parser/cpp/pe_enum.cxx192
-rw-r--r--autodoc/source/parser/cpp/pe_enum.hxx141
-rw-r--r--autodoc/source/parser/cpp/pe_enval.cxx171
-rw-r--r--autodoc/source/parser/cpp/pe_enval.hxx102
-rw-r--r--autodoc/source/parser/cpp/pe_expr.cxx207
-rw-r--r--autodoc/source/parser/cpp/pe_expr.hxx108
-rw-r--r--autodoc/source/parser/cpp/pe_file.cxx320
-rw-r--r--autodoc/source/parser/cpp/pe_file.hxx212
-rw-r--r--autodoc/source/parser/cpp/pe_funct.cxx613
-rw-r--r--autodoc/source/parser/cpp/pe_funct.hxx284
-rw-r--r--autodoc/source/parser/cpp/pe_ignor.cxx119
-rw-r--r--autodoc/source/parser/cpp/pe_ignor.hxx78
-rw-r--r--autodoc/source/parser/cpp/pe_namsp.cxx166
-rw-r--r--autodoc/source/parser/cpp/pe_namsp.hxx102
-rw-r--r--autodoc/source/parser/cpp/pe_param.cxx283
-rw-r--r--autodoc/source/parser/cpp/pe_param.hxx141
-rw-r--r--autodoc/source/parser/cpp/pe_tpltp.cxx178
-rw-r--r--autodoc/source/parser/cpp/pe_tpltp.hxx109
-rw-r--r--autodoc/source/parser/cpp/pe_tydef.cxx146
-rw-r--r--autodoc/source/parser/cpp/pe_tydef.hxx93
-rw-r--r--autodoc/source/parser/cpp/pe_type.cxx557
-rw-r--r--autodoc/source/parser/cpp/pe_type.hxx188
-rw-r--r--autodoc/source/parser/cpp/pe_vafu.cxx652
-rw-r--r--autodoc/source/parser/cpp/pe_vafu.hxx292
-rw-r--r--autodoc/source/parser/cpp/pe_vari.cxx190
-rw-r--r--autodoc/source/parser/cpp/pe_vari.hxx133
-rw-r--r--autodoc/source/parser/cpp/pev.hxx307
-rw-r--r--autodoc/source/parser/cpp/preproc.cxx234
-rw-r--r--autodoc/source/parser/cpp/preproc.hxx119
-rw-r--r--autodoc/source/parser/cpp/prs_cpp.cxx251
-rw-r--r--autodoc/source/parser/cpp/sdocdist.hxx161
-rw-r--r--autodoc/source/parser/cpp/sfscope.hxx72
-rw-r--r--autodoc/source/parser/cpp/sownstck.hxx328
-rw-r--r--autodoc/source/parser/cpp/srecover.hxx135
-rw-r--r--autodoc/source/parser/cpp/tkp_cpp.cxx95
-rw-r--r--autodoc/source/parser/cpp/tkp_cpp.hxx102
-rw-r--r--autodoc/source/parser/cpp/tokintpr.hxx120
-rw-r--r--autodoc/source/parser/inc/adoc/a_rdocu.hxx74
-rw-r--r--autodoc/source/parser/inc/adoc/adoc_tok.hxx65
-rw-r--r--autodoc/source/parser/inc/adoc/atokdeal.hxx63
-rw-r--r--autodoc/source/parser/inc/adoc/cx_a_std.hxx108
-rw-r--r--autodoc/source/parser/inc/adoc/cx_a_sub.hxx149
-rw-r--r--autodoc/source/parser/inc/adoc/docu_pe.hxx195
-rw-r--r--autodoc/source/parser/inc/adoc/prs_adoc.hxx58
-rw-r--r--autodoc/source/parser/inc/adoc/tk_attag.hxx101
-rw-r--r--autodoc/source/parser/inc/adoc/tk_docw.hxx120
-rw-r--r--autodoc/source/parser/inc/adoc/tokintpr.hxx120
-rw-r--r--autodoc/source/parser/inc/cpp/ctokdeal.hxx77
-rw-r--r--autodoc/source/parser/inc/cpp/prs_cpp.hxx70
-rw-r--r--autodoc/source/parser/inc/doc_deal.hxx92
-rw-r--r--autodoc/source/parser/inc/semantic/callf.hxx290
-rw-r--r--autodoc/source/parser/inc/semantic/parseenv.hxx113
-rw-r--r--autodoc/source/parser/inc/semantic/sub_pe.hxx115
-rw-r--r--autodoc/source/parser/inc/semantic/sub_peu.hxx134
-rw-r--r--autodoc/source/parser/inc/tokens/parseinc.hxx206
-rw-r--r--autodoc/source/parser/inc/tokens/stmstarr.hxx88
-rw-r--r--autodoc/source/parser/inc/tokens/stmstate.hxx71
-rw-r--r--autodoc/source/parser/inc/tokens/stmstfin.hxx83
-rw-r--r--autodoc/source/parser/inc/tokens/tkp.hxx102
-rw-r--r--autodoc/source/parser/inc/tokens/tkpcontx.hxx143
-rw-r--r--autodoc/source/parser/inc/tokens/tkpstama.hxx126
-rw-r--r--autodoc/source/parser/inc/tokens/tokdeal.hxx80
-rw-r--r--autodoc/source/parser/inc/tokens/token.hxx69
-rw-r--r--autodoc/source/parser/inc/tokens/tokproct.hxx86
-rw-r--r--autodoc/source/parser/inc/x_docu.hxx61
-rw-r--r--autodoc/source/parser/inc/x_parse.hxx66
-rw-r--r--autodoc/source/parser/kernel/makefile.mk62
-rw-r--r--autodoc/source/parser/kernel/parsefct.cxx84
-rw-r--r--autodoc/source/parser/kernel/parsefct.hxx63
-rw-r--r--autodoc/source/parser/kernel/x_docu.cxx64
-rw-r--r--autodoc/source/parser/kernel/x_parse.cxx101
-rw-r--r--autodoc/source/parser/semantic/makefile.mk62
-rw-r--r--autodoc/source/parser/semantic/parseenv.cxx89
-rw-r--r--autodoc/source/parser/tokens/makefile.mk66
-rw-r--r--autodoc/source/parser/tokens/stmstarr.cxx102
-rw-r--r--autodoc/source/parser/tokens/stmstate.cxx49
-rw-r--r--autodoc/source/parser/tokens/stmstfin.cxx64
-rw-r--r--autodoc/source/parser/tokens/tkp.cxx75
-rw-r--r--autodoc/source/parser/tokens/tkpcontx.cxx71
-rw-r--r--autodoc/source/parser/tokens/tkpstama.cxx180
-rw-r--r--autodoc/source/parser/tokens/tokdeal.cxx53
121 files changed, 18957 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..8ec5e73d9fef
--- /dev/null
+++ b/autodoc/source/parser/adoc/a_rdocu.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: a_rdocu.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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
+
diff --git a/autodoc/source/parser/adoc/adoc_tok.cxx b/autodoc/source/parser/adoc/adoc_tok.cxx
new file mode 100644
index 000000000000..353fec80ca0c
--- /dev/null
+++ b/autodoc/source/parser/adoc/adoc_tok.cxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: adoc_tok.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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
+
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..3066d0f85cd8
--- /dev/null
+++ b/autodoc/source/parser/adoc/cx_a_std.cxx
@@ -0,0 +1,519 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_a_std.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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>
+
+
+*/
+
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..448829901751
--- /dev/null
+++ b/autodoc/source/parser/adoc/cx_a_sub.cxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_a_sub.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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
+
diff --git a/autodoc/source/parser/adoc/docu_pe.cxx b/autodoc/source/parser/adoc/docu_pe.cxx
new file mode 100644
index 000000000000..97f36ac36476
--- /dev/null
+++ b/autodoc/source/parser/adoc/docu_pe.cxx
@@ -0,0 +1,406 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: docu_pe.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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
+
+
+
+
+
diff --git a/autodoc/source/parser/adoc/makefile.mk b/autodoc/source/parser/adoc/makefile.mk
new file mode 100644
index 000000000000..29087875491b
--- /dev/null
+++ b/autodoc/source/parser/adoc/makefile.mk
@@ -0,0 +1,66 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# 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..531fc794c677
--- /dev/null
+++ b/autodoc/source/parser/adoc/prs_adoc.cxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: prs_adoc.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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
+
+
+
diff --git a/autodoc/source/parser/adoc/tk_attag.cxx b/autodoc/source/parser/adoc/tk_attag.cxx
new file mode 100644
index 000000000000..2a1e5bb9e81e
--- /dev/null
+++ b/autodoc/source/parser/adoc/tk_attag.cxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tk_attag.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 {
+
+#if 0
+#define EV_AtTagId( val, tex ) ENUM_VALUE(E_AtTagId, eATTAGID_##val, val, tex )
+
+EV_AtTagId(atid_ATT, "ATTENTION" );
+EV_AtTagId(atid_author, "Author" );
+EV_AtTagId(atid_change, "Change" );
+EV_AtTagId(atid_collab, "Collaborators" );
+EV_AtTagId(atid_contact, "Contact" );
+EV_AtTagId(atid_copyright, "Copyright (c)" );
+EV_AtTagId(atid_descr, "Description" );
+EV_AtTagId(atid_devstat, "Development State" );
+EV_AtTagId(atid_docdate, "Date of Documentation" );
+EV_AtTagId(atid_derive, "How to Derive from this class" );
+EV_AtTagId(atid_instance, "Instances" );
+EV_AtTagId(atid_life, "Lifecycle" );
+EV_AtTagId(atid_multi, "Multiplicity" );
+EV_AtTagId(atid_onerror, "On Error" );
+EV_AtTagId(atid_persist, "Persistence" );
+EV_AtTagId(atid_postcond, "Postcondition" );
+EV_AtTagId(atid_precond, "Precondition" );
+EV_AtTagId(atid_return, "Return" );
+EV_AtTagId(atid_short, "Summary" );
+EV_AtTagId(atid_since, "Valid Since" );
+EV_AtTagId(atid_todo, "Todo" );
+EV_AtTagId(atid_version, "Version" );
+#endif // 0
+
+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
+
diff --git a/autodoc/source/parser/adoc/tk_docw.cxx b/autodoc/source/parser/adoc/tk_docw.cxx
new file mode 100644
index 000000000000..1e05d6e6e3d2
--- /dev/null
+++ b/autodoc/source/parser/adoc/tk_docw.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tk_docw.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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
+
+
diff --git a/autodoc/source/parser/cpp/all_toks.cxx b/autodoc/source/parser/cpp/all_toks.cxx
new file mode 100644
index 000000000000..78531222d76b
--- /dev/null
+++ b/autodoc/source/parser/cpp/all_toks.cxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: all_toks.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 <all_toks.hxx>
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cpp/ctokdeal.hxx>
+#include "c_dealer.hxx"
+#include "tokintpr.hxx"
+
+
+
+namespace cpp {
+
+
+void
+Token::DealOut( ::TokenDealer & o_rDealer )
+{
+ // KORR_FUTURE HACK (casting to derivation cpp::TokenDealer)
+ o_rDealer.AsDistributor()->Deal_CppCode(*this);
+}
+
+
+#define DEF_TOKEN_CLASS(name) \
+void \
+Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \
+{ io_rInterpreter.Hdl_##name(*this); } \
+INT16 \
+Tok_##name::TypeId() const { return Tid_##name; } \
+const char * \
+Tok_##name::Text() const { return #name; }
+
+#define DEF_TOKEN_CLASS_WITHTEXT(name, text ) \
+void \
+Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \
+{ io_rInterpreter.Hdl_##name(*this); } \
+INT16 \
+Tok_##name::TypeId() const { return Tid_##name; } \
+const char * \
+Tok_##name::Text() const { return text; }
+
+
+DEF_TOKEN_CLASS_WITHTEXT(Identifier,sText)
+DEF_TOKEN_CLASS_WITHTEXT(Operator,sText)
+
+DEF_TOKEN_CLASS(operator)
+DEF_TOKEN_CLASS(class)
+DEF_TOKEN_CLASS(struct)
+DEF_TOKEN_CLASS(union)
+DEF_TOKEN_CLASS(enum)
+DEF_TOKEN_CLASS(typedef)
+DEF_TOKEN_CLASS(public)
+DEF_TOKEN_CLASS(protected)
+DEF_TOKEN_CLASS(private)
+DEF_TOKEN_CLASS(template)
+DEF_TOKEN_CLASS(virtual)
+DEF_TOKEN_CLASS(friend)
+DEF_TOKEN_CLASS_WITHTEXT(Tilde,"~")
+DEF_TOKEN_CLASS(const)
+DEF_TOKEN_CLASS(volatile)
+DEF_TOKEN_CLASS(extern)
+DEF_TOKEN_CLASS(static)
+DEF_TOKEN_CLASS(mutable)
+DEF_TOKEN_CLASS(register)
+DEF_TOKEN_CLASS(inline)
+DEF_TOKEN_CLASS(explicit)
+DEF_TOKEN_CLASS(namespace)
+DEF_TOKEN_CLASS(using)
+DEF_TOKEN_CLASS(throw)
+DEF_TOKEN_CLASS_WITHTEXT(SwBracket_Left,"{")
+DEF_TOKEN_CLASS_WITHTEXT(SwBracket_Right,"}")
+DEF_TOKEN_CLASS_WITHTEXT(ArrayBracket_Left,"[")
+DEF_TOKEN_CLASS_WITHTEXT(ArrayBracket_Right,"]")
+DEF_TOKEN_CLASS_WITHTEXT(Bracket_Left,"(")
+DEF_TOKEN_CLASS_WITHTEXT(Bracket_Right,")")
+DEF_TOKEN_CLASS_WITHTEXT(DoubleColon,"::")
+DEF_TOKEN_CLASS_WITHTEXT(Semicolon,";")
+DEF_TOKEN_CLASS_WITHTEXT(Comma,",")
+DEF_TOKEN_CLASS_WITHTEXT(Colon,":")
+DEF_TOKEN_CLASS_WITHTEXT(Assign,"=")
+DEF_TOKEN_CLASS_WITHTEXT(Less,"<")
+DEF_TOKEN_CLASS_WITHTEXT(Greater,">")
+DEF_TOKEN_CLASS_WITHTEXT(Asterix,"*")
+DEF_TOKEN_CLASS_WITHTEXT(AmpersAnd,"&")
+DEF_TOKEN_CLASS_WITHTEXT(Ellipse,"...")
+DEF_TOKEN_CLASS(typename)
+
+DEF_TOKEN_CLASS_WITHTEXT(DefineName,sText)
+DEF_TOKEN_CLASS_WITHTEXT(MacroName,sText)
+DEF_TOKEN_CLASS_WITHTEXT(MacroParameter,sText)
+// DEF_TOKEN_CLASS_WITHTEXT(PreProDefinition,sText)
+
+void
+Tok_PreProDefinition::Trigger( TokenInterpreter & io_rInterpreter ) const
+{ io_rInterpreter.Hdl_PreProDefinition(*this); }
+
+INT16
+Tok_PreProDefinition::TypeId() const { return Tid_PreProDefinition; }
+
+const char *
+Tok_PreProDefinition::Text() const
+{
+ return sText;
+}
+
+
+
+DEF_TOKEN_CLASS_WITHTEXT(BuiltInType,sText)
+DEF_TOKEN_CLASS_WITHTEXT(TypeSpecializer,sText)
+DEF_TOKEN_CLASS_WITHTEXT(Constant,sText)
+
+const char *
+Tok_UnblockMacro::Text() const
+{
+ return sMacroName;
+}
+
+void
+Tok_UnblockMacro::DealOut( ::TokenDealer & o_rDealer )
+{
+ // KORR_FUTURE HACK (casting to derivation cpp::TokenDealer)
+ o_rDealer.AsDistributor()->Deal_Cpp_UnblockMacro(*this);
+}
+
+} // namespace cpp
diff --git a/autodoc/source/parser/cpp/all_toks.hxx b/autodoc/source/parser/cpp/all_toks.hxx
new file mode 100644
index 000000000000..fa3943250a99
--- /dev/null
+++ b/autodoc/source/parser/cpp/all_toks.hxx
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: all_toks.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_ALL_TOKS_HXX
+#define ADC_CPP_ALL_TOKS_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_tok.hxx"
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp {
+
+class Tok_Identifier : public cpp::Token
+{
+ public:
+ Tok_Identifier(
+ const char * i_sText ) : sText(i_sText) {}
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ virtual INT16 TypeId() const;
+ virtual const char *
+ Text() const;
+ private:
+ String sText;
+};
+const INT16 Tid_Identifier = 1;
+
+/** == != <= >= && || !
+
+ new delete sizeof typeid
+ + - / % ^ | << >>
+ . -> ?
+ += -= *= /= %= &= |= ^= <<= >>=
+*/
+class Tok_Operator : public cpp::Token
+{
+ public:
+ Tok_Operator(
+ const char * i_sText ) : sText(i_sText) {}
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ virtual INT16 TypeId() const;
+ virtual const char *
+ Text() const;
+ private:
+ String sText;
+};
+const INT16 Tid_Operator = 2;
+
+
+
+#define DECL_TOKEN_CLASS(name,tid) \
+class Tok_##name : public cpp::Token \
+{ public: \
+ virtual void Trigger( \
+ TokenInterpreter & io_rInterpreter ) const; \
+ virtual INT16 TypeId() const; \
+ virtual const char * \
+ Text() const; \
+}; \
+const INT16 Tid_##name = tid
+
+DECL_TOKEN_CLASS(operator,3);
+DECL_TOKEN_CLASS(class,4);
+DECL_TOKEN_CLASS(struct,5);
+DECL_TOKEN_CLASS(union,6);
+DECL_TOKEN_CLASS(enum,7);
+DECL_TOKEN_CLASS(typedef,8);
+DECL_TOKEN_CLASS(public,9);
+DECL_TOKEN_CLASS(protected,10);
+DECL_TOKEN_CLASS(private,11);
+DECL_TOKEN_CLASS(template,12);
+DECL_TOKEN_CLASS(virtual,13);
+DECL_TOKEN_CLASS(friend,14);
+DECL_TOKEN_CLASS(Tilde,15);
+DECL_TOKEN_CLASS(const,16);
+DECL_TOKEN_CLASS(volatile,17);
+DECL_TOKEN_CLASS(extern,18);
+DECL_TOKEN_CLASS(static,19);
+DECL_TOKEN_CLASS(mutable,20);
+DECL_TOKEN_CLASS(register,21);
+DECL_TOKEN_CLASS(inline,22);
+DECL_TOKEN_CLASS(explicit,23);
+DECL_TOKEN_CLASS(namespace,24);
+DECL_TOKEN_CLASS(using,25);
+DECL_TOKEN_CLASS(throw,26);
+DECL_TOKEN_CLASS(SwBracket_Left,27);
+DECL_TOKEN_CLASS(SwBracket_Right,28);
+DECL_TOKEN_CLASS(ArrayBracket_Left,29);
+DECL_TOKEN_CLASS(ArrayBracket_Right,30);
+DECL_TOKEN_CLASS(Bracket_Left,31);
+DECL_TOKEN_CLASS(Bracket_Right,32);
+DECL_TOKEN_CLASS(DoubleColon,33);
+DECL_TOKEN_CLASS(Semicolon,34);
+DECL_TOKEN_CLASS(Comma,35);
+DECL_TOKEN_CLASS(Colon,36);
+DECL_TOKEN_CLASS(Assign,37);
+DECL_TOKEN_CLASS(Less,38);
+DECL_TOKEN_CLASS(Greater,39);
+DECL_TOKEN_CLASS(Asterix,40);
+DECL_TOKEN_CLASS(AmpersAnd,41);
+DECL_TOKEN_CLASS(Ellipse,42);
+DECL_TOKEN_CLASS(typename,43);
+
+#undef DECL_TOKEN_CLASS
+
+#define DECL_TOKEN_CLASS_WITHTEXT(name,tid) \
+class Tok_##name : public cpp::Token \
+{ public: \
+ Tok_##name( \
+ const char * i_sText ) : sText(i_sText) {} \
+ virtual void Trigger( \
+ TokenInterpreter & io_rInterpreter ) const; \
+ virtual INT16 TypeId() const; \
+ virtual const char * \
+ Text() const; \
+ private: \
+ String sText; \
+}; \
+const INT16 Tid_##name = tid
+
+
+
+DECL_TOKEN_CLASS_WITHTEXT(DefineName,44);
+DECL_TOKEN_CLASS_WITHTEXT(MacroName,45);
+DECL_TOKEN_CLASS_WITHTEXT(MacroParameter,46);
+DECL_TOKEN_CLASS_WITHTEXT(PreProDefinition,47);
+
+/** char short int long float double wchar_t size_t
+*/
+DECL_TOKEN_CLASS_WITHTEXT(BuiltInType, 48);
+
+/** signed unsigned
+*/
+DECL_TOKEN_CLASS_WITHTEXT(TypeSpecializer, 49);
+DECL_TOKEN_CLASS_WITHTEXT(Constant, 50);
+
+
+
+/** This token does nothing in C++ code. It is added by the
+ internal macro-replacer to mark the position, where a
+ define or macro becomes valid again, which was until then
+ invalid, because the text was a replacement of this macro.
+ ( Avoiding endless recursive macro replacement. )
+*/
+class Tok_UnblockMacro : public ::TextToken
+{
+ public:
+ Tok_UnblockMacro(
+ const char * i_sMacroName ) : sMacroName(i_sMacroName) {}
+ virtual const char* Text() const;
+
+ virtual void DealOut(
+ ::TokenDealer & o_rDealer );
+ private:
+ String sMacroName;
+};
+
+
+
+#if 0 // just for viewing:
+class Tok_TypeKey : public cpp::Token // file-><type-PE>
+class Tok_Template : public cpp::Token // file
+class Tok_Namespace : public cpp::Token // file
+class Tok_Bracket : public cpp::Token // ueberall
+class Tok_Separator : public cpp::Token // ueberall
+
+class Tok_Identifier : public cpp::Token // ueberall
+class Tok_NameSeparator : public cpp::Token // Type, Name
+class Tok_BuiltInType : public cpp::Token // ueberall
+class Tok_ConVol : public cpp::Token // class-><FuVa>
+class Tok_StorageClass : public cpp::Token // file-><type>,<FuVa>
+class Tok_OperatorFunctionName : public cpp::Token // class
+
+class Tok_Protection : public cpp::Token // class
+class Tok_Virtual : public cpp::Token // class
+class Tok_Friend : public cpp::Token // class
+class Tok_Tilde : public cpp::Token // class, expression
+
+class Tok_Ellipse : public cpp::Token // function-ParaList
+class Tok_Assignment : public cpp::Token // VariableDeclaraton, Function, Parameter
+class Tok_Throw : public cpp::Token // function
+class Tok_LessMore : public cpp::Token
+class Tok_Operator : public cpp::Token // expression
+
+class Tok_Ignore : public cpp::Token
+class Tok_ContextChanger : public cpp::Token
+#endif // 0
+
+
+} // namespace cpp
+
+#endif
diff --git a/autodoc/source/parser/cpp/c_dealer.cxx b/autodoc/source/parser/cpp/c_dealer.cxx
new file mode 100644
index 000000000000..ba8e44321e49
--- /dev/null
+++ b/autodoc/source/parser/cpp/c_dealer.cxx
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: c_dealer.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 "c_dealer.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <ary/cpp/c_gate.hxx>
+#include <ary/loc/locp_le.hxx>
+#include <ary/loc/loc_root.hxx>
+#include <ary/loc/loc_file.hxx>
+//#include <ary/docu.hxx>
+#include <adoc/a_rdocu.hxx>
+#include "all_toks.hxx"
+#include "c_rcode.hxx"
+
+
+namespace ary
+{
+namespace loc
+{
+ class Root;
+}
+}
+
+
+
+
+namespace cpp
+{
+
+Distributor::Distributor( ary::cpp::Gate & io_rAryGate )
+ : aCppPreProcessor(),
+ aCodeExplorer(io_rAryGate),
+ aDocuExplorer(),
+ pGate(&io_rAryGate),
+ pFileEventHandler(0),
+ pDocuDistributor(0)
+{
+ pFileEventHandler = & aCodeExplorer.FileEventHandler();
+ pDocuDistributor = & aCodeExplorer.DocuDistributor();
+}
+
+void
+Distributor::AssignPartners( CharacterSource & io_rSourceText,
+ const MacroMap & i_rValidMacros )
+{
+ aCppPreProcessor.AssignPartners(aCodeExplorer, io_rSourceText, i_rValidMacros);
+}
+
+Distributor::~Distributor()
+{
+}
+
+void
+Distributor::StartNewFile( const csv::ploc::Path & i_file )
+{
+ const csv::ploc::Root &
+ root_dir = i_file.RootDir();
+ StreamLock
+ sl(700);
+ root_dir.Get(sl());
+ csv::ploc::Path
+ root_path( sl().c_str(), true );
+ ary::loc::Le_id
+ root_id = pGate->Locations().CheckIn_Root(root_path).LeId();
+ ary::loc::File &
+ rFile = pGate->Locations().CheckIn_File(
+ i_file.File(),
+ i_file.DirChain(),
+ root_id );
+ pFileEventHandler->SetCurFile(rFile);
+
+ aCodeExplorer.StartNewFile();
+
+ csv_assert( pDocuDistributor != 0 );
+ aDocuExplorer.StartNewFile(*pDocuDistributor);
+}
+
+
+void
+Distributor::Deal_Eol()
+{
+ pFileEventHandler->Event_IncrLineCount();
+}
+
+void
+Distributor::Deal_Eof()
+{
+ // Do nothing yet.
+}
+
+void
+Distributor::Deal_Cpp_UnblockMacro( Tok_UnblockMacro & let_drToken )
+{
+ aCppPreProcessor.UnblockMacro(let_drToken.Text());
+ delete &let_drToken;
+}
+
+void
+Distributor::Deal_CppCode( cpp::Token & let_drToken )
+{
+ aCppPreProcessor.Process_Token(let_drToken);
+}
+
+void
+Distributor::Deal_AdcDocu( adoc::Token & let_drToken )
+{
+ aDocuExplorer.Process_Token(let_drToken);
+}
+
+Distributor *
+Distributor::AsDistributor()
+{
+ return this;
+}
+
+
+
+
+
+} // namespace cpp
+
+
diff --git a/autodoc/source/parser/cpp/c_dealer.hxx b/autodoc/source/parser/cpp/c_dealer.hxx
new file mode 100644
index 000000000000..b891cf9e5a5f
--- /dev/null
+++ b/autodoc/source/parser/cpp/c_dealer.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: c_dealer.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_C_DEALER_HXX
+#define ADC_CPP_C_DEALER_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <cpp/ctokdeal.hxx>
+#include <adoc/atokdeal.hxx>
+#include <ary/info/docstore.hxx>
+ // COMPONENTS
+#include "preproc.hxx"
+#include "c_rcode.hxx"
+#include <adoc/a_rdocu.hxx>
+ // PARAMETERS
+
+namespace csv
+{
+ namespace ploc
+ {
+ class Path;
+ class DirectoryChain;
+ }
+}
+
+
+class TokenParser;
+
+
+namespace cpp
+{
+
+class PE_File;
+class DefineDescription;
+
+
+class Distributor : public cpp::TokenDealer, /// Handle C++ code tokens.
+ public adoc::TokenDealer /// Handle Autodoc documentation tokens.
+{
+ public:
+ typedef std::map< String, DefineDescription* > MacroMap;
+
+ // LIFECYCLE
+ Distributor(
+ ary::cpp::Gate & io_rGate );
+ ~Distributor();
+ // OPERATIONS
+ void AssignPartners(
+ CharacterSource & io_rSourceText,
+ const MacroMap & i_rValidMacros );
+ void StartNewFile(
+ const csv::ploc::Path &
+ i_file );
+ virtual void Deal_Eol();
+ virtual void Deal_Eof();
+
+ virtual void Deal_CppCode(
+ cpp::Token & let_drToken );
+ virtual void Deal_Cpp_UnblockMacro(
+ Tok_UnblockMacro & let_drToken );
+
+ virtual void Deal_AdcDocu(
+ adoc::Token & let_drToken );
+ virtual Distributor *
+ AsDistributor();
+ private:
+ // DATA
+ PreProcessor aCppPreProcessor;
+ CodeExplorer aCodeExplorer;
+ adoc::DocuExplorer aDocuExplorer;
+ ary::cpp::Gate * pGate;
+ FileScope_EventHandler *
+ pFileEventHandler;
+ DocuDealer * pDocuDistributor;
+};
+
+
+
+} // namespace cpp
+#endif
+
diff --git a/autodoc/source/parser/cpp/c_rcode.cxx b/autodoc/source/parser/cpp/c_rcode.cxx
new file mode 100644
index 000000000000..e8f688168d3f
--- /dev/null
+++ b/autodoc/source/parser/cpp/c_rcode.cxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: c_rcode.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 "c_rcode.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_namesp.hxx>
+// #include <ary/cpp/c_groups.hxx>
+#include <ary/loc/locp_le.hxx>
+#include "cpp_pe.hxx"
+#include <adc_cl.hxx>
+#include <x_parse.hxx>
+#include "pe_file.hxx"
+
+#ifdef IRIX
+// see i19418 incomplete type for cpp::PE_Namespace
+#include "pe_namsp.hxx"
+#include "pe_ignor.hxx"
+#include "pe_defs.hxx"
+#include "pe_vafu.hxx"
+#include "pe_tydef.hxx"
+#include "pe_tpltp.hxx"
+#include "pe_type.hxx"
+#include "pe_vari.hxx"
+#include "pe_funct.hxx"
+#include "pe_enum.hxx"
+#include "pe_param.hxx"
+#include "pe_class.hxx"
+#include "pe_expression.hxx"
+#include "pe_base.hxx"
+#include "pe_enum.hxx"
+#include "pe_enval.hxx"
+#endif
+
+
+const uintt C_nNO_TRY = uintt(-1);
+
+
+namespace cpp {
+
+
+CodeExplorer::CodeExplorer( ary::cpp::Gate & io_rAryGate )
+ : aGlobalParseContext(io_rAryGate),
+ // aEnvironments,
+ pPE_File(0),
+ pGate(&io_rAryGate),
+ dpCurToken(0)
+{
+ pPE_File = new PE_File( aGlobalParseContext );
+}
+
+CodeExplorer::~CodeExplorer()
+{
+}
+
+void
+CodeExplorer::StartNewFile()
+{
+ csv::erase_container(aEnvironments);
+
+ aEnvironments.push_back( pPE_File.MutablePtr() );
+ pPE_File->Enter(push);
+}
+
+void
+CodeExplorer::Process_Token( DYN cpp::Token & let_drToken )
+{
+if (DEBUG_ShowTokens())
+{
+ Cout() << let_drToken.Text() << Endl();
+}
+ dpCurToken = &let_drToken;
+ aGlobalParseContext.ResetResult();
+
+ do {
+ CurToken().Trigger( CurEnv() );
+ AcknowledgeResult();
+ } while ( dpCurToken );
+}
+
+void
+CodeExplorer::AcknowledgeResult()
+{
+ if (CurResult().eDone == done)
+ dpCurToken = 0;
+
+ switch ( CurResult().eStackAction )
+ {
+ case stay:
+ break;
+ case push:
+ CurEnv().Leave(push);
+ aEnvironments.push_back( &PushEnv() );
+ PushEnv().Enter(push);
+ break;
+ case pop_success:
+ CurEnv().Leave(pop_success);
+ aEnvironments.pop_back();
+ CurEnv().Enter(pop_success);
+ break;
+ case pop_failure:
+ {
+ Cpp_PE * pRecover = 0;
+ do {
+ CurEnv().Leave(pop_failure);
+ aEnvironments.pop_back();
+ if ( aEnvironments.empty() )
+ break;
+ pRecover = CurEnv().Handle_ChildFailure();
+ } while ( pRecover == 0 );
+ if ( pRecover != 0 )
+ {
+ aEnvironments.push_back(pRecover);
+ pRecover->Enter(push);
+ }
+ else
+ {
+ throw X_Parser( X_Parser::x_UnexpectedToken, CurToken().Text(), aGlobalParseContext.CurFileName(), aGlobalParseContext.LineCount() );
+ }
+ } break;
+ default:
+ csv_assert(false);
+ } // end switch(CurResult().eStackAction)
+}
+
+const Token &
+CodeExplorer::CurToken() const
+{
+ csv_assert(dpCurToken);
+
+ return *dpCurToken;
+}
+
+Cpp_PE &
+CodeExplorer::CurEnv() const
+{
+ csv_assert(aEnvironments.size() > 0);
+ csv_assert(aEnvironments.back() != 0);
+
+ return *aEnvironments.back();
+}
+
+Cpp_PE &
+CodeExplorer::PushEnv() const
+{
+ TokenProcessing_Result & rCurResult = const_cast< TokenProcessing_Result& >(aGlobalParseContext.CurResult());
+ Cpp_PE * ret = dynamic_cast< Cpp_PE* >(rCurResult.pEnv2Push);
+ csv_assert( ret != 0 );
+ return *ret;
+}
+
+
+
+} // namespace cpp
+
diff --git a/autodoc/source/parser/cpp/c_rcode.hxx b/autodoc/source/parser/cpp/c_rcode.hxx
new file mode 100644
index 000000000000..28a2785de917
--- /dev/null
+++ b/autodoc/source/parser/cpp/c_rcode.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: c_rcode.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_C_RCODE_HXX
+#define ADC_CPP_C_RCODE_HXX
+
+// BASE CLASSES
+#include <tokens/tokproct.hxx>
+// USED SERVICES
+#include <cosv/ploc.hxx>
+#include "cxt2ary.hxx"
+#include <ary/cpp/c_types4cpp.hxx>
+#include <ary/loc/loc_types4loc.hxx>
+
+
+
+namespace ary
+{
+namespace cpp
+{
+ class Gate;
+}
+namespace doc
+{
+ class OldCppDocu;
+}
+}
+
+namespace cpp
+{
+ class PE_File;
+ class Token;
+ class Cpp_PE;
+
+
+
+
+class CodeExplorer : private TokenProcessing_Types
+
+{
+ public:
+ CodeExplorer(
+ ary::cpp::Gate & io_rAryGate );
+ ~CodeExplorer();
+
+ void StartNewFile();
+ void Process_Token(
+ DYN cpp::Token & let_drToken );
+ // ACCESS
+ FileScope_EventHandler &
+ FileEventHandler() { return aGlobalParseContext; }
+ DocuDealer & DocuDistributor() { return aGlobalParseContext; }
+
+ private:
+ typedef std::vector< cpp::Cpp_PE* > EnvironmentStack;
+
+ void AcknowledgeResult();
+ const Token & CurToken() const;
+ Cpp_PE & CurEnv() const;
+ Cpp_PE & PushEnv() const;
+ TokenProcessing_Result &
+ CurResult() { return aGlobalParseContext.CurResult(); }
+
+ // DATA
+ ContextForAry aGlobalParseContext;
+
+ EnvironmentStack aEnvironments;
+ Dyn<PE_File> pPE_File;
+
+ ary::cpp::Gate * pGate;
+ cpp::Token * dpCurToken;
+};
+
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/cpp_pe.cxx b/autodoc/source/parser/cpp/cpp_pe.cxx
new file mode 100644
index 000000000000..858bea64612e
--- /dev/null
+++ b/autodoc/source/parser/cpp/cpp_pe.cxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cpp_pe.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 "cpp_pe.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <ary/doc/d_oldcppdocu.hxx>
+#include "cpp_tok.hxx"
+
+
+
+
+namespace cpp {
+
+void
+Cpp_PE::SetTokenResult( E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push )
+{
+ rMyEnv.SetTokenResult( i_eDone,
+ i_eWhat2DoWithEnvStack,
+ i_pParseEnv2Push );
+}
+
+Cpp_PE::Cpp_PE( Cpp_PE * io_pParent )
+ : ParseEnvironment( io_pParent ),
+ rMyEnv( io_pParent->Env() )
+{
+ csv_assert(io_pParent != 0);
+}
+
+Cpp_PE::Cpp_PE( EnvData & i_rEnv )
+ : ParseEnvironment(0),
+ rMyEnv(i_rEnv)
+{
+}
+
+void
+Cpp_PE::StdHandlingOfSyntaxError( const char * )
+{
+ SetTokenResult(not_done, pop_failure);
+}
+
+
+Cpp_PE *
+Cpp_PE::Handle_ChildFailure()
+{
+ return 0;
+}
+
+} // namespace cpp
+
diff --git a/autodoc/source/parser/cpp/cpp_pe.hxx b/autodoc/source/parser/cpp/cpp_pe.hxx
new file mode 100644
index 000000000000..af46c1312884
--- /dev/null
+++ b/autodoc/source/parser/cpp/cpp_pe.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cpp_pe.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CPP_PE_HXX
+#define ADC_CPP_CPP_PE_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <semantic/parseenv.hxx>
+#include "tokintpr.hxx"
+ // COMPONENTS
+#include "pev.hxx"
+ // PARAMETERS
+#include <ary/cpp/c_types4cpp.hxx>
+
+
+namespace cpp {
+
+class Cpp_PE : public ::ParseEnvironment,
+ public TokenInterpreter
+{
+ public:
+ typedef cpp::PeEnvironment EnvData;
+
+ void SetTokenResult(
+ E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push = 0 );
+
+ virtual Cpp_PE * Handle_ChildFailure(); // Defaulted to 0.
+
+ protected:
+ Cpp_PE(
+ Cpp_PE * io_pParent );
+ Cpp_PE(
+ EnvData & i_rEnv );
+
+ EnvData & Env() const;
+
+ void StdHandlingOfSyntaxError(
+ const char * i_sText );
+
+ private:
+ // DATA
+ EnvData & rMyEnv;
+};
+
+inline Cpp_PE::EnvData &
+Cpp_PE::Env() const
+ { return rMyEnv; }
+
+} // namespace cpp
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/cpp_tok.hxx b/autodoc/source/parser/cpp/cpp_tok.hxx
new file mode 100644
index 000000000000..413fc9136c90
--- /dev/null
+++ b/autodoc/source/parser/cpp/cpp_tok.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cpp_tok.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_TOK_HXX
+#define ADC_CPP_TOK_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/token.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace cpp {
+
+
+class TokenInterpreter;
+
+
+class Token : public TextToken
+{
+ public:
+ // LIFECYCLE
+ virtual ~Token() {}
+
+ // OPERATIONS
+ virtual INT16 TypeId() const = 0;
+ virtual void DealOut(
+ ::TokenDealer & o_rDealer );
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const = 0;
+};
+
+
+} // namespace cpp
+
+#endif
+
+
diff --git a/autodoc/source/parser/cpp/cx_base.cxx b/autodoc/source/parser/cpp/cx_base.cxx
new file mode 100644
index 000000000000..38a4c14b6be4
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_base.cxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_base.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 "cx_base.hxx"
+
+// NOT FULLY DECLARED SERVICES
+#include <tokens/token.hxx>
+#include "c_dealer.hxx"
+
+
+
+namespace cpp {
+
+
+
+Cx_Base::Cx_Base( TkpContext * io_pFollowUpContext )
+ : pDealer(0),
+ pFollowUpContext(io_pFollowUpContext)
+ // pNewToken
+{
+}
+
+bool
+Cx_Base::PassNewToken()
+{
+ if (pNewToken)
+ {
+ pNewToken.Release()->DealOut(Dealer());
+ return true;
+ }
+ return false;
+}
+
+TkpContext &
+Cx_Base::FollowUpContext()
+{
+ csv_assert(pFollowUpContext != 0);
+ return *pFollowUpContext;
+}
+
+void
+Cx_Base::AssignDealer( Distributor & o_rDealer )
+{
+ pDealer = &o_rDealer;
+}
+
+
+} // namespace cpp
+
+
+
+
diff --git a/autodoc/source/parser/cpp/cx_base.hxx b/autodoc/source/parser/cpp/cx_base.hxx
new file mode 100644
index 000000000000..88102ca9ea90
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_base.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_base.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CX_BASE_HXX
+#define ADC_CPP_CX_BASE_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+class TextToken;
+
+
+namespace cpp
+{
+
+class Distributor;
+
+
+class Cx_Base : public ::TkpContext
+{
+ public:
+ virtual bool PassNewToken();
+ virtual TkpContext &
+ FollowUpContext();
+
+ virtual void AssignDealer(
+ Distributor & o_rDealer );
+ protected:
+ // LIFECYCLE
+ Cx_Base(
+ TkpContext * io_pFollowUpContext );
+
+ void SetNewToken(
+ DYN ::TextToken * let_dpToken );
+ void SetFollowUpContext(
+ TkpContext * io_pContext );
+
+ Distributor & Dealer() const;
+
+ private:
+ // DATA
+ Distributor * pDealer;
+ TkpContext * pFollowUpContext;
+ Dyn< ::TextToken > pNewToken;
+};
+
+
+
+
+inline void
+Cx_Base::SetNewToken( DYN ::TextToken * let_dpToken )
+ { pNewToken = let_dpToken; }
+inline void
+Cx_Base::SetFollowUpContext( TkpContext * io_pContext )
+ { pFollowUpContext = io_pContext; }
+inline Distributor &
+Cx_Base::Dealer() const
+ { csv_assert(pDealer != 0);
+ return *pDealer; }
+
+
+
+
+
+} // namespace cpp
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/cx_c_pp.cxx b/autodoc/source/parser/cpp/cx_c_pp.cxx
new file mode 100644
index 000000000000..8121d34c318f
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_c_pp.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_c_pp.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "cx_c_pp.hxx"
+
+
+
+// NOT FULLY DECLARED SERVICES
+#include "c_dealer.hxx"
+#include <tokens/parseinc.hxx>
+#include <x_parse.hxx>
+#include "all_toks.hxx"
+
+
+namespace cpp
+{
+
+Context_Preprocessor::Context_Preprocessor( TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext),
+ pContext_Parent(&i_rFollowUpContext),
+ pContext_PP_MacroParams( 0 ),
+ pContext_PP_Definition( new Context_PP_Definition(i_rFollowUpContext) )
+{
+ pContext_PP_MacroParams = new Context_PP_MacroParams(*pContext_PP_Definition);
+}
+
+void
+Context_Preprocessor::ReadCharChain( CharacterSource & io_rText )
+{
+ jumpOverWhite( io_rText );
+ jumpToWhite( io_rText );
+ const char * sPP_Keyword = io_rText.CutToken();
+ if ( strcmp(sPP_Keyword, "define") == 0 )
+ ReadDefine(io_rText);
+ else
+ ReadDefault(io_rText);
+}
+
+void
+Context_Preprocessor::AssignDealer( Distributor & o_rDealer )
+{
+ Cx_Base::AssignDealer(o_rDealer);
+ pContext_PP_MacroParams->AssignDealer(o_rDealer);
+ pContext_PP_Definition->AssignDealer(o_rDealer);
+}
+
+void
+Context_Preprocessor::ReadDefault( CharacterSource & io_rText )
+{
+ int o_rCount_BackslashedLineBreaks = 0;
+ jumpToEol(io_rText,o_rCount_BackslashedLineBreaks);
+ for ( ; o_rCount_BackslashedLineBreaks > 0; --o_rCount_BackslashedLineBreaks )
+ Dealer().Deal_Eol();
+
+ if (io_rText.CurChar() != NULCH)
+ jumpOverEol(io_rText);
+ io_rText.CutToken();
+ Dealer().Deal_Eol();
+ SetNewToken(0);
+ SetFollowUpContext( pContext_Parent );
+}
+
+void
+Context_Preprocessor::ReadDefine( CharacterSource & io_rText )
+{
+ jumpOverWhite( io_rText );
+ io_rText.CutToken();
+
+ char cNext = '\0';
+ for ( cNext = io_rText.CurChar();
+ static_cast<UINT8>(cNext) > 32 AND cNext != '(';
+ cNext = io_rText.MoveOn() )
+ { }
+
+ bool bMacro = cNext == '(';
+
+ if ( NOT bMacro )
+ {
+ SetNewToken( new Tok_DefineName(io_rText.CutToken()) );
+ SetFollowUpContext( pContext_PP_Definition.Ptr() );
+ }
+ else
+ {
+ SetNewToken( new Tok_MacroName(io_rText.CutToken()) );
+ io_rText.MoveOn();
+ io_rText.CutToken();
+ SetFollowUpContext( pContext_PP_MacroParams.Ptr() );
+ }
+}
+
+
+Context_PP_MacroParams::Context_PP_MacroParams( Cx_Base & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext),
+ pContext_PP_Definition(&i_rFollowUpContext)
+{
+}
+
+void
+Context_PP_MacroParams::ReadCharChain( CharacterSource & io_rText )
+{
+ uintt nLen;
+
+ jumpOverWhite( io_rText );
+ // KORR_FUTURE Handling line breaks within macro parameters:
+ char cSeparator = jumpTo( io_rText, ',', ')' );
+ csv_assert( cSeparator != 0 );
+
+ static char cBuf[500];
+ // KORR_FUTURE, make it still safer, here:
+ strcpy( cBuf, io_rText.CutToken() ); // SAFE STRCPY (#100211# - checked)
+ for ( nLen = strlen(cBuf);
+ nLen > 0 AND cBuf[nLen-1] < 33;
+ --nLen )
+ { }
+ cBuf[nLen] = '\0';
+ SetNewToken( new Tok_MacroParameter(cBuf) );
+
+ io_rText.MoveOn();
+ io_rText.CutToken();
+ if ( cSeparator == ',')
+ SetFollowUpContext( this );
+ else // Must be ')'
+ SetFollowUpContext( pContext_PP_Definition );
+}
+
+Context_PP_Definition::Context_PP_Definition( TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext),
+ pContext_Parent(&i_rFollowUpContext)
+{
+}
+
+void
+Context_PP_Definition::ReadCharChain( CharacterSource & io_rText )
+{
+ int o_rCount_BackslashedLineBreaks = 0;
+ jumpToEol(io_rText,o_rCount_BackslashedLineBreaks);
+ for ( ; o_rCount_BackslashedLineBreaks > 0; --o_rCount_BackslashedLineBreaks )
+ Dealer().Deal_Eol();
+ SetNewToken( new Tok_PreProDefinition(io_rText.CutToken()) );
+ if (io_rText.CurChar() != NULCH)
+ jumpOverEol(io_rText);
+ Dealer().Deal_Eol();
+}
+
+
+} // namespace cpp
+
+
+
+
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/cx_c_pp.hxx b/autodoc/source/parser/cpp/cx_c_pp.hxx
new file mode 100644
index 000000000000..47a14f795702
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_c_pp.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_c_pp.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CX_C_PP_HXX
+#define ADC_CPP_CX_C_PP_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+#include "cx_base.hxx"
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace cpp
+{
+
+class Context_Preprocessor : public Cx_Base
+{
+ public:
+ Context_Preprocessor(
+ TkpContext & i_rFollowUpContext );
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual void AssignDealer(
+ Distributor & o_rDealer );
+ private:
+ // Locals
+ void ReadDefault(
+ CharacterSource & io_rText );
+ void ReadDefine(
+ CharacterSource & io_rText );
+
+ // DATA
+ TkpContext * pContext_Parent;
+ Dyn<Cx_Base> pContext_PP_MacroParams;
+ Dyn<Cx_Base> pContext_PP_Definition;
+};
+
+class Context_PP_MacroParams : public Cx_Base
+{
+ public:
+ Context_PP_MacroParams(
+ Cx_Base & i_rFollowUpContext );
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ private:
+ // DATA
+ Cx_Base * pContext_PP_Definition;
+};
+
+class Context_PP_Definition : public Cx_Base
+{
+ public:
+ Context_PP_Definition(
+ TkpContext & i_rFollowUpContext );
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+
+ private:
+ // DATA
+ TkpContext * pContext_Parent;
+};
+
+
+} // namespace cpp
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/cx_c_std.cxx b/autodoc/source/parser/cpp/cx_c_std.cxx
new file mode 100644
index 000000000000..6c5edfed190d
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_c_std.cxx
@@ -0,0 +1,532 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_c_std.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "cx_c_std.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include "all_toks.hxx"
+#include "cx_c_pp.hxx"
+#include "cx_c_sub.hxx"
+#include <tools/tkpchars.hxx>
+#include <tokens/tkpstama.hxx>
+#include <x_parse.hxx>
+#include "c_dealer.hxx"
+
+
+namespace cpp {
+
+
+const intt C_nCppInitialNrOfStati = 600;
+const intt C_nStatusSize = 128;
+
+
+
+const uintt nF_fin_Error = 1;
+const uintt nF_fin_CreateWithoutText = 2;
+const uintt nF_fin_CreateWithText = 3;
+const uintt nF_fin_Ignore = 4;
+const uintt nF_fin_EOL = 5;
+const uintt nF_fin_EOF = 6;
+const uintt nF_fin_Bezeichner = 7;
+
+const uintt nF_goto_Preprocessor = 10;
+const uintt nF_goto_Comment = 11;
+const uintt nF_goto_Docu = 12;
+const uintt nF_goto_Const = 13;
+const uintt nF_goto_UnblockMacro = 14;
+
+// Token create functions for the state machine:
+DYN TextToken * TCF_Identifier(const char * text) { return new Tok_Identifier(text); }
+
+DYN TextToken * TCF_operator(const char *) { return new Tok_operator; }
+DYN TextToken * TCF_class(const char *) { return new Tok_class; }
+DYN TextToken * TCF_struct(const char *) { return new Tok_struct; }
+DYN TextToken * TCF_union(const char *) { return new Tok_union; }
+DYN TextToken * TCF_enum(const char *) { return new Tok_enum; }
+DYN TextToken * TCF_typedef(const char *) { return new Tok_typedef; }
+DYN TextToken * TCF_public(const char *) { return new Tok_public; }
+DYN TextToken * TCF_protected(const char *) { return new Tok_protected; }
+DYN TextToken * TCF_private(const char *) { return new Tok_private; }
+DYN TextToken * TCF_template(const char *) { return new Tok_template; }
+DYN TextToken * TCF_virtual(const char *) { return new Tok_virtual; }
+DYN TextToken * TCF_friend(const char *) { return new Tok_friend; }
+DYN TextToken * TCF_Tilde(const char *) { return new Tok_Tilde; }
+DYN TextToken * TCF_const(const char *) { return new Tok_const; }
+DYN TextToken * TCF_volatile(const char *) { return new Tok_volatile; }
+DYN TextToken * TCF_extern(const char *) { return new Tok_extern; }
+DYN TextToken * TCF_static(const char *) { return new Tok_static; }
+DYN TextToken * TCF_mutable(const char *) { return new Tok_mutable; }
+DYN TextToken * TCF_register(const char *) { return new Tok_register; }
+DYN TextToken * TCF_inline(const char *) { return new Tok_inline; }
+DYN TextToken * TCF_explicit(const char *) { return new Tok_explicit; }
+DYN TextToken * TCF_namespace(const char *) { return new Tok_namespace; }
+DYN TextToken * TCF_using(const char *) { return new Tok_using; }
+DYN TextToken * TCF_throw(const char *) { return new Tok_throw; }
+DYN TextToken * TCF_SwBracketOpen(const char *) { return new Tok_SwBracket_Left; }
+DYN TextToken * TCF_SwBracketClose(const char *) { return new Tok_SwBracket_Right; }
+DYN TextToken * TCF_ArBracketOpen(const char *) { return new Tok_ArrayBracket_Left; }
+DYN TextToken * TCF_ArBracketClose(const char *) { return new Tok_ArrayBracket_Right; }
+DYN TextToken * TCF_BracketOpen(const char *) { return new Tok_Bracket_Left; }
+DYN TextToken * TCF_BracketClose(const char *) { return new Tok_Bracket_Right; }
+DYN TextToken * TCF_DblColon(const char *) { return new Tok_DoubleColon; }
+DYN TextToken * TCF_Semikolon(const char *) { return new Tok_Semicolon; }
+DYN TextToken * TCF_Komma(const char *) { return new Tok_Comma; }
+DYN TextToken * TCF_Colon(const char *) { return new Tok_Colon; }
+DYN TextToken * TCF_Zuweisung(const char *) { return new Tok_Assign; }
+DYN TextToken * TCF_Smaller(const char *) { return new Tok_Less; }
+DYN TextToken * TCF_Bigger(const char *) { return new Tok_Greater; }
+DYN TextToken * TCF_Stern(const char *) { return new Tok_Asterix; }
+DYN TextToken * TCF_Ampersand(const char *) { return new Tok_AmpersAnd; }
+DYN TextToken * TCF_Ellipse(const char *) { return new Tok_Ellipse; }
+DYN TextToken * TCF_typename(const char *) { return new Tok_typename; }
+
+ // Operators
+DYN TextToken * TCF_Operator(const char * text) { return new Tok_Operator(text); }
+
+DYN TextToken * TCF_BuiltInType(const char * text) { return new Tok_BuiltInType(text); }
+DYN TextToken * TCF_TypeModifier(const char * text) { return new Tok_TypeSpecializer(text); }
+
+DYN TextToken * TCF_Eof(const char *) { return new Tok_Eof; }
+
+
+
+Context_CppStd::Context_CppStd( DYN autodoc::TkpDocuContext & let_drContext_Docu )
+ : Cx_Base(0),
+ aStateMachine(C_nStatusSize,C_nCppInitialNrOfStati),
+ pDocuContext(&let_drContext_Docu),
+ pContext_Comment(0),
+ pContext_Preprocessor(0),
+ pContext_ConstString(0),
+ pContext_ConstChar(0),
+ pContext_ConstNumeric(0),
+ pContext_UnblockMacro(0)
+{
+ pDocuContext->SetParentContext(*this,"*/");
+
+ pContext_Comment = new Context_Comment(*this);
+ pContext_Preprocessor = new Context_Preprocessor(*this);
+ pContext_ConstString = new Context_ConstString(*this);
+ pContext_ConstChar = new Context_ConstChar(*this);
+ pContext_ConstNumeric = new Context_ConstNumeric(*this);
+ pContext_UnblockMacro = new Context_UnblockMacro(*this);
+
+ SetupStateMachine();
+}
+
+Context_CppStd::~Context_CppStd()
+{
+}
+
+void
+Context_CppStd::ReadCharChain( CharacterSource & io_rText )
+{
+ SetNewToken(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.
+ SetFollowUpContext(rBound.FollowUpContext());
+ PerformStatusFunction(rBound.StatusFunctionNr(), fTokenCreateFunction, io_rText);
+}
+
+void
+Context_CppStd::AssignDealer( Distributor & o_rDealer )
+{
+ Cx_Base::AssignDealer(o_rDealer);
+
+ pDocuContext->AssignDealer(o_rDealer);
+ pContext_Comment->AssignDealer(o_rDealer);
+ pContext_Preprocessor->AssignDealer(o_rDealer);
+ pContext_ConstString->AssignDealer(o_rDealer);
+ pContext_ConstChar->AssignDealer(o_rDealer);
+ pContext_ConstNumeric->AssignDealer(o_rDealer);
+ pContext_UnblockMacro->AssignDealer(o_rDealer);
+}
+
+void
+Context_CppStd::PerformStatusFunction( uintt i_nStatusSignal,
+ F_CRTOK i_fTokenCreateFunction,
+ CharacterSource & io_rText )
+{
+ switch (i_nStatusSignal)
+ {
+ case nF_fin_CreateWithoutText:
+ io_rText.CutToken();
+ csv_assert(i_fTokenCreateFunction != 0);
+ SetNewToken( (*i_fTokenCreateFunction)(0) );
+ break;
+ case nF_fin_CreateWithText:
+ csv_assert(i_fTokenCreateFunction != 0);
+ SetNewToken( (*i_fTokenCreateFunction)(io_rText.CutToken()) );
+ break;
+ case nF_fin_Ignore:
+ io_rText.CutToken();
+ SetNewToken(0);
+ break;
+ case nF_fin_EOL:
+ io_rText.CutToken();
+ SetNewToken(0);
+ Dealer().Deal_Eol();
+ break;
+ case nF_fin_EOF:
+ io_rText.CutToken();
+ SetNewToken( TCF_Eof(0) );
+ break;
+ case nF_fin_Bezeichner:
+ SetNewToken( TCF_Identifier(io_rText.CutToken()) );
+ break;
+
+ case nF_goto_Preprocessor:
+ io_rText.CutToken();
+ SetNewToken(0);
+ break;
+ case nF_goto_Comment:
+ SetNewToken(0);
+ pContext_Comment->SetMode_IsMultiLine( io_rText.CutToken()[1] == '*' );
+ break;
+ case nF_goto_Docu:
+ SetNewToken(0);
+ pDocuContext->SetMode_IsMultiLine( io_rText.CutToken()[1] == '*' );
+ break;
+ case nF_goto_Const:
+ SetNewToken(0);
+ break;
+ case nF_goto_UnblockMacro:
+ SetNewToken(0);
+ break;
+
+ case nF_fin_Error:
+ default:
+ {
+ char cCC = io_rText.CurChar();
+ String sCurChar( &cCC, 1 );
+ throw X_Parser( X_Parser::x_InvalidChar, sCurChar, String::Null_(), 0 );
+ }
+ } // end switch (i_nStatusSignal)
+}
+
+void
+Context_CppStd::SetupStateMachine()
+{
+ // Besondere Array-Stati (kein Tokenabschluss oder Kontextwechsel):
+// const INT16 top = 0; // Top-Status
+ const INT16 wht = 1; // Whitespace-überlese-Status
+ const INT16 bez = 2; // Bezeichner-lese-Status
+
+ // Tokenfinish-Stati:
+ const INT16 finError = 3;
+ const INT16 finIgnore = 4;
+ const INT16 finBezeichner = 5;
+ const INT16 finKeyword = 6;
+ const INT16 finPunctuation = 7;
+ const INT16 finBiType = 8;
+ const INT16 finTypeModifier = 9;
+ const INT16 finEOL = 10;
+ const INT16 finEOF = 11;
+
+ // Kontextwechsel-Stati:
+ const INT16 gotoComment = 12;
+ const INT16 gotoDocu = 13;
+ const INT16 gotoPreprocessor = 14;
+ const INT16 gotoConstString = 15;
+ const INT16 gotoConstChar = 16;
+ const INT16 gotoConstNumeric = 17;
+ const INT16 gotoUnblockMacro = 18;
+
+ // Abbreviations to be used in status tables:
+ const INT16 err = finError;
+ const INT16 fig = finIgnore;
+ const INT16 fbz = finBezeichner;
+ const INT16 fof = finEOF;
+ const INT16 cst = gotoConstString;
+ const INT16 cch = gotoConstChar;
+ const INT16 cnr = gotoConstNumeric;
+
+
+ /// Zeros - '0' - will be replaced by 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, // 16 ...
+ wht, 0,cst, 0,err, 0, 0,cch, 0, 0, 0, 0, 0, 0, 0, 0,
+ cnr,cnr,cnr,cnr,cnr,cnr,cnr,cnr,cnr,cnr, 0, 0, 0, 0, 0, 0, // 48 ...
+ 0,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez, 0, 0, 0, 0,bez, // 80 ...
+ 0,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez, 0, 0, 0, 0,err, // 80 ...
+ };
+
+ 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,fig,wht,wht,fig,err,err,
+ err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // 16 ...
+ wht,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,
+ fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig, // 48 ...
+ fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,
+ fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig, // 80 ...
+ fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,
+ fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,err
+ };
+
+ const INT16 A_nBezeichnerStatus[C_nStatusSize] =
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ {fbz,err,err,err,err,err,err,err,err,fbz,fbz,fbz,fbz,fbz,err,err,
+ err,err,err,err,err,err,err,err,err,err,fbz,err,err,err,err,err, // 16 ...
+ fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,fbz,fbz, // 48 ...
+ fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,bez, // 80 ...
+ fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,err
+ };
+
+
+ const INT16 A_nOperatorDefStatus[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
+ };
+
+ const INT16 A_nBezDefStatus[C_nStatusSize] =
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ {fbz,err,err,err,err,err,err,err,err,fbz,fbz,fbz,fbz,fbz,err,err,
+ err,err,err,err,err,err,err,err,err,err,fbz,err,err,err,err,err, // 16 ...
+ fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,fbz,fbz, // 48 ...
+ fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,bez, // 80 ...
+ fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
+ bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,err
+ };
+
+ DYN StmArrayStatus * dpStatusTop
+ = new StmArrayStatus( C_nStatusSize, A_nTopStatus, 0, true);
+ DYN StmArrayStatus * dpStatusWhite
+ = new StmArrayStatus( C_nStatusSize, A_nWhitespaceStatus, 0, true);
+ DYN StmArrayStatus * dpStatusBez
+ = new StmArrayStatus( C_nStatusSize, A_nBezeichnerStatus, TCF_Identifier, 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_finBezeichner
+ = new StmBoundsStatus( *this, *this, nF_fin_Bezeichner, true );
+ DYN StmBoundsStatus * dpBst_finKeyword
+ = new StmBoundsStatus( *this, *this, nF_fin_CreateWithoutText, false );
+ DYN StmBoundsStatus * dpBst_finPunctuation
+ = new StmBoundsStatus( *this, *this, nF_fin_CreateWithText, false );
+ DYN StmBoundsStatus * dpBst_finBiType
+ = new StmBoundsStatus( *this, *this, nF_fin_CreateWithText, false );
+ DYN StmBoundsStatus * dpBst_finTypeModifier
+ = new StmBoundsStatus( *this, *this, nF_fin_CreateWithText, false );
+ DYN StmBoundsStatus * dpBst_finEOL
+ = new StmBoundsStatus( *this, *this, nF_fin_EOL, false );
+ DYN StmBoundsStatus * dpBst_finEOF
+ = new StmBoundsStatus( *this, TkpContext::Null_(), nF_fin_EOF, false );
+
+ DYN StmBoundsStatus * dpBst_gotoComment
+ = new StmBoundsStatus( *this, *pContext_Comment, nF_goto_Comment, false );
+ DYN StmBoundsStatus * dpBst_gotoDocu
+ = new StmBoundsStatus( *this, *pDocuContext, nF_goto_Docu, false );
+ DYN StmBoundsStatus * dpBst_gotoPreprocessor
+ = new StmBoundsStatus( *this, *pContext_Preprocessor, nF_goto_Preprocessor, false );
+ DYN StmBoundsStatus * dpBst_gotoConstString
+ = new StmBoundsStatus( *this, *pContext_ConstString, nF_goto_Const, false );
+ DYN StmBoundsStatus * dpBst_gotoConstChar
+ = new StmBoundsStatus( *this, *pContext_ConstChar, nF_goto_Const, false );
+ DYN StmBoundsStatus * dpBst_gotoConstNumeric
+ = new StmBoundsStatus( *this, *pContext_ConstNumeric, nF_goto_Const, false );
+ DYN StmBoundsStatus * dpBst_gotoUnblockMacro
+ = new StmBoundsStatus( *this, *pContext_UnblockMacro, nF_goto_UnblockMacro, false );
+
+ // dpMain aufbauen:
+ aStateMachine.AddStatus(dpStatusTop);
+
+ aStateMachine.AddStatus(dpStatusWhite);
+ aStateMachine.AddStatus(dpStatusBez);
+
+ aStateMachine.AddStatus(dpBst_finError);
+ aStateMachine.AddStatus(dpBst_finIgnore);
+ aStateMachine.AddStatus(dpBst_finBezeichner);
+ aStateMachine.AddStatus(dpBst_finKeyword);
+ aStateMachine.AddStatus(dpBst_finPunctuation);
+ aStateMachine.AddStatus(dpBst_finBiType);
+ aStateMachine.AddStatus(dpBst_finTypeModifier);
+ aStateMachine.AddStatus(dpBst_finEOL);
+ aStateMachine.AddStatus(dpBst_finEOF);
+
+ aStateMachine.AddStatus(dpBst_gotoComment);
+ aStateMachine.AddStatus(dpBst_gotoDocu);
+ aStateMachine.AddStatus(dpBst_gotoPreprocessor);
+ aStateMachine.AddStatus(dpBst_gotoConstString);
+ aStateMachine.AddStatus(dpBst_gotoConstChar);
+ aStateMachine.AddStatus(dpBst_gotoConstNumeric);
+ aStateMachine.AddStatus(dpBst_gotoUnblockMacro);
+
+ // Identifier
+
+ // Keywords and other unique Tokens
+ aStateMachine.AddToken("operator",TCF_operator,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("class",TCF_class,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("struct",TCF_struct,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("union",TCF_union,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("enum",TCF_enum,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("typedef",TCF_typedef,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("public",TCF_public,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("protected",TCF_protected,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("private",TCF_private,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("template",TCF_template,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("virtual",TCF_virtual,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("friend",TCF_friend,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("~",TCF_Tilde,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("const",TCF_const,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("volatile",TCF_volatile,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("extern",TCF_extern,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("static",TCF_static,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("mutable",TCF_mutable,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("register",TCF_register,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("inline",TCF_inline,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("explicit",TCF_explicit,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("namespace",TCF_namespace,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("using",TCF_using,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("throw",TCF_throw,A_nBezDefStatus,finKeyword);
+ aStateMachine.AddToken("{",TCF_SwBracketOpen,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("}",TCF_SwBracketClose,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("[",TCF_ArBracketOpen,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("]",TCF_ArBracketClose,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("(",TCF_BracketOpen,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken(")",TCF_BracketClose,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("::",TCF_DblColon,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken(";",TCF_Semikolon,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken(",",TCF_Komma,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken(":",TCF_Colon,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("=",TCF_Zuweisung,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("<",TCF_Smaller,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken(">",TCF_Bigger,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("*",TCF_Stern,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("&",TCF_Ampersand,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("...",TCF_Ellipse,A_nOperatorDefStatus,finKeyword);
+ aStateMachine.AddToken("typename",TCF_typename,A_nOperatorDefStatus,finKeyword);
+
+ // Operators
+ aStateMachine.AddToken("==",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("!=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("<=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken(">=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("&&",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("||",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("!",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("new",TCF_Operator,A_nBezDefStatus,finPunctuation);
+ aStateMachine.AddToken("delete",TCF_Operator,A_nBezDefStatus,finPunctuation);
+ aStateMachine.AddToken("sizeof",TCF_Operator,A_nBezDefStatus,finPunctuation);
+ aStateMachine.AddToken("typeid",TCF_Operator,A_nBezDefStatus,finPunctuation);
+ aStateMachine.AddToken("+",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("-",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("/",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("%",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("^",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("|",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("<<",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken(">>",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken(".",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("->",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("?",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("+=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("-=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("*=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("/=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("%=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("&=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("|=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("^=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken("<<=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+ aStateMachine.AddToken(">>=",TCF_Operator,A_nOperatorDefStatus,finPunctuation);
+
+ // Builtin types
+ aStateMachine.AddToken("char", TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("short", TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("int", TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("long", TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("float", TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("double",TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("wchar_t",TCF_BuiltInType, A_nBezDefStatus, finBiType);
+ aStateMachine.AddToken("size_t",TCF_BuiltInType, A_nBezDefStatus, finBiType);
+
+ // Type modifiers
+ aStateMachine.AddToken("signed", TCF_TypeModifier, A_nBezDefStatus, finTypeModifier);
+ aStateMachine.AddToken("unsigned", TCF_TypeModifier, A_nBezDefStatus, finTypeModifier);
+
+ // To ignore
+ aStateMachine.AddToken("auto", 0, A_nBezDefStatus, finIgnore);
+ aStateMachine.AddToken("_cdecl", 0, A_nBezDefStatus, finIgnore);
+ aStateMachine.AddToken("__cdecl", 0, A_nBezDefStatus, finIgnore);
+ aStateMachine.AddToken("__stdcall", 0, A_nBezDefStatus, finIgnore);
+ aStateMachine.AddToken("__fastcall",0, A_nBezDefStatus, finIgnore);
+ aStateMachine.AddToken("/**/", 0, A_nOperatorDefStatus,finIgnore);
+
+ // Context changers
+ aStateMachine.AddToken("#", 0, A_nOperatorDefStatus, gotoPreprocessor);
+ aStateMachine.AddToken("#undef",0, A_nOperatorDefStatus, gotoPreprocessor);
+ aStateMachine.AddToken("#unblock-",
+ 0, A_nOperatorDefStatus, gotoUnblockMacro);
+ aStateMachine.AddToken("/*", 0, A_nOperatorDefStatus, gotoComment);
+ aStateMachine.AddToken("//", 0, A_nOperatorDefStatus, gotoComment);
+ aStateMachine.AddToken("/**", 0, A_nOperatorDefStatus, gotoDocu);
+ aStateMachine.AddToken("///", 0, A_nOperatorDefStatus, gotoDocu);
+
+ // Line ends
+ // regular
+ aStateMachine.AddToken("\r\n", 0, A_nOperatorDefStatus, finEOL);
+ aStateMachine.AddToken("\n", 0, A_nOperatorDefStatus, finEOL);
+ aStateMachine.AddToken("\r", 0, A_nOperatorDefStatus, finEOL);
+ // To ignore in some cases(may be only at preprocessor?), but
+ // linecount has to be incremented.
+ aStateMachine.AddToken("\\\r\n",0, A_nOperatorDefStatus, finEOL);
+ aStateMachine.AddToken("\\\n", 0, A_nOperatorDefStatus, finEOL);
+ aStateMachine.AddToken("\\\r", 0, A_nOperatorDefStatus, finEOL);
+};
+
+
+} // namespace cpp
+
diff --git a/autodoc/source/parser/cpp/cx_c_std.hxx b/autodoc/source/parser/cpp/cx_c_std.hxx
new file mode 100644
index 000000000000..34bcf56e3c77
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_c_std.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_c_std.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CX_C_STD_HXX
+#define ADC_CPP_CX_C_STD_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+#include "cx_base.hxx"
+ // COMPONENTS
+#include <tokens/tkpstama.hxx>
+ // PARAMETERS
+
+
+
+namespace cpp {
+
+class Context_Comment;
+
+/**
+*/
+class Context_CppStd : public Cx_Base,
+ private StateMachineContext
+{
+ public:
+ // LIFECYCLE
+ Context_CppStd(
+ DYN autodoc::TkpDocuContext &
+ let_drContext_Docu );
+ ~Context_CppStd();
+ // OPERATIONS
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual void AssignDealer(
+ Distributor & o_rDealer );
+ private:
+ // SERVICE FUNCTIONS
+ void PerformStatusFunction(
+ uintt i_nStatusSignal,
+ StmArrayStatus::F_CRTOK
+ i_fTokenCreateFunction,
+ CharacterSource & io_rText );
+ void SetupStateMachine();
+
+ // DATA
+ StateMachine aStateMachine;
+
+ // Contexts
+ Dyn<autodoc::TkpDocuContext>
+ pDocuContext;
+
+ Dyn<Context_Comment>
+ pContext_Comment;
+ Dyn<Cx_Base> pContext_Preprocessor;
+ Dyn<Cx_Base> pContext_ConstString;
+ Dyn<Cx_Base> pContext_ConstChar;
+ Dyn<Cx_Base> pContext_ConstNumeric;
+ Dyn<Cx_Base> pContext_UnblockMacro;
+};
+
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/cx_c_sub.cxx b/autodoc/source/parser/cpp/cx_c_sub.cxx
new file mode 100644
index 000000000000..e45f121efb66
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_c_sub.cxx
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_c_sub.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "cx_c_sub.hxx"
+
+
+
+// NOT FULLY DECLARED SERVICES
+#include <ctype.h>
+#include "c_dealer.hxx"
+#include <tokens/parseinc.hxx>
+#include <x_parse.hxx>
+#include "all_toks.hxx"
+
+
+namespace cpp {
+
+
+
+void
+Context_Comment::ReadCharChain( CharacterSource & io_rText )
+{
+ // KORR_FUTURE
+ // Counting of lines must be implemented.
+ if (bCurrentModeIsMultiline)
+ {
+ char cNext = NULCH;
+
+ do {
+ do {
+ cNext = jumpTo( io_rText,'*',char(10) );
+ if (cNext == NULCH)
+ throw X_Parser( X_Parser::x_UnexpectedEOF, "", String::Null_(), 0 );
+ else if ( cNext == char(10) )
+ {
+ jumpOverEol(io_rText);
+ Dealer().Deal_Eol();
+ }
+ } while ( cNext != '*');
+ cNext = jumpOver(io_rText,'*');
+ if (cNext == NULCH)
+ throw X_Parser( X_Parser::x_UnexpectedEOF, "", String::Null_(), 0 );
+ } while (cNext != '/');
+ io_rText.MoveOn();
+ io_rText.CutToken();
+ SetNewToken(0);
+ }
+ else //
+ {
+ int o_rCount_BackslashedLineBreaks = 0;
+ jumpToEol(io_rText,o_rCount_BackslashedLineBreaks);
+ for ( ; o_rCount_BackslashedLineBreaks > 0; --o_rCount_BackslashedLineBreaks )
+ Dealer().Deal_Eol();
+
+ if (io_rText.CurChar() != NULCH)
+ jumpOverEol(io_rText);
+ io_rText.CutToken();
+ Dealer().Deal_Eol();
+ SetNewToken(0);
+ } // endif
+}
+
+
+void
+Context_ConstString::ReadCharChain( CharacterSource & io_rText )
+{
+ char cNext = io_rText.MoveOn();
+
+ while (cNext != '"')
+ { // Get one complete string constant: "...."
+ while (cNext != '"' AND cNext != '\\')
+ { // Get string till next '\\'
+ cNext = io_rText.MoveOn();
+ }
+ if (cNext == '\\')
+ {
+ io_rText.MoveOn();
+ cNext = io_rText.MoveOn();
+ }
+ }
+ io_rText.MoveOn();
+ SetNewToken(new Tok_Constant(io_rText.CutToken()));
+}
+
+void
+Context_ConstChar::ReadCharChain( CharacterSource & io_rText )
+{
+ char cNext = io_rText.MoveOn();
+
+ while (cNext != '\'')
+ { // Get one complete char constant: "...."
+ while (cNext != '\'' AND cNext != '\\')
+ { // Get string till next '\\'
+ cNext = io_rText.MoveOn();
+ }
+ if (cNext == '\\')
+ {
+ io_rText.MoveOn();
+ cNext = io_rText.MoveOn();
+ }
+ }
+ io_rText.MoveOn();
+ SetNewToken(new Tok_Constant(io_rText.CutToken()));
+}
+
+void
+Context_ConstNumeric::ReadCharChain(CharacterSource & io_rText)
+{
+ char cNext = 0;
+
+ do {
+ do {
+ cNext = static_cast<char>( tolower(io_rText.MoveOn()) );
+ } while ( (cNext != 'e' AND isalnum(cNext)) OR cNext == '.');
+ if (cNext == 'e')
+ {
+ cNext = io_rText.MoveOn();
+ if (cNext == '+' OR cNext == '-')
+ cNext = io_rText.MoveOn();
+ } // endif
+ } while (isalnum(cNext) OR cNext == '.'); // Reicht aus, wenn Zahlen korrekt geschrieben sind
+ SetNewToken(new Tok_Constant(io_rText.CutToken()));
+}
+
+void
+Context_UnblockMacro::ReadCharChain(CharacterSource & io_rText)
+{
+ jumpToWhite(io_rText);
+ SetNewToken(new Tok_UnblockMacro( io_rText.CutToken() + strlen("#unblock-") ));
+}
+
+} // namespace cpp
diff --git a/autodoc/source/parser/cpp/cx_c_sub.hxx b/autodoc/source/parser/cpp/cx_c_sub.hxx
new file mode 100644
index 000000000000..d51d9c213cfc
--- /dev/null
+++ b/autodoc/source/parser/cpp/cx_c_sub.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_c_sub.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CX_C_SUB_HXX
+#define ADC_CPP_CX_C_SUB_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+#include "cx_base.hxx"
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace cpp {
+
+
+class Context_Comment : public Cx_Base
+{
+ public:
+ Context_Comment(
+ TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext) {}
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ void SetMode_IsMultiLine(
+ bool i_bTrue )
+ { bCurrentModeIsMultiline = i_bTrue; }
+ private:
+ bool bCurrentModeIsMultiline;
+};
+
+class Context_ConstString : public Cx_Base
+{
+ public:
+ Context_ConstString(
+ TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext) {}
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+};
+
+class Context_ConstChar : public Cx_Base
+{
+ public:
+ Context_ConstChar(
+ TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext) {}
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+};
+
+class Context_ConstNumeric : public Cx_Base
+{
+ public:
+ Context_ConstNumeric(
+ TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext) {}
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+};
+
+class Context_UnblockMacro : public Cx_Base
+{
+ public:
+ Context_UnblockMacro(
+ TkpContext & i_rFollowUpContext )
+ : Cx_Base(&i_rFollowUpContext) {}
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+};
+
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/cxt2ary.cxx b/autodoc/source/parser/cpp/cxt2ary.cxx
new file mode 100644
index 000000000000..7a30c7884a1b
--- /dev/null
+++ b/autodoc/source/parser/cpp/cxt2ary.cxx
@@ -0,0 +1,360 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cxt2ary.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "cxt2ary.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <ary/entity.hxx>
+#include <ary/cpp/c_class.hxx>
+#include <ary/cpp/c_define.hxx>
+#include <ary/cpp/c_enum.hxx>
+#include <ary/cpp/c_enuval.hxx>
+#include <ary/cpp/c_funct.hxx>
+#include <ary/cpp/c_macro.hxx>
+#include <ary/cpp/c_tydef.hxx>
+#include <ary/cpp/c_vari.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <ary/loc/loc_file.hxx>
+#include <ary/doc/d_oldcppdocu.hxx>
+#include <ary/info/docstore.hxx>
+#include "icprivow.hxx"
+
+// Implementationheaders, only to be used in this file!
+#include "sfscope.hxx"
+#include "sownstck.hxx"
+#include "sdocdist.hxx"
+#include "srecover.hxx"
+
+
+
+
+
+namespace cpp
+{
+
+using ary::cpp::E_Protection;
+
+ContextForAry::ContextForAry( ary::cpp::Gate & io_rAryGate )
+ : pGate(&io_rAryGate),
+ aTokenResult(),
+ pFileScopeInfo( new S_FileScopeInfo ),
+ pOwnerStack( new S_OwnerStack ),
+ pDocuDistributor( new S_DocuDistributor ),
+ pRecoveryGuard( new S_RecoveryGuard )
+{
+ OpenNamespace( pGate->Ces().GlobalNamespace() );
+}
+
+ContextForAry::~ContextForAry()
+{
+}
+
+ary::loc::File &
+ContextForAry::inq_CurFile() const
+{
+ csv_assert(pFileScopeInfo->pCurFile != 0);
+
+ return *pFileScopeInfo->pCurFile;
+}
+
+ary::cpp::Namespace &
+ContextForAry::inq_CurNamespace() const
+{
+ return pOwnerStack->CurNamespace();
+}
+
+ary::cpp::Class *
+ContextForAry::inq_CurClass() const
+{
+ return pOwnerStack->CurClass();
+}
+
+ary::cpp::Enum *
+ContextForAry::inq_CurEnum() const
+{
+ return pOwnerStack->CurEnum();
+}
+
+
+ary::cpp::InputContext::Owner &
+ContextForAry::inq_CurOwner() const
+{
+ return pOwnerStack->CurOwner();
+}
+
+E_Protection
+ContextForAry::inq_CurProtection() const
+{
+ return pOwnerStack->CurProtection();
+}
+
+void
+ContextForAry::do_SetTokenResult( E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push )
+{
+ aTokenResult.eDone = i_eDone;
+ aTokenResult.eStackAction = i_eWhat2DoWithEnvStack;
+ aTokenResult.pEnv2Push = i_pParseEnv2Push;
+}
+
+void
+ContextForAry::do_OpenNamespace( ary::cpp::Namespace & io_rOpenedNamespace )
+{
+ pOwnerStack->OpenNamespace( io_rOpenedNamespace );
+}
+
+void
+ContextForAry::do_OpenExternC( bool )
+{
+ pOwnerStack->OpenExternC();
+ // KORR_FUTURE
+ // use i_bOnlyForOneDeclaration
+}
+
+void
+ContextForAry::do_OpenClass( ary::cpp::Class & io_rOpenedClass )
+{
+ pOwnerStack->OpenClass(io_rOpenedClass);
+ pDocuDistributor->SetCurrentlyStoredRe(io_rOpenedClass);
+}
+
+void
+ContextForAry::do_OpenEnum( ary::cpp::Enum & io_rOpenedEnum )
+{
+ pOwnerStack->OpenEnum(io_rOpenedEnum);
+ pDocuDistributor->SetCurrentlyStoredRe(io_rOpenedEnum);
+}
+
+void
+ContextForAry::do_CloseBlock()
+{
+ pOwnerStack->CloseBlock();
+}
+
+void
+ContextForAry::do_CloseClass()
+{
+ pOwnerStack->CloseClass();
+}
+
+void
+ContextForAry::do_CloseEnum()
+{
+ pOwnerStack->CloseEnum();
+}
+
+void
+ContextForAry::do_SetCurProtection( ary::cpp::E_Protection i_eProtection )
+{
+ pOwnerStack->SetCurProtection(i_eProtection);
+}
+
+void
+ContextForAry::do_OpenTemplate( const StringVector & i_rParameters )
+{
+ pFileScopeInfo->pCurTemplateParameters = new StringVector(i_rParameters);
+}
+
+DYN StringVector *
+ContextForAry::do_Get_CurTemplateParameters()
+{
+ return pFileScopeInfo->pCurTemplateParameters.Release();
+}
+
+void
+ContextForAry::do_Close_OpenTemplate()
+{
+ if (pFileScopeInfo->pCurTemplateParameters)
+ delete pFileScopeInfo->pCurTemplateParameters.Release();
+}
+
+void
+ContextForAry::do_Event_Class_FinishedBase( const String & )
+{
+ // KORR_FUTURE
+}
+
+void
+ContextForAry::do_Event_Store_Typedef( ary::cpp::Typedef & io_rTypedef )
+{
+ pDocuDistributor->SetCurrentlyStoredRe(io_rTypedef);
+}
+
+void
+ContextForAry::do_Event_Store_EnumValue( ary::cpp::EnumValue & io_rEnumValue )
+{
+ pDocuDistributor->SetCurrentlyStoredRe(io_rEnumValue);
+}
+
+void
+ContextForAry::do_Event_Store_CppDefinition( ary::cpp::DefineEntity & io_rDefinition )
+{
+ pDocuDistributor->SetCurrentlyStoredRe(io_rDefinition);
+}
+
+void
+ContextForAry::do_Event_EnterFunction_ParameterList()
+{
+ // KORR_FUTURE
+ // Inform pDocuDistributor about possibility of parameters' inline documentation.
+}
+
+void
+ContextForAry::do_Event_Function_FinishedParameter( const String & )
+{
+ // KORR_FUTURE
+}
+
+void
+ContextForAry::do_Event_LeaveFunction_ParameterList()
+{
+ // KORR_FUTURE
+}
+
+void
+ContextForAry::do_Event_EnterFunction_Implementation()
+{
+ // KORR_FUTURE
+}
+
+void
+ContextForAry::do_Event_LeaveFunction_Implementation()
+{
+ // KORR_FUTURE
+}
+
+void
+ContextForAry::do_Event_Store_Function( ary::cpp::Function & io_rFunction )
+{
+ pDocuDistributor->SetCurrentlyStoredRe(io_rFunction);
+}
+
+
+void
+ContextForAry::do_Event_Store_Variable( ary::cpp::Variable & io_rVariable )
+{
+ pDocuDistributor->SetCurrentlyStoredRe(io_rVariable);
+}
+
+void
+ContextForAry::do_TakeDocu( DYN ary::doc::OldCppDocu & let_drInfo )
+{
+ let_drInfo.Store2(*pDocuDistributor);
+}
+
+void
+ContextForAry::do_StartWaitingFor_Recovery()
+{
+ pRecoveryGuard->StartWaitingFor_Recovery();
+}
+
+ary::cpp::Gate &
+ContextForAry::inq_AryGate() const
+{
+ return * const_cast< ary::cpp::Gate* >(pGate);
+}
+
+const ary::cpp::InputContext &
+ContextForAry::inq_Context() const
+{
+ return *this;
+}
+
+String
+ContextForAry::inq_CurFileName() const
+{
+ return pFileScopeInfo->pCurFile != 0
+ ? pFileScopeInfo->pCurFile->LocalName()
+ : String::Null_();
+}
+
+uintt
+ContextForAry::inq_LineCount() const
+{
+ return pFileScopeInfo->nLineCount;
+}
+
+bool
+ContextForAry::inq_IsWaitingFor_Recovery() const
+{
+ return pRecoveryGuard->IsWithinRecovery();
+}
+
+bool
+ContextForAry::inq_IsExternC() const
+{
+ return pOwnerStack->IsExternC();
+}
+
+void
+ContextForAry::do_SetCurFile( ary::loc::File & io_rCurFile )
+{
+ pFileScopeInfo->pCurFile = &io_rCurFile;
+ pFileScopeInfo->nLineCount = 0;
+ pFileScopeInfo->pCurTemplateParameters = 0;
+
+ pOwnerStack->Reset();
+ pDocuDistributor->Reset();
+ pRecoveryGuard->Reset();
+}
+
+void
+ContextForAry::do_Event_IncrLineCount()
+{
+ ++pFileScopeInfo->nLineCount;
+ pDocuDistributor->Event_LineBreak();
+}
+
+void
+ContextForAry::do_Event_SwBracketOpen()
+{
+ pRecoveryGuard->Hdl_SwBracketOpen();
+}
+
+void
+ContextForAry::do_Event_SwBracketClose()
+{
+ pRecoveryGuard->Hdl_SwBracketClose();
+}
+
+void
+ContextForAry::do_Event_Semicolon()
+{
+ pRecoveryGuard->Hdl_Semicolon();
+}
+
+
+
+
+} // namespace cpp
diff --git a/autodoc/source/parser/cpp/cxt2ary.hxx b/autodoc/source/parser/cpp/cxt2ary.hxx
new file mode 100644
index 000000000000..93597ac5c097
--- /dev/null
+++ b/autodoc/source/parser/cpp/cxt2ary.hxx
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cxt2ary.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CTX2ARY_HXX
+#define ADC_CPP_CTX2ARY_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <ary/cpp/inpcontx.hxx>
+#include <doc_deal.hxx>
+#include "pev.hxx"
+#include "fevnthdl.hxx"
+ // COMPONENTS
+ // PARAMETERS
+
+namespace ary
+{
+namespace loc
+{
+ class File;
+}
+}
+
+
+
+namespace cpp
+{
+
+
+/** @descr
+ This class provides information about the context of an
+ CodeEntity, which is going to be stored in the repository.
+ The information is used mainly by class ary::cpp::Gate.
+
+ Also it provides information for the parser about actual
+ state of several public variables.
+
+ @todo
+ Include events, which allow correct storing of inline
+ documentation after enum values, parameters,
+ base classes.
+*/
+class ContextForAry : public ary::cpp::InputContext,
+ public cpp::PeEnvironment,
+ public cpp::FileScope_EventHandler,
+ public DocuDealer
+{
+ public:
+ // LIFECYCLE
+ ContextForAry(
+ ary::cpp::Gate & io_rAryGate );
+ virtual ~ContextForAry();
+
+ // OPERATIONS
+ void ResetResult() { aTokenResult.Reset(); }
+
+ // INQUIRY
+ const TokenProcessing_Result &
+ CurResult() const { return aTokenResult; }
+ // ACCESS
+ TokenProcessing_Result &
+ CurResult() { return aTokenResult; }
+
+ private:
+ // Interface ary::cpp::InputContext:
+ virtual ary::loc::File &
+ inq_CurFile() const;
+ virtual ary::cpp::Namespace &
+ inq_CurNamespace() const;
+ virtual ary::cpp::Class *
+ inq_CurClass() const;
+ virtual ary::cpp::Enum *
+ inq_CurEnum() const;
+
+ virtual Owner & inq_CurOwner() const;
+ virtual ary::cpp::E_Protection
+ inq_CurProtection() const;
+
+ // Interface PeEnvironment
+ virtual void do_SetTokenResult(
+ E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push );
+ virtual void do_OpenNamespace(
+ ary::cpp::Namespace &
+ io_rOpenedNamespace );
+ virtual void do_OpenExternC(
+ bool i_bOnlyForOneDeclaration );
+ virtual void do_OpenClass(
+ ary::cpp::Class & io_rOpenedClass );
+ virtual void do_OpenEnum(
+ ary::cpp::Enum & io_rOpenedEnum );
+ virtual void do_CloseBlock();
+ virtual void do_CloseClass();
+ virtual void do_CloseEnum();
+ virtual void do_SetCurProtection(
+ ary::cpp::E_Protection
+ i_eProtection );
+ virtual void do_OpenTemplate(
+ const StringVector &
+ i_rParameters );
+ virtual DYN StringVector *
+ do_Get_CurTemplateParameters();
+ virtual void do_Close_OpenTemplate();
+ virtual void do_Event_Class_FinishedBase(
+ const String & i_sBaseName );
+
+ virtual void do_Event_Store_Typedef(
+ ary::cpp::Typedef & io_rTypedef );
+ virtual void do_Event_Store_EnumValue(
+ ary::cpp::EnumValue &
+ io_rEnumValue );
+ virtual void do_Event_Store_CppDefinition(
+ ary::cpp::DefineEntity &
+ io_rDefinition );
+ virtual void do_Event_EnterFunction_ParameterList();
+ virtual void do_Event_Function_FinishedParameter(
+ const String & i_sParameterName );
+ virtual void do_Event_LeaveFunction_ParameterList();
+ virtual void do_Event_EnterFunction_Implementation();
+ virtual void do_Event_LeaveFunction_Implementation();
+ virtual void do_Event_Store_Function(
+ ary::cpp::Function &
+ io_rFunction );
+ virtual void do_Event_Store_Variable(
+ ary::cpp::Variable &
+ io_rVariable );
+ virtual void do_TakeDocu(
+ DYN ary::doc::OldCppDocu &
+ let_drInfo );
+ virtual void do_StartWaitingFor_Recovery();
+ virtual ary::cpp::Gate &
+ inq_AryGate() const;
+ virtual const ary::cpp::InputContext &
+ inq_Context() const;
+ virtual String inq_CurFileName() const;
+ virtual uintt inq_LineCount() const;
+ virtual bool inq_IsWaitingFor_Recovery() const;
+ virtual bool inq_IsExternC() const;
+
+ // Interface FileScope_EventHandler
+ virtual void do_SetCurFile(
+ ary::loc::File & io_rCurFile );
+ virtual void do_Event_IncrLineCount();
+ virtual void do_Event_SwBracketOpen();
+ virtual void do_Event_SwBracketClose();
+ virtual void do_Event_Semicolon();
+
+ // Local types
+ struct S_FileScopeInfo;
+ struct S_OwnerStack;
+ struct S_DocuDistributor;
+ struct S_RecoveryGuard;
+
+ // DATA
+ ary::cpp::Gate * pGate;
+ TokenProcessing_Result
+ aTokenResult;
+ Dyn<S_FileScopeInfo>
+ pFileScopeInfo;
+ Dyn<S_OwnerStack> pOwnerStack;
+ Dyn<S_DocuDistributor>
+ pDocuDistributor;
+ Dyn<S_RecoveryGuard>
+ pRecoveryGuard;
+};
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/defdescr.cxx b/autodoc/source/parser/cpp/defdescr.cxx
new file mode 100644
index 000000000000..fc0ece01cda5
--- /dev/null
+++ b/autodoc/source/parser/cpp/defdescr.cxx
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: defdescr.cxx,v $
+ * $Revision: 1.6.18.1 $
+ *
+ * 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 "defdescr.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <prprpr.hxx>
+
+
+
+
+namespace cpp
+{
+
+
+
+
+DefineDescription::DefineDescription( const String & i_sName,
+ const str_vector & i_rDefinition )
+ : sName(i_sName),
+ // aParams,
+ aDefinition(i_rDefinition),
+ eDefineType(type_define)
+{
+}
+
+DefineDescription::DefineDescription( const String & i_sName,
+ const str_vector & i_rParams,
+ const str_vector & i_rDefinition )
+ : sName(i_sName),
+ aParams(i_rParams),
+ aDefinition(i_rDefinition),
+ eDefineType(type_macro)
+{
+}
+
+DefineDescription::~DefineDescription()
+{
+}
+
+void
+DefineDescription::GetDefineText( csv::StreamStr & o_rText ) const
+{
+ if ( aDefinition.begin() == aDefinition.end() OR eDefineType != type_define )
+ return;
+
+
+ bool bSwitch_Stringify = false;
+ bool bSwitch_Concatenate = false;
+
+ for ( str_vector::const_iterator it = aDefinition.begin();
+ it != aDefinition.end();
+ ++it )
+ {
+ if ( HandleOperatorsBeforeTextItem( o_rText,
+ bSwitch_Stringify,
+ bSwitch_Concatenate,
+ *it ) )
+ {
+ continue;
+ }
+
+ o_rText << (*it);
+
+ Do_bStringify_end(o_rText, bSwitch_Stringify);
+ o_rText << " ";
+ }
+ o_rText.seekp(-1, csv::cur);
+}
+
+void
+DefineDescription::GetMacroText( csv::StreamStr & o_rText,
+ const StringVector & i_rGivenArguments ) const
+{
+ bool bSwitch_Stringify = false;
+ bool bSwitch_Concatenate = false;
+ intt nActiveParamNr = -1;
+
+ if ( aDefinition.begin() == aDefinition.end() OR eDefineType != type_macro )
+ return;
+
+ for ( str_vector::const_iterator it = aDefinition.begin();
+ it != aDefinition.end();
+ ++it )
+ {
+ if ( HandleOperatorsBeforeTextItem( o_rText,
+ bSwitch_Stringify,
+ bSwitch_Concatenate,
+ *it ) )
+ {
+ continue;
+ }
+
+ for ( str_vector::const_iterator param_it = aParams.begin();
+ param_it != aParams.end() AND nActiveParamNr == -1;
+ ++param_it )
+ {
+ if ( strcmp(*it, *param_it) == 0 )
+ nActiveParamNr = param_it - aParams.begin();
+ }
+ if ( nActiveParamNr == -1 )
+ {
+ o_rText << (*it);
+ }
+ else
+ {
+ o_rText << i_rGivenArguments[nActiveParamNr];
+ nActiveParamNr = -1;
+ }
+
+ Do_bStringify_end(o_rText, bSwitch_Stringify);
+ o_rText << " ";
+ }
+ o_rText.seekp(-1, csv::cur);
+}
+
+
+
+} // end namespace cpp
+
+
+
+
+
+bool
+CheckForOperator( bool & o_bStringify,
+ bool & o_bConcatenate,
+ const String & i_sTextItem )
+{
+ if ( strcmp(i_sTextItem, "##") == 0 )
+ {
+ o_bConcatenate = true;
+ return true;
+ }
+ else if ( strcmp(i_sTextItem, "#") == 0 )
+ {
+ o_bStringify = true;
+ return true;
+ }
+ return false;
+}
+
+void
+Do_bConcatenate( csv::StreamStr & o_rText,
+ bool & io_bConcatenate )
+{
+ if ( io_bConcatenate )
+ {
+ uintt nPos;
+ for ( nPos = o_rText.tellp() - 1;
+ nPos > 0 ? o_rText.c_str()[nPos] == ' ' : false;
+ --nPos ) ;
+ o_rText.seekp(nPos+1);
+ io_bConcatenate = false;
+ }
+}
+
+void
+Do_bStringify_begin( csv::StreamStr & o_rText,
+ bool i_bStringify )
+{
+ if ( i_bStringify )
+ {
+ o_rText << "\"";
+ }
+}
+
+void
+Do_bStringify_end( csv::StreamStr & o_rText,
+ bool & io_bStringify )
+{
+ if ( io_bStringify )
+ {
+ o_rText << "\"";
+ io_bStringify = false;
+ }
+}
+
+
+bool
+HandleOperatorsBeforeTextItem( csv::StreamStr & o_rText,
+ bool & io_bStringify,
+ bool & io_bConcatenate,
+ const String & i_sTextItem )
+{
+ if ( CheckForOperator( io_bStringify,
+ io_bConcatenate,
+ i_sTextItem) )
+ {
+ return true;
+ }
+ Do_bConcatenate(o_rText, io_bConcatenate);
+ Do_bStringify_begin(o_rText, io_bStringify);
+
+ return false;
+}
+
+
+
diff --git a/autodoc/source/parser/cpp/defdescr.hxx b/autodoc/source/parser/cpp/defdescr.hxx
new file mode 100644
index 000000000000..3a0707212f7f
--- /dev/null
+++ b/autodoc/source/parser/cpp/defdescr.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: defdescr.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_DEFDESCR_HXX
+#define ADC_CPP_DEFDESCR_HXX
+
+
+
+
+namespace cpp
+{
+
+/** Describes a C/C++ #define statement. May be a define or a macro, for which
+ two cases the two different constructors are to be used.
+
+ This class is used by cpp::PreProcessor.
+*/
+class DefineDescription
+{
+ public:
+ enum E_DefineType
+ {
+ type_define,
+ type_macro
+ };
+ typedef StringVector str_vector;
+
+ DefineDescription( /// Used for: #define DEFINE xyz
+ const String & i_sName,
+ const str_vector & i_rDefinition );
+ DefineDescription( /// Used for: #define MACRO(...) abc
+ const String & i_sName,
+ const str_vector & i_rParams,
+ const str_vector & i_rDefinition );
+ ~DefineDescription();
+
+ /// Only vaild if (eDefineType == type_define) else returns "".
+ void GetDefineText(
+ csv::StreamStr & o_rText ) const;
+
+ /// Only vaild if (eDefineType == type_macro) else returns "".
+ void GetMacroText(
+ csv::StreamStr & o_rText,
+ const StringVector &
+ i_rGivenArguments ) const;
+
+ uintt ParamCount() const;
+ E_DefineType DefineType() const;
+
+ private:
+ // DATA
+ String sName;
+ str_vector aParams;
+ str_vector aDefinition;
+ E_DefineType eDefineType;
+};
+
+
+
+
+// IMPLEMENTATION
+inline uintt
+DefineDescription::ParamCount() const
+ { return aParams.size(); }
+inline DefineDescription::E_DefineType
+DefineDescription::DefineType() const
+ { return eDefineType; }
+
+
+
+
+} // end namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/fevnthdl.hxx b/autodoc/source/parser/cpp/fevnthdl.hxx
new file mode 100644
index 000000000000..d6bf67c68027
--- /dev/null
+++ b/autodoc/source/parser/cpp/fevnthdl.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fevnthdl.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_FEVNTHDL_HXX
+#define ADC_CPP_FEVNTHDL_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace ary
+{
+namespace loc
+{
+ class File;
+}
+}
+
+
+
+
+namespace cpp
+{
+
+
+/** This is an interface, which accepts the file scope events that may
+ be important for parsing. It is implementation-dependant, where to
+ put or what to do with them.
+*/
+class FileScope_EventHandler
+{
+ public:
+ // LIFECYCLE
+ virtual ~FileScope_EventHandler() {}
+
+ // OPERATIONS
+ void SetCurFile(
+ ary::loc::File & io_rCurFile );
+ void Event_IncrLineCount();
+ void Event_SwBracketOpen();
+ void Event_SwBracketClose();
+ void Event_Semicolon();
+
+ private:
+ virtual void do_SetCurFile(
+ ary::loc::File & io_rCurFile ) = 0;
+ virtual void do_Event_IncrLineCount() = 0;
+ virtual void do_Event_SwBracketOpen() = 0;
+ virtual void do_Event_SwBracketClose() = 0;
+ virtual void do_Event_Semicolon() = 0;
+};
+
+
+// IMPLEMENTATION
+
+inline void
+FileScope_EventHandler::SetCurFile( ary::loc::File & io_rCurFile )
+ { do_SetCurFile(io_rCurFile); }
+inline void
+FileScope_EventHandler::Event_IncrLineCount()
+ { do_Event_IncrLineCount(); }
+inline void
+FileScope_EventHandler::Event_SwBracketOpen()
+ { do_Event_SwBracketOpen(); }
+inline void
+FileScope_EventHandler::Event_SwBracketClose()
+ { do_Event_SwBracketClose(); }
+inline void
+FileScope_EventHandler::Event_Semicolon()
+ { do_Event_Semicolon(); }
+
+
+
+
+} // namespace cpp
+#endif
+
diff --git a/autodoc/source/parser/cpp/icprivow.cxx b/autodoc/source/parser/cpp/icprivow.cxx
new file mode 100644
index 000000000000..c227f53c63f3
--- /dev/null
+++ b/autodoc/source/parser/cpp/icprivow.cxx
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: icprivow.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 <icprivow.hxx>
+
+
+// NOT FULLY DEFINED SERVICES
+#include <ary/cpp/c_namesp.hxx>
+#include <ary/cpp/c_class.hxx>
+
+
+
+namespace cpp
+{
+
+
+
+//****************** Owner_Namespace ********************//
+Owner_Namespace::Owner_Namespace()
+ : pScope(0)
+{
+}
+
+void
+Owner_Namespace::SetAnotherNamespace( ary::cpp::Namespace & io_rScope )
+{
+ pScope = &io_rScope;
+}
+
+bool
+Owner_Namespace::HasClass( const String & i_sLocalName )
+{
+ return pScope->Search_LocalClass(i_sLocalName).IsValid();
+}
+
+void
+Owner_Namespace::do_Add_Class( const String & i_sLocalName,
+ Cid i_nId )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalClass(i_sLocalName, i_nId);
+}
+
+void
+Owner_Namespace::do_Add_Enum( const String & i_sLocalName,
+ Cid i_nId )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalEnum(i_sLocalName, i_nId);
+}
+
+void
+Owner_Namespace::do_Add_Typedef( const String & i_sLocalName,
+ Cid i_nId )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalTypedef(i_sLocalName, i_nId);
+}
+
+void
+Owner_Namespace::do_Add_Operation( const String & i_sLocalName,
+ Cid i_nId,
+ bool )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalOperation(i_sLocalName, i_nId);
+}
+
+void
+Owner_Namespace::do_Add_Variable( const String & i_sLocalName,
+ Cid i_nId,
+ bool i_bIsConst,
+ bool )
+{
+ csv_assert(pScope != 0);
+ if (i_bIsConst)
+ pScope->Add_LocalConstant(i_sLocalName, i_nId);
+ else
+ pScope->Add_LocalVariable(i_sLocalName, i_nId);
+}
+
+
+Cid
+Owner_Namespace::inq_CeId() const
+{
+ csv_assert(pScope != 0);
+ return pScope->CeId();
+}
+
+
+//****************** Owner_Class ********************//
+
+Owner_Class::Owner_Class()
+ : pScope(0)
+{
+}
+
+void
+Owner_Class::SetAnotherClass( ary::cpp::Class & io_rScope )
+{
+ pScope = &io_rScope;
+}
+
+bool
+Owner_Class::HasClass( const String & )
+{
+ return false;
+}
+
+void
+Owner_Class::do_Add_Class( const String & i_sLocalName,
+ Cid i_nId )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalClass(i_sLocalName, i_nId);
+}
+
+void
+Owner_Class::do_Add_Enum( const String & i_sLocalName,
+ Cid i_nId )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalEnum(i_sLocalName, i_nId);
+}
+
+void
+Owner_Class::do_Add_Typedef( const String & i_sLocalName,
+ Cid i_nId )
+{
+ csv_assert(pScope != 0);
+ pScope->Add_LocalTypedef(i_sLocalName, i_nId);
+}
+
+void
+Owner_Class::do_Add_Operation( const String & i_sLocalName,
+ Cid i_nId,
+ bool i_bIsStatic )
+{
+ csv_assert(pScope != 0);
+ if (i_bIsStatic)
+ pScope->Add_LocalStaticOperation(i_sLocalName, i_nId);
+ else
+ pScope->Add_LocalOperation(i_sLocalName, i_nId);
+}
+
+void
+Owner_Class::do_Add_Variable( const String & i_sLocalName,
+ Cid i_nId,
+ bool ,
+ bool i_bIsStatic )
+{
+ csv_assert(pScope != 0);
+ if (i_bIsStatic)
+ pScope->Add_LocalStaticData(i_sLocalName, i_nId);
+ else
+ pScope->Add_LocalData(i_sLocalName, i_nId);
+}
+
+Cid
+Owner_Class::inq_CeId() const
+{
+ csv_assert(pScope != 0);
+ return pScope->CeId();
+}
+
+
+} // namespace cpp
diff --git a/autodoc/source/parser/cpp/icprivow.hxx b/autodoc/source/parser/cpp/icprivow.hxx
new file mode 100644
index 000000000000..9500f72e5963
--- /dev/null
+++ b/autodoc/source/parser/cpp/icprivow.hxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: icprivow.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ARY_CPP_ICPRIVOW_HXX
+#define ARY_CPP_ICPRIVOW_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <ary/cpp/inpcontx.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp
+{
+
+
+
+typedef ary::cpp::Ce_id Cid;
+
+
+class Owner_Namespace : public ary::cpp::InputContext::Owner
+{
+ public:
+ Owner_Namespace();
+ void SetAnotherNamespace(
+ ary::cpp::Namespace &
+ io_rScope );
+ virtual bool HasClass(
+ const String & i_sLocalName );
+ private:
+ virtual void do_Add_Class(
+ const String & i_sLocalName,
+ Cid i_nId );
+ virtual void do_Add_Enum(
+ const String & i_sLocalName,
+ Cid i_nId );
+ virtual void do_Add_Typedef(
+ const String & i_sLocalName,
+ Cid i_nId );
+ virtual void do_Add_Operation(
+ const String & i_sLocalName,
+ Cid i_nId,
+ bool );
+ virtual void do_Add_Variable(
+ const String & i_sLocalName,
+ Cid i_nId,
+ bool i_bIsConst,
+ bool i_bIsStatic );
+ virtual Cid inq_CeId() const;
+
+ // DATA
+ ary::cpp::Namespace *
+ pScope;
+};
+
+class Owner_Class : public ary::cpp::InputContext::Owner
+{
+ public:
+ Owner_Class();
+ void SetAnotherClass(
+ ary::cpp::Class & io_rScope );
+
+ /** @attention Only a dummy for use at ary::cpp::Gate!
+ Will work nerver!
+ */
+ virtual bool HasClass(
+ const String & i_sLocalName );
+ private:
+ virtual void do_Add_Class(
+ const String & i_sLocalName,
+ Cid i_nId );
+ virtual void do_Add_Enum(
+ const String & i_sLocalName,
+ Cid i_nId );
+ virtual void do_Add_Typedef(
+ const String & i_sLocalName,
+ Cid i_nId );
+ virtual void do_Add_Operation(
+ const String & i_sLocalName,
+ Cid i_nId,
+ bool i_bIsStaticMember );
+ virtual void do_Add_Variable(
+ const String & i_sLocalName,
+ Cid i_nId,
+ bool i_bIsConst,
+ bool i_bIsStatic );
+ virtual Cid inq_CeId() const;
+
+ // DATA
+ ary::cpp::Class * pScope;
+};
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/makefile.mk b/autodoc/source/parser/cpp/makefile.mk
new file mode 100644
index 000000000000..454713e8c49d
--- /dev/null
+++ b/autodoc/source/parser/cpp/makefile.mk
@@ -0,0 +1,91 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# 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_cpp
+
+
+# --- Settings -----------------------------------------------------
+
+ENABLE_EXCEPTIONS=true
+PRJINC=$(PRJ)$/source
+
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk
+
+
+
+# --- Files --------------------------------------------------------
+
+
+OBJFILES= \
+ $(OBJ)$/all_toks.obj \
+ $(OBJ)$/c_dealer.obj \
+ $(OBJ)$/c_rcode.obj \
+ $(OBJ)$/cpp_pe.obj \
+ $(OBJ)$/cx_base.obj \
+ $(OBJ)$/cx_c_pp.obj \
+ $(OBJ)$/cx_c_std.obj \
+ $(OBJ)$/cx_c_sub.obj \
+ $(OBJ)$/cxt2ary.obj \
+ $(OBJ)$/defdescr.obj \
+ $(OBJ)$/icprivow.obj \
+ $(OBJ)$/pe_base.obj \
+ $(OBJ)$/pe_class.obj \
+ $(OBJ)$/pe_defs.obj \
+ $(OBJ)$/pe_expr.obj \
+ $(OBJ)$/pe_enum.obj \
+ $(OBJ)$/pe_enval.obj \
+ $(OBJ)$/pe_file.obj \
+ $(OBJ)$/pe_funct.obj \
+ $(OBJ)$/pe_ignor.obj \
+ $(OBJ)$/pe_namsp.obj \
+ $(OBJ)$/pe_param.obj \
+ $(OBJ)$/pe_tpltp.obj \
+ $(OBJ)$/pe_type.obj \
+ $(OBJ)$/pe_tydef.obj \
+ $(OBJ)$/pe_vafu.obj \
+ $(OBJ)$/pe_vari.obj \
+ $(OBJ)$/preproc.obj \
+ $(OBJ)$/prs_cpp.obj \
+ $(OBJ)$/tkp_cpp.obj
+
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_base.cxx b/autodoc/source/parser/cpp/pe_base.cxx
new file mode 100644
index 000000000000..ba4c0c1bf000
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_base.cxx
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_base.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 "pe_base.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_type.hxx>
+#include "pe_type.hxx"
+
+
+
+
+namespace cpp
+{
+
+
+static const PE_Base::Base aNullBase_;
+
+
+PE_Base::PE_Base( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati(new PeStatusArray<PE_Base>)
+ // aBaseIds,
+ // pSpType,
+ // pSpuBaseName
+{
+ Setup_StatusFunctions();
+ aBaseIds.reserve(4);
+
+ pSpType = new SP_Type(*this);
+ pSpuBaseName = new SPU_BaseName(*pSpType, 0, &PE_Base::SpReturn_BaseName);
+}
+
+
+PE_Base::~PE_Base()
+{
+}
+
+void
+PE_Base::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Base::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Base>::F_Tok F_Tok;
+ static F_Tok stateF_startOfNext[] = { &PE_Base::On_startOfNext_Identifier,
+ &PE_Base::On_startOfNext_public,
+ &PE_Base::On_startOfNext_protected,
+ &PE_Base::On_startOfNext_private,
+ &PE_Base::On_startOfNext_virtual,
+ &PE_Base::On_startOfNext_DoubleColon };
+ static INT16 stateT_startOfNext[] = { Tid_Identifier,
+ Tid_public,
+ Tid_protected,
+ Tid_private,
+ Tid_virtual,
+ Tid_DoubleColon };
+ static F_Tok stateF_inName[] = { &PE_Base::On_inName_Identifier,
+ &PE_Base::On_inName_virtual,
+ &PE_Base::On_inName_SwBracket_Left,
+ &PE_Base::On_inName_DoubleColon,
+ &PE_Base::On_inName_Comma };
+ static INT16 stateT_inName[] = { Tid_Identifier,
+ Tid_virtual,
+ Tid_SwBracket_Left,
+ Tid_DoubleColon,
+ Tid_Comma };
+
+ SEMPARSE_CREATE_STATUS(PE_Base, startOfNext, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Base, inName, Hdl_SyntaxError);
+}
+
+void
+PE_Base::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Base::InitData()
+{
+ pStati->SetCur(startOfNext);
+ csv::erase_container(aBaseIds);
+ aBaseIds.push_back(aNullBase_);
+}
+
+void
+PE_Base::TransferData()
+{
+ // Does nothing.
+}
+
+void
+PE_Base::SpReturn_BaseName()
+{
+ CurObject().nId = pSpuBaseName->Child().Result_Type().Id();
+
+ static StreamStr aBaseName(100);
+ aBaseName.seekp(0);
+ pSpuBaseName->Child().Result_Type().Get_Text( aBaseName, Env().AryGate() );
+
+ Env().Event_Class_FinishedBase(aBaseName.c_str());
+}
+
+void
+PE_Base::On_startOfNext_public(const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(inName);
+
+ CurObject().eProtection = ary::cpp::PROTECT_public;
+}
+
+void
+PE_Base::On_startOfNext_protected(const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(inName);
+
+ CurObject().eProtection = ary::cpp::PROTECT_protected;
+}
+
+void
+PE_Base::On_startOfNext_private(const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(inName);
+
+ CurObject().eProtection = ary::cpp::PROTECT_private;
+}
+
+void
+PE_Base::On_startOfNext_virtual(const char *)
+{
+ SetTokenResult(done, stay);
+
+ CurObject().eVirtuality = ary::cpp::VIRTUAL_virtual;
+}
+
+void
+PE_Base::On_startOfNext_Identifier(const char * )
+{
+ pSpuBaseName->Push(not_done);
+}
+
+void
+PE_Base::On_startOfNext_DoubleColon(const char *)
+{
+ pSpuBaseName->Push(not_done);
+}
+
+void
+PE_Base::On_inName_Identifier(const char * )
+{
+ pSpuBaseName->Push(not_done);
+}
+
+void
+PE_Base::On_inName_virtual(const char *)
+{
+ SetTokenResult(done, stay);
+
+ CurObject().eVirtuality = ary::cpp::VIRTUAL_virtual;
+}
+
+void
+PE_Base::On_inName_DoubleColon(const char *)
+{
+ pSpuBaseName->Push(not_done);
+}
+
+void
+PE_Base::On_inName_Comma(const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(startOfNext);
+
+ aBaseIds.push_back( aNullBase_ );
+}
+
+void
+PE_Base::On_inName_SwBracket_Left(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+
+} // namespace cpp
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_base.hxx b/autodoc/source/parser/cpp/pe_base.hxx
new file mode 100644
index 000000000000..c56e40932788
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_base.hxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_base.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_BASE_HXX
+#define ADC_CPP_PE_BASE_HXX
+
+// BASE CLASSES
+#include "cpp_pe.hxx"
+// USED SERVICES
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+#include <ary/cpp/c_types4cpp.hxx>
+#include <ary/cpp/c_slntry.hxx>
+
+
+
+namespace cpp
+{
+
+class PE_Type;
+
+class PE_Base : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ startOfNext,
+ inName,
+ size_of_states
+ };
+
+ typedef ary::cpp::List_Bases BaseList;
+ typedef ary::cpp::S_Classes_Base Base;
+
+ PE_Base(
+ Cpp_PE * i_pParent );
+ ~PE_Base();
+
+ const BaseList & Result_BaseIds() const;
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ private:
+ typedef SubPe< PE_Base, PE_Type > SP_Type;
+ typedef SubPeUse< PE_Base, PE_Type> SPU_BaseName;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void SpReturn_BaseName();
+
+ void On_startOfNext_Identifier(const char *);
+ void On_startOfNext_public(const char *);
+ void On_startOfNext_protected(const char *);
+ void On_startOfNext_private(const char *);
+ void On_startOfNext_virtual(const char *);
+ void On_startOfNext_DoubleColon(const char *);
+
+ void On_inName_Identifier(const char *);
+ void On_inName_virtual(const char *);
+ void On_inName_SwBracket_Left(const char *);
+ void On_inName_DoubleColon(const char *);
+ void On_inName_Comma(const char *);
+
+ Base & CurObject();
+
+ // DATA
+ Dyn< PeStatusArray<PE_Base> >
+ pStati;
+
+ Dyn<SP_Type> pSpType; /// till "{" incl.
+ Dyn<SPU_BaseName> pSpuBaseName;
+
+ BaseList aBaseIds;
+};
+
+
+
+// IMPLEMENTATION
+
+inline const PE_Base::BaseList &
+PE_Base::Result_BaseIds() const
+ { return aBaseIds; }
+
+
+inline PE_Base::Base &
+PE_Base::CurObject()
+ { return aBaseIds.back(); }
+
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/pe_class.cxx b/autodoc/source/parser/cpp/pe_class.cxx
new file mode 100644
index 000000000000..f43f55fc704a
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_class.cxx
@@ -0,0 +1,506 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_class.cxx,v $
+ * $Revision: 1.11 $
+ *
+ * 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 "pe_class.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_class.hxx>
+#include <ary/cpp/c_namesp.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <all_toks.hxx>
+#include "pe_base.hxx"
+#include "pe_defs.hxx"
+#include "pe_enum.hxx"
+#include "pe_tydef.hxx"
+#include "pe_vafu.hxx"
+#include "pe_ignor.hxx"
+
+
+namespace cpp {
+
+// using ary::Cid;
+
+PE_Class::PE_Class(Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Class> ),
+ // pSpBase,
+ // pSpTypedef,
+ // pSpVarFunc,
+ // pSpIgnore,
+ // pSpuBase,
+ // pSpuTypedef,
+ // pSpuVarFunc,
+ // pSpuUsing,
+ // pSpuIgnoreFailure,
+ // sLocalName,
+ eClassKey(ary::cpp::CK_class),
+ pCurObject(0),
+ // aBases,
+ eResult_KindOf(is_declaration)
+{
+ Setup_StatusFunctions();
+
+ pSpBase = new SP_Base(*this);
+ pSpTypedef = new SP_Typedef(*this);
+ pSpVarFunc = new SP_VarFunc(*this);
+ pSpIgnore = new SP_Ignore(*this);
+ pSpDefs = new SP_Defines(*this);
+
+ pSpuBase = new SPU_Base(*pSpBase, 0, &PE_Class::SpReturn_Base);
+ pSpuTypedef = new SPU_Typedef(*pSpTypedef, 0, 0);
+ pSpuVarFunc = new SPU_VarFunc(*pSpVarFunc, 0, 0);
+
+ pSpuTemplate= new SPU_Ignore(*pSpIgnore, 0, 0);
+ pSpuUsing = new SPU_Ignore(*pSpIgnore, 0, 0);
+ pSpuIgnoreFailure
+ = new SPU_Ignore(*pSpIgnore, 0, 0);
+ pSpuDefs = new SPU_Defines(*pSpDefs, 0, 0);
+}
+
+
+PE_Class::~PE_Class()
+{
+}
+
+void
+PE_Class::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+Cpp_PE *
+PE_Class::Handle_ChildFailure()
+{
+ SetCurSPU(pSpuIgnoreFailure.Ptr());
+ return &pSpuIgnoreFailure->Child();
+}
+
+void
+PE_Class::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Class>::F_Tok F_Tok;
+
+ static F_Tok stateF_start[] = { &PE_Class::On_start_class,
+ &PE_Class::On_start_struct,
+ &PE_Class::On_start_union };
+ static INT16 stateT_start[] = { Tid_class,
+ Tid_struct,
+ Tid_union };
+
+ static F_Tok stateF_expectName[] = { &PE_Class::On_expectName_Identifier,
+ &PE_Class::On_expectName_SwBracket_Left,
+ &PE_Class::On_expectName_Colon
+ };
+ static INT16 stateT_expectName[] = { Tid_Identifier,
+ Tid_SwBracket_Left,
+ Tid_Colon
+ };
+
+ static F_Tok stateF_gotName[] = { &PE_Class::On_gotName_SwBracket_Left,
+ &PE_Class::On_gotName_Semicolon,
+ &PE_Class::On_gotName_Colon };
+ static INT16 stateT_gotName[] = { Tid_SwBracket_Left,
+ Tid_Semicolon,
+ Tid_Colon };
+
+ static F_Tok stateF_bodyStd[] = { &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_ClassKey,
+ &PE_Class::On_bodyStd_ClassKey,
+ &PE_Class::On_bodyStd_ClassKey,
+
+ &PE_Class::On_bodyStd_enum,
+ &PE_Class::On_bodyStd_typedef,
+ &PE_Class::On_bodyStd_public,
+ &PE_Class::On_bodyStd_protected,
+ &PE_Class::On_bodyStd_private,
+
+ &PE_Class::On_bodyStd_template,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_friend,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+
+ &PE_Class::On_bodyStd_using,
+ &PE_Class::On_bodyStd_SwBracket_Right,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_DefineName,
+ &PE_Class::On_bodyStd_MacroName,
+
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc,
+ &PE_Class::On_bodyStd_VarFunc, };
+
+ static INT16 stateT_bodyStd[] = { Tid_Identifier,
+ Tid_operator,
+ Tid_class,
+ Tid_struct,
+ Tid_union,
+
+ Tid_enum,
+ Tid_typedef,
+ Tid_public,
+ Tid_protected,
+ Tid_private,
+
+ Tid_template,
+ Tid_virtual,
+ Tid_friend,
+ Tid_Tilde,
+ Tid_const,
+
+ Tid_volatile,
+ Tid_static,
+ Tid_mutable,
+ Tid_inline,
+ Tid_explicit,
+
+ Tid_using,
+ Tid_SwBracket_Right,
+ Tid_DoubleColon,
+ Tid_typename,
+ Tid_DefineName,
+
+ Tid_MacroName,
+ Tid_BuiltInType,
+ Tid_TypeSpecializer };
+
+ static F_Tok stateF_inProtection[] = { &PE_Class::On_inProtection_Colon };
+ static INT16 stateT_inProtection[] = { Tid_Colon };
+
+ static F_Tok stateF_afterDecl[] = { &PE_Class::On_afterDecl_Semicolon };
+ static INT16 stateT_afterDecl[] = { Tid_Semicolon };
+
+ SEMPARSE_CREATE_STATUS(PE_Class, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Class, expectName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Class, gotName, On_gotName_Return2Type);
+ SEMPARSE_CREATE_STATUS(PE_Class, bodyStd, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Class, inProtection, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Class, afterDecl, On_afterDecl_Return2Type);
+
+#if 0
+ static F_Tok stateF_inFriend[] = { On_inFriend_class,
+ On_inFriend_struct,
+ On_inFriend_union };
+ // Default: On_inFriend_Function
+ static INT16 stateT_inFriend[] = { Tid_class,
+ Tid_struct,
+ Tid_union };
+#endif // 0
+}
+
+void
+PE_Class::InitData()
+{
+ pStati->SetCur(start);
+ sLocalName.clear();
+ eClassKey = ary::cpp::CK_class;
+ pCurObject = 0;
+ csv::erase_container(aBases);
+ eResult_KindOf = is_declaration;
+}
+
+void
+PE_Class::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_Class::Hdl_SyntaxError( const char * i_sText)
+{
+ if ( *i_sText == ';' )
+ {
+ Cerr() << Env().CurFileName() << ", line "
+ << Env().LineCount()
+ << ": Sourcecode warning: ';' as a toplevel declaration is deprecated."
+ << Endl();
+ SetTokenResult(done,stay);
+ return;
+ }
+
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Class::Init_CurObject()
+{
+ // KORR_FUTURE
+ // This will have to be done before parsing base classes, because of
+ // possible inline documentation for base classes.
+ pCurObject = & Env().AryGate().Ces().Store_Class( Env().Context(), sLocalName, eClassKey );
+
+ for ( PE_Base::BaseList::const_iterator it = aBases.begin();
+ it != aBases.end();
+ ++it )
+ {
+ pCurObject->Add_BaseClass( *it );
+ } // end for
+
+ Dyn< StringVector >
+ pTplParams( Env().Get_CurTemplateParameters() );
+ if ( pTplParams )
+ {
+ for ( StringVector::const_iterator it = pTplParams->begin();
+ it != pTplParams->end();
+ ++it )
+ {
+ pCurObject->Add_TemplateParameterType( *it, ary::cpp::Type_id(0) );
+ } // end for
+ }
+}
+
+void
+PE_Class::SpReturn_Base()
+{
+ aBases = pSpuBase->Child().Result_BaseIds();
+ pStati->SetCur(gotName);
+}
+
+void
+PE_Class::On_start_class( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expectName);
+ eClassKey = ary::cpp::CK_class;
+}
+
+void
+PE_Class::On_start_struct( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expectName);
+ eClassKey = ary::cpp::CK_struct;
+}
+
+void
+PE_Class::On_start_union( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expectName);
+ eClassKey = ary::cpp::CK_union;
+}
+
+void
+PE_Class::On_expectName_Identifier( const char * i_sText )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(gotName);
+ sLocalName = i_sText;
+}
+
+void
+PE_Class::On_expectName_SwBracket_Left( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(bodyStd);
+
+ sLocalName = "";
+ Init_CurObject();
+ sLocalName = pCurObject->LocalName();
+
+ Env().OpenClass(*pCurObject);
+}
+
+void
+PE_Class::On_expectName_Colon( const char * )
+{
+ pStati->SetCur(gotName);
+ sLocalName = "";
+
+ pSpuBase->Push(done);
+}
+
+void
+PE_Class::On_gotName_SwBracket_Left( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(bodyStd);
+
+ Init_CurObject();
+ if ( sLocalName.empty() )
+ sLocalName = pCurObject->LocalName();
+
+ Env().OpenClass(*pCurObject);
+}
+
+void
+PE_Class::On_gotName_Semicolon( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+
+ eResult_KindOf = is_predeclaration;
+}
+
+void
+PE_Class::On_gotName_Colon( const char * )
+{
+ pSpuBase->Push(done);
+}
+
+void
+PE_Class::On_gotName_Return2Type( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+
+ eResult_KindOf = is_qualified_typename;
+}
+
+void
+PE_Class::On_bodyStd_VarFunc( const char * )
+{
+ pSpuVarFunc->Push(not_done);
+}
+
+void
+PE_Class::On_bodyStd_ClassKey( const char * )
+{
+ pSpuVarFunc->Push(not_done); // This is correct,
+ // classes are parsed via PE_Type.
+}
+
+void
+PE_Class::On_bodyStd_enum( const char * )
+{
+ pSpuVarFunc->Push(not_done); // This is correct,
+ // enums are parsed via PE_Type.
+}
+
+void
+PE_Class::On_bodyStd_typedef( const char * )
+{
+ pSpuTypedef->Push(not_done);
+}
+
+void
+PE_Class::On_bodyStd_public( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(inProtection);
+
+ Env().SetCurProtection(ary::cpp::PROTECT_public);
+}
+
+void
+PE_Class::On_bodyStd_protected( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(inProtection);
+
+ Env().SetCurProtection(ary::cpp::PROTECT_protected);
+}
+
+void
+PE_Class::On_bodyStd_private( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(inProtection);
+
+ Env().SetCurProtection(ary::cpp::PROTECT_private);
+}
+
+void
+PE_Class::On_bodyStd_template( const char * )
+{
+ pSpuTemplate->Push(done);
+}
+
+void
+PE_Class::On_bodyStd_friend( const char * )
+{
+ // KORR_FUTURE
+ pSpuUsing->Push(done);
+}
+
+void
+PE_Class::On_bodyStd_using( const char * )
+{
+ pSpuUsing->Push(done);
+}
+
+void
+PE_Class::On_bodyStd_SwBracket_Right( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterDecl);
+
+ Env().CloseClass();
+}
+
+void
+PE_Class::On_bodyStd_DefineName(const char * )
+{
+ pSpuDefs->Push(not_done);
+}
+
+void
+PE_Class::On_bodyStd_MacroName(const char * )
+{
+ pSpuDefs->Push(not_done);
+}
+
+
+void
+PE_Class::On_inProtection_Colon( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(bodyStd);
+}
+
+void
+PE_Class::On_afterDecl_Semicolon( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+ eResult_KindOf = is_declaration;
+}
+
+void
+PE_Class::On_afterDecl_Return2Type( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+ eResult_KindOf = is_implicit_declaration;
+}
+
+
+} // namespace cpp
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_class.hxx b/autodoc/source/parser/cpp/pe_class.hxx
new file mode 100644
index 000000000000..86b13d5b415a
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_class.hxx
@@ -0,0 +1,259 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_class.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_CLASS_HXX
+#define ADC_CPP_PE_CLASS_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // OTHER
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+#include <ary/cpp/c_types4cpp.hxx>
+#include <ary/cpp/c_slntry.hxx>
+#include "all_toks.hxx"
+
+namespace ary
+{
+namespace cpp
+{
+ class Class;
+}
+}
+
+
+namespace cpp
+{
+
+
+using ary::cpp::E_Protection;
+using ary::cpp::E_Virtuality;
+
+
+class PE_Base;
+class PE_Enum;
+class PE_Typedef;
+class PE_VarFunc;
+class PE_Ignore;
+class PE_Defines;
+
+
+class PE_Class : public cpp::Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start, /// before class, struct or union
+ expectName, /// after class, struct or union
+ gotName, /// after name, before : or {
+ bodyStd, /// after {
+ inProtection, /// after public, protected or private and before ":"
+ afterDecl, /// after ending }
+ size_of_states
+ };
+
+ enum E_KindOfResult
+ {
+ is_declaration, // normal
+ is_implicit_declaration, // like in: class Abc { public int n; } aAbc;
+ is_predeclaration, // like: class Abc;
+ is_qualified_typename // like in: class Abc * fx();
+
+ };
+
+ PE_Class(
+ Cpp_PE * i_pParent );
+ ~PE_Class();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+ virtual Cpp_PE * Handle_ChildFailure();
+
+ E_KindOfResult Result_KindOf() const;
+ const String & Result_LocalName() const;
+ const String & Result_FirstNameSegment() const;
+
+ private:
+ typedef SubPe< PE_Class, PE_Base > SP_Base;
+// typedef SubPe< PE_Class, PE_Enum> SP_Enum;
+ typedef SubPe< PE_Class, PE_Typedef> SP_Typedef;
+ typedef SubPe< PE_Class, PE_VarFunc> SP_VarFunc;
+ typedef SubPe< PE_Class, PE_Ignore > SP_Ignore;
+ typedef SubPe< PE_Class, PE_Defines> SP_Defines;
+
+ typedef SubPeUse< PE_Class, PE_Base> SPU_Base;
+// typedef SubPeUse< PE_Class, PE_Enum> SPU_Enum;
+ typedef SubPeUse< PE_Class, PE_Typedef> SPU_Typedef;
+ typedef SubPeUse< PE_Class, PE_VarFunc> SPU_VarFunc;
+ typedef SubPeUse< PE_Class, PE_Ignore> SPU_Ignore;
+ typedef SubPeUse< PE_Class, PE_Defines> SPU_Defines;
+
+ typedef ary::cpp::List_Bases BaseList;
+ typedef ary::cpp::S_Classes_Base Base;
+ typedef ary::cpp::E_Protection E_Protection;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+ void Init_CurObject();
+
+ void SpReturn_Base();
+
+ void On_start_class( const char * );
+ void On_start_struct( const char * );
+ void On_start_union( const char * );
+
+ void On_expectName_Identifier( const char * );
+ void On_expectName_SwBracket_Left( const char * );
+ void On_expectName_Colon( const char * );
+
+ void On_gotName_SwBracket_Left( const char * );
+ void On_gotName_Semicolon( const char * );
+ void On_gotName_Colon( const char * );
+ void On_gotName_Return2Type( const char * );
+
+ void On_bodyStd_VarFunc( const char * );
+ void On_bodyStd_ClassKey( const char * );
+ void On_bodyStd_enum( const char * );
+ void On_bodyStd_typedef( const char * );
+ void On_bodyStd_public( const char * );
+ void On_bodyStd_protected( const char * );
+ void On_bodyStd_private( const char * );
+ void On_bodyStd_template( const char * );
+ void On_bodyStd_friend( const char * );
+ void On_bodyStd_using( const char * );
+ void On_bodyStd_SwBracket_Right( const char * );
+ void On_bodyStd_DefineName(const char * );
+ void On_bodyStd_MacroName(const char * );
+
+ void On_inProtection_Colon( const char * );
+
+ void On_afterDecl_Semicolon( const char * );
+ void On_afterDecl_Return2Type( const char * );
+
+ // DATA
+ Dyn< PeStatusArray<PE_Class> >
+ pStati;
+
+ Dyn<SP_Base> pSpBase;
+// Dyn<SP_Enum> pSpEnum;
+ Dyn<SP_Typedef> pSpTypedef;
+ Dyn<SP_VarFunc> pSpVarFunc;
+ Dyn<SP_Ignore> pSpIgnore;
+ Dyn<SP_Defines> pSpDefs;
+
+ Dyn<SPU_Base> pSpuBase;
+// Dyn<SPU_Enum> pSpuEnum;
+ Dyn<SPU_Typedef> pSpuTypedef;
+ Dyn<SPU_VarFunc> pSpuVarFunc;
+
+ Dyn<SPU_Ignore> pSpuTemplate;
+ Dyn<SPU_Ignore> pSpuUsing;
+ Dyn<SPU_Ignore> pSpuIgnoreFailure;
+ Dyn<SPU_Defines> pSpuDefs;
+
+
+
+ String sLocalName;
+ ary::cpp::E_ClassKey
+ eClassKey;
+ ary::cpp::Class * pCurObject;
+ BaseList aBases;
+
+ E_KindOfResult eResult_KindOf;
+};
+
+
+
+// IMPLEMENTATION
+
+inline PE_Class::E_KindOfResult
+PE_Class::Result_KindOf() const
+{
+ return eResult_KindOf;
+}
+
+inline const String &
+PE_Class::Result_LocalName() const
+{
+ return sLocalName;
+}
+
+inline const String &
+PE_Class::Result_FirstNameSegment() const
+{
+ return sLocalName;
+}
+
+
+
+
+} // namespace cpp
+
+
+#if 0 // Branches
+
+class struct union
+ -> Class
+ -> Predeclaration
+
+typedef
+ -> Typedef
+
+enum
+ -> Enum
+
+TypeDeclaration
+ -> Function In Class
+ -> Variable
+
+public, protected, private
+ -> Protection declaration
+
+friend
+ -> Friend Class
+ -> Friend Function
+
+virtual
+ -> Function In Class
+
+using
+ -> Using Declaration
+
+
+#endif // 0
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_defs.cxx b/autodoc/source/parser/cpp/pe_defs.cxx
new file mode 100644
index 000000000000..da56265e7730
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_defs.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_defs.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 "pe_defs.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_define.hxx>
+#include <ary/cpp/c_macro.hxx>
+#include <ary/cpp/cp_def.hxx>
+#include "all_toks.hxx"
+
+
+namespace cpp
+{
+
+
+PE_Defines::PE_Defines( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Defines> ),
+ // sName,
+ // aParameters,
+ // sDefinition,
+ bIsMacro(false)
+{
+ Setup_StatusFunctions();
+}
+
+
+PE_Defines::~PE_Defines()
+{
+}
+
+void
+PE_Defines::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Defines::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Defines>::F_Tok F_Tok;
+ static F_Tok stateF_expectName[] = { &PE_Defines::On_expectName_DefineName,
+ &PE_Defines::On_expectName_MacroName
+ };
+ static INT16 stateT_expectName[] = { Tid_DefineName,
+ Tid_MacroName
+ };
+
+ static F_Tok stateF_gotDefineName[] = { &PE_Defines::On_gotDefineName_PreProDefinition };
+ static INT16 stateT_gotDefineName[] = { Tid_PreProDefinition };
+
+ static F_Tok stateF_expectMacroParameters[] =
+ { &PE_Defines::On_expectMacroParameters_MacroParameter,
+ &PE_Defines::On_expectMacroParameters_PreProDefinition
+ };
+ static INT16 stateT_expectMacroParameters[] =
+ { Tid_MacroParameter,
+ Tid_PreProDefinition
+ };
+
+ SEMPARSE_CREATE_STATUS(PE_Defines, expectName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Defines, gotDefineName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Defines, expectMacroParameters, Hdl_SyntaxError);
+}
+
+void
+PE_Defines::InitData()
+{
+ pStati->SetCur(expectName);
+
+ sName.clear();
+ csv::erase_container( aParameters );
+ csv::erase_container( aDefinition );
+ bIsMacro = false;
+}
+
+void
+PE_Defines::TransferData()
+{
+ if (NOT bIsMacro)
+ {
+ if (aDefinition.empty() OR aDefinition.front().empty())
+ return;
+
+ ary::cpp::Define &
+ rNew = Env().AryGate().Defs().Store_Define(
+ Env().Context(), sName, aDefinition );
+ Env().Event_Store_CppDefinition(rNew);
+ }
+ else
+ {
+ ary::cpp::Macro &
+ rNew = Env().AryGate().Defs().Store_Macro(
+ Env().Context(), sName, aParameters, aDefinition );
+ Env().Event_Store_CppDefinition(rNew);
+ }
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_Defines::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Defines::On_expectName_DefineName( const char * i_sText )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(gotDefineName);
+
+ sName = i_sText;
+ bIsMacro = false;
+}
+
+void
+PE_Defines::On_expectName_MacroName( const char * i_sText )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expectMacroParameters);
+
+ sName = i_sText;
+ bIsMacro = true;
+}
+
+void
+PE_Defines::On_gotDefineName_PreProDefinition( const char * i_sText )
+{
+ SetTokenResult(done, pop_success);
+
+ aDefinition.push_back( String (i_sText) );
+}
+
+void
+PE_Defines::On_expectMacroParameters_MacroParameter( const char * i_sText )
+{
+ SetTokenResult(done, stay);
+ aParameters.push_back( String (i_sText) );
+}
+
+void
+PE_Defines::On_expectMacroParameters_PreProDefinition( const char * i_sText )
+{
+ SetTokenResult(done, pop_success);
+
+ aDefinition.push_back( String (i_sText) );
+}
+
+
+} // namespace cpp
+
diff --git a/autodoc/source/parser/cpp/pe_defs.hxx b/autodoc/source/parser/cpp/pe_defs.hxx
new file mode 100644
index 000000000000..6341701a5ebc
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_defs.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_defs.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_DEFS_HXX
+#define ADC_CPP_PE_DEFS_HXX
+
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+
+
+namespace cpp
+{
+
+
+
+class PE_Defines : public cpp::Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ expectName,
+ gotDefineName,
+ expectMacroParameters,
+ size_of_states
+ };
+
+ PE_Defines(
+ Cpp_PE * i_pParent );
+ ~PE_Defines();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ private:
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void On_expectName_DefineName( const char * );
+ void On_expectName_MacroName( const char * );
+
+ void On_gotDefineName_PreProDefinition( const char * );
+
+ void On_expectMacroParameters_MacroParameter( const char * );
+ void On_expectMacroParameters_PreProDefinition( const char * );
+
+ // DATA
+ Dyn< PeStatusArray<PE_Defines> >
+ pStati;
+
+ String sName;
+ StringVector aParameters;
+ StringVector aDefinition;
+ bool bIsMacro;
+};
+
+
+
+} //namespace cpp
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_enum.cxx b/autodoc/source/parser/cpp/pe_enum.cxx
new file mode 100644
index 000000000000..79aba8aef878
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_enum.cxx
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_enum.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "pe_enum.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_enum.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <all_toks.hxx>
+#include "pe_enval.hxx"
+
+
+namespace cpp {
+
+
+PE_Enum::PE_Enum(Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Enum> ),
+ // pSpValue,
+ // pSpuValue,
+ // sLocalName,
+ pCurObject(0),
+ eResult_KindOf(is_declaration)
+{
+ Setup_StatusFunctions();
+
+ pSpValue = new SP_EnumValue(*this);
+ pSpuValue = new SPU_EnumValue(*pSpValue, 0, 0);
+}
+
+
+PE_Enum::~PE_Enum()
+{
+}
+
+void
+PE_Enum::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Enum::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Enum>::F_Tok F_Tok;
+ static F_Tok stateF_expectName[] = { &PE_Enum::On_expectName_Identifier,
+ &PE_Enum::On_expectName_SwBracket_Left
+ };
+ static INT16 stateT_expectName[] = { Tid_Identifier,
+ Tid_SwBracket_Left
+ };
+
+ static F_Tok stateF_gotName[] = { &PE_Enum::On_gotName_SwBracket_Left };
+ static INT16 stateT_gotName[] = { Tid_SwBracket_Left };
+
+ static F_Tok stateF_bodyStd[] = { &PE_Enum::On_bodyStd_Identifier,
+ &PE_Enum::On_bodyStd_SwBracket_Right };
+ static INT16 stateT_bodyStd[] = { Tid_Identifier,
+ Tid_SwBracket_Right };
+
+ static F_Tok stateF_afterBlock[] = { &PE_Enum::On_afterBlock_Semicolon };
+ static INT16 stateT_afterBlock[] = { Tid_Semicolon };
+
+ SEMPARSE_CREATE_STATUS(PE_Enum, expectName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Enum, gotName, On_gotName_Return2Type);
+ SEMPARSE_CREATE_STATUS(PE_Enum, bodyStd, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Enum, afterBlock, On_afterBlock_Return2Type);
+}
+
+void
+PE_Enum::InitData()
+{
+ pStati->SetCur(expectName);
+ pCurObject = 0;
+ sLocalName.clear();
+ eResult_KindOf = is_declaration;
+}
+
+void
+PE_Enum::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_Enum::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Enum::On_expectName_Identifier( const char * i_sText )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(gotName);
+
+ sLocalName = i_sText;
+ pCurObject = & Env().AryGate().Ces().Store_Enum( Env().Context(), sLocalName );
+}
+
+void
+PE_Enum::On_expectName_SwBracket_Left( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(bodyStd);
+
+ sLocalName = "";
+ pCurObject = & Env().AryGate().Ces().Store_Enum( Env().Context(), sLocalName );
+ sLocalName = pCurObject->LocalName();
+
+ Env().OpenEnum(*pCurObject);
+}
+
+void
+PE_Enum::On_gotName_SwBracket_Left( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(bodyStd);
+ Env().OpenEnum(*pCurObject);
+}
+
+void
+PE_Enum::On_gotName_Return2Type( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+
+ eResult_KindOf = is_qualified_typename;
+}
+
+void
+PE_Enum::On_bodyStd_Identifier( const char * )
+{
+ pSpuValue->Push(not_done);
+}
+
+void
+PE_Enum::On_bodyStd_SwBracket_Right( const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterBlock);
+
+ Env().CloseEnum();
+}
+
+void
+PE_Enum::On_afterBlock_Semicolon( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+ eResult_KindOf = is_declaration;
+}
+
+void
+PE_Enum::On_afterBlock_Return2Type( const char * )
+{
+ SetTokenResult(not_done, pop_success);
+ eResult_KindOf = is_implicit_declaration;
+}
+
+} // namespace cpp
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_enum.hxx b/autodoc/source/parser/cpp/pe_enum.hxx
new file mode 100644
index 000000000000..75adfe269573
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_enum.hxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_enum.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_ENUM_HXX
+#define ADC_CPP_PE_ENUM_HXX
+
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+// #include "all_toks.hxx"
+
+
+namespace cpp {
+
+
+class PE_EnumValue;
+
+class PE_Enum : public cpp::Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ expectName, /// after "enum"
+ gotName, /// after name, before : or {
+ bodyStd, /// after {
+ afterBlock, /// after ending }
+ size_of_states
+ };
+
+ enum E_KindOfResult
+ {
+ is_declaration, // normal
+ is_implicit_declaration, // like in: enum Abc { rot, gelb, blau } aAbc;
+ is_qualified_typename // like in: enum Abc * fx();
+
+ };
+ PE_Enum(
+ Cpp_PE * i_pParent );
+ ~PE_Enum();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ E_KindOfResult Result_KindOf() const;
+ const String & Result_LocalName() const;
+ const String & Result_FirstNameSegment() const;
+
+ private:
+ typedef SubPe< PE_Enum, PE_EnumValue > SP_EnumValue;
+ typedef SubPeUse< PE_Enum, PE_EnumValue> SPU_EnumValue;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void On_expectName_Identifier( const char * );
+ void On_expectName_SwBracket_Left( const char * );
+
+ void On_gotName_SwBracket_Left( const char * );
+ void On_gotName_Return2Type( const char * );
+
+ void On_bodyStd_Identifier( const char * );
+ void On_bodyStd_SwBracket_Right( const char * );
+
+ void On_afterBlock_Semicolon( const char * );
+ void On_afterBlock_Return2Type( const char * );
+
+ // DATA
+ Dyn< PeStatusArray<PE_Enum> >
+ pStati;
+ Dyn<SP_EnumValue> pSpValue;
+ Dyn<SPU_EnumValue> pSpuValue;
+
+ String sLocalName;
+ ary::cpp::Enum * pCurObject;
+
+ E_KindOfResult eResult_KindOf;
+};
+
+
+
+// IMPLEMENTATION
+inline PE_Enum::E_KindOfResult
+PE_Enum::Result_KindOf() const
+{
+ return eResult_KindOf;
+}
+
+inline const String &
+PE_Enum::Result_LocalName() const
+{
+ return sLocalName;
+}
+
+inline const String &
+PE_Enum::Result_FirstNameSegment() const
+{
+ return sLocalName;
+}
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_enval.cxx b/autodoc/source/parser/cpp/pe_enval.cxx
new file mode 100644
index 000000000000..b29f740c08a2
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_enval.cxx
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_enval.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 "pe_enval.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include "pe_expr.hxx"
+
+
+
+namespace cpp {
+
+
+PE_EnumValue::PE_EnumValue( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_EnumValue> )
+ // pSpExpression,
+ // pSpuInitExpression
+{
+ Setup_StatusFunctions();
+
+ pSpExpression = new SP_Expression(*this);
+ pSpuInitExpression = new SPU_Expression(*pSpExpression, 0, &PE_EnumValue::SpReturn_InitExpression);
+}
+
+PE_EnumValue::~PE_EnumValue()
+{
+}
+
+void
+PE_EnumValue::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_EnumValue::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_EnumValue>::F_Tok F_Tok;
+
+ static F_Tok stateF_start[] = { &PE_EnumValue::On_start_Identifier };
+ static INT16 stateT_start[] = { Tid_Identifier };
+
+ static F_Tok stateF_afterName[] = { &PE_EnumValue::On_afterName_SwBracket_Right,
+ &PE_EnumValue::On_afterName_Comma,
+ &PE_EnumValue::On_afterName_Assign };
+ static INT16 stateT_afterName[] = { Tid_SwBracket_Right,
+ Tid_Comma,
+ Tid_Assign };
+
+ static F_Tok stateF_expectFinish[] = { &PE_EnumValue::On_expectFinish_SwBracket_Right,
+ &PE_EnumValue::On_expectFinish_Comma };
+ static INT16 stateT_expectFinish[] = { Tid_SwBracket_Right,
+ Tid_Comma };
+
+ SEMPARSE_CREATE_STATUS(PE_EnumValue, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_EnumValue, afterName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_EnumValue, expectFinish, Hdl_SyntaxError);
+}
+
+void
+PE_EnumValue::InitData()
+{
+ pStati->SetCur(start);
+
+ sName.clear();
+ sInitExpression.clear();
+}
+
+void
+PE_EnumValue::TransferData()
+{
+ pStati->SetCur(size_of_states);
+
+ ary::cpp::EnumValue &
+ rEnVal = Env().AryGate().Ces().Store_EnumValue(
+ Env().Context(), sName, sInitExpression );
+ Env().Event_Store_EnumValue(rEnVal);
+}
+
+void
+PE_EnumValue::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_EnumValue::SpReturn_InitExpression()
+{
+ pStati->SetCur(expectFinish);
+
+ sInitExpression = pSpuInitExpression->Child().Result_Text();
+}
+
+void
+PE_EnumValue::On_start_Identifier(const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterName);
+
+ sName = i_sText;
+}
+
+void
+PE_EnumValue::On_afterName_SwBracket_Right(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_EnumValue::On_afterName_Comma(const char * )
+{
+ SetTokenResult(done, pop_success);
+}
+
+void
+PE_EnumValue::On_afterName_Assign(const char * )
+{
+ pSpuInitExpression->Push(done);
+}
+
+void
+PE_EnumValue::On_expectFinish_SwBracket_Right(const char * )
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_EnumValue::On_expectFinish_Comma(const char * )
+{
+ SetTokenResult(done, pop_success);
+}
+
+
+} // namespace cpp
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_enval.hxx b/autodoc/source/parser/cpp/pe_enval.hxx
new file mode 100644
index 000000000000..a66ae2dc8613
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_enval.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_enval.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_ENVAL_HXX
+#define ADC_CPP_PE_ENVAL_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+
+
+namespace cpp {
+
+class PE_Expression;
+
+
+class PE_EnumValue : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start, // before name
+ afterName,
+ expectFinish, // after init-expression
+ size_of_states
+ };
+ PE_EnumValue(
+ Cpp_PE * i_pParent );
+ ~PE_EnumValue();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ private:
+ typedef SubPe< PE_EnumValue, PE_Expression > SP_Expression;
+ typedef SubPeUse< PE_EnumValue, PE_Expression> SPU_Expression;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError(const char *);
+
+ void SpReturn_InitExpression();
+
+ void On_start_Identifier(const char * );
+
+ void On_afterName_SwBracket_Right(const char * );
+ void On_afterName_Comma(const char * );
+ void On_afterName_Assign(const char * );
+
+ void On_expectFinish_SwBracket_Right(const char * );
+ void On_expectFinish_Comma(const char * );
+
+ // DATA
+ Dyn< PeStatusArray<PE_EnumValue> >
+ pStati;
+ Dyn<SP_Expression> pSpExpression;
+ Dyn<SPU_Expression> pSpuInitExpression;
+
+ String sName;
+ String sInitExpression;
+};
+
+
+
+
+} // namespace cpp
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_expr.cxx b/autodoc/source/parser/cpp/pe_expr.cxx
new file mode 100644
index 000000000000..d79551dd61e2
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_expr.cxx
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_expr.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 "pe_expr.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+
+
+namespace cpp {
+
+
+
+PE_Expression::PE_Expression( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Expression> ),
+ aResult_Text(100),
+ nBracketCounter(0)
+{
+ Setup_StatusFunctions();
+}
+
+
+PE_Expression::~PE_Expression()
+{
+}
+
+void
+PE_Expression::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+
+#if 0
+ switch (i_rTok.TypeId())
+ {
+ case Tid_SwBracket_Left: SetTokenResult(done, stay);
+ nBracketCounter++;
+ bBlockOpened = true;
+ break;
+ case Tid_SwBracket_Right: SetTokenResult(done, stay);
+ nBracketCounter--;
+ break;
+ case Tid_Semicolon: if (nBracketCounter == 0)
+ SetTokenResult(done, pop_success);
+ else
+ SetTokenResult(done, stay);
+ break;
+ default:
+ if ( bBlockOpened AND nBracketCounter == 0 )
+ {
+ SetTokenResult(not_done, pop_success);
+ }
+ else
+ {
+ SetTokenResult(done, stay);
+ }
+ } // end switch
+#endif // 0
+}
+
+void
+PE_Expression::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Expression>::F_Tok F_Tok;
+
+ static F_Tok stateF_std[] = { &PE_Expression::On_std_SwBracket_Left,
+ &PE_Expression::On_std_SwBracket_Right,
+ &PE_Expression::On_std_ArrayBracket_Left,
+ &PE_Expression::On_std_ArrayBracket_Right,
+ &PE_Expression::On_std_Bracket_Left,
+ &PE_Expression::On_std_Bracket_Right,
+ &PE_Expression::On_std_Semicolon,
+ &PE_Expression::On_std_Comma };
+ static INT16 stateT_std[] = { Tid_SwBracket_Left,
+ Tid_SwBracket_Right,
+ Tid_ArrayBracket_Left,
+ Tid_ArrayBracket_Right,
+ Tid_Bracket_Left,
+ Tid_Bracket_Right,
+ Tid_Semicolon,
+ Tid_Comma };
+
+ SEMPARSE_CREATE_STATUS(PE_Expression, std, On_std_Default);
+}
+
+void
+PE_Expression::InitData()
+{
+ pStati->SetCur(std);
+ aResult_Text.seekp(0);
+ nBracketCounter = 0;
+}
+
+void
+PE_Expression::TransferData()
+{
+ pStati->SetCur(size_of_states);
+ if ( aResult_Text.tellp() > 0)
+ aResult_Text.pop_back(1);
+}
+
+void
+PE_Expression::On_std_Default( const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ aResult_Text << i_sText << " ";
+}
+
+void
+PE_Expression::On_std_SwBracket_Left( const char *)
+{
+ SetTokenResult(done, stay);
+ nBracketCounter++;
+}
+
+void
+PE_Expression::On_std_SwBracket_Right( const char *)
+{
+ nBracketCounter--;
+ if ( nBracketCounter >= 0 )
+ SetTokenResult(done, stay);
+ else
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Expression::On_std_ArrayBracket_Left( const char *)
+{
+ SetTokenResult(done, stay);
+ nBracketCounter++;
+}
+
+void
+PE_Expression::On_std_ArrayBracket_Right( const char *)
+{
+ nBracketCounter--;
+ if ( nBracketCounter >= 0 )
+ SetTokenResult(done, stay);
+ else
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Expression::On_std_Bracket_Left( const char *)
+{
+ SetTokenResult(done, stay);
+ nBracketCounter++;
+}
+
+void
+PE_Expression::On_std_Bracket_Right( const char *)
+{
+ nBracketCounter--;
+ if ( nBracketCounter >= 0 )
+ SetTokenResult(done, stay);
+ else
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Expression::On_std_Semicolon( const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Expression::On_std_Comma( const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+
+} // namespace cpp
+
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_expr.hxx b/autodoc/source/parser/cpp/pe_expr.hxx
new file mode 100644
index 000000000000..54bf7bc4f106
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_expr.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_expr.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_EXPR_HXX
+#define ADC_CPP_PE_EXPR_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+
+
+namespace cpp {
+
+
+class PE_Expression : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ std,
+ size_of_states
+ };
+ PE_Expression(
+ Cpp_PE * i_pParent );
+ ~PE_Expression();
+
+ const char * Result_Text() const;
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ private:
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void On_std_Default( const char *);
+
+ void On_std_SwBracket_Left( const char *);
+ void On_std_SwBracket_Right( const char *);
+ void On_std_ArrayBracket_Left( const char *);
+ void On_std_ArrayBracket_Right( const char *);
+ void On_std_Bracket_Left( const char *);
+ void On_std_Bracket_Right( const char *);
+ void On_std_Semicolon( const char *);
+ void On_std_Comma( const char *);
+
+ // DATA
+ Dyn< PeStatusArray<PE_Expression> >
+ pStati;
+
+ csv::StreamStr aResult_Text;
+
+ intt nBracketCounter;
+};
+
+
+
+// IMPLEMENTATION
+
+inline const char *
+PE_Expression::Result_Text() const
+{
+ return aResult_Text.c_str();
+}
+
+
+} // namespace cpp
+
+
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/cpp/pe_file.cxx b/autodoc/source/parser/cpp/pe_file.cxx
new file mode 100644
index 000000000000..af2924d8adeb
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_file.cxx
@@ -0,0 +1,320 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_file.cxx,v $
+ * $Revision: 1.12 $
+ *
+ * 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 "pe_file.hxx"
+
+// NOT FULLY DECLARED SERVICES
+#include "pe_defs.hxx"
+#include "pe_enum.hxx"
+#include "pe_namsp.hxx"
+#include "pe_tpltp.hxx"
+#include "pe_tydef.hxx"
+#include "pe_vafu.hxx"
+#include "pe_ignor.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+
+
+namespace cpp
+{
+
+PE_File::PE_File( cpp::PeEnvironment & io_rEnv)
+ : Cpp_PE(io_rEnv),
+ pEnv(&io_rEnv),
+ pStati( new PeStatusArray<PE_File> ),
+ // pSpNamespace,
+ // pSpTypedef,
+ // pSpVarFunc,
+ // pSpIgnore,
+ // pSpuNamespace,
+ // pSpuClass,
+ // pSpuTypedef,
+ // pSpuVarFunc,
+ // pSpuTemplate,
+ // pSpuUsing,
+ // pSpuIgnoreFailure,
+ bWithinSingleExternC(false)
+{
+ Setup_StatusFunctions();
+
+ pSpNamespace = new SP_Namespace(*this);
+ pSpTypedef = new SP_Typedef(*this);
+ pSpVarFunc = new SP_VarFunc(*this);
+ pSpTemplate = new SP_Template(*this);
+ pSpDefs = new SP_Defines(*this);
+ pSpIgnore = new SP_Ignore(*this);
+
+ pSpuNamespace = new SPU_Namespace(*pSpNamespace, 0, 0);
+ pSpuTypedef = new SPU_Typedef(*pSpTypedef, 0, 0);
+ pSpuVarFunc = new SPU_VarFunc(*pSpVarFunc, 0, &PE_File::SpReturn_VarFunc);
+ pSpuTemplate = new SPU_Template(*pSpTemplate, 0, &PE_File::SpReturn_Template);
+ pSpuDefs = new SPU_Defines(*pSpDefs, 0, 0);
+ pSpuUsing = new SPU_Ignore(*pSpIgnore, 0, 0);
+ pSpuIgnoreFailure
+ = new SPU_Ignore(*pSpIgnore, 0, 0);
+}
+
+PE_File::~PE_File()
+{
+}
+
+void
+PE_File::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+Cpp_PE *
+PE_File::Handle_ChildFailure()
+{
+ SetCurSPU(pSpuIgnoreFailure.Ptr());
+ return &pSpuIgnoreFailure->Child();
+}
+
+void
+PE_File::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_File>::F_Tok F_Tok;
+ static F_Tok stateF_std[] = { &PE_File::On_std_VarFunc,
+ &PE_File::On_std_ClassKey,
+ &PE_File::On_std_ClassKey,
+ &PE_File::On_std_ClassKey,
+ &PE_File::On_std_enum,
+
+ &PE_File::On_std_typedef,
+ &PE_File::On_std_template,
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_extern,
+
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_namespace,
+ &PE_File::On_std_using,
+
+ &PE_File::On_std_SwBracketRight,
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_DefineName,
+ &PE_File::On_std_MacroName,
+
+ &PE_File::On_std_VarFunc,
+ &PE_File::On_std_VarFunc };
+
+ static INT16 stateT_std[] = { Tid_Identifier,
+ Tid_class,
+ Tid_struct,
+ Tid_union,
+ Tid_enum,
+
+ Tid_typedef,
+ Tid_template,
+ Tid_const,
+ Tid_volatile,
+ Tid_extern,
+
+ Tid_static,
+ Tid_register,
+ Tid_inline,
+ Tid_namespace,
+ Tid_using,
+
+ Tid_SwBracket_Right,
+ Tid_DoubleColon,
+ Tid_typename,
+ Tid_DefineName,
+ Tid_MacroName,
+
+ Tid_BuiltInType,
+ Tid_TypeSpecializer };
+
+ static F_Tok stateF_in_extern[] = { &PE_File::On_in_extern_Constant };
+ static INT16 stateT_in_extern[] = { Tid_Constant };
+
+ static F_Tok stateF_in_externC[] = { &PE_File::On_in_externC_SwBracket_Left };
+ static INT16 stateT_in_externC[] = { Tid_SwBracket_Left };
+
+
+ SEMPARSE_CREATE_STATUS(PE_File, std, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_File, in_extern, On_in_extern_Ignore);
+ SEMPARSE_CREATE_STATUS(PE_File, in_externC, On_in_externC_NoBlock);
+}
+
+void
+PE_File::InitData()
+{
+ pStati->SetCur(std);
+}
+
+void
+PE_File::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_File::Hdl_SyntaxError( const char * i_sText)
+{
+ if ( *i_sText == ';' )
+ {
+ Cerr() << Env().CurFileName() << ", line "
+ << Env().LineCount()
+ << ": Sourcecode warning: ';' as a toplevel declaration is deprecated."
+ << Endl();
+ SetTokenResult(done,stay);
+ return;
+ }
+
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_File::SpReturn_VarFunc()
+{
+ if (bWithinSingleExternC)
+ {
+ access_Env().CloseBlock();
+ bWithinSingleExternC = false;
+ }
+}
+
+void
+PE_File::SpReturn_Template()
+{
+ access_Env().OpenTemplate( pSpuTemplate->Child().Result_Parameters() );
+}
+
+void
+PE_File::On_std_namespace(const char * )
+{
+ pSpuNamespace->Push(done);
+}
+
+void
+PE_File::On_std_ClassKey(const char * )
+{
+ pSpuVarFunc->Push(not_done); // This is correct,
+ // classes are parsed via PE_Type.
+}
+
+void
+PE_File::On_std_typedef(const char * )
+{
+ pSpuTypedef->Push(not_done);
+}
+
+void
+PE_File::On_std_enum(const char * )
+{
+ pSpuVarFunc->Push(not_done); // This is correct,
+ // enums are parsed via PE_Type.
+}
+
+void
+PE_File::On_std_VarFunc(const char * )
+{
+ pSpuVarFunc->Push(not_done);
+}
+
+void
+PE_File::On_std_template(const char * )
+{
+ pSpuTemplate->Push(done);
+}
+
+void
+PE_File::On_std_extern(const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(in_extern);
+}
+
+void
+PE_File::On_std_using(const char * )
+{
+ pSpuUsing->Push(done);
+}
+
+void
+PE_File::On_std_SwBracketRight(const char * )
+{
+ SetTokenResult(done,stay);
+ access_Env().CloseBlock();
+}
+
+void
+PE_File::On_std_DefineName(const char * )
+{
+ pSpuDefs->Push(not_done);
+}
+
+void
+PE_File::On_std_MacroName(const char * )
+{
+ pSpuDefs->Push(not_done);
+}
+
+void
+PE_File::On_in_extern_Constant(const char * )
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(in_externC);
+
+ access_Env().OpenExternC();
+}
+
+void
+PE_File::On_in_extern_Ignore(const char * )
+{
+ SetTokenResult(not_done, stay);
+ pStati->SetCur(std);
+}
+
+void
+PE_File::On_in_externC_SwBracket_Left(const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(std);
+}
+
+void
+PE_File::On_in_externC_NoBlock(const char * )
+{
+ SetTokenResult(not_done, stay);
+ pStati->SetCur(std);
+
+ bWithinSingleExternC = true;
+}
+
+
+} // namespace cpp
diff --git a/autodoc/source/parser/cpp/pe_file.hxx b/autodoc/source/parser/cpp/pe_file.hxx
new file mode 100644
index 000000000000..b24c2ee292cf
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_file.hxx
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_file.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_FILE_HXX
+#define ADC_CPP_PE_FILE_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+
+
+namespace cpp {
+
+ class PeEnvironment;
+
+ class PE_Namespace;
+ class PE_Enum;
+ class PE_Typedef;
+ class PE_VarFunc;
+ class PE_TemplateTop;
+ class PE_Defines;
+ class PE_Ignore;
+
+#if 0
+class PE_Template;
+class PE_Extern;
+#endif
+
+
+class PE_File : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ std, /// before class, struct or union
+ in_extern,
+ in_externC,
+ size_of_states
+ };
+
+ PE_File(
+ PeEnvironment & io_rEnv );
+ ~PE_File();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+ virtual Cpp_PE * Handle_ChildFailure();
+
+ private:
+ typedef SubPe< PE_File, PE_Namespace> SP_Namespace;
+ typedef SubPe< PE_File, PE_Typedef> SP_Typedef;
+ typedef SubPe< PE_File, PE_VarFunc> SP_VarFunc;
+ typedef SubPe< PE_File, PE_TemplateTop> SP_Template;
+ typedef SubPe< PE_File, PE_Defines> SP_Defines;
+ typedef SubPe< PE_File, PE_Ignore > SP_Ignore;
+#if 0
+ typedef SubPe< PE_File, PE_Using> SP_Using;
+#endif // 0
+
+ typedef SubPeUse< PE_File, PE_Namespace> SPU_Namespace;
+ typedef SubPeUse< PE_File, PE_Typedef> SPU_Typedef;
+ typedef SubPeUse< PE_File, PE_VarFunc> SPU_VarFunc;
+ typedef SubPeUse< PE_File, PE_TemplateTop> SPU_Template;
+ typedef SubPeUse< PE_File, PE_Defines> SPU_Defines;
+ typedef SubPeUse< PE_File, PE_Ignore> SPU_Ignore;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void SpReturn_VarFunc();
+ void SpReturn_Template();
+
+ void On_std_namespace(const char * i_sText);
+ void On_std_ClassKey(const char * i_sText);
+ void On_std_typedef(const char * i_sText);
+ void On_std_enum(const char * i_sText);
+ void On_std_VarFunc(const char * i_sText);
+ void On_std_template(const char * i_sText);
+ void On_std_extern(const char * i_sText);
+ void On_std_using(const char * i_sText);
+ void On_std_SwBracketRight(const char * i_sText);
+
+ void On_std_DefineName(const char * i_sText);
+ void On_std_MacroName(const char * i_sText);
+
+ void On_in_extern_Constant(const char * i_sText);
+ void On_in_extern_Ignore(const char * i_sText);
+ void On_in_externC_SwBracket_Left(const char * i_sText);
+ void On_in_externC_NoBlock(const char * i_sText);
+
+ PeEnvironment & access_Env() { return *pEnv; }
+
+
+ // DATA
+ PeEnvironment * pEnv;
+
+ Dyn< PeStatusArray<PE_File> >
+ pStati;
+
+ Dyn<SP_Namespace> pSpNamespace;
+ Dyn<SP_Typedef> pSpTypedef;
+ Dyn<SP_VarFunc> pSpVarFunc;
+ Dyn<SP_Template> pSpTemplate;
+ Dyn<SP_Defines> pSpDefs;
+
+ Dyn<SP_Ignore> pSpIgnore;
+#if 0
+ SP_Using aSpUsing;
+#endif // 0
+
+ Dyn<SPU_Namespace> pSpuNamespace;
+ Dyn<SPU_Typedef> pSpuTypedef;
+ Dyn<SPU_VarFunc> pSpuVarFunc;
+ Dyn<SPU_Template> pSpuTemplate;
+ Dyn<SPU_Defines> pSpuDefs;
+
+ Dyn<SPU_Ignore> pSpuUsing;
+ Dyn<SPU_Ignore> pSpuIgnoreFailure;
+
+ bool bWithinSingleExternC; /** After 'extern "C"' without following '{',
+ waiting for the next function or variable to
+ set back to false.
+ */
+};
+
+} // namespace cpp
+
+
+
+#if 0 // Branches
+
+namespace
+ -> Named Namespace declaration
+ -> Unnamed Namespace declaration
+ -> Namespace alias definition
+
+class struct union
+ -> Class
+ -> Predeclaration
+
+typedef
+ -> Typedef
+
+enum
+ -> Enum
+
+extern
+ -> Extern-"C"
+ -> TypeDeclaration
+
+TypeDeclaration
+ -> FunctionDecl
+ -> FunctionDef
+ -> Variable
+
+template
+ -> TemplateClass
+ -> TemplateFunction
+ -> TemplateFunction/Method-Implementation
+ -> TemplatePredeclaration
+
+}
+ -> End of Namespace
+ -> End of Extern-"C"
+
+asm
+ -> AssemblerDeclaration
+
+using
+ -> Using-Declaration
+ -> Using-Directive
+
+#endif // 0
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_funct.cxx b/autodoc/source/parser/cpp/pe_funct.cxx
new file mode 100644
index 000000000000..d3fd7509f767
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_funct.cxx
@@ -0,0 +1,613 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_funct.cxx,v $
+ * $Revision: 1.13 $
+ *
+ * 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 "pe_funct.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_funct.hxx>
+#include <ary/cpp/c_type.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <ary/cpp/cp_type.hxx>
+#include <ary/cpp/inpcontx.hxx>
+#include "pe_type.hxx"
+#include "pe_param.hxx"
+
+
+
+
+namespace cpp
+{
+
+
+inline void
+PE_Function::PerformFinishingPunctuation()
+{
+ SetTokenResult(not_done,pop_success);
+}
+
+
+PE_Function::PE_Function( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Function> ),
+ // pSpParameter,
+ // pSpuParameter,
+ // pSpType,
+ // pSpuException,
+ // pSpuCastOperatorType,
+ nResult(0),
+ bResult_WithImplementation(false),
+ aName(60),
+ eVirtuality(ary::cpp::VIRTUAL_none),
+ eConVol(ary::cpp::CONVOL_none),
+ // aFlags,
+ nReturnType(0),
+ // aParameters
+ // aExceptions,
+ bThrow(false),
+ nBracketCounterInImplementation(0)
+{
+ Setup_StatusFunctions();
+
+ pSpParameter = new SP_Parameter(*this);
+ pSpType = new SP_Type(*this);
+
+ pSpuParameter = new SPU_Parameter(*pSpParameter, 0, &PE_Function::SpReturn_Parameter);
+ pSpuException = new SPU_Type(*pSpType, 0, &PE_Function::SpReturn_Exception);
+ pSpuCastOperatorType = new SPU_Type(*pSpType, &PE_Function::SpInit_CastOperatorType, &PE_Function::SpReturn_CastOperatorType);
+}
+
+PE_Function::~PE_Function()
+{
+
+}
+
+void
+PE_Function::Init_Std( const String & i_sName,
+ ary::cpp::Type_id i_nReturnType,
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags i_aFlags )
+{
+ aName << i_sName;
+ eVirtuality = i_bVirtual ? ary::cpp::VIRTUAL_virtual : ary::cpp::VIRTUAL_none;
+ aFlags = i_aFlags;
+ nReturnType = i_nReturnType;
+ pStati->SetCur(afterName);
+}
+
+void
+PE_Function::Init_Ctor( const String & i_sName,
+ ary::cpp::FunctionFlags i_aFlags )
+{
+ aName << i_sName;
+ eVirtuality = ary::cpp::VIRTUAL_none;
+ aFlags = i_aFlags;
+ nReturnType = 0;
+ pStati->SetCur(afterName);
+}
+
+void
+PE_Function::Init_Dtor( const String & i_sName,
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags i_aFlags )
+{
+ aName << "~" << i_sName;
+ eVirtuality = i_bVirtual ? ary::cpp::VIRTUAL_virtual : ary::cpp::VIRTUAL_none;
+ aFlags = i_aFlags;
+ nReturnType = 0;
+ pStati->SetCur(afterName);
+}
+
+void
+PE_Function::Init_CastOperator( bool i_bVirtual,
+ ary::cpp::FunctionFlags i_aFlags )
+{
+ aName << "operator ";
+ eVirtuality = i_bVirtual ? ary::cpp::VIRTUAL_virtual : ary::cpp::VIRTUAL_none;
+ aFlags = i_aFlags;
+ nReturnType = 0;
+ pStati->SetCur(afterCastOperator);
+}
+
+void
+PE_Function::Init_NormalOperator( ary::cpp::Type_id i_nReturnType,
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags i_aFlags )
+{
+ aName << "operator";
+ eVirtuality = i_bVirtual ? ary::cpp::VIRTUAL_virtual : ary::cpp::VIRTUAL_none;
+ aFlags = i_aFlags;
+ nReturnType = i_nReturnType;
+ pStati->SetCur(afterStdOperator);
+}
+
+ary::cpp::Ce_id
+PE_Function::Result_Id() const
+{
+ return nResult;
+}
+
+void
+PE_Function::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Function::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Function>::F_Tok F_Tok;
+
+ static F_Tok stateF_afterStdOperator[] =
+ { &PE_Function::On_afterOperator_Std_Operator,
+ &PE_Function::On_afterOperator_Std_LeftBracket,
+ &PE_Function::On_afterOperator_Std_LeftBracket,
+ &PE_Function::On_afterOperator_Std_Operator,
+ &PE_Function::On_afterOperator_Std_Operator,
+ &PE_Function::On_afterOperator_Std_Operator,
+ &PE_Function::On_afterOperator_Std_Operator,
+ &PE_Function::On_afterOperator_Std_Operator,
+ &PE_Function::On_afterOperator_Std_Operator };
+ static INT16 stateT_afterStdOperator[] =
+ { Tid_Operator,
+ Tid_ArrayBracket_Left,
+ Tid_Bracket_Left,
+ Tid_Comma,
+ Tid_Assign,
+ Tid_Less,
+ Tid_Greater,
+ Tid_Asterix,
+ Tid_AmpersAnd };
+
+ static F_Tok stateF_afterStdOperatorLeftBracket[] =
+ { &PE_Function::On_afterStdOperatorLeftBracket_RightBracket,
+ &PE_Function::On_afterStdOperatorLeftBracket_RightBracket };
+ static INT16 stateT_afterStdOperatorLeftBracket[] =
+ { Tid_ArrayBracket_Right,
+ Tid_Bracket_Right };
+
+ static F_Tok stateF_afterCastOperator[] =
+ { &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type,
+ &PE_Function::On_afterOperator_Cast_Type };
+ static INT16 stateT_afterCastOperator[] =
+ { Tid_Identifier,
+ Tid_class,
+ Tid_struct,
+ Tid_union,
+ Tid_enum,
+ Tid_const,
+ Tid_volatile,
+ Tid_DoubleColon,
+ Tid_typename,
+ Tid_BuiltInType,
+ Tid_TypeSpecializer };
+
+ static F_Tok stateF_afterName[] = { &PE_Function::On_afterName_Bracket_Left };
+ static INT16 stateT_afterName[] = { Tid_Bracket_Left };
+
+ static F_Tok stateF_expectParameterSeparator[] =
+ { &PE_Function::On_expectParameterSeparator_BracketRight,
+ &PE_Function::On_expectParameterSeparator_Comma };
+ static INT16 stateT_expectParameterSeparator[] =
+ { Tid_Bracket_Right,
+ Tid_Comma };
+
+ static F_Tok stateF_afterParameters[] = { &PE_Function::On_afterParameters_const,
+ &PE_Function::On_afterParameters_volatile,
+ &PE_Function::On_afterParameters_throw,
+ &PE_Function::On_afterParameters_SwBracket_Left,
+ &PE_Function::On_afterParameters_Semicolon,
+ &PE_Function::On_afterParameters_Comma,
+ &PE_Function::On_afterParameters_Colon,
+ &PE_Function::On_afterParameters_Assign };
+ static INT16 stateT_afterParameters[] = { Tid_const,
+ Tid_volatile,
+ Tid_throw,
+ Tid_SwBracket_Left,
+ Tid_Semicolon,
+ Tid_Comma,
+ Tid_Colon,
+ Tid_Assign };
+
+ static F_Tok stateF_afterThrow[] = { &PE_Function::On_afterThrow_Bracket_Left };
+ static INT16 stateT_afterThrow[] = { Tid_Bracket_Left };
+
+ static F_Tok stateF_expectExceptionSeparator[] =
+ { &PE_Function::On_expectExceptionSeparator_BracketRight,
+ &PE_Function::On_expectExceptionSeparator_Comma };
+ static INT16 stateT_expectExceptionSeparator[] =
+ { Tid_Bracket_Right,
+ Tid_Comma };
+
+ static F_Tok stateF_afterExceptions[] = { &PE_Function::On_afterExceptions_SwBracket_Left,
+ &PE_Function::On_afterExceptions_Semicolon,
+ &PE_Function::On_afterExceptions_Comma,
+ &PE_Function::On_afterExceptions_Colon,
+ &PE_Function::On_afterExceptions_Assign };
+ static INT16 stateT_afterExceptions[] = { Tid_SwBracket_Left,
+ Tid_Semicolon,
+ Tid_Comma,
+ Tid_Colon,
+ Tid_Assign };
+
+ static F_Tok stateF_expectZero[] = { &PE_Function::On_expectZero_Constant };
+ static INT16 stateT_expectZero[] = { Tid_Constant };
+
+ static F_Tok stateF_inImplementation[] =
+ { &PE_Function::On_inImplementation_SwBracket_Left,
+ &PE_Function::On_inImplementation_SwBracket_Right };
+ static INT16 stateT_inImplementation[] =
+ { Tid_SwBracket_Left,
+ Tid_SwBracket_Right };
+
+ SEMPARSE_CREATE_STATUS(PE_Function, afterStdOperator, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, afterStdOperatorLeftBracket, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, afterCastOperator, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, afterName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, expectParameterSeparator, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, afterParameters, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, afterThrow, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, expectExceptionSeparator, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, afterExceptions, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, expectZero, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Function, inImplementation, On_inImplementation_Default );
+}
+
+void
+PE_Function::InitData()
+{
+ pStati->SetCur( afterName ),
+ nResult = 0;
+ bResult_WithImplementation = false;
+ aName.seekp(0);
+ eVirtuality = ary::cpp::VIRTUAL_none;
+ eConVol = ary::cpp::CONVOL_none;
+ aFlags.Reset();
+ nReturnType = 0;
+ csv::erase_container(aParameters);
+ csv::erase_container(aExceptions);
+ bThrow = false;
+}
+
+void
+PE_Function::TransferData()
+{
+ String sName( aName.c_str() );
+ ary::cpp::Function *
+ pFunction = Env().AryGate().Ces().Store_Operation(
+ Env().Context(),
+ sName,
+ nReturnType,
+ aParameters,
+ eVirtuality,
+ eConVol,
+ aFlags,
+ bThrow,
+ aExceptions );
+ if (pFunction != 0)
+ {
+ // KORR_FUTURE: How to handle differing documentation?
+
+ Dyn< StringVector >
+ pTplParams ( Env().Get_CurTemplateParameters() );
+ if ( pTplParams )
+ {
+ for ( StringVector::const_iterator it = pTplParams->begin();
+ it != pTplParams->end();
+ ++it )
+ {
+ pFunction->Add_TemplateParameterType( *it, ary::cpp::Type_id(0) );
+ } // end for
+ }
+
+ Env().Event_Store_Function(*pFunction);
+ }
+
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_Function::Hdl_SyntaxError(const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Function::SpInit_CastOperatorType()
+{
+ pSpuCastOperatorType->Child().Init_AsCastOperatorType();
+}
+
+void
+PE_Function::SpReturn_Parameter()
+{
+ pStati->SetCur(expectParameterSeparator);
+
+ ary::cpp::Type_id nParamType = pSpuParameter->Child().Result_FrontType();
+ if ( nParamType.IsValid() ) // Check, if there was a parameter, or only the closing ')'.
+ {
+ aParameters.push_back( pSpuParameter->Child().Result_ParamInfo() );
+ }
+}
+
+void
+PE_Function::SpReturn_Exception()
+{
+ pStati->SetCur(expectExceptionSeparator);
+
+ ary::cpp::Type_id
+ nException = pSpuException->Child().Result_Type().TypeId();
+ if ( nException.IsValid() AND pSpuException->Child().Result_KindOf() == PE_Type::is_type )
+ {
+ aExceptions.push_back( nException );
+ }
+}
+
+void
+PE_Function::SpReturn_CastOperatorType()
+{
+ pStati->SetCur(afterName);
+
+ Env().AryGate().Types().Get_TypeText(
+ aName, pSpuCastOperatorType->Child().Result_Type().TypeId() );
+}
+
+void
+PE_Function::On_afterOperator_Std_Operator(const char * i_sText)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterName);
+
+ if ( 'a' <= *i_sText AND *i_sText <= 'z' )
+ aName << ' ';
+ aName << i_sText;
+}
+
+void
+PE_Function::On_afterOperator_Std_LeftBracket(const char * i_sText)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterStdOperatorLeftBracket);
+
+ aName << i_sText;
+}
+
+void
+PE_Function::On_afterStdOperatorLeftBracket_RightBracket(const char * i_sText)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterName);
+
+ aName << i_sText;
+}
+
+void
+PE_Function::On_afterOperator_Cast_Type(const char *)
+{
+ pSpuCastOperatorType->Push(not_done);
+}
+
+void
+PE_Function::On_afterName_Bracket_Left(const char *)
+{
+ pSpuParameter->Push(done);
+}
+
+void
+PE_Function::On_expectParameterSeparator_BracketRight(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterParameters);
+}
+
+void
+PE_Function::On_expectParameterSeparator_Comma(const char *)
+{
+ pSpuParameter->Push(done);
+}
+
+void
+PE_Function::On_afterParameters_const(const char *)
+{
+ SetTokenResult(done,stay);
+ eConVol = static_cast<E_ConVol>(
+ static_cast<int>(eConVol) | static_cast<int>(ary::cpp::CONVOL_const) );
+}
+
+void
+PE_Function::On_afterParameters_volatile(const char *)
+{
+ SetTokenResult(done,stay);
+ eConVol = static_cast<E_ConVol>(
+ static_cast<int>(eConVol) | static_cast<int>(ary::cpp::CONVOL_volatile) );
+}
+
+void
+PE_Function::On_afterParameters_throw(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterThrow);
+ bThrow = true;
+}
+
+void
+PE_Function::On_afterParameters_SwBracket_Left(const char *)
+{
+ EnterImplementation(1);
+}
+
+void
+PE_Function::On_afterParameters_Semicolon(const char *)
+{
+ PerformFinishingPunctuation();
+}
+
+void
+PE_Function::On_afterParameters_Comma(const char *)
+{
+ PerformFinishingPunctuation();
+}
+
+void
+PE_Function::On_afterParameters_Colon(const char *)
+{
+ EnterImplementation(0);
+}
+
+void
+PE_Function::On_afterParameters_Assign(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(expectZero);
+}
+
+void
+PE_Function::On_afterThrow_Bracket_Left(const char *)
+{
+ pSpuException->Push(done);
+}
+
+void
+PE_Function::On_expectExceptionSeparator_BracketRight(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterExceptions);
+}
+
+void
+PE_Function::On_expectExceptionSeparator_Comma(const char *)
+{
+ pSpuException->Push(done);
+}
+
+void
+PE_Function::On_afterExceptions_SwBracket_Left(const char *)
+{
+ EnterImplementation(1);
+}
+
+void
+PE_Function::On_afterExceptions_Semicolon(const char *)
+{
+ PerformFinishingPunctuation();
+}
+
+void
+PE_Function::On_afterExceptions_Comma(const char *)
+{
+ PerformFinishingPunctuation();
+}
+
+void
+PE_Function::On_afterExceptions_Colon(const char *)
+{
+ EnterImplementation(0);
+}
+
+void
+PE_Function::On_afterExceptions_Assign(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(expectZero);
+}
+
+void
+PE_Function::On_expectZero_Constant(const char * i_sText)
+{
+ if ( strcmp(i_sText,"0") != 0 )
+ Hdl_SyntaxError(i_sText);
+
+ SetTokenResult(done,stay);
+ pStati->SetCur(afterExceptions);
+
+ eVirtuality = ary::cpp::VIRTUAL_abstract;
+}
+
+void
+PE_Function::On_inImplementation_SwBracket_Left(const char *)
+{
+ SetTokenResult(done,stay);
+ nBracketCounterInImplementation++;
+}
+
+void
+PE_Function::On_inImplementation_SwBracket_Right(const char *)
+{
+ nBracketCounterInImplementation--;
+ if (nBracketCounterInImplementation == 0)
+ {
+ SetTokenResult(done,pop_success);
+ }
+ else
+ {
+ SetTokenResult(done,stay);
+ }
+}
+
+void
+PE_Function::On_inImplementation_Default(const char *)
+{
+ SetTokenResult(done,stay);
+}
+
+void
+PE_Function::EnterImplementation( intt i_nBracketCountStart )
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(inImplementation);
+
+ bResult_WithImplementation = true;
+ nBracketCounterInImplementation = i_nBracketCountStart;
+ if ( Env().Context().CurClass() != 0 )
+ {
+ aFlags.SetInline();
+ }
+}
+
+
+
+} // namespace cpp
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_funct.hxx b/autodoc/source/parser/cpp/pe_funct.hxx
new file mode 100644
index 000000000000..1c37df6a657a
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_funct.hxx
@@ -0,0 +1,284 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_funct.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_FUNCT_HXX
+#define ADC_CPP_PE_FUNCT_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+#include <ary/cpp/c_types4cpp.hxx>
+#include <ary/cpp/c_vfflag.hxx>
+ // PARAMETERS
+
+
+namespace ary
+{
+namespace cpp
+{
+class Function;
+struct S_VariableInfo;
+}
+}
+
+namespace cpp
+{
+
+class PE_Type;
+class PE_Parameter;
+
+class PE_Function : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ afterStdOperator, // if initializes as operator
+ afterStdOperatorLeftBracket,
+ // if initializes as operator with ( or [
+ afterCastOperator, // if initializes as operator
+ afterName, // undecided
+ expectParameterSeparator, //
+ afterParameters, // before const, volatile throw or = 0.
+ afterThrow, // expect (
+ expectExceptionSeparator, //
+ afterExceptions, // = 0 oder ; oder ,
+ expectZero, // after '='
+ inImplementation, // after {
+ size_of_states
+ };
+ typedef ary::cpp::E_Protection E_Protection;
+ typedef ary::cpp::E_Virtuality E_Virtuality;
+ typedef ary::cpp::E_ConVol E_ConVol;
+
+ PE_Function(
+ Cpp_PE * i_pParent );
+ ~PE_Function();
+
+ void Init_Std(
+ const String & i_sName,
+ ary::cpp::Type_id i_nReturnType,
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags
+ i_aFlags );
+ void Init_Ctor(
+ const String & i_sName,
+ ary::cpp::FunctionFlags
+ i_aFlags );
+ void Init_Dtor(
+ const String & i_sName,
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags
+ i_aFlags );
+ void Init_CastOperator(
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags
+ i_aFlags );
+ void Init_NormalOperator(
+ ary::cpp::Type_id i_nReturnType,
+ bool i_bVirtual,
+ ary::cpp::FunctionFlags
+ i_aFlags );
+
+ ary::cpp::Ce_id Result_Id() const;
+ bool Result_WithImplementation() const;
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+ private:
+ typedef SubPe< PE_Function, PE_Type > SP_Type;
+ typedef SubPeUse< PE_Function, PE_Type > SPU_Type;
+ typedef SubPe< PE_Function, PE_Parameter> SP_Parameter;
+ typedef SubPeUse<PE_Function, PE_Parameter> SPU_Parameter;
+
+ typedef std::vector<ary::cpp::S_Parameter> ParameterList;
+ typedef std::vector<ary::cpp::Type_id> ExceptionTypeList;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError(const char * i_sText);
+
+ void SpInit_CastOperatorType();
+
+ void SpReturn_Parameter();
+ void SpReturn_Exception();
+ void SpReturn_CastOperatorType();
+
+ void On_afterOperator_Std_Operator(const char * i_sText); // Operator+() etc.
+ void On_afterOperator_Std_LeftBracket(const char * i_sText); // operator [] or ()
+ void On_afterStdOperatorLeftBracket_RightBracket(const char * i_sText);
+ void On_afterOperator_Cast_Type(const char * i_sText); // Type
+
+ void On_afterName_Bracket_Left(const char * i_sText);
+
+ void On_expectParameterSeparator_BracketRight(const char * i_sText);
+ void On_expectParameterSeparator_Comma(const char * i_sText);
+
+ void On_afterParameters_const(const char * i_sText);
+ void On_afterParameters_volatile(const char * i_sText);
+ void On_afterParameters_throw(const char * i_sText);
+ void On_afterParameters_SwBracket_Left(const char * i_sText);
+ void On_afterParameters_Semicolon(const char * i_sText);
+ void On_afterParameters_Comma(const char * i_sText);
+ void On_afterParameters_Colon(const char * i_sText);
+ void On_afterParameters_Assign(const char * i_sText);
+
+ void On_afterThrow_Bracket_Left(const char * i_sText);
+
+ void On_expectExceptionSeparator_BracketRight(const char * i_sText);
+ void On_expectExceptionSeparator_Comma(const char * i_sText);
+
+ void On_afterExceptions_SwBracket_Left(const char * i_sText);
+ void On_afterExceptions_Semicolon(const char * i_sText);
+ void On_afterExceptions_Comma(const char * i_sText);
+ void On_afterExceptions_Colon(const char * i_sText);
+ void On_afterExceptions_Assign(const char * i_sText);
+
+ void On_expectZero_Constant(const char * i_sText);
+
+ void On_inImplementation_SwBracket_Left(const char * i_sText);
+ void On_inImplementation_SwBracket_Right(const char * i_sText);
+ void On_inImplementation_Default(const char * i_sText);
+
+ void PerformFinishingPunctuation();
+ void EnterImplementation(
+ intt i_nBracketCountStart ); /// 1 normally, 0 in initialisation section of c'tors.
+
+ // DATA
+ Dyn< PeStatusArray<PE_Function> >
+ pStati;
+
+ Dyn< SP_Parameter > pSpParameter;
+ Dyn< SPU_Parameter> pSpuParameter;
+ Dyn< SP_Type > pSpType;
+ Dyn< SPU_Type > pSpuException;
+ Dyn< SPU_Type > pSpuCastOperatorType; // in "operator int()" or "operator ThatClass *()"
+
+ ary::cpp::Ce_id nResult;
+ bool bResult_WithImplementation; // Necessary for the parent ParseEnvironment
+ // to know, there is no semicolon or comma following.
+ // Pre results
+ StreamStr aName;
+ E_Virtuality eVirtuality;
+ E_ConVol eConVol;
+ ary::cpp::FunctionFlags
+ aFlags;
+ ary::cpp::Type_id nReturnType;
+ ParameterList aParameters;
+ ExceptionTypeList aExceptions;
+ bool bThrow; // Indicates, if there is a throw - important, if there are 0 exceptions listed.
+ intt nBracketCounterInImplementation;
+};
+
+
+
+
+// IMPLEMENTATION
+inline bool
+PE_Function::Result_WithImplementation() const
+ { return bResult_WithImplementation; }
+
+
+
+
+} // namespace cpp
+#endif
+
+
+
+
+
+/* // Overview of Stati
+
+Undecided
+---------
+
+start // vor und während storage class specifiern
+
+->Typ
+
+expectName // Typ ist da
+
+afterName
+
+
+
+
+Variable
+--------
+
+start // vor und während storage class specifiern
+
+->Typ
+
+expectName // Typ ist da -> im Falle von '(': notyetimplemented
+afterName
+
+expectSize // after [
+expectFinish
+ // vor ; oder ,
+expectNextVarName // anders als bei expectName kann hier auch * oder & kommen
+
+
+
+
+
+Function
+--------
+
+start // vor und während storage class specifiern
+
+->Typ
+
+expectName // Typ ist da
+expectBracket // Nach Name
+expectParameter // nach ( oder ,
+-> Parameter
+after Parameters // before const, volatile throw or = 0.
+after throw // expect (
+expectException // after (
+after exceptions // = 0 oder ; oder ,
+
+
+expectNextVarName // anders als bei expectName kann hier auch * oder & kommen
+
+
+
+
+
+
+
+*/
diff --git a/autodoc/source/parser/cpp/pe_ignor.cxx b/autodoc/source/parser/cpp/pe_ignor.cxx
new file mode 100644
index 000000000000..27563edd0d7c
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_ignor.cxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_ignor.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 "pe_ignor.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+
+
+namespace cpp {
+
+
+
+PE_Ignore::PE_Ignore( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ nBracketCounter(0),
+ bBlockOpened(false)
+{
+ Setup_StatusFunctions();
+}
+
+
+PE_Ignore::~PE_Ignore()
+{
+}
+
+void
+PE_Ignore::Call_Handler( const cpp::Token & i_rTok )
+{
+ if ( NOT bBlockOpened )
+ {
+ switch (i_rTok.TypeId())
+ {
+ case Tid_SwBracket_Left: SetTokenResult(done, stay);
+ nBracketCounter++;
+ bBlockOpened = true;
+ break;
+ case Tid_Semicolon: SetTokenResult(done, pop_success);
+ break;
+ default:
+ SetTokenResult(done, stay);
+ } // end switch
+ }
+ else if ( nBracketCounter > 0 )
+ {
+ SetTokenResult(done, stay);
+
+ switch (i_rTok.TypeId())
+ {
+ case Tid_SwBracket_Left: nBracketCounter++;
+ break;
+ case Tid_SwBracket_Right: nBracketCounter--;
+ break;
+ } // end switch
+ }
+ else if ( i_rTok.TypeId() == Tid_Semicolon )
+ {
+ SetTokenResult(done, pop_success);
+ }
+ else
+ {
+ SetTokenResult(not_done, pop_success);
+ }
+}
+
+void
+PE_Ignore::Setup_StatusFunctions()
+{
+ // Does nothing.
+}
+
+void
+PE_Ignore::InitData()
+{
+ nBracketCounter = 0;
+ bBlockOpened = false;
+}
+
+void
+PE_Ignore::TransferData()
+{
+ // Does nothing.
+}
+
+
+} // namespace cpp
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_ignor.hxx b/autodoc/source/parser/cpp/pe_ignor.hxx
new file mode 100644
index 000000000000..936bec871750
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_ignor.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_ignor.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_IGNOR_HXX
+#define ADC_CPP_PE_IGNOR_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <cpp_pe.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace cpp {
+
+
+class PE_Ignore : public Cpp_PE
+{
+ public:
+ PE_Ignore(
+ Cpp_PE * i_pParent );
+ ~PE_Ignore();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+ private:
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+
+ // DATA
+ uintt nBracketCounter;
+ bool bBlockOpened;
+};
+
+
+
+// IMPLEMENTATION
+
+
+} // namespace cpp
+
+
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/cpp/pe_namsp.cxx b/autodoc/source/parser/cpp/pe_namsp.cxx
new file mode 100644
index 000000000000..a0b789326390
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_namsp.cxx
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_namsp.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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 <pe_namsp.hxx>
+
+
+// NOT FULLY DECLARED SERVICES
+#include <all_toks.hxx>
+#include <ary/cpp/c_namesp.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <semantic/callf.hxx>
+#include "x_parse.hxx"
+
+
+
+
+namespace cpp
+{
+
+PE_Namespace::PE_Namespace( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Namespace> ),
+ // sLocalname
+ bPush(false)
+{
+ Setup_StatusFunctions();
+}
+
+PE_Namespace::~PE_Namespace()
+{
+}
+
+void
+PE_Namespace::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Namespace>::F_Tok F_Tok;
+ static F_Tok stateF_start[] = { &PE_Namespace::On_start_Identifier,
+ &PE_Namespace::On_start_SwBracket_Left };
+ static INT16 stateT_start[] = { Tid_Identifier,
+ Tid_SwBracket_Left };
+ static F_Tok stateF_gotName[] = { &PE_Namespace::On_gotName_SwBracket_Left,
+ &PE_Namespace::On_gotName_Assign };
+ static INT16 stateT_gotName[] = { Tid_SwBracket_Left,
+ Tid_Assign };
+ static F_Tok stateF_expectSemicolon[] = { &PE_Namespace::On_expectSemicolon_Semicolon };
+ static INT16 stateT_expectSemicolon[] = { Tid_Semicolon };
+
+ SEMPARSE_CREATE_STATUS(PE_Namespace, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Namespace, gotName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Namespace, expectSemicolon, Hdl_SyntaxError);
+}
+
+void
+PE_Namespace::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Namespace::InitData()
+{
+ pStati->SetCur(start);
+ sLocalName = "";
+ bPush = false;
+}
+
+void
+PE_Namespace::TransferData()
+{
+ if (bPush)
+ {
+ ary::cpp::Namespace &
+ rNew = Env().AryGate().Ces().CheckIn_Namespace(
+ Env().Context(),
+ sLocalName );
+ Env().OpenNamespace(rNew);
+ }
+}
+
+void
+PE_Namespace::Hdl_SyntaxError( const char * i_sText)
+{
+ throw X_Parser( X_Parser::x_UnexpectedToken,
+ i_sText != 0 ? i_sText : "",
+ Env().CurFileName(),
+ Env().LineCount() );
+}
+
+void
+PE_Namespace::On_start_Identifier(const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(gotName);
+
+ sLocalName = i_sText;
+}
+
+void
+PE_Namespace::On_start_SwBracket_Left(const char * )
+{
+ SetTokenResult(done, pop_success);
+ pStati->SetCur(size_of_states);
+
+ sLocalName = ""; // Anonymous namespace, a name is created in
+ // Gate().CheckIn_Namespace() .
+
+ bPush = true;
+}
+
+void
+PE_Namespace::On_gotName_SwBracket_Left(const char * )
+{
+ SetTokenResult(done, pop_success);
+ pStati->SetCur(size_of_states);
+
+ bPush = true;
+}
+
+void
+PE_Namespace::On_gotName_Assign(const char * )
+{
+ // KORR_FUTURE
+ Hdl_SyntaxError(0);
+}
+
+void
+PE_Namespace::On_expectSemicolon_Semicolon(const char * )
+{
+ SetTokenResult(done,pop_success);
+ pStati->SetCur(size_of_states);
+}
+
+} // namespace cpp
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_namsp.hxx b/autodoc/source/parser/cpp/pe_namsp.hxx
new file mode 100644
index 000000000000..18b2943c14f4
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_namsp.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_namsp.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_NAMSP_HXX
+#define ADC_CPP_PE_NAMSP_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_pe.hxx>
+ // PARAMETERS
+
+namespace ary
+{
+namespace cpp
+{
+class Namespace;
+}
+}
+
+
+namespace cpp
+{
+
+
+class PE_Namespace : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start,
+ gotName,
+ expectSemicolon, /// after namespace assignment
+ size_of_states
+ };
+ PE_Namespace(
+ Cpp_PE * i_pParent );
+ ~PE_Namespace();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ ary::cpp::Namespace *
+ Result_OpenedNamespace() const;
+ private:
+ void Setup_StatusFunctions();
+
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void On_start_Identifier(const char * i_sText);
+ void On_start_SwBracket_Left(const char * i_sText);
+ void On_gotName_SwBracket_Left(const char * i_sText);
+ void On_gotName_Assign(const char * i_sText);
+ void On_expectSemicolon_Semicolon(const char * i_sText);
+
+ // DATA
+ Dyn< PeStatusArray<PE_Namespace> >
+ pStati;
+
+ String sLocalName;
+ bool bPush;
+};
+
+
+
+
+} // namespace cpp
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_param.cxx b/autodoc/source/parser/cpp/pe_param.cxx
new file mode 100644
index 000000000000..9a5d88c2fa06
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_param.cxx
@@ -0,0 +1,283 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_param.cxx,v $
+ * $Revision: 1.11 $
+ *
+ * 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 "pe_param.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/cp_type.hxx>
+#include "pe_type.hxx"
+#include "pe_vari.hxx"
+
+
+namespace cpp {
+
+
+
+//*********************** PE_Parameter ***********************//
+
+
+PE_Parameter::PE_Parameter( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Parameter> )
+ // pSpType,
+ // pSpuType,
+ // pSpVariable,
+ // pSpuVariable,
+ // aResultParamInfo
+{
+ Setup_StatusFunctions();
+
+ pSpType = new SP_Type(*this);
+ pSpuType = new SPU_Type(*pSpType, &PE_Parameter::SpInit_Type, &PE_Parameter::SpReturn_Type);
+ pSpVariable = new SP_Variable(*this);
+ pSpuVariable = new SPU_Variable(*pSpVariable, &PE_Parameter::SpInit_Variable, &PE_Parameter::SpReturn_Variable);
+}
+
+PE_Parameter::~PE_Parameter()
+{
+}
+
+void
+PE_Parameter::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Parameter::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Parameter>::F_Tok F_Tok;
+ static F_Tok stateF_start[] = { &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type,
+
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Bracket_Right,
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Ellipse,
+
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type,
+ &PE_Parameter::On_start_Type };
+ static INT16 stateT_start[] = { Tid_Identifier,
+ Tid_class,
+ Tid_struct,
+ Tid_union,
+ Tid_enum,
+
+ Tid_const,
+ Tid_volatile,
+ Tid_Bracket_Right,
+ Tid_DoubleColon,
+ Tid_Ellipse,
+
+ Tid_typename,
+ Tid_BuiltInType,
+ Tid_TypeSpecializer };
+
+ static F_Tok stateF_expectName[] = { &PE_Parameter::On_expectName_Identifier,
+ &PE_Parameter::On_expectName_ArrayBracket_Left,
+ &PE_Parameter::On_expectName_Bracket_Right,
+ &PE_Parameter::On_expectName_Comma,
+ &PE_Parameter::On_afterName_Assign };
+ static INT16 stateT_expectName[] = { Tid_Identifier,
+ Tid_ArrayBracket_Left,
+ Tid_Bracket_Right,
+ Tid_Comma,
+ Tid_Assign };
+ static F_Tok stateF_afterName[] = { &PE_Parameter::On_afterName_ArrayBracket_Left,
+ &PE_Parameter::On_afterName_Bracket_Right,
+ &PE_Parameter::On_afterName_Comma,
+ &PE_Parameter::On_afterName_Assign };
+ static INT16 stateT_afterName[] = { Tid_ArrayBracket_Left,
+ Tid_Bracket_Right,
+ Tid_Comma,
+ Tid_Assign };
+ static F_Tok stateF_finished[] = { &PE_Parameter::On_finished_Comma,
+ &PE_Parameter::On_finished_Bracket_Right };
+ static INT16 stateT_finished[] = { Tid_Bracket_Right,
+ Tid_Comma };
+
+ SEMPARSE_CREATE_STATUS(PE_Parameter, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Parameter, expectName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Parameter, afterName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Parameter, finished, Hdl_SyntaxError);
+}
+
+
+void
+PE_Parameter::InitData()
+{
+ pStati->SetCur(start);
+ aResultParamInfo.Empty();
+}
+
+void
+PE_Parameter::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_Parameter::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Parameter::SpInit_Type()
+{
+ // Does nothing.
+}
+
+void
+PE_Parameter::SpInit_Variable()
+{
+ // Does nothing.
+}
+
+void
+PE_Parameter::SpReturn_Type()
+{
+ aResultParamInfo.nType = pSpuType->Child().Result_Type().Id();
+ pStati->SetCur(expectName);
+}
+
+void
+PE_Parameter::SpReturn_Variable()
+{
+ if (pSpuVariable->Child().Result_Pattern() > 0)
+ {
+ aResultParamInfo.sSizeExpression = pSpuVariable->Child().Result_SizeExpression();
+ aResultParamInfo.sInitExpression = pSpuVariable->Child().Result_InitExpression();
+ }
+}
+
+void
+PE_Parameter::On_start_Type(const char *)
+{
+ pSpuType->Push(not_done);
+}
+
+void
+PE_Parameter::On_start_Bracket_Right(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Parameter::On_start_Ellipse(const char *)
+{
+ SetTokenResult(done, pop_success);
+
+ aResultParamInfo.nType = Env().AryGate().Types().Tid_Ellipse();
+}
+
+void
+PE_Parameter::On_expectName_Identifier(const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterName);
+
+ aResultParamInfo.sName = i_sText;
+}
+
+void
+PE_Parameter::On_expectName_ArrayBracket_Left(const char * i_sText)
+{
+ On_afterName_ArrayBracket_Left(i_sText);
+}
+
+void
+PE_Parameter::On_expectName_Bracket_Right(const char * i_sText)
+{
+ On_afterName_Bracket_Right(i_sText);
+}
+
+void
+PE_Parameter::On_expectName_Comma(const char * i_sText)
+{
+ On_afterName_Comma(i_sText);
+}
+
+void
+PE_Parameter::On_afterName_ArrayBracket_Left(const char *)
+{
+ pSpuVariable->Push(not_done);
+}
+
+void
+PE_Parameter::On_afterName_Bracket_Right(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Parameter::On_afterName_Comma(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Parameter::On_afterName_Assign(const char *)
+{
+ pSpuVariable->Push(not_done);
+}
+
+void
+PE_Parameter::On_finished_Bracket_Right(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Parameter::On_finished_Comma(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+
+} // namespace cpp
+
+
+
+
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_param.hxx b/autodoc/source/parser/cpp/pe_param.hxx
new file mode 100644
index 000000000000..40a4bf85f714
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_param.hxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_param.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_PARAM_HXX
+#define ADC_CPP_PE_PARAM_HXX
+
+// BASE CLASSES
+#include "cpp_pe.hxx"
+// USED SERVICES
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+#include <ary/cpp/c_vfflag.hxx>
+
+
+
+
+namespace cpp
+{
+ class PE_Type;
+ class PE_Variable;
+
+
+
+
+class PE_Parameter : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start,
+ expectName,
+ afterName,
+ finished,
+ size_of_states
+ };
+ typedef ary::cpp::S_Parameter S_ParamInfo;
+
+ explicit PE_Parameter(
+ Cpp_PE * i_pParent );
+ ~PE_Parameter();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ ary::cpp::Type_id Result_FrontType() const;
+ const S_ParamInfo & Result_ParamInfo() const;
+
+ private:
+ typedef SubPe< PE_Parameter, PE_Type > SP_Type;
+ typedef SubPeUse< PE_Parameter, PE_Type > SPU_Type;
+ typedef SubPe< PE_Parameter, PE_Variable > SP_Variable;
+ typedef SubPeUse< PE_Parameter, PE_Variable > SPU_Variable;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void SpInit_Type(); // Type and Ignore.
+ void SpInit_Variable();
+ void SpReturn_Type();
+ void SpReturn_Variable();
+
+ void On_start_Type(const char * i_sText);
+ void On_start_Bracket_Right(const char * i_sText);
+ void On_start_Ellipse(const char * i_sText);
+
+ void On_expectName_Identifier(const char * i_sText);
+ void On_expectName_ArrayBracket_Left(const char * i_sText);
+ void On_expectName_Bracket_Right(const char * i_sText);
+ void On_expectName_Comma(const char * i_sText);
+
+ void On_afterName_ArrayBracket_Left(const char * i_sText);
+ void On_afterName_Bracket_Right(const char * i_sText);
+ void On_afterName_Comma(const char * i_sText);
+ void On_afterName_Assign(const char * i_sText);
+
+ void On_finished_Bracket_Right(const char * i_sText);
+ void On_finished_Comma(const char * i_sText);
+
+ // DATA
+ Dyn< PeStatusArray<PE_Parameter> >
+ pStati;
+
+ Dyn<SP_Type> pSpType;
+ Dyn<SPU_Type> pSpuType;
+ Dyn<SP_Variable> pSpVariable;
+ Dyn<SPU_Variable> pSpuVariable;
+
+ S_ParamInfo aResultParamInfo;
+};
+
+
+
+
+// IMPLEMENTATION
+inline ary::cpp::Type_id
+PE_Parameter::Result_FrontType() const
+{
+ return aResultParamInfo.nType;
+}
+
+inline const PE_Parameter::S_ParamInfo &
+PE_Parameter::Result_ParamInfo() const
+{
+ return aResultParamInfo;
+}
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/pe_tpltp.cxx b/autodoc/source/parser/cpp/pe_tpltp.cxx
new file mode 100644
index 000000000000..6c86d40ab239
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_tpltp.cxx
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_tpltp.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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 "pe_tpltp.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+
+
+
+namespace cpp {
+
+
+
+PE_TemplateTop::PE_TemplateTop( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_TemplateTop> ),
+ // aResult_Parameters,
+ bCurIsConstant(false)
+{
+ Setup_StatusFunctions();
+}
+
+
+PE_TemplateTop::~PE_TemplateTop()
+{
+}
+
+void
+PE_TemplateTop::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_TemplateTop::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_TemplateTop>::F_Tok F_Tok;
+
+ static F_Tok stateF_start[] = { &PE_TemplateTop::On_start_Less };
+ static INT16 stateT_start[] = { Tid_Less };
+
+ static F_Tok stateF_expect_qualifier[]= { &PE_TemplateTop::On_expect_qualifier_ClassOrTypename,
+ &PE_TemplateTop::On_expect_qualifier_Greater,
+ &PE_TemplateTop::On_expect_qualifier_ClassOrTypename };
+ static INT16 stateT_expect_qualifier[]= { Tid_class,
+ Tid_Greater,
+ Tid_typename };
+
+ static F_Tok stateF_expect_name[] = { &PE_TemplateTop::On_expect_name_Identifier };
+ static INT16 stateT_expect_name[] = { Tid_Identifier };
+
+ static F_Tok stateF_expect_separator[]= { &PE_TemplateTop::On_expect_separator_Comma,
+ &PE_TemplateTop::On_expect_separator_Greater };
+ static INT16 stateT_expect_separator[]= { Tid_Comma,
+ Tid_Greater };
+
+ SEMPARSE_CREATE_STATUS(PE_TemplateTop, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_TemplateTop, expect_qualifier, On_expect_qualifier_Other);
+ SEMPARSE_CREATE_STATUS(PE_TemplateTop, expect_name, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_TemplateTop, expect_separator, Hdl_SyntaxError);
+}
+
+void
+PE_TemplateTop::InitData()
+{
+ pStati->SetCur(start);
+ csv::erase_container(aResult_Parameters);
+ bCurIsConstant = false;
+}
+
+void
+PE_TemplateTop::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_TemplateTop::Hdl_SyntaxError(const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_TemplateTop::On_start_Less( const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expect_qualifier);
+}
+
+void
+PE_TemplateTop::On_expect_qualifier_ClassOrTypename( const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expect_name);
+}
+
+void
+PE_TemplateTop::On_expect_qualifier_Greater(const char *)
+{
+ SetTokenResult(done, pop_success);
+}
+
+void
+PE_TemplateTop::On_expect_qualifier_Other( const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expect_name);
+
+ bCurIsConstant = true;
+}
+
+void
+PE_TemplateTop::On_expect_name_Identifier( const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expect_separator);
+
+ StreamLock sl(50);
+ if ( NOT bCurIsConstant )
+ {
+ String sText( sl() << "typename " << i_sText << c_str );
+ aResult_Parameters.push_back(sText);
+ }
+ else //
+ {
+ String sText( sl() << "constant " << i_sText << c_str );
+ aResult_Parameters.push_back(sText);
+ bCurIsConstant = false;
+ } // endif
+}
+
+void
+PE_TemplateTop::On_expect_separator_Comma( const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expect_qualifier);
+}
+
+void
+PE_TemplateTop::On_expect_separator_Greater( const char *)
+{
+ SetTokenResult(done, pop_success);
+}
+
+
+
+
+} // namespace cpp
diff --git a/autodoc/source/parser/cpp/pe_tpltp.hxx b/autodoc/source/parser/cpp/pe_tpltp.hxx
new file mode 100644
index 000000000000..3517eaf54701
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_tpltp.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_tpltp.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_TPLTP_HXX
+#define ADC_CPP_PE_TPLTP_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+
+
+namespace cpp {
+
+
+
+class PE_TemplateTop : public cpp::Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start,
+ expect_qualifier,
+ expect_name,
+ expect_separator,
+ size_of_states
+ };
+ PE_TemplateTop(
+ Cpp_PE * i_pParent );
+ ~PE_TemplateTop();
+
+ const StringVector &
+ Result_Parameters() const;
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+ private:
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError(const char *);
+
+
+ void On_start_Less(const char *);
+
+ void On_expect_qualifier_ClassOrTypename(const char *);
+ void On_expect_qualifier_Greater(const char *);
+ void On_expect_qualifier_Other(const char *);
+
+ void On_expect_name_Identifier(const char *);
+
+ void On_expect_separator_Comma(const char *);
+ void On_expect_separator_Greater(const char *);
+
+ // DATA
+ Dyn< PeStatusArray<PE_TemplateTop> >
+ pStati;
+
+ StringVector
+ aResult_Parameters;
+ bool bCurIsConstant;
+};
+
+
+
+// IMPLEMENTATION
+
+inline const StringVector &
+PE_TemplateTop::Result_Parameters() const
+ { return aResult_Parameters; }
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/pe_tydef.cxx b/autodoc/source/parser/cpp/pe_tydef.cxx
new file mode 100644
index 000000000000..450844c9bcaa
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_tydef.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_tydef.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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 "pe_tydef.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_type.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <all_toks.hxx>
+#include "pe_type.hxx"
+
+
+namespace cpp {
+
+
+PE_Typedef::PE_Typedef(Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Typedef> ),
+ // pSpType,
+ // pSpuType,
+ // sName
+ nType(0)
+{
+ Setup_StatusFunctions();
+
+ pSpType = new SP_Type(*this);
+ pSpuType = new SPU_Type(*pSpType, 0, &PE_Typedef::SpReturn_Type);
+}
+
+PE_Typedef::~PE_Typedef()
+{
+}
+
+void
+PE_Typedef::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Typedef::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Typedef>::F_Tok F_Tok;
+ static F_Tok stateF_start[] = { &PE_Typedef::On_start_typedef };
+ static INT16 stateT_start[] = { Tid_typedef };
+
+ static F_Tok stateF_expectName[] = { &PE_Typedef::On_expectName_Identifier };
+ static INT16 stateT_expectName[] = { Tid_Identifier };
+
+ static F_Tok stateF_afterName[] = { &PE_Typedef::On_afterName_Semicolon };
+ static INT16 stateT_afterName[] = { Tid_Semicolon };
+
+ SEMPARSE_CREATE_STATUS(PE_Typedef, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Typedef, expectName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Typedef, afterName, Hdl_SyntaxError);
+}
+
+void
+PE_Typedef::InitData()
+{
+ pStati->SetCur(start);
+
+ sName.clear();
+ nType = 0;
+}
+
+void
+PE_Typedef::TransferData()
+{
+ pStati->SetCur(size_of_states);
+
+ ary::cpp::Typedef &
+ rTypedef = Env().AryGate().Ces().Store_Typedef(
+ Env().Context(), sName, nType );
+ Env().Event_Store_Typedef(rTypedef);
+}
+
+void
+PE_Typedef::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Typedef::SpReturn_Type()
+{
+ pStati->SetCur(expectName);
+
+ nType = pSpuType->Child().Result_Type().Id();
+}
+
+void
+PE_Typedef::On_start_typedef( const char * )
+{
+ pSpuType->Push(done);
+}
+
+void
+PE_Typedef::On_expectName_Identifier( const char * i_sText )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterName);
+
+ sName = i_sText;
+}
+
+void
+PE_Typedef::On_afterName_Semicolon( const char * )
+{
+ SetTokenResult(done, pop_success);
+}
+
+} // namespace cpp
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_tydef.hxx b/autodoc/source/parser/cpp/pe_tydef.hxx
new file mode 100644
index 000000000000..8c183c7cdbf9
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_tydef.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_tydef.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_TYDEF_HXX
+#define ADC_CPP_PE_TYDEF_HXX
+
+// BASE CLASSES
+#include "cpp_pe.hxx"
+// USED SERVICES
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+
+
+namespace cpp
+{
+ class PE_Type;
+
+
+
+
+class PE_Typedef : public cpp::Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start,
+ expectName,
+ afterName,
+ size_of_states
+ };
+ PE_Typedef(
+ Cpp_PE * i_pParent );
+ ~PE_Typedef();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+ private:
+ typedef SubPe< PE_Typedef, PE_Type > SP_Type;
+ typedef SubPeUse< PE_Typedef, PE_Type> SPU_Type;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void SpReturn_Type();
+
+ void On_start_typedef( const char * );
+ void On_expectName_Identifier( const char * );
+ void On_afterName_Semicolon( const char * );
+
+ // DATA
+ Dyn< PeStatusArray<PE_Typedef> >
+ pStati;
+ Dyn<SP_Type> pSpType;
+ Dyn<SPU_Type> pSpuType;
+
+ String sName;
+ ary::cpp::Type_id nType;
+};
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/pe_type.cxx b/autodoc/source/parser/cpp/pe_type.cxx
new file mode 100644
index 000000000000..44aa2223bd05
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_type.cxx
@@ -0,0 +1,557 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_type.cxx,v $
+ * $Revision: 1.11 $
+ *
+ * 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 "pe_type.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <ary/cpp/inpcontx.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_class.hxx>
+#include <ary/cpp/c_namesp.hxx>
+#include <ary/cpp/cp_type.hxx>
+#include "pe_class.hxx"
+#include "pe_enum.hxx"
+#include <x_parse.hxx>
+
+
+
+class NullType : public ary::cpp::Type
+{
+ private:
+ virtual void do_Accept(
+ csv::ProcessorIfc & io_processor ) const;
+ virtual ary::ClassId
+ get_AryClass() const;
+ virtual bool inq_IsConst() const;
+ virtual void inq_Get_Text(
+ StreamStr & o_rPreName,
+ StreamStr & o_rName,
+ StreamStr & o_rPostName,
+ const ary::cpp::Gate &
+ i_rGate ) const;
+};
+
+void
+NullType::do_Accept(csv::ProcessorIfc & ) const
+{
+ // Does nothing.
+}
+
+ary::ClassId
+NullType::get_AryClass() const
+{
+ return 0;
+}
+
+bool
+NullType::inq_IsConst() const
+{
+ return true;
+}
+
+void
+NullType::inq_Get_Text( StreamStr & ,
+ StreamStr & ,
+ StreamStr & ,
+ const ary::cpp::Gate & ) const
+{
+ // Does nothing.
+}
+
+
+
+
+namespace cpp
+{
+
+
+inline bool
+PE_Type::IsType() const
+ { return eResult_KindOf == is_type; }
+
+
+PE_Type::PE_Type( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Type> ),
+ pSpType(0),
+ pSpuType_TemplateParameter(0),
+ // pSpClass,
+ // pSpuClass,
+ // pSpEnum,
+ // pSpuEnum,
+ pType(0),
+ pCurTemplate_ParameterList(0),
+ // sOwningClassName,
+ // sParsedClass_Name,
+ pResult_Type(0),
+ eResult_KindOf(is_none),
+ bIsCastOperatorType(false)
+{
+ Setup_StatusFunctions();
+
+ pSpType = new SP_Type(*this);
+ pSpClass = new SP_Class(*this);
+ pSpEnum = new SP_Enum(*this);
+
+ pSpuType_TemplateParameter
+ = new SPU_Type( *pSpType, 0,
+ &PE_Type::SpReturn_Type_TemplateParameter );
+ pSpuClass = new SPU_Class( *pSpClass, 0,
+ & PE_Type::SpReturn_Class );
+ pSpuEnum = new SPU_Enum( *pSpEnum, 0,
+ & PE_Type::SpReturn_Enum );
+}
+
+PE_Type::~PE_Type()
+{
+}
+
+void
+PE_Type::Init_AsCastOperatorType()
+{
+ bIsCastOperatorType = true;
+}
+
+void
+PE_Type::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Type::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Type>::F_Tok F_Tok;
+ static F_Tok stateF_start[] = { &PE_Type::On_start_Identifier,
+ &PE_Type::On_start_class,
+ &PE_Type::On_start_class,
+ &PE_Type::On_start_class,
+ &PE_Type::On_start_enum,
+ &PE_Type::On_start_const,
+ &PE_Type::On_start_volatile,
+ &PE_Type::On_start_Bracket_Right,
+ &PE_Type::On_start_DoubleColon,
+ &PE_Type::On_start_typename,
+ &PE_Type::On_start_BuiltInType,
+ &PE_Type::On_start_TypeSpecializer };
+ static INT16 stateT_start[] = { Tid_Identifier,
+ Tid_class,
+ Tid_struct,
+ Tid_union,
+ Tid_enum,
+ Tid_const,
+ Tid_volatile,
+ Tid_Bracket_Right,
+ Tid_DoubleColon,
+ Tid_typename,
+ Tid_BuiltInType,
+ Tid_TypeSpecializer };
+
+ static F_Tok stateF_expect_namesegment[] = { &PE_Type::On_expect_namesegment_Identifier,
+ &PE_Type::On_expect_namesegment_Identifier };
+ static INT16 stateT_expect_namesegment[] = { Tid_Identifier,
+ Tid_BuiltInType };
+
+ static F_Tok stateF_after_namesegment[] = { &PE_Type::On_after_namesegment_const,
+ &PE_Type::On_after_namesegment_volatile,
+ &PE_Type::On_after_namesegment_Bracket_Left,
+ &PE_Type::On_after_namesegment_DoubleColon,
+ &PE_Type::On_after_namesegment_Less,
+ &PE_Type::On_after_namesegment_Asterix,
+ &PE_Type::On_after_namesegment_AmpersAnd };
+ static INT16 stateT_after_namesegment[] = { Tid_const,
+ Tid_volatile,
+ Tid_Bracket_Left,
+ Tid_DoubleColon,
+ Tid_Less,
+ Tid_Asterix,
+ Tid_AmpersAnd };
+
+ static F_Tok stateF_afterclass_expect_semicolon[] =
+ { &PE_Type::On_afterclass_expect_semicolon_Semicolon };
+ static INT16 stateT_afterclass_expect_semicolon[] =
+ { Tid_Semicolon };
+
+ static F_Tok stateF_within_template[] = { &PE_Type::On_within_template_Comma,
+ &PE_Type::On_within_template_Greater,
+ &PE_Type::On_within_template_Constant };
+ static INT16 stateT_within_template[] = { Tid_Comma,
+ Tid_Greater,
+ Tid_Constant };
+
+ static F_Tok stateF_within_indirection[] = { &PE_Type::On_within_indirection_const,
+ &PE_Type::On_within_indirection_volatile,
+ &PE_Type::On_within_indirection_Asterix,
+ &PE_Type::On_within_indirection_AmpersAnd };
+ static INT16 stateT_within_indirection[] = { Tid_const,
+ Tid_volatile,
+ Tid_Asterix,
+ Tid_AmpersAnd };
+
+ SEMPARSE_CREATE_STATUS(PE_Type, start, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Type, expect_namesegment, On_EndOfType);
+ SEMPARSE_CREATE_STATUS(PE_Type, after_namesegment, On_EndOfType);
+ SEMPARSE_CREATE_STATUS(PE_Type, afterclass_expect_semicolon, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Type, within_template, On_within_template_TypeStart);
+ SEMPARSE_CREATE_STATUS(PE_Type, within_indirection, On_EndOfType);
+}
+
+void
+PE_Type::InitData()
+{
+ pStati->SetCur(start);
+
+ ary::cpp::Ce_id
+ scope_id = Env().Context().CurClass() != 0
+ ? Env().Context().CurClass()->CeId()
+ : Env().Context().CurNamespace().CeId();
+
+ pType = new ary::cpp::UsedType(scope_id);
+ pCurTemplate_ParameterList = 0;
+ sOwningClassName
+ = Env().Context().CurClass() != 0
+ ? Env().Context().CurClass()->LocalName().c_str()
+ : "";
+ sParsedClass_Name.clear();
+ pResult_Type = 0;
+ eResult_KindOf = is_type;
+ bIsCastOperatorType = false;
+}
+
+void
+PE_Type::TransferData()
+{
+ pStati->SetCur(size_of_states);
+
+ if ( IsType() )
+ pResult_Type = & Env().AryGate().Types().CheckIn_UsedType(
+ Env().Context(),
+ *pType.Release() );
+ else
+ pResult_Type = new NullType;
+}
+
+void
+PE_Type::Hdl_SyntaxError( const char * i_sText )
+{
+ StdHandlingOfSyntaxError( i_sText );
+}
+
+void
+PE_Type::SpReturn_Type_TemplateParameter()
+{
+ if ( pSpuType_TemplateParameter->Child().Result_KindOf() != is_type )
+ throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0);
+
+ pCurTemplate_ParameterList->AddParam_Type(
+ pSpuType_TemplateParameter->Child().Result_Type().TypeId() );
+}
+
+void
+PE_Type::SpReturn_Class()
+{
+ switch ( pSpuClass->Child().Result_KindOf() )
+ {
+ case PE_Class::is_declaration:
+ pStati->SetCur(afterclass_expect_semicolon);
+ eResult_KindOf = is_explicit_class_declaration;
+ break;
+ case PE_Class::is_implicit_declaration:
+ pStati->SetCur(after_namesegment);
+ pType->Add_NameSegment(
+ pSpuClass->Child().Result_LocalName() );
+ break;
+ case PE_Class::is_predeclaration:
+ pStati->SetCur(afterclass_expect_semicolon);
+ eResult_KindOf = is_class_predeclaration;
+ break;
+ case PE_Class::is_qualified_typename:
+ pStati->SetCur(after_namesegment);
+ pType->Add_NameSegment(
+ pSpuClass->Child().Result_FirstNameSegment() );
+ break;
+ default:
+ csv_assert(false);
+ }
+}
+
+void
+PE_Type::SpReturn_Enum()
+{
+ switch ( pSpuEnum->Child().Result_KindOf() )
+ {
+ case PE_Enum::is_declaration:
+ pStati->SetCur(afterclass_expect_semicolon);
+ eResult_KindOf = is_explicit_enum_declaration;
+ break;
+ case PE_Enum::is_implicit_declaration:
+ pStati->SetCur(after_namesegment);
+ pType->Add_NameSegment(
+ pSpuEnum->Child().Result_LocalName() );
+ break;
+ case PE_Enum::is_qualified_typename:
+ pStati->SetCur(after_namesegment);
+ pType->Add_NameSegment(
+ pSpuEnum->Child().Result_FirstNameSegment() );
+ break;
+ default:
+ csv_assert(false);
+ }
+}
+
+void
+PE_Type::On_EndOfType(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Type::On_start_Identifier( const char * i_sText )
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(after_namesegment);
+
+ pType->Add_NameSegment(i_sText);
+}
+
+void
+PE_Type::On_start_class(const char *)
+{
+ pSpuClass->Push(not_done);
+}
+
+void
+PE_Type::On_start_enum(const char *)
+{
+ pSpuEnum->Push(done);
+}
+
+void
+PE_Type::On_start_const(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Const();
+}
+
+void
+PE_Type::On_start_volatile(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Volatile();
+}
+
+void
+PE_Type::On_start_Bracket_Right(const char *)
+{
+ SetTokenResult(not_done,pop_success);
+
+ eResult_KindOf = is_none;
+}
+
+void
+PE_Type::On_start_DoubleColon(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Absolute();
+}
+
+void
+PE_Type::On_start_BuiltInType(const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(after_namesegment);
+ pType->Set_BuiltIn(i_sText);
+}
+
+void
+PE_Type::On_start_TypeSpecializer(const char * i_sText)
+{
+ SetTokenResult(done,stay);
+ if (*i_sText == 'u') {
+ pType->Set_Unsigned();
+ }
+ else if (*i_sText == 's') {
+ pType->Set_Signed();
+ }
+ else {
+ csv_assert(false);
+ }
+}
+
+void
+PE_Type::On_start_typename(const char *)
+{
+ SetTokenResult(done,stay);
+}
+
+void
+PE_Type::On_expect_namesegment_Identifier(const char * i_sText)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(after_namesegment);
+ pType->Add_NameSegment(i_sText);
+}
+
+void
+PE_Type::On_after_namesegment_const(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Const();
+}
+
+void
+PE_Type::On_after_namesegment_volatile(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Volatile();
+}
+
+void
+PE_Type::On_after_namesegment_Bracket_Left(const char * i_sText)
+{
+ if ( bIsCastOperatorType )
+ {
+ SetTokenResult(not_done, pop_success);
+ }
+ else if ( pType->LocalName() == sOwningClassName )
+ {
+ SetTokenResult(not_done,pop_success);
+ eResult_KindOf = is_constructor;
+
+ }
+ else //
+ {
+ On_EndOfType(i_sText);
+ } // endif
+}
+
+void
+PE_Type::On_after_namesegment_DoubleColon(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(expect_namesegment);
+}
+
+void
+PE_Type::On_after_namesegment_Less(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(within_template);
+
+ pCurTemplate_ParameterList = & pType->Enter_Template();
+}
+
+void
+PE_Type::On_after_namesegment_Asterix(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(within_indirection);
+ pType->Add_PtrLevel();
+}
+
+void
+PE_Type::On_after_namesegment_AmpersAnd(const char *)
+{
+ SetTokenResult(done,pop_success);
+ pType->Set_Reference();
+}
+
+void
+PE_Type::On_afterclass_expect_semicolon_Semicolon(const char *)
+{
+ csv_assert( NOT IsType() );
+ SetTokenResult(not_done,pop_success);
+}
+
+void
+PE_Type::On_within_template_Comma(const char *)
+{
+ SetTokenResult(done,stay);
+}
+
+void
+PE_Type::On_within_template_Greater(const char *)
+{
+ SetTokenResult(done,stay);
+ pStati->SetCur(after_namesegment);
+
+ pCurTemplate_ParameterList = 0;
+}
+
+void
+PE_Type::On_within_template_Constant(const char * i_sText)
+{
+ // KORR_FUTURE
+ Cerr() << "Templates with constants as parameters are not yet supported by Autodoc" << Endl();
+ Hdl_SyntaxError(i_sText);
+}
+
+void
+PE_Type::On_within_template_TypeStart(const char *)
+{
+ pSpuType_TemplateParameter->Push(not_done);
+}
+
+void
+PE_Type::On_within_indirection_const(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Const();
+}
+
+void
+PE_Type::On_within_indirection_volatile(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Set_Volatile();
+}
+
+void
+PE_Type::On_within_indirection_Asterix(const char *)
+{
+ SetTokenResult(done,stay);
+ pType->Add_PtrLevel();
+}
+
+void
+PE_Type::On_within_indirection_AmpersAnd(const char *)
+{
+ SetTokenResult(done,pop_success);
+ pType->Set_Reference();
+}
+
+} // namespace cpp
+
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_type.hxx b/autodoc/source/parser/cpp/pe_type.hxx
new file mode 100644
index 000000000000..7806f5335023
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_type.hxx
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_type.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_TYPE_HXX
+#define ADC_CPP_PE_TYPE_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <ary/cpp/usedtype.hxx>
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+ // PARAMETERS
+#include <ary/cpp/c_types4cpp.hxx>
+
+
+
+namespace cpp {
+
+class PE_Class;
+class PE_Enum;
+class PE_Expression;
+
+class PE_Type : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start,
+ expect_namesegment,
+ after_namesegment,
+ afterclass_expect_semicolon,
+ within_template,
+ within_indirection,
+ size_of_states
+ };
+ enum E_KindOfResult
+ {
+ is_none,
+ is_type,
+ is_constructor,
+ is_explicit_class_declaration,
+ is_class_predeclaration,
+ is_explicit_enum_declaration
+ };
+
+ PE_Type(
+ Cpp_PE * i_pParent );
+ ~PE_Type();
+
+ void Init_AsCastOperatorType();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ E_KindOfResult Result_KindOf() const;
+ const ary::cpp::Type &
+ Result_Type() const;
+ private:
+ typedef SubPe< PE_Type, PE_Type > SP_Type;
+ typedef SubPe< PE_Type, PE_Class > SP_Class;
+ typedef SubPe< PE_Type, PE_Enum > SP_Enum;
+ typedef SubPeUse< PE_Type, PE_Type > SPU_Type;
+ typedef SubPeUse< PE_Type, PE_Class > SPU_Class;
+ typedef SubPeUse< PE_Type, PE_Enum > SPU_Enum;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError( const char *);
+
+ void SpReturn_Type_TemplateParameter();
+ void SpReturn_Class();
+ void SpReturn_Enum();
+
+ void On_EndOfType(const char *);
+
+ void On_start_Identifier(const char *);
+ void On_start_class(const char *);
+ void On_start_enum(const char *);
+ void On_start_const(const char *);
+ void On_start_volatile(const char *);
+ void On_start_Bracket_Right(const char *);
+ void On_start_DoubleColon(const char *);
+ void On_start_BuiltInType(const char *);
+ void On_start_TypeSpecializer(const char *);
+ void On_start_typename(const char *);
+
+ void On_expect_namesegment_Identifier(const char *);
+
+ void On_after_namesegment_const(const char *);
+ void On_after_namesegment_volatile(const char *);
+ void On_after_namesegment_Bracket_Left(const char *);
+ void On_after_namesegment_DoubleColon(const char *);
+ void On_after_namesegment_Less(const char *);
+ void On_after_namesegment_Asterix(const char *);
+ void On_after_namesegment_AmpersAnd(const char *);
+
+ void On_afterclass_expect_semicolon_Semicolon(const char *);
+
+ void On_within_template_Comma(const char *);
+ void On_within_template_Greater(const char *);
+ void On_within_template_Constant(const char *);
+ void On_within_template_TypeStart(const char *);
+
+ void On_within_indirection_const(const char *);
+ void On_within_indirection_volatile(const char *);
+ void On_within_indirection_Asterix(const char *);
+ void On_within_indirection_AmpersAnd(const char *);
+
+ bool IsType() const;
+
+ // DATA
+ Dyn< PeStatusArray<PE_Type> >
+ pStati;
+
+ Dyn<SP_Type> pSpType;
+ Dyn<SPU_Type> pSpuType_TemplateParameter;
+ Dyn<SP_Class> pSpClass;
+ Dyn<SPU_Class> pSpuClass;
+ Dyn<SP_Enum> pSpEnum;
+ Dyn<SPU_Enum> pSpuEnum;
+
+ Dyn<ary::cpp::UsedType>
+ pType;
+ ary::cpp::ut::List_TplParameter *
+ pCurTemplate_ParameterList;
+ String sOwningClassName;
+ String sParsedClass_Name;
+
+ const ary::cpp::Type *
+ pResult_Type;
+ E_KindOfResult eResult_KindOf;
+ bool bIsCastOperatorType;
+};
+
+
+
+// IMPLEMENTATION
+
+
+inline const ary::cpp::Type &
+PE_Type::Result_Type() const
+ { csv_assert(pResult_Type != 0);
+ return *pResult_Type; }
+inline PE_Type::E_KindOfResult
+PE_Type::Result_KindOf() const
+ { return eResult_KindOf; }
+
+
+} // namespace cpp
+
+
+#endif
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_vafu.cxx b/autodoc/source/parser/cpp/pe_vafu.cxx
new file mode 100644
index 000000000000..265b5a6665ba
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_vafu.cxx
@@ -0,0 +1,652 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_vafu.cxx,v $
+ * $Revision: 1.12 $
+ *
+ * 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 "pe_vafu.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <ary/cpp/c_class.hxx>
+#include <ary/cpp/c_vari.hxx>
+#include <ary/cpp/c_vfflag.hxx>
+#include <ary/cpp/cp_ce.hxx>
+#include <ary/cpp/inpcontx.hxx>
+#include "pe_type.hxx"
+#include "pe_vari.hxx"
+#include "pe_funct.hxx"
+#include "pe_ignor.hxx"
+#include <x_parse.hxx>
+
+
+
+
+namespace cpp {
+
+
+
+//*********************** PE_VarFunc ***********************//
+
+
+PE_VarFunc::PE_VarFunc( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_VarFunc> ),
+ // pSpType,
+ // pSpuType,
+ // pSpVariable,
+ // pSpuVariable,
+ // pSpFunction,
+ // pSpuFunctionStd,
+ // pSpuFunctionCtor,
+ // pSpuFunctionDtor,
+ // pSpuFunctionCastOperator,
+ // pSpuFunctionNormalOperator
+ // pSpIgnore,
+ // pSpuIgnore,
+ nCounter_TemplateBrackets(0),
+ bInDestructor(false),
+ // aResultIds,
+ nResultFrontType(0),
+ eResultType(result_unknown),
+ bVirtual(false),
+ bStatic(false),
+ bExtern(false),
+ bExternC(false),
+ bMutable(false),
+ bInline(false),
+ bRegister(false),
+ bExplicit(false)
+{
+ Setup_StatusFunctions();
+
+ pSpType = new SP_Type(*this);
+ pSpuType = new SPU_Type(*pSpType, 0, &PE_VarFunc::SpReturn_Type);
+ pSpVariable = new SP_Variable(*this);
+ pSpuVariable = new SPU_Variable(*pSpVariable, 0, &PE_VarFunc::SpReturn_Variable);
+ pSpFunction = new SP_Function(*this);
+ pSpuFunctionStd = new SPU_Function(*pSpFunction, &PE_VarFunc::SpInit_FunctionStd, &PE_VarFunc::SpReturn_FunctionStd);
+ pSpuFunctionCtor = new SPU_Function(*pSpFunction, &PE_VarFunc::SpInit_FunctionCtor, &PE_VarFunc::SpReturn_FunctionStd);
+ pSpuFunctionDtor = new SPU_Function(*pSpFunction, &PE_VarFunc::SpInit_FunctionDtor, &PE_VarFunc::SpReturn_FunctionStd);
+ pSpuFunctionCastOperator
+ = new SPU_Function(*pSpFunction, &PE_VarFunc::SpInit_FunctionCastOperator, &PE_VarFunc::SpReturn_FunctionStd);
+ pSpuFunctionNormalOperator
+ = new SPU_Function(*pSpFunction, &PE_VarFunc::SpInit_FunctionNormalOperator, &PE_VarFunc::SpReturn_FunctionStd);
+ pSpIgnore = new SP_Ignore(*this);
+ pSpuIgnore = new SPU_Ignore(*pSpIgnore, 0, &PE_VarFunc::SpReturn_Ignore);
+}
+
+PE_VarFunc::~PE_VarFunc()
+{
+}
+
+void
+PE_VarFunc::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_VarFunc::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_VarFunc>::F_Tok F_Tok;
+
+ static F_Tok stateF_start[] = { &PE_VarFunc::On_start_Identifier,
+ &PE_VarFunc::On_start_operator,
+ &PE_VarFunc::On_start_TypeKey,
+ &PE_VarFunc::On_start_TypeKey,
+ &PE_VarFunc::On_start_TypeKey,
+ &PE_VarFunc::On_start_TypeKey,
+ &PE_VarFunc::On_start_virtual,
+ &PE_VarFunc::On_start_Tilde,
+ &PE_VarFunc::On_start_const,
+ &PE_VarFunc::On_start_volatile,
+ &PE_VarFunc::On_start_extern,
+ &PE_VarFunc::On_start_static,
+ &PE_VarFunc::On_start_mutable,
+ &PE_VarFunc::On_start_register,
+ &PE_VarFunc::On_start_inline,
+ &PE_VarFunc::On_start_explicit,
+ &PE_VarFunc::On_start_Bracket_Right,
+ &PE_VarFunc::On_start_Identifier,
+ &PE_VarFunc::On_start_typename,
+ &PE_VarFunc::On_start_Identifier,
+ &PE_VarFunc::On_start_Identifier };
+ static INT16 stateT_start[] = { Tid_Identifier,
+ Tid_operator,
+ Tid_class,
+ Tid_struct,
+ Tid_union,
+ Tid_enum,
+ Tid_virtual,
+ Tid_Tilde,
+ Tid_const,
+ Tid_volatile,
+ Tid_extern,
+ Tid_static,
+ Tid_mutable,
+ Tid_register,
+ Tid_inline,
+ Tid_explicit,
+ Tid_Bracket_Right,
+ Tid_DoubleColon,
+ Tid_typename,
+ Tid_BuiltInType,
+ Tid_TypeSpecializer };
+
+ static F_Tok stateF_expectCtor[] = { &PE_VarFunc::On_expectCtor_Bracket_Left };
+ static INT16 stateT_expectCtor[] = { Tid_Bracket_Left };
+
+ static F_Tok stateF_afterClassDecl[] = { &PE_VarFunc::On_afterClassDecl_Semicolon };
+ static INT16 stateT_afterClassDecl[] = { Tid_Semicolon };
+
+ static F_Tok stateF_expectName[] = { &PE_VarFunc::On_expectName_Identifier,
+ &PE_VarFunc::On_expectName_operator,
+ &PE_VarFunc::On_expectName_Bracket_Left };
+ static INT16 stateT_expectName[] = { Tid_Identifier,
+ Tid_operator,
+ Tid_Bracket_Left };
+
+ static F_Tok stateF_afterName[] = { &PE_VarFunc::On_afterName_ArrayBracket_Left,
+ &PE_VarFunc::On_afterName_Bracket_Left,
+ &PE_VarFunc::On_afterName_DoubleColon,
+ &PE_VarFunc::On_afterName_Semicolon,
+ &PE_VarFunc::On_afterName_Comma,
+ &PE_VarFunc::On_afterName_Assign,
+ &PE_VarFunc::On_afterName_Less };
+ static INT16 stateT_afterName[] = { Tid_ArrayBracket_Left,
+ Tid_Bracket_Left,
+ Tid_DoubleColon,
+ Tid_Semicolon,
+ Tid_Comma,
+ Tid_Assign,
+ Tid_Less };
+
+ static F_Tok stateF_afterName_inErraneousTemplate[] =
+ { &PE_VarFunc::On_afterName_inErraneousTemplate_Less,
+ &PE_VarFunc::On_afterName_inErraneousTemplate_Greater };
+ static INT16 stateT_afterName_inErraneousTemplate[] =
+ { Tid_Less,
+ Tid_Greater };
+
+ static F_Tok stateF_finished[] = { &PE_VarFunc::On_finished_Semicolon,
+ &PE_VarFunc::On_finished_Comma };
+ static INT16 stateT_finished[] = { Tid_Semicolon,
+ Tid_Comma };
+
+ static F_Tok stateF_finishedIncludingFunctionImplementation[] =
+ { &PE_VarFunc::On_finishedIncludingFunctionImplementation_Default
+ };
+ static INT16 stateT_finishedIncludingFunctionImplementation[] =
+ { Tid_BuiltInType // Just to have one entry, but it is default handled, too.
+ };
+
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, start, Hdl_UnknownToken);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, expectCtor, Hdl_UnknownToken);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, afterClassDecl, Hdl_UnknownToken);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, expectName, Hdl_UnknownToken);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, afterName, Hdl_UnknownToken);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, afterName_inErraneousTemplate, On_afterName_inErraneousTemplate_Default);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, finished, On_finished_Default);
+ SEMPARSE_CREATE_STATUS(PE_VarFunc, finishedIncludingFunctionImplementation, On_finishedIncludingFunctionImplementation_Default);
+}
+
+void
+PE_VarFunc::InitData()
+{
+ pStati->SetCur(start);
+ csv::erase_container(aResultIds);
+
+ nCounter_TemplateBrackets = 0;
+ bInDestructor = false;
+
+ nResultFrontType = 0;
+ eResultType = result_unknown;
+ sName.clear();
+ bVirtual = ary::cpp::VIRTUAL_none;
+ bStatic = false;
+ bExtern = false;
+ bExternC = false;
+ bMutable = false;
+ bInline = false;
+ bRegister = false;
+ bExplicit = false;
+}
+
+void
+PE_VarFunc::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_VarFunc::Hdl_UnknownToken( const char *)
+{
+ pSpuIgnore->Push(not_done);
+}
+
+void
+PE_VarFunc::SpInit_FunctionStd()
+{
+ if ( nResultFrontType.IsValid() AND sName.length() > 0 )
+ {
+ pSpuFunctionStd->Child().Init_Std(
+ sName,
+ nResultFrontType,
+ bVirtual,
+ CreateFunctionFlags() );
+ }
+ else
+ {
+ throw X_Parser( X_Parser::x_UnexpectedToken,
+ "",
+ Env().CurFileName(),
+ Env().LineCount() );
+ }
+}
+
+void
+PE_VarFunc::SpInit_FunctionCtor()
+{
+ ary::cpp::Class * pOwnerClass = Env().Context().CurClass();
+ csv_assert( pOwnerClass != 0 );
+ pSpuFunctionStd->Child().Init_Ctor( pOwnerClass->LocalName(),
+ CreateFunctionFlags() );
+}
+
+void
+PE_VarFunc::SpInit_FunctionDtor()
+{
+ pSpuFunctionStd->Child().Init_Dtor( sName,
+ bVirtual,
+ CreateFunctionFlags() );
+}
+
+void
+PE_VarFunc::SpInit_FunctionCastOperator()
+{
+ pSpuFunctionStd->Child().Init_CastOperator( bVirtual,
+ CreateFunctionFlags() );
+}
+
+void
+PE_VarFunc::SpInit_FunctionNormalOperator()
+{
+ pSpuFunctionStd->Child().Init_NormalOperator( nResultFrontType,
+ bVirtual,
+ CreateFunctionFlags() );
+}
+
+void
+PE_VarFunc::SpReturn_Type()
+{
+ switch ( pSpuType->Child().Result_KindOf() )
+ {
+ case PE_Type::is_type:
+ pStati->SetCur(expectName);
+ nResultFrontType
+ = pSpuType->Child().Result_Type().Id();
+ break;
+ case PE_Type::is_constructor:
+ pStati->SetCur(expectCtor);
+ eResultType = result_function;
+ break;
+ case PE_Type::is_explicit_class_declaration:
+ case PE_Type::is_explicit_enum_declaration:
+ pStati->SetCur(afterClassDecl);
+ eResultType = result_ignore;
+ break;
+ case PE_Type::is_class_predeclaration:
+ pStati->SetCur(afterClassDecl);
+ eResultType = result_ignore;
+ break;
+ default:
+ ;
+ }
+}
+
+void
+PE_VarFunc::SpReturn_Variable()
+{
+ typedef ary::cpp::VariableFlags VarFlags;
+
+ if ( NOT bExtern )
+ {
+ VarFlags aFlags( UINT16(
+ ( bStatic AND Env().Context().CurClass() == 0 ? VarFlags::f_static_local : 0 )
+ | ( bStatic AND Env().Context().CurClass() != 0 ? VarFlags::f_static_member : 0 )
+ | ( bMutable ? VarFlags::f_mutable : 0 ) )
+ );
+
+// ary::S_InitData aData( 0, Env().CurCeSpace().Id(), i_sName, 0 );
+ ary::cpp::Variable & rCurParsedVariable
+ = Env().AryGate().Ces().Store_Variable( Env().Context(),
+ sName,
+ nResultFrontType,
+ aFlags,
+ pSpuVariable->Child().Result_SizeExpression(),
+ pSpuVariable->Child().Result_InitExpression() );
+ Env().Event_Store_Variable(rCurParsedVariable);
+ aResultIds.push_back( rCurParsedVariable.CeId() );
+ eResultType = result_variable;
+ }
+ else if (bExtern)
+ {
+ eResultType = result_ignore;
+ }
+
+ pStati->SetCur(finished);
+}
+
+void
+PE_VarFunc::SpReturn_FunctionStd()
+{
+ if ( (NOT bExtern) OR bExternC )
+ {
+ aResultIds.push_back(pSpuFunctionStd->Child().Result_Id());
+ eResultType = result_function;
+ }
+ else
+ {
+ eResultType = result_ignore;
+ }
+
+ if ( NOT pSpuFunctionStd->Child().Result_WithImplementation() )
+ pStati->SetCur(finished);
+ else
+ pStati->SetCur(finishedIncludingFunctionImplementation);
+}
+
+void
+PE_VarFunc::SpReturn_Ignore()
+{
+ pStati->SetCur(finished);
+}
+
+void
+PE_VarFunc::On_start_Identifier(const char *)
+{
+ pSpuType->Push(not_done);
+}
+
+void
+PE_VarFunc::On_start_operator(const char *)
+{
+ pSpuFunctionCastOperator->Push(done);
+}
+
+void
+PE_VarFunc::On_start_TypeKey(const char *)
+{
+ pSpuType->Push(not_done);
+}
+
+void
+PE_VarFunc::On_start_virtual(const char *)
+{
+ SetTokenResult(done, stay);
+ bVirtual = true;
+}
+
+void
+PE_VarFunc::On_start_Tilde(const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expectName);
+
+ bInDestructor = true;
+}
+
+void
+PE_VarFunc::On_start_const(const char *)
+{
+ pSpuType->Push(not_done);
+}
+
+void
+PE_VarFunc::On_start_volatile(const char *)
+{
+ pSpuType->Push(not_done);
+}
+
+void
+PE_VarFunc::On_start_extern(const char *)
+{
+ SetTokenResult(done, stay);
+ bExtern = true;
+}
+
+void
+PE_VarFunc::On_start_static(const char *)
+{
+ SetTokenResult(done, stay);
+ bStatic = true;
+}
+
+void
+PE_VarFunc::On_start_mutable(const char *)
+{
+ SetTokenResult(done, stay);
+ bMutable = true;
+}
+
+void
+PE_VarFunc::On_start_register(const char *)
+{
+ SetTokenResult(done, stay);
+ bRegister = true;
+}
+
+void
+PE_VarFunc::On_start_inline(const char *)
+{
+ SetTokenResult(done, stay);
+
+ bInline = true;
+}
+
+void
+PE_VarFunc::On_start_explicit(const char *)
+{
+ SetTokenResult(done, stay);
+ bExplicit = true;
+}
+
+void
+PE_VarFunc::On_start_Bracket_Right(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_VarFunc::On_start_typename(const char *)
+{
+ pSpuType->Push(not_done);
+}
+
+void
+PE_VarFunc::On_expectCtor_Bracket_Left(const char *)
+{
+ pSpuFunctionCtor->Push(not_done);
+}
+
+void
+PE_VarFunc::On_afterClassDecl_Semicolon(const char *)
+{
+ SetTokenResult(done, pop_success);
+}
+
+void
+PE_VarFunc::On_expectName_Identifier(const char * i_sText)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterName);
+ sName = i_sText;
+}
+
+void
+PE_VarFunc::On_expectName_operator(const char *)
+{
+ pSpuFunctionNormalOperator->Push(done);
+}
+
+void
+PE_VarFunc::On_expectName_Bracket_Left(const char *)
+{
+ // Function pointer declaration
+ pSpuIgnore->Push(not_done);
+ // TODO
+}
+
+
+void
+PE_VarFunc::On_afterName_ArrayBracket_Left(const char *)
+{
+ pSpuVariable->Push(not_done);
+}
+
+void
+PE_VarFunc::On_afterName_Bracket_Left(const char *)
+{
+ if ( NOT bInDestructor)
+ pSpuFunctionStd->Push(not_done);
+ else
+ pSpuFunctionDtor->Push(not_done);
+}
+
+void
+PE_VarFunc::On_afterName_DoubleColon(const char *)
+{
+ pSpuIgnore->Push(done); // This seems to be only an implementation.
+
+ // This may have been a template.
+ // In that case, the declaration needs to be closed.
+ Env().Close_OpenTemplate();
+}
+
+void
+PE_VarFunc::On_afterName_Semicolon(const char *)
+{
+ pSpuVariable->Push(not_done);
+}
+
+void
+PE_VarFunc::On_afterName_Comma(const char *)
+{
+ pSpuVariable->Push(not_done);
+}
+
+void
+PE_VarFunc::On_afterName_Assign(const char * )
+{
+ pSpuVariable->Push(not_done);
+}
+
+void
+PE_VarFunc::On_afterName_Less(const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterName_inErraneousTemplate);
+
+ nCounter_TemplateBrackets = 1;
+}
+
+void
+PE_VarFunc::On_afterName_inErraneousTemplate_Less(const char * )
+{
+ SetTokenResult(done, stay);
+
+ nCounter_TemplateBrackets++;
+}
+
+void
+PE_VarFunc::On_afterName_inErraneousTemplate_Greater(const char * )
+{
+ SetTokenResult(done, stay);
+
+ nCounter_TemplateBrackets--;
+ if ( nCounter_TemplateBrackets == 0 )
+ pStati->SetCur(afterName);
+}
+
+void
+PE_VarFunc::On_afterName_inErraneousTemplate_Default(const char * )
+{
+ SetTokenResult(done, stay);
+}
+
+void
+PE_VarFunc::On_finished_Semicolon(const char * ) // Should be Semicolon !!!
+{
+ SetTokenResult(done, pop_success);
+}
+
+void
+PE_VarFunc::On_finished_Comma(const char * )
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(expectName);
+}
+
+void
+PE_VarFunc::On_finished_Default(const char * )
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_VarFunc::On_finishedIncludingFunctionImplementation_Default(const char * )
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+ary::cpp::FunctionFlags
+PE_VarFunc::CreateFunctionFlags()
+{
+ typedef ary::cpp::FunctionFlags FuncFlags;
+
+ return FuncFlags( UINT16(
+ ( bStatic AND Env().Context().CurClass() == 0 ? FuncFlags::f_static_local : 0 )
+ | ( bStatic AND Env().Context().CurClass() != 0 ? FuncFlags::f_static_member : 0 )
+ | ( bExtern ? FuncFlags::f_extern : 0 )
+ | ( Env().IsExternC() ? FuncFlags::f_externC : 0 )
+ | ( bMutable ? FuncFlags::f_mutable : 0 )
+ | ( bInline ? FuncFlags::f_inline : 0 )
+ | ( bRegister ? FuncFlags::f_register : 0 )
+ | ( bExplicit ? FuncFlags::f_explicit : 0 ) )
+ );
+
+}
+
+
+} // namespace cpp
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_vafu.hxx b/autodoc/source/parser/cpp/pe_vafu.hxx
new file mode 100644
index 000000000000..1d22d67d0082
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_vafu.hxx
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_vafu.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef ADC_CPP_PE_VAFU_HXX
+#define ADC_CPP_PE_VAFU_HXX
+
+// BASE CLASSES
+#include "cpp_pe.hxx"
+// USED SERVICES
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+#include <ary/cpp/c_types4cpp.hxx>
+#include <ary/cpp/c_vfflag.hxx>
+
+
+
+namespace cpp
+{
+
+class PE_Type;
+class PE_Variable;
+class PE_Function;
+class PE_Ignore;
+
+
+
+
+class PE_VarFunc : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ start,
+ expectCtor,
+ afterClassDecl, // Also used for after enum declaration.
+ expectName,
+ afterName,
+ afterName_inErraneousTemplate,
+ finished,
+ finishedIncludingFunctionImplementation,
+ size_of_states
+ };
+ enum E_ResultType
+ {
+ result_unknown = 0,
+ result_ignore, /// Used for class and enum declarations and predeclarations and for extern variables and functions.
+ result_variable,
+ result_function
+ };
+
+ typedef ary::cpp::E_Protection E_Protection;
+
+
+ PE_VarFunc(
+ Cpp_PE * i_pParent );
+ ~PE_VarFunc();
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ const std::vector<ary::cpp::Ce_id> &
+ Result_Ids() const;
+ ary::cpp::Type_id Result_FrontType() const;
+ const StringVector &
+ Result_Names() const;
+ E_ResultType Result_CeType() const;
+
+ private:
+ typedef SubPe< PE_VarFunc, PE_Type > SP_Type;
+ typedef SubPeUse< PE_VarFunc, PE_Type > SPU_Type;
+ typedef SubPe< PE_VarFunc, PE_Variable > SP_Variable;
+ typedef SubPeUse< PE_VarFunc, PE_Variable > SPU_Variable;
+ typedef SubPe< PE_VarFunc, PE_Function > SP_Function;
+ typedef SubPeUse< PE_VarFunc, PE_Function > SPU_Function;
+ typedef SubPe< PE_VarFunc, PE_Ignore > SP_Ignore;
+ typedef SubPeUse< PE_VarFunc, PE_Ignore > SPU_Ignore;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_UnknownToken( const char *);
+
+ void SpInit_FunctionStd();
+ void SpInit_FunctionCtor();
+ void SpInit_FunctionDtor();
+ void SpInit_FunctionCastOperator();
+ void SpInit_FunctionNormalOperator();
+ void SpReturn_Type();
+ void SpReturn_Variable();
+ void SpReturn_FunctionStd();
+ void SpReturn_Ignore();
+
+ void On_start_Identifier(const char * i_sText);
+ void On_start_operator(const char * i_sText);
+ void On_start_TypeKey(const char * i_sText);
+ void On_start_virtual(const char * i_sText);
+ void On_start_Tilde(const char * i_sText);
+ void On_start_const(const char * i_sText);
+ void On_start_volatile(const char * i_sText);
+ void On_start_extern(const char * i_sText);
+ void On_start_static(const char * i_sText);
+ void On_start_mutable(const char * i_sText);
+ void On_start_register(const char * i_sText);
+ void On_start_inline(const char * i_sText);
+ void On_start_explicit(const char * i_sText);
+ void On_start_Bracket_Right(const char * i_sText);
+ void On_start_typename(const char * i_sText);
+
+ void On_expectCtor_Bracket_Left(const char * i_sText);
+
+ void On_afterClassDecl_Semicolon(const char * i_sText);
+
+ void On_expectName_Identifier(const char * i_sText);
+ void On_expectName_operator(const char * i_sText);
+ void On_expectName_Bracket_Left(const char * i_sText);
+
+ void On_afterName_ArrayBracket_Left(const char * i_sText);
+ void On_afterName_Bracket_Left(const char * i_sText);
+ void On_afterName_DoubleColon(const char * i_sText);
+ void On_afterName_Semicolon(const char * i_sText);
+ void On_afterName_Comma(const char * i_sText);
+ void On_afterName_Assign(const char * i_sText);
+ void On_afterName_Less(const char * i_sText);
+
+ void On_afterName_inErraneousTemplate_Less(const char * i_sText);
+ void On_afterName_inErraneousTemplate_Greater(const char * i_sText);
+ void On_afterName_inErraneousTemplate_Default(const char * i_sText);
+
+ void On_finished_Semicolon(const char * i_sText);
+ void On_finished_Comma(const char * i_sText);
+ void On_finished_Default(const char * i_sText);
+
+ void On_finishedIncludingFunctionImplementation_Default(const char * i_sText);
+
+ ary::cpp::FunctionFlags
+ CreateFunctionFlags();
+
+ // DATA
+ Dyn< PeStatusArray<PE_VarFunc> >
+ pStati;
+
+ Dyn<SP_Type> pSpType;
+ Dyn<SPU_Type> pSpuType;
+ Dyn<SP_Variable> pSpVariable;
+ Dyn<SPU_Variable> pSpuVariable;
+ Dyn<SP_Function> pSpFunction;
+ Dyn<SPU_Function> pSpuFunctionStd;
+ Dyn<SPU_Function> pSpuFunctionCtor;
+ Dyn<SPU_Function> pSpuFunctionDtor;
+ Dyn<SPU_Function> pSpuFunctionCastOperator;
+ Dyn<SPU_Function> pSpuFunctionNormalOperator;
+ Dyn<SP_Ignore> pSpIgnore;
+ Dyn<SPU_Ignore> pSpuIgnore;
+
+ intt nCounter_TemplateBrackets;
+ bool bInDestructor;
+
+ std::vector<ary::cpp::Ce_id>
+ aResultIds;
+ ary::cpp::Type_id nResultFrontType;
+ E_ResultType eResultType;
+
+ // Pre-Results
+ String sName;
+
+ bool bVirtual;
+ bool bStatic;
+ bool bExtern;
+ bool bExternC;
+ bool bMutable;
+ bool bInline;
+ bool bRegister;
+ bool bExplicit;
+};
+
+
+
+// IMPLEMENTATION
+
+inline const std::vector<ary::cpp::Ce_id> &
+PE_VarFunc::Result_Ids() const
+ { return aResultIds; }
+inline ary::cpp::Type_id
+PE_VarFunc::Result_FrontType() const
+ { return nResultFrontType; }
+inline PE_VarFunc::E_ResultType
+PE_VarFunc::Result_CeType() const
+ { return eResultType; }
+
+
+
+} // namespace cpp
+
+
+
+
+#endif
+
+
+/* // Overview of Stati
+
+Undecided
+---------
+
+start // vor und während storage class specifiern
+ any ->stay
+ operaator ->goto Function
+
+->Typ
+
+expectName
+ Identifier ->stay
+ operator ->goto Function
+
+afterName ->goto Variable or Function
+
+
+
+
+Variable
+--------
+
+start // vor und während storage class specifiern
+
+->Typ
+
+expectName // Typ ist da -> im Falle von '(': notyetimplemented
+afterName
+
+expectSize // after [
+expectFinish
+ // vor ; oder ,
+expectNextVarName // anders als bei expectName kann hier auch * oder & kommen
+
+
+
+
+
+Function
+--------
+
+start // vor und während storage class specifiern
+
+->Typ
+
+expectName // Typ ist da
+expectBracket // Nach Name
+expectParameter // nach ( oder ,
+-> Parameter
+after Parameters // before const, volatile throw or = 0.
+after throw // expect (
+expectException // after (
+after exceptions // = 0 oder ; oder ,
+
+
+expectNextVarName // anders als bei expectName kann hier auch * oder & kommen
+
+
+
+
+
+
+
+*/
diff --git a/autodoc/source/parser/cpp/pe_vari.cxx b/autodoc/source/parser/cpp/pe_vari.cxx
new file mode 100644
index 000000000000..9d3ba37c43db
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_vari.cxx
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_vari.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "pe_vari.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include "pe_expr.hxx"
+
+
+
+
+namespace cpp {
+
+
+PE_Variable::PE_Variable( Cpp_PE * i_pParent )
+ : Cpp_PE(i_pParent),
+ pStati( new PeStatusArray<PE_Variable> )
+ // pSpExpression,
+ // pSpuArraySizeExpression,
+ // pSpuInitExpression,
+ // sResultSizeExpression,
+ // sResultInitExpression
+{
+ Setup_StatusFunctions();
+
+ pSpExpression = new SP_Expression(*this);
+
+ pSpuArraySizeExpression = new SPU_Expression(*pSpExpression, 0, &PE_Variable::SpReturn_ArraySizeExpression);
+ pSpuInitExpression = new SPU_Expression(*pSpExpression, 0, &PE_Variable::SpReturn_InitExpression);
+}
+
+PE_Variable::~PE_Variable()
+{
+}
+
+void
+PE_Variable::Call_Handler( const cpp::Token & i_rTok )
+{
+ pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
+}
+
+void
+PE_Variable::Setup_StatusFunctions()
+{
+ typedef CallFunction<PE_Variable>::F_Tok F_Tok;
+
+ static F_Tok stateF_afterName[] = { &PE_Variable::On_afterName_ArrayBracket_Left,
+ &PE_Variable::On_afterName_Semicolon,
+ &PE_Variable::On_afterName_Comma,
+ &PE_Variable::On_afterName_Assign };
+ static INT16 stateT_afterName[] = { Tid_ArrayBracket_Left,
+ Tid_Semicolon,
+ Tid_Comma,
+ Tid_Assign };
+ static F_Tok stateF_afterSize[] = { &PE_Variable::On_afterSize_ArrayBracket_Right };
+ static INT16 stateT_afterSize[] = { Tid_ArrayBracket_Right };
+ static F_Tok stateF_expectFinish[] = { &PE_Variable::On_expectFinish_Bracket_Right,
+ &PE_Variable::On_expectFinish_Semicolon,
+ &PE_Variable::On_expectFinish_Comma };
+ static INT16 stateT_expectFinish[] = { Tid_Bracket_Right,
+ Tid_Semicolon,
+ Tid_Comma };
+
+ SEMPARSE_CREATE_STATUS(PE_Variable, afterName, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Variable, afterSize, Hdl_SyntaxError);
+ SEMPARSE_CREATE_STATUS(PE_Variable, expectFinish, Hdl_SyntaxError);
+}
+
+void
+PE_Variable::InitData()
+{
+ pStati->SetCur(afterName);
+
+ sResultSizeExpression.clear();
+ sResultInitExpression.clear();
+}
+
+void
+PE_Variable::TransferData()
+{
+ pStati->SetCur(size_of_states);
+}
+
+void
+PE_Variable::Hdl_SyntaxError( const char * i_sText)
+{
+ StdHandlingOfSyntaxError(i_sText);
+}
+
+void
+PE_Variable::SpReturn_ArraySizeExpression()
+{
+ pStati->SetCur(afterSize);
+
+ sResultSizeExpression = pSpuArraySizeExpression->Child().Result_Text();
+}
+
+void
+PE_Variable::SpReturn_InitExpression()
+{
+ pStati->SetCur(expectFinish);
+
+ sResultInitExpression = pSpuInitExpression->Child().Result_Text();
+}
+
+void
+PE_Variable::On_afterName_ArrayBracket_Left(const char *)
+{
+ pSpuArraySizeExpression->Push(done);
+}
+
+void
+PE_Variable::On_afterName_Semicolon(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Variable::On_afterName_Comma(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Variable::On_afterName_Assign(const char *)
+{
+ pSpuInitExpression->Push(done);
+}
+
+void
+PE_Variable::On_afterSize_ArrayBracket_Right(const char *)
+{
+ SetTokenResult(done, stay);
+ pStati->SetCur(afterName);
+}
+
+void
+PE_Variable::On_expectFinish_Semicolon(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Variable::On_expectFinish_Comma(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+void
+PE_Variable::On_expectFinish_Bracket_Right(const char *)
+{
+ SetTokenResult(not_done, pop_success);
+}
+
+
+} // namespace cpp
+
+
+
+
diff --git a/autodoc/source/parser/cpp/pe_vari.hxx b/autodoc/source/parser/cpp/pe_vari.hxx
new file mode 100644
index 000000000000..42896e5fa418
--- /dev/null
+++ b/autodoc/source/parser/cpp/pe_vari.hxx
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pe_vari.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PE_VARI_HXX
+#define ADC_CPP_PE_VARI_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cpp_pe.hxx"
+ // COMPONENTS
+#include <semantic/callf.hxx>
+#include <semantic/sub_peu.hxx>
+#include <ary/cpp/c_types4cpp.hxx>
+#include <ary/cpp/c_vfflag.hxx>
+ // PARAMETERS
+
+
+namespace cpp {
+
+class PE_Expression;
+
+
+class PE_Variable : public Cpp_PE
+{
+ public:
+ enum E_State
+ {
+ afterName, //
+ afterSize, // after ]
+ expectFinish, // after InitExpression
+ size_of_states
+ };
+ PE_Variable(
+ Cpp_PE * i_pParent );
+ ~PE_Variable();
+
+ /** @return
+ Bit 0x0001 != 0, if there is a size and
+ bit 0x0002 != 0, if there is an initialisation.
+ */
+ UINT16 Result_Pattern() const;
+ const String & Result_SizeExpression() const;
+ const String & Result_InitExpression() const;
+
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok );
+
+ private:
+ typedef SubPe< PE_Variable, PE_Expression > SP_Expression;
+ typedef SubPeUse< PE_Variable, PE_Expression> SPU_Expression;
+
+ void Setup_StatusFunctions();
+ virtual void InitData();
+ virtual void TransferData();
+ void Hdl_SyntaxError(const char *);
+
+ void SpReturn_ArraySizeExpression();
+ void SpReturn_InitExpression();
+
+ void On_afterName_ArrayBracket_Left(const char * i_sText);
+ void On_afterName_Semicolon(const char * i_sText);
+ void On_afterName_Comma(const char * i_sText);
+ void On_afterName_Assign(const char * i_sText);
+
+ void On_afterSize_ArrayBracket_Right(const char * i_sText);
+
+ void On_expectFinish_Semicolon(const char * i_sText);
+ void On_expectFinish_Comma(const char * i_sText);
+ void On_expectFinish_Bracket_Right(const char * i_sText);
+
+ // DATA
+ Dyn< PeStatusArray<PE_Variable> >
+ pStati;
+
+ Dyn<SP_Expression> pSpExpression;
+ Dyn<SPU_Expression> pSpuArraySizeExpression;
+ Dyn<SPU_Expression> pSpuInitExpression;
+
+ String sResultSizeExpression;
+ String sResultInitExpression;
+};
+
+
+
+// IMPLEMENTATION
+
+
+inline UINT16
+PE_Variable::Result_Pattern() const
+ { return ( sResultSizeExpression.length() > 0 ? 1 : 0 )
+ + ( sResultInitExpression.length() > 0 ? 2 : 0 ); }
+inline const String &
+PE_Variable::Result_SizeExpression() const
+ { return sResultSizeExpression; }
+inline const String &
+PE_Variable::Result_InitExpression() const
+ { return sResultInitExpression; }
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/pev.hxx b/autodoc/source/parser/cpp/pev.hxx
new file mode 100644
index 000000000000..c97db44503da
--- /dev/null
+++ b/autodoc/source/parser/cpp/pev.hxx
@@ -0,0 +1,307 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pev.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PEV_HXX
+#define ADC_CPP_PEV_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tokproct.hxx>
+ // COMPONENTS
+ // PARAMETERS
+#include <ary/cpp/c_types4cpp.hxx>
+
+namespace ary
+{
+ namespace cpp
+ {
+ class Gate;
+ class InputContext;
+
+ class Namespace;
+ class Class;
+ class Enum;
+ class Typedef;
+ class Function;
+ class Variable;
+ class EnumValue;
+
+ class DefineEntity;
+ }
+
+ class Documentation;
+}
+
+
+namespace cpp
+{
+
+
+class PeEnvironment : protected TokenProcessing_Types
+{
+ public:
+ // INQUIRY
+ virtual ~PeEnvironment() {}
+
+ // OPERATIONS
+ // Token results
+ void SetTokenResult(
+ E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push = 0 );
+
+ // Owner stack
+ void OpenNamespace(
+ ary::cpp::Namespace &
+ io_rOpenedNamespace );
+ void OpenExternC(
+ bool i_bOnlyForOneDeclaration = false );
+ void OpenClass(
+ ary::cpp::Class & io_rOpenedClass );
+ void OpenEnum(
+ ary::cpp::Enum & io_rOpenedEnum );
+ void CloseBlock(); /// Handles a '}' on file scope.
+ void CloseClass();
+ void CloseEnum();
+ void SetCurProtection( /// Handles 'public:', 'protected:' and 'private:' on class scope.
+ ary::cpp::E_Protection
+ i_eProtection );
+ void OpenTemplate(
+ const StringVector &
+ i_rParameters );
+ /// Removes parameters from this object.
+ DYN StringVector * Get_CurTemplateParameters();
+ /// Checks, if a template is still open, and if yes, closes it.
+ void Close_OpenTemplate();
+
+ // Special events
+ void Event_Class_FinishedBase(
+ const String & i_sParameterName );
+
+ void Event_Store_Typedef(
+ ary::cpp::Typedef & io_rTypedef );
+ void Event_Store_EnumValue(
+ ary::cpp::EnumValue &
+ io_rEnumValue );
+ void Event_Store_CppDefinition(
+ ary::cpp::DefineEntity &
+ io_rDefinition );
+
+ void Event_EnterFunction_ParameterList();
+ void Event_Function_FinishedParameter(
+ const String & i_sParameterName );
+ void Event_LeaveFunction_ParameterList();
+ void Event_EnterFunction_Implementation();
+ void Event_LeaveFunction_Implementation();
+
+ void Event_Store_Function(
+ ary::cpp::Function &
+ io_rFunction );
+ void Event_Store_Variable(
+ ary::cpp::Variable &
+ io_rVariable );
+ // Error recovery
+ void StartWaitingFor_Recovery();
+
+ // INQUIRY
+ ary::cpp::Gate & AryGate() const;
+ const ary::cpp::InputContext &
+ Context() const;
+ String CurFileName() const;
+ uintt LineCount() const;
+ bool IsWaitingFor_Recovery() const;
+ bool IsExternC() const;
+
+ private:
+ virtual void do_SetTokenResult(
+ E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push ) = 0;
+ virtual void do_OpenNamespace(
+ ary::cpp::Namespace &
+ io_rOpenedNamespace ) = 0;
+ virtual void do_OpenExternC(
+ bool i_bOnlyForOneDeclaration ) = 0;
+ virtual void do_OpenClass(
+ ary::cpp::Class & io_rOpenedClass ) = 0;
+ virtual void do_OpenEnum(
+ ary::cpp::Enum & io_rOpenedEnum ) = 0;
+ virtual void do_CloseBlock() = 0;
+ virtual void do_CloseClass() = 0;
+ virtual void do_CloseEnum() = 0;
+ virtual void do_SetCurProtection(
+ ary::cpp::E_Protection
+ i_eProtection ) = 0;
+ virtual void do_OpenTemplate(
+ const StringVector &
+ i_rParameters ) = 0;
+ virtual DYN StringVector *
+ do_Get_CurTemplateParameters() = 0;
+ virtual void do_Close_OpenTemplate() = 0;
+ virtual void do_Event_Class_FinishedBase(
+ const String & i_sBaseName ) = 0;
+
+ virtual void do_Event_Store_Typedef(
+ ary::cpp::Typedef & io_rTypedef ) = 0;
+ virtual void do_Event_Store_EnumValue(
+ ary::cpp::EnumValue &
+ io_rEnumValue ) = 0;
+ virtual void do_Event_Store_CppDefinition(
+ ary::cpp::DefineEntity &
+ io_rDefinition ) = 0;
+ virtual void do_Event_EnterFunction_ParameterList() = 0;
+ virtual void do_Event_Function_FinishedParameter(
+ const String & i_sParameterName ) = 0;
+ virtual void do_Event_LeaveFunction_ParameterList() = 0;
+ virtual void do_Event_EnterFunction_Implementation() = 0;
+ virtual void do_Event_LeaveFunction_Implementation() = 0;
+ virtual void do_Event_Store_Function(
+ ary::cpp::Function &
+ io_rFunction ) = 0;
+ virtual void do_Event_Store_Variable(
+ ary::cpp::Variable &
+ io_rVariable ) = 0;
+ virtual void do_StartWaitingFor_Recovery() = 0;
+ virtual ary::cpp::Gate &
+ inq_AryGate() const = 0;
+ virtual const ary::cpp::InputContext &
+ inq_Context() const = 0;
+ virtual String inq_CurFileName() const = 0;
+ virtual uintt inq_LineCount() const = 0;
+ virtual bool inq_IsWaitingFor_Recovery() const = 0;
+ virtual bool inq_IsExternC() const = 0;
+};
+
+
+
+// IMPLEMENTATION
+
+inline void
+PeEnvironment::SetTokenResult( E_TokenDone i_eDone,
+ E_EnvStackAction i_eWhat2DoWithEnvStack,
+ ParseEnvironment * i_pParseEnv2Push )
+ { do_SetTokenResult(i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push); }
+inline void
+PeEnvironment::OpenNamespace( ary::cpp::Namespace & io_rOpenedNamespace )
+ { do_OpenNamespace(io_rOpenedNamespace); }
+inline void
+PeEnvironment::OpenExternC( bool i_bOnlyForOneDeclaration )
+ { do_OpenExternC(i_bOnlyForOneDeclaration); }
+inline void
+PeEnvironment::OpenClass( ary::cpp::Class & io_rOpenedClass )
+ { do_OpenClass(io_rOpenedClass); }
+inline void
+PeEnvironment::OpenEnum( ary::cpp::Enum & io_rOpenedEnum )
+ { do_OpenEnum(io_rOpenedEnum); }
+inline void
+PeEnvironment::CloseBlock()
+ { do_CloseBlock(); }
+inline void
+PeEnvironment::CloseClass()
+ { do_CloseClass(); }
+inline void
+PeEnvironment::CloseEnum()
+ { do_CloseEnum(); }
+inline void
+PeEnvironment::SetCurProtection( ary::cpp::E_Protection i_eProtection )
+ { do_SetCurProtection(i_eProtection); }
+inline void
+PeEnvironment::OpenTemplate( const StringVector & i_rParameters )
+ { do_OpenTemplate(i_rParameters); }
+inline DYN StringVector *
+PeEnvironment::Get_CurTemplateParameters()
+ { return do_Get_CurTemplateParameters(); }
+inline void
+PeEnvironment::Close_OpenTemplate()
+ { do_Close_OpenTemplate(); }
+inline void
+PeEnvironment::Event_Class_FinishedBase( const String & i_sBaseName )
+ { do_Event_Class_FinishedBase(i_sBaseName); }
+inline void
+PeEnvironment::Event_Store_Typedef( ary::cpp::Typedef & io_rTypedef )
+ { do_Event_Store_Typedef(io_rTypedef); }
+inline void
+PeEnvironment::Event_Store_EnumValue( ary::cpp::EnumValue & io_rEnumValue )
+ { do_Event_Store_EnumValue(io_rEnumValue); }
+inline void
+PeEnvironment::Event_Store_CppDefinition( ary::cpp::DefineEntity & io_rDefinition )
+ { do_Event_Store_CppDefinition(io_rDefinition); }
+inline void
+PeEnvironment::Event_EnterFunction_ParameterList()
+ { do_Event_EnterFunction_ParameterList(); }
+inline void
+PeEnvironment::Event_Function_FinishedParameter( const String & i_sParameterName )
+ { do_Event_Function_FinishedParameter(i_sParameterName); }
+inline void
+PeEnvironment::Event_LeaveFunction_ParameterList()
+ { do_Event_LeaveFunction_ParameterList(); }
+inline void
+PeEnvironment::Event_EnterFunction_Implementation()
+ { do_Event_EnterFunction_Implementation(); }
+inline void
+PeEnvironment::Event_LeaveFunction_Implementation()
+ { do_Event_LeaveFunction_Implementation(); }
+inline void
+PeEnvironment::Event_Store_Function( ary::cpp::Function & io_rFunction )
+ { do_Event_Store_Function(io_rFunction); }
+inline void
+PeEnvironment::Event_Store_Variable( ary::cpp::Variable & io_rVariable )
+ { do_Event_Store_Variable(io_rVariable); }
+inline void
+PeEnvironment::StartWaitingFor_Recovery()
+ { do_StartWaitingFor_Recovery(); }
+inline ary::cpp::Gate &
+PeEnvironment::AryGate() const
+ { return inq_AryGate(); }
+inline const ary::cpp::InputContext &
+PeEnvironment::Context() const
+ { return inq_Context(); }
+inline String
+PeEnvironment::CurFileName() const
+ { return inq_CurFileName(); }
+inline uintt
+PeEnvironment::LineCount() const
+ { return inq_LineCount(); }
+inline bool
+PeEnvironment::IsWaitingFor_Recovery() const
+ { return inq_IsWaitingFor_Recovery(); }
+inline bool
+PeEnvironment::IsExternC() const
+ { return inq_IsExternC(); }
+
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/preproc.cxx b/autodoc/source/parser/cpp/preproc.cxx
new file mode 100644
index 000000000000..4643551481be
--- /dev/null
+++ b/autodoc/source/parser/cpp/preproc.cxx
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: preproc.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 "preproc.hxx"
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/tpl/tpltools.hxx>
+#include "all_toks.hxx"
+#include "defdescr.hxx"
+#include <tools/tkpchars.hxx>
+#include "c_rcode.hxx"
+
+
+namespace cpp
+{
+
+
+PreProcessor::F_TOKENPROC PreProcessor::aTokProcs[PreProcessor::state_MAX] =
+ {
+ &PreProcessor::On_plain,
+ &PreProcessor::On_expect_macro_bracket_left,
+ &PreProcessor::On_expect_macro_param
+ };
+
+
+PreProcessor::PreProcessor()
+ : pCppExplorer(0),
+ pSourceText(0),
+ pCurValidDefines(0),
+ // aTokens,
+ eState(plain),
+ pCurMacro(0),
+ dpCurMacroName(0),
+ // aCurMacroParams,
+ aCurParamText(60000),
+ nBracketInParameterCounter(0)
+ // aBlockedMacroNames
+{
+}
+
+PreProcessor::~PreProcessor()
+{
+}
+
+void
+PreProcessor::AssignPartners( CodeExplorer & o_rCodeExplorer,
+ CharacterSource & o_rCharSource,
+ const MacroMap & i_rCurValidDefines )
+{
+ pCppExplorer = &o_rCodeExplorer;
+ pSourceText = &o_rCharSource;
+ pCurValidDefines = &i_rCurValidDefines;
+}
+
+void
+PreProcessor::Process_Token( cpp::Token & let_drToken )
+{
+ csv_assert(pCppExplorer != 0); // Implies pSourceText and pCurValidDefines.
+
+ (this->*aTokProcs[eState])(let_drToken);
+}
+
+void
+PreProcessor::On_plain( cpp::Token & let_drToken )
+{
+ if ( let_drToken.TypeId() == Tid_Identifier )
+ {
+ if (CheckForDefine(let_drToken))
+ return;
+ }
+
+ pCppExplorer->Process_Token(let_drToken);
+}
+
+void
+PreProcessor::On_expect_macro_bracket_left( cpp::Token & let_drToken )
+{
+ if ( let_drToken.TypeId() == Tid_Bracket_Left )
+ {
+ aCurParamText.seekp(0);
+ eState = expect_macro_param;
+ }
+ else
+ {
+ pCppExplorer->Process_Token(*dpCurMacroName);
+ dpCurMacroName = 0;
+ pCppExplorer->Process_Token(let_drToken);
+ eState = plain;
+ }
+}
+
+void
+PreProcessor::On_expect_macro_param( cpp::Token & let_drToken )
+{
+ if ( let_drToken.TypeId() == Tid_Bracket_Left )
+ nBracketInParameterCounter++;
+ else if ( let_drToken.TypeId() == Tid_Bracket_Right )
+ {
+ if ( nBracketInParameterCounter > 0 )
+ nBracketInParameterCounter--;
+ else
+ {
+ if ( NOT csv::no_str(aCurParamText.c_str()) )
+ {
+ aCurMacroParams.push_back( String(aCurParamText.c_str()) );
+ }
+ csv_assert( aCurMacroParams.size() == pCurMacro->ParamCount() );
+
+ InterpretMacro();
+ eState = plain;
+ return;
+ }
+ }
+ else if ( let_drToken.TypeId() == Tid_Comma AND nBracketInParameterCounter == 0 )
+ {
+ aCurMacroParams.push_back( String (aCurParamText.c_str()) );
+ aCurParamText.seekp(0);
+ return;
+ }
+
+ // KORR_FUTURE:
+ // If in future whitespace is parsed also, that should match exactly and the
+ // safety spaces, " ", here should be removed.
+ aCurParamText << let_drToken.Text() << " ";
+}
+
+bool
+PreProcessor::CheckForDefine( cpp::Token & let_drToken )
+{
+ String sTokenText(let_drToken.Text());
+ pCurMacro = csv::value_from_map( *pCurValidDefines, sTokenText );
+ if (pCurMacro == 0 )
+ return false;
+ for ( StringVector::const_iterator it = aBlockedMacroNames.begin();
+ it != aBlockedMacroNames.end();
+ ++it )
+ {
+ if ( strcmp( (*it).c_str(), let_drToken.Text() ) == 0 )
+ return false;
+ }
+
+ if ( pCurMacro->DefineType() == DefineDescription::type_define )
+ {
+ delete &let_drToken;
+
+ aCurParamText.seekp(0);
+ pCurMacro->GetDefineText(aCurParamText);
+
+ if ( aCurParamText.tellp() > 1 )
+ pSourceText->InsertTextAtCurPos(aCurParamText.c_str());
+ }
+ else // ( pCurMacro->DefineType() == DefineDescription::type_macro )
+ {
+ dpCurMacroName = &let_drToken;
+ eState = expect_macro_bracket_left;
+ csv::erase_container( aCurMacroParams );
+ aCurParamText.seekp(0);
+ nBracketInParameterCounter = 0;
+ } // endif
+
+ return true;
+}
+
+void
+PreProcessor::UnblockMacro( const char * i_sMacroName )
+{
+ for ( StringVector::iterator it = aBlockedMacroNames.begin();
+ it != aBlockedMacroNames.end();
+ ++it )
+ {
+ if ( strcmp( (*it), i_sMacroName ) == 0 )
+ {
+ aBlockedMacroNames.erase(it);
+ break;
+ }
+ } /// end for
+}
+
+void
+PreProcessor::InterpretMacro()
+{
+ aCurParamText.seekp(0);
+ pCurMacro->GetMacroText(aCurParamText, aCurMacroParams);
+
+ if ( NOT csv::no_str(aCurParamText.c_str()) )
+ {
+ aCurParamText.seekp(-1, csv::cur);
+ aCurParamText << " #unblock-" << dpCurMacroName->Text() << " ";
+
+ pSourceText->InsertTextAtCurPos(aCurParamText.c_str());
+ String sCurMacroName(dpCurMacroName->Text());
+ aBlockedMacroNames.insert( aBlockedMacroNames.begin(), sCurMacroName );
+ }
+
+ delete dpCurMacroName;
+ dpCurMacroName = 0;
+ pCurMacro = 0;
+ csv::erase_container(aCurMacroParams);
+ aCurParamText.seekp(0);
+}
+
+
+} // end namespace cpp
+
+
diff --git a/autodoc/source/parser/cpp/preproc.hxx b/autodoc/source/parser/cpp/preproc.hxx
new file mode 100644
index 000000000000..618c9dba4693
--- /dev/null
+++ b/autodoc/source/parser/cpp/preproc.hxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: preproc.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PREPROC_HXX
+#define ADC_CPP_PREPROC_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <deque>
+ // PARAMETERS
+
+class CharacterSource;
+
+
+namespace cpp
+{
+
+class Token;
+class CodeExplorer;
+class DefineDescription;
+
+
+class PreProcessor
+{
+ public:
+ typedef std::map< String, DefineDescription* > MacroMap;
+
+ // LIFECYCLE
+ PreProcessor();
+ ~PreProcessor();
+ // OPERATONS
+ void AssignPartners(
+ CodeExplorer & o_rCodeExplorer,
+ CharacterSource & o_rCharSource,
+ const MacroMap & i_rCurValidDefines );
+ void Process_Token(
+ cpp::Token & let_drToken );
+ void UnblockMacro(
+ const char * i_sMacroName );
+ private:
+ public: // Necessary for instantiation of static variable:
+ enum E_State
+ {
+ plain = 0,
+ expect_macro_bracket_left,
+ expect_macro_param,
+ state_MAX
+ };
+ typedef void (PreProcessor::* F_TOKENPROC )(cpp::Token &);
+ void On_plain( cpp::Token & );
+ void On_expect_macro_bracket_left( cpp::Token & );
+ void On_expect_macro_param( cpp::Token & );
+
+ private: // Reprivate again:
+ typedef std::deque< DYN cpp::Token * > TokenQueue;
+ typedef StringVector List_MacroParams;
+
+
+ bool CheckForDefine(
+ cpp::Token & let_drToken );
+ void InterpretMacro();
+
+ // DATA
+ static F_TOKENPROC aTokProcs[state_MAX];
+ // Referenced extern objects
+ CodeExplorer * pCppExplorer;
+ CharacterSource * pSourceText;
+ const MacroMap * pCurValidDefines;
+
+ // internal data
+ TokenQueue aTokens;
+
+ E_State eState;
+
+ DefineDescription * pCurMacro;
+ DYN Token * dpCurMacroName;
+ List_MacroParams aCurMacroParams;
+ csv::StreamStr aCurParamText;
+
+ intt nBracketInParameterCounter;
+ StringVector aBlockedMacroNames;
+};
+
+
+
+} // end namespace cpp
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/prs_cpp.cxx b/autodoc/source/parser/cpp/prs_cpp.cxx
new file mode 100644
index 000000000000..92ada96328b2
--- /dev/null
+++ b/autodoc/source/parser/cpp/prs_cpp.cxx
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: prs_cpp.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 <cpp/prs_cpp.hxx>
+
+
+// NOT FULLY DEFINED SERVICES
+#include <cosv/file.hxx>
+#include <ary/ary.hxx>
+#include <ary/cpp/c_gate.hxx>
+#include <autodoc/prs_docu.hxx>
+#include <autodoc/filecoli.hxx>
+#include <autodoc/x_parsing.hxx>
+#include <tools/tkpchars.hxx>
+#include <adc_cl.hxx>
+#include "c_dealer.hxx"
+#include "defdescr.hxx"
+#include "tkp_cpp.hxx"
+
+
+// Helper function
+static bool Local_LoadFile(
+ CharacterSource & o_rTextBuffer,
+ const String & i_rFullFilePath );
+
+
+
+
+namespace cpp
+{
+
+// This class is used for the UDK as workaround for the missing
+// feature of parsing #define s.
+
+class Udk_MacroMap
+{
+ public:
+ typedef std::map< String , DefineDescription* > Data;
+
+ Udk_MacroMap();
+ ~Udk_MacroMap();
+
+ const Data & GetData() const { return aData; }
+
+ private:
+ Data aData;
+};
+
+struct S_RunningData
+{
+ CharacterSource aFileContent;
+ ary::cpp::Gate & rCppGate;
+ Udk_MacroMap aMacros;
+ Distributor aDealer;
+ TokenParser_Cpp aTkp;
+
+ S_RunningData(
+ ary::Repository & o_rRepository,
+ const autodoc::DocumentationParser_Ifc &
+ i_rDocumentationInterpreter );
+};
+
+
+
+
+Cpluplus_Parser::Cpluplus_Parser()
+// : pRunningData
+{
+}
+
+Cpluplus_Parser::~Cpluplus_Parser()
+{
+}
+
+void
+Cpluplus_Parser::Setup( ary::Repository & o_rRepository,
+ const autodoc::DocumentationParser_Ifc & i_rDocumentationInterpreter )
+{
+ pRunningData = new S_RunningData(o_rRepository, i_rDocumentationInterpreter);
+}
+
+void
+Cpluplus_Parser::Run( const autodoc::FileCollector_Ifc & i_rFiles )
+{
+ for ( autodoc::FileCollector_Ifc::const_iterator iter = i_rFiles.Begin();
+ iter != i_rFiles.End();
+ ++iter )
+ {
+ csv::ploc::Path
+ aFilePath(*iter);
+
+ try
+ {
+ if ( NOT Local_LoadFile(pRunningData->aFileContent, *iter) )
+ continue;
+ for ( pRunningData->aTkp.StartNewFile(aFilePath);
+ pRunningData->aTkp.HasMore();
+ pRunningData->aTkp.GetNextToken() )
+ ;
+ }
+ catch (autodoc::X_Parser_Ifc & rX_Parse)
+ {
+ if ( DEBUG_ShowStoring() OR DEBUG_ShowText() )
+ Cerr() << rX_Parse << Endl();
+ }
+ catch (...)
+ {
+ if ( DEBUG_ShowStoring() OR DEBUG_ShowText() )
+ Cerr() << "Error: Unknown exception." << Endl();
+ }
+ } // end for (iter)
+}
+
+S_RunningData::S_RunningData( ary::Repository & o_rRepository,
+ const autodoc::DocumentationParser_Ifc & i_rDocumentationInterpreter )
+ : aFileContent(),
+ rCppGate( o_rRepository.Gate_Cpp() ),
+ aMacros(),
+ aDealer(o_rRepository.Gate_Cpp()),
+ aTkp( * i_rDocumentationInterpreter.Create_DocuContext() )
+{
+ aDealer.AssignPartners( aFileContent,
+ aMacros.GetData() );
+ aTkp.AssignPartners( aFileContent, aDealer );
+}
+
+
+Udk_MacroMap::Udk_MacroMap()
+{
+ String sSAL_CALL("SAL_CALL");
+ String sSAL_CALL_ELLIPSE("SAL_CALL_ELLIPSE");
+ String sSAL_NO_VTABLE("SAL_NO_VTABLE");
+ String sREGISTRY_CALLTYPE("REGISTRY_CALLTYPE");
+ String sSAL_THROW("SAL_THROW");
+ String sSAL_THROW_EXTERN_C("SAL_THROW_EXTERN_C");
+
+ String s__DEF_COMPIMPLHELPER_A("__DEF_COMPIMPLHELPER_A");
+ String s__DEF_COMPIMPLHELPER_B("__DEF_COMPIMPLHELPER_B");
+ String s__DEF_COMPIMPLHELPER("__DEF_COMPIMPLHELPER");
+
+ String s__DEF_IMPLHELPER_PRE("__DEF_IMPLHELPER_PRE");
+ String s__IFC_WRITEOFFSET("__IFC_WRITEOFFSET");
+ String s__DEF_IMPLHELPER_POST("__DEF_IMPLHELPER_POST");
+
+ String sSAL_EXCEPTION_DLLPUBLIC_EXPORT("SAL_EXCEPTION_DLLPUBLIC_EXPORT");
+ String sSAL_EXCEPTION_DLLPRIVATE("SAL_EXCEPTION_DLLPRIVATE");
+
+
+ StringVector aEmpty;
+
+ StringVector aParamsSAL_THROW;
+ aParamsSAL_THROW.push_back( String ("exc") );
+ StringVector aDefSAL_THROW;
+ aDefSAL_THROW.push_back( String ("throw") );
+ aDefSAL_THROW.push_back( String ("exc") );
+
+ StringVector aCompImplHelperParams;
+ aCompImplHelperParams.push_back(String ("N"));
+
+
+ // filling up the list
+
+
+ aData[sSAL_CALL] = new DefineDescription(sSAL_CALL, aEmpty);
+ aData[sSAL_CALL_ELLIPSE] = new DefineDescription(sSAL_CALL_ELLIPSE, aEmpty);
+ aData[sSAL_NO_VTABLE] = new DefineDescription(sSAL_NO_VTABLE, aEmpty);
+ aData[sREGISTRY_CALLTYPE] = new DefineDescription(sREGISTRY_CALLTYPE, aEmpty);
+
+ aData[sSAL_THROW] = new DefineDescription(sSAL_THROW, aParamsSAL_THROW, aDefSAL_THROW);
+ aData[sSAL_THROW_EXTERN_C] = new DefineDescription(sSAL_THROW_EXTERN_C, aEmpty, aEmpty);
+
+ aData[s__DEF_COMPIMPLHELPER_A]
+ = new DefineDescription( s__DEF_COMPIMPLHELPER_A, aCompImplHelperParams, aEmpty);
+ aData[s__DEF_COMPIMPLHELPER_B]
+ = new DefineDescription(s__DEF_COMPIMPLHELPER_B, aCompImplHelperParams, aEmpty);
+ aData[s__DEF_COMPIMPLHELPER]
+ = new DefineDescription(s__DEF_COMPIMPLHELPER, aCompImplHelperParams, aEmpty);
+
+ aData[s__DEF_IMPLHELPER_PRE]
+ = new DefineDescription(s__DEF_IMPLHELPER_PRE, aCompImplHelperParams, aEmpty);
+ aData[s__IFC_WRITEOFFSET]
+ = new DefineDescription(s__IFC_WRITEOFFSET, aCompImplHelperParams, aEmpty);
+ aData[s__DEF_IMPLHELPER_POST]
+ = new DefineDescription(s__DEF_IMPLHELPER_POST, aCompImplHelperParams, aEmpty);
+
+ aData[sSAL_EXCEPTION_DLLPUBLIC_EXPORT]
+ = new DefineDescription(sSAL_EXCEPTION_DLLPUBLIC_EXPORT, aEmpty);
+ aData[sSAL_EXCEPTION_DLLPRIVATE]
+ = new DefineDescription(sSAL_EXCEPTION_DLLPRIVATE, aEmpty);
+}
+
+Udk_MacroMap::~Udk_MacroMap()
+{
+ for ( Data::iterator it = aData.begin(); it != aData.end(); ++it )
+ {
+ delete (*it).second;
+ }
+}
+
+
+
+} // namespace cpp
+
+
+bool
+Local_LoadFile( CharacterSource & o_rTextBuffer,
+ const String & i_rFullFilePath )
+{
+ Cout() << "Parse " << i_rFullFilePath << " ..." << Endl();
+
+ csv::File aFile( i_rFullFilePath, csv::CFM_READ );
+ if (NOT aFile.open())
+ {
+ Cerr() << " could not be opened.\n" << Endl();
+ return false;
+ }
+ o_rTextBuffer.LoadText(aFile);
+ aFile.close();
+ return true;
+}
+
+
+
diff --git a/autodoc/source/parser/cpp/sdocdist.hxx b/autodoc/source/parser/cpp/sdocdist.hxx
new file mode 100644
index 000000000000..55295297740d
--- /dev/null
+++ b/autodoc/source/parser/cpp/sdocdist.hxx
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdocdist.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_SDOCDIST_HXX
+#define ADC_CPP_SDOCDIST_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cxt2ary.hxx"
+#include <ary/info/docstore.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp
+{
+
+using ary::Documentation;
+
+/** Implementation struct for cpp::ContextForAry.
+*/
+
+struct ContextForAry::S_DocuDistributor : public ary::info::DocuStore
+{
+ public:
+ S_DocuDistributor() : pCurRe(0) {}
+ ~S_DocuDistributor() {}
+
+ void Reset() { pCurRe = 0; pLastStoredDocu = 0; }
+
+ void SetCurrentlyStoredRe(
+ ary::cpp::CppEntity &
+ io_rRe );
+ void Event_LineBreak();
+
+ private:
+ // Interface ary::info::DocuStore
+ virtual void do_Store2CurFile(
+ DYN ary::doc::Node& let_drDocu );
+ virtual void do_Store2CurNamespace(
+ DYN ary::doc::Node& let_drDocu );
+
+ virtual void do_Store2ConnectedDeclaration(
+ DYN ary::doc::Node& let_drDocu );
+
+ virtual void do_Store2Glossary(
+ DYN ary::doc::Node& let_drDocu,
+ const String & i_sExplainedTerm );
+ virtual void do_Store2GlobalTexts(
+ DYN ary::doc::Node& let_drDocu,
+ ary::info::GlobalTextId
+ i_nId );
+ // DATA
+ ary::cpp::CppEntity *
+ pCurRe;
+ Dyn<ary::doc::Node> pLastStoredDocu;
+};
+
+
+// IMPLEMENTATION
+
+/* The implementation is in header, though not all inline, because this file
+ is included in cxt2ary.cxx only!
+*/
+
+
+void
+ContextForAry::
+S_DocuDistributor::SetCurrentlyStoredRe( ary::cpp::CppEntity & io_rRe )
+{
+ pCurRe = &io_rRe;
+ if ( pLastStoredDocu )
+ pCurRe->Set_Docu( *pLastStoredDocu.Release() );
+}
+
+inline void
+ContextForAry::
+S_DocuDistributor::Event_LineBreak()
+{
+ pCurRe = 0;
+}
+
+void
+ContextForAry::
+S_DocuDistributor::do_Store2CurFile( DYN ary::doc::Node & let_drDocu )
+{
+ // KORR_FUTURE
+ delete &let_drDocu;
+}
+
+void
+ContextForAry::
+S_DocuDistributor::do_Store2CurNamespace( DYN ary::doc::Node & let_drDocu )
+{
+ // KORR_FUTURE
+ delete &let_drDocu;
+}
+
+void
+ContextForAry::
+S_DocuDistributor::do_Store2ConnectedDeclaration( DYN ary::doc::Node & let_drDocu )
+{
+ if ( pCurRe != 0 )
+ pCurRe->Set_Docu(let_drDocu);
+ else
+ pLastStoredDocu = &let_drDocu;
+}
+
+void
+ContextForAry::
+S_DocuDistributor::do_Store2Glossary( DYN ary::doc::Node & let_drDocu,
+ const String & // i_sExplainedTerm
+ )
+{
+ // KORR_FUTURE
+ delete &let_drDocu;
+}
+
+void
+ContextForAry::
+S_DocuDistributor::do_Store2GlobalTexts( DYN ary::doc::Node & let_drDocu,
+ ary::info::GlobalTextId // i_nId
+ )
+{
+ // KORR_FUTURE
+ delete &let_drDocu;
+}
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/sfscope.hxx b/autodoc/source/parser/cpp/sfscope.hxx
new file mode 100644
index 000000000000..cfca4ba203e1
--- /dev/null
+++ b/autodoc/source/parser/cpp/sfscope.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sfscope.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_SFSCOPE_HXX
+#define ADC_CPP_SFSCOPE_HXX
+
+// USED SERVICES
+#include "cxt2ary.hxx"
+
+
+
+
+namespace cpp
+{
+
+
+/** Implementation struct for cpp::ContextForAry.
+*/
+struct ContextForAry::S_FileScopeInfo
+{
+ ary::loc::File * pCurFile;
+ uintt nLineCount;
+ Dyn<StringVector> pCurTemplateParameters;
+
+ S_FileScopeInfo();
+};
+
+
+
+
+// IMPLEMENTATION
+inline
+ContextForAry::
+S_FileScopeInfo::S_FileScopeInfo()
+ : pCurFile(0),
+ nLineCount(0),
+ pCurTemplateParameters(0)
+{
+}
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/cpp/sownstck.hxx b/autodoc/source/parser/cpp/sownstck.hxx
new file mode 100644
index 000000000000..ef5ccfc5d803
--- /dev/null
+++ b/autodoc/source/parser/cpp/sownstck.hxx
@@ -0,0 +1,328 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sownstck.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_SOWNSTCK_HXX
+#define ADC_CPP_SOWNSTCK_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cxt2ary.hxx"
+ // COMPONENTS
+#include <ary/cpp/c_types4cpp.hxx>
+#include <estack.hxx>
+ // PARAMETERS
+#include <ary/cpp/c_namesp.hxx>
+#include <x_parse.hxx>
+
+
+namespace cpp
+{
+
+using ary::cpp::E_Protection;
+
+
+/** Implementation struct for cpp::ContextForAry.
+*/
+struct ContextForAry::S_OwnerStack
+{
+ public:
+ S_OwnerStack();
+ void SetGlobalNamespace(
+ ary::cpp::Namespace &
+ io_rGlobalNamespace );
+ ~S_OwnerStack();
+
+ void Reset();
+
+ void OpenNamespace(
+ ary::cpp::Namespace &
+ io_rOpenedNamespace );
+ void OpenExternC();
+ void OpenClass(
+ ary::cpp::Class & io_rOpenedClass );
+ void OpenEnum(
+ ary::cpp::Enum & io_rOpenedEnum );
+ void CloseBlock();
+ void CloseClass();
+ void CloseEnum();
+ void SetCurProtection(
+ ary::cpp::E_Protection
+ i_eProtection );
+ ary::cpp::Namespace &
+ CurNamespace() const;
+ ary::cpp::Class * CurClass() const;
+ ary::cpp::Enum * CurEnum() const;
+
+ Owner & CurOwner() const;
+ ary::cpp::E_Protection
+ CurProtection() const;
+ bool IsExternC() const { return nExternC > 0; }
+
+ private:
+ typedef std::pair< ary::cpp::Class*, E_Protection > ClassEnv;
+ typedef EStack< ary::cpp::Namespace* > Stack_Namespaces;
+ typedef EStack< ClassEnv > Stack_Classes;
+ typedef ary::cpp::InputContext::Owner Ifc_Owner;
+
+ void SetOwner_2CurNamespace();
+ void SetOwner_2CurClass();
+ void SetOwner_2None();
+
+ // DATA
+ Stack_Namespaces aStack_Namespaces;
+ Stack_Classes aStack_Classes;
+ ary::cpp::Enum * pCurEnum;
+ uintt nExternC; /// This is a number, for the case that extern "C" blocks are nested.
+
+ Dyn<Owner_Namespace>
+ pOwner_Namespace;
+ Dyn<Owner_Class> pOwner_Class;
+ Ifc_Owner * pOwner_Cur;
+};
+
+
+// IMPLEMENTATION
+
+/* The implementation is in header, though not inline, because this file is included
+ in cxt2ary.cxx only!
+*/
+
+inline ary::cpp::Namespace &
+ContextForAry::
+S_OwnerStack::CurNamespace() const
+{
+ csv_assert( aStack_Namespaces.size() > 0 );
+ return *aStack_Namespaces.top();
+}
+
+inline ary::cpp::Class *
+ContextForAry::
+S_OwnerStack::CurClass() const
+{
+ return aStack_Classes.size() > 0
+ ? aStack_Classes.top().first
+ : (ary::cpp::Class *) 0;
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::SetOwner_2CurNamespace()
+{
+ csv_assert( aStack_Namespaces.size() > 0 );
+ pOwner_Cur = pOwner_Namespace.MutablePtr();
+ pOwner_Namespace->SetAnotherNamespace( CurNamespace() );
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::SetOwner_2CurClass()
+{
+ csv_assert( aStack_Classes.size() > 0 );
+ pOwner_Cur = pOwner_Class.MutablePtr();
+ pOwner_Class->SetAnotherClass( *CurClass() );
+}
+
+ContextForAry::
+S_OwnerStack::S_OwnerStack()
+ : // aStack_Namespaces,
+ // aStack_Classes,
+ pCurEnum(0),
+ nExternC(0),
+ pOwner_Namespace(new Owner_Namespace),
+ pOwner_Class(new Owner_Class),
+ pOwner_Cur(0)
+{
+}
+
+void
+ContextForAry::
+S_OwnerStack::Reset()
+{
+ while ( aStack_Namespaces.top()->Owner().IsValid() )
+ aStack_Namespaces.pop();
+ while ( NOT aStack_Classes.empty() )
+ aStack_Classes.pop();
+ pCurEnum = 0;
+ nExternC = 0;
+ SetOwner_2CurNamespace();
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::SetGlobalNamespace( ary::cpp::Namespace & io_rGlobalNamespace )
+{
+ csv_assert( aStack_Namespaces.size() == 0 );
+ aStack_Namespaces.push(&io_rGlobalNamespace);
+ SetOwner_2CurNamespace();
+}
+
+ContextForAry::
+S_OwnerStack::~S_OwnerStack()
+{
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::OpenNamespace( ary::cpp::Namespace & io_rOpenedNamespace )
+{
+ csv_assert( aStack_Namespaces.size() > 0 OR io_rOpenedNamespace.Parent() == 0 );
+ aStack_Namespaces.push(&io_rOpenedNamespace);
+ SetOwner_2CurNamespace();
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::OpenExternC()
+{
+ ++nExternC;
+// SetOwner_2None();
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::SetCurProtection( ary::cpp::E_Protection i_eProtection )
+{
+ csv_assert( aStack_Classes.size() > 0 );
+ aStack_Classes.top().second = i_eProtection;
+}
+
+inline ary::cpp::Enum *
+ContextForAry::
+S_OwnerStack::CurEnum() const
+{
+ return pCurEnum;
+}
+
+
+inline ary::cpp::InputContext::Owner &
+ContextForAry::
+S_OwnerStack::CurOwner() const
+{
+ csv_assert( pOwner_Cur != 0 );
+ return *pOwner_Cur;
+}
+
+inline E_Protection
+ContextForAry::
+S_OwnerStack::CurProtection() const
+{
+ return aStack_Classes.size() > 0
+ ? aStack_Classes.top().second
+ : ary::cpp::PROTECT_global;
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::SetOwner_2None()
+{
+ pOwner_Cur = 0;
+}
+
+void
+ContextForAry::
+S_OwnerStack::OpenClass( ary::cpp::Class & io_rOpenedClass )
+{
+ E_Protection eDefaultProtection
+ = io_rOpenedClass.ClassKey() == ary::cpp::CK_class
+ ? ary::cpp::PROTECT_private
+ : ary::cpp::PROTECT_public;
+ aStack_Classes.push( ClassEnv(&io_rOpenedClass, eDefaultProtection) );
+ SetOwner_2CurClass();
+}
+
+inline void
+ContextForAry::
+S_OwnerStack::OpenEnum( ary::cpp::Enum & io_rOpenedEnum )
+{
+ csv_assert( pCurEnum == 0 );
+ pCurEnum = &io_rOpenedEnum;
+ SetOwner_2None();
+}
+
+void
+ContextForAry::
+S_OwnerStack::CloseBlock()
+{
+ if (nExternC > 0)
+ {
+ --nExternC;
+ }
+ else
+ {
+ // csv_assert( aStack_Classes.size() == 0 );
+ if ( aStack_Classes.size() > 0 )
+ throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0);
+
+ csv_assert( pCurEnum == 0 );
+ aStack_Namespaces.pop();
+
+ // csv_assert( aStack_Namespaces.size() > 0 );
+ if( aStack_Namespaces.size() == 0 )
+ throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0);
+
+ }
+ SetOwner_2CurNamespace();
+}
+
+void
+ContextForAry::
+S_OwnerStack::CloseClass()
+{
+ // csv_assert( aStack_Classes.size() > 0 );
+ if ( aStack_Classes.size() == 0 )
+ throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0);
+
+ aStack_Classes.pop();
+ if ( aStack_Classes.size() > 0 )
+ SetOwner_2CurClass();
+ else
+ SetOwner_2CurNamespace();
+}
+
+void
+ContextForAry::
+S_OwnerStack::CloseEnum()
+{
+ csv_assert( pCurEnum != 0 );
+ pCurEnum = 0;
+ if ( aStack_Classes.size() > 0 )
+ SetOwner_2CurClass();
+ else
+ SetOwner_2CurNamespace();
+}
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/srecover.hxx b/autodoc/source/parser/cpp/srecover.hxx
new file mode 100644
index 000000000000..f8f754fd9487
--- /dev/null
+++ b/autodoc/source/parser/cpp/srecover.hxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: srecover.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_SRECOVER_HXX
+#define ADC_CPP_SRECOVER_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include "cxt2ary.hxx"
+#include <ary/info/docstore.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp
+{
+
+/** Implementation struct for cpp::ContextForAry.
+*/
+struct ContextForAry::S_RecoveryGuard
+{
+ public:
+ S_RecoveryGuard();
+ ~S_RecoveryGuard();
+
+ void Reset() { bIsWithinRecovery = false; nBlockBracketsCounter = 0; }
+
+ void StartWaitingFor_Recovery();
+
+ void Hdl_SwBracketOpen();
+ void Hdl_SwBracketClose();
+ void Hdl_Semicolon();
+
+ bool IsWithinRecovery() const;
+
+ private:
+ // DATA
+ bool bIsWithinRecovery;
+ intt nBlockBracketsCounter;
+};
+
+
+
+// IMPLEMENTATION
+
+/* The implementation is in header, though not all inline, because this file
+ is included in cxt2ary.cxx only!
+*/
+
+ContextForAry::
+S_RecoveryGuard::S_RecoveryGuard()
+ : bIsWithinRecovery(false),
+ nBlockBracketsCounter(0)
+{
+}
+
+ContextForAry::
+S_RecoveryGuard::~S_RecoveryGuard()
+{
+}
+
+inline void
+ContextForAry::
+S_RecoveryGuard::StartWaitingFor_Recovery()
+{
+ bIsWithinRecovery = true;
+ nBlockBracketsCounter = 0;
+}
+
+void
+ContextForAry::
+S_RecoveryGuard::Hdl_SwBracketOpen()
+{
+ if ( bIsWithinRecovery )
+ ++nBlockBracketsCounter;
+}
+
+void
+ContextForAry::
+S_RecoveryGuard::Hdl_SwBracketClose()
+{
+ if ( bIsWithinRecovery )
+ --nBlockBracketsCounter;
+}
+
+inline void
+ContextForAry::
+S_RecoveryGuard::Hdl_Semicolon()
+{
+ if (bIsWithinRecovery AND nBlockBracketsCounter == 0)
+ bIsWithinRecovery = false;
+}
+
+inline bool
+ContextForAry::
+S_RecoveryGuard::IsWithinRecovery() const
+{
+ return bIsWithinRecovery;
+}
+
+
+
+} // namespace cpp
+
+
+#endif
+
diff --git a/autodoc/source/parser/cpp/tkp_cpp.cxx b/autodoc/source/parser/cpp/tkp_cpp.cxx
new file mode 100644
index 000000000000..7cf6271c80f8
--- /dev/null
+++ b/autodoc/source/parser/cpp/tkp_cpp.cxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkp_cpp.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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 "tkp_cpp.hxx"
+
+// NOT FULLY DECLARED SERVICES
+#include "cx_c_std.hxx"
+#include "c_dealer.hxx"
+
+
+namespace cpp {
+
+
+
+
+TokenParser_Cpp::TokenParser_Cpp( DYN autodoc::TkpDocuContext & let_drDocuContext )
+ : pBaseContext( new Context_CppStd( let_drDocuContext ) ),
+ pCurContext(0),
+ pDealer(0),
+ pCharacterSource(0)
+{
+ SetStartContext();
+}
+
+TokenParser_Cpp::~TokenParser_Cpp()
+{
+}
+
+void
+TokenParser_Cpp::AssignPartners( CharacterSource & io_rCharacterSource,
+ cpp::Distributor & o_rDealer )
+{
+ pDealer = &o_rDealer;
+ pBaseContext->AssignDealer(o_rDealer);
+ pCharacterSource = &io_rCharacterSource;
+}
+
+void
+TokenParser_Cpp::StartNewFile( const csv::ploc::Path & i_file )
+{
+ csv_assert(pDealer != 0);
+ pDealer->StartNewFile(i_file);
+
+ csv_assert(pCharacterSource != 0);
+ Start(*pCharacterSource);
+}
+
+void
+TokenParser_Cpp::SetStartContext()
+{
+ pCurContext = pBaseContext.Ptr();
+}
+
+void
+TokenParser_Cpp::SetCurrentContext( TkpContext & io_rContext )
+{
+ pCurContext = &io_rContext;
+}
+
+TkpContext &
+TokenParser_Cpp::CurrentContext()
+{
+ return *pCurContext;
+}
+
+} // namespace cpp
+
diff --git a/autodoc/source/parser/cpp/tkp_cpp.hxx b/autodoc/source/parser/cpp/tkp_cpp.hxx
new file mode 100644
index 000000000000..82e3f89fd025
--- /dev/null
+++ b/autodoc/source/parser/cpp/tkp_cpp.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkp_cpp.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_TKP_CPP_HXX
+#define ADC_TKP_CPP_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkp.hxx>
+ // COMPONENTS
+ // PARAMETRS
+
+namespace autodoc
+{
+ class TkpDocuContext;
+}
+
+namespace csv
+{
+ namespace ploc
+ {
+ class Path;
+ class DirectoryChain;
+ }
+}
+
+
+namespace cpp {
+
+class Context_CppStd;
+class DefineDescription;
+class Distributor;
+
+
+/** This is a TokenParser which is able to parse tokens from
+ C++ source code.
+*/
+class TokenParser_Cpp : public TokenParser
+{
+ public:
+ typedef std::map< String, DefineDescription* > MacroMap;
+
+ // LIFECYCLE
+ TokenParser_Cpp(
+ DYN autodoc::TkpDocuContext &
+ let_drDocuContext );
+ virtual ~TokenParser_Cpp();
+
+ // OPERATIONS
+ void AssignPartners(
+ CharacterSource & io_rCharacterSource,
+ cpp::Distributor & o_rDealer );
+ void StartNewFile(
+ const csv::ploc::Path &
+ i_file );
+ private:
+ virtual void SetStartContext();
+ virtual void SetCurrentContext(
+ TkpContext & io_rContext );
+ virtual TkpContext &
+ CurrentContext();
+ // DATA
+ Dyn<Context_CppStd> pBaseContext;
+ TkpContext * pCurContext;
+ Distributor * pDealer;
+ CharacterSource * pCharacterSource;
+};
+
+
+} // namespace cpp
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/cpp/tokintpr.hxx b/autodoc/source/parser/cpp/tokintpr.hxx
new file mode 100644
index 000000000000..a697cc75a6d0
--- /dev/null
+++ b/autodoc/source/parser/cpp/tokintpr.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tokintpr.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_TOKINTPR_HXX
+#define ADC_CPP_TOKINTPR_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <all_toks.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp {
+
+
+
+#define DECL_TOK_HANDLER(token) \
+ void Hdl_##token( \
+ const Tok_##token & i_rTok ) { Call_Handler(i_rTok); }
+
+class TokenInterpreter
+{
+ public:
+ virtual ~TokenInterpreter() {}
+
+ DECL_TOK_HANDLER(Identifier)
+ DECL_TOK_HANDLER(Operator)
+ DECL_TOK_HANDLER(operator)
+ DECL_TOK_HANDLER(class)
+ DECL_TOK_HANDLER(struct)
+ DECL_TOK_HANDLER(union)
+ DECL_TOK_HANDLER(enum)
+ DECL_TOK_HANDLER(typedef)
+ DECL_TOK_HANDLER(public)
+ DECL_TOK_HANDLER(protected)
+ DECL_TOK_HANDLER(private)
+ DECL_TOK_HANDLER(template)
+ DECL_TOK_HANDLER(virtual)
+ DECL_TOK_HANDLER(friend)
+ DECL_TOK_HANDLER(Tilde)
+ DECL_TOK_HANDLER(const)
+ DECL_TOK_HANDLER(volatile)
+ DECL_TOK_HANDLER(extern)
+ DECL_TOK_HANDLER(static)
+ DECL_TOK_HANDLER(mutable)
+ DECL_TOK_HANDLER(register)
+ DECL_TOK_HANDLER(inline)
+ DECL_TOK_HANDLER(explicit)
+ DECL_TOK_HANDLER(namespace)
+ DECL_TOK_HANDLER(using)
+ DECL_TOK_HANDLER(throw)
+ DECL_TOK_HANDLER(SwBracket_Left)
+ DECL_TOK_HANDLER(SwBracket_Right)
+ DECL_TOK_HANDLER(ArrayBracket_Left)
+ DECL_TOK_HANDLER(ArrayBracket_Right)
+ DECL_TOK_HANDLER(Bracket_Left)
+ DECL_TOK_HANDLER(Bracket_Right)
+ DECL_TOK_HANDLER(DoubleColon)
+ DECL_TOK_HANDLER(Semicolon)
+ DECL_TOK_HANDLER(Comma)
+ DECL_TOK_HANDLER(Colon)
+ DECL_TOK_HANDLER(Assign)
+ DECL_TOK_HANDLER(Less)
+ DECL_TOK_HANDLER(Greater)
+ DECL_TOK_HANDLER(Asterix)
+ DECL_TOK_HANDLER(AmpersAnd)
+ DECL_TOK_HANDLER(Ellipse)
+ DECL_TOK_HANDLER(typename)
+ DECL_TOK_HANDLER(DefineName)
+ DECL_TOK_HANDLER(MacroName)
+ DECL_TOK_HANDLER(MacroParameter)
+ DECL_TOK_HANDLER(PreProDefinition)
+ DECL_TOK_HANDLER(BuiltInType)
+ DECL_TOK_HANDLER(TypeSpecializer)
+ DECL_TOK_HANDLER(Constant)
+
+ protected:
+ virtual void Call_Handler(
+ const cpp::Token & i_rTok ) = 0;
+};
+
+#undef DECL_TOK_HANDLER
+
+
+// IMPLEMENTATION
+
+
+} // namespace cpp
+
+
+#endif
diff --git a/autodoc/source/parser/inc/adoc/a_rdocu.hxx b/autodoc/source/parser/inc/adoc/a_rdocu.hxx
new file mode 100644
index 000000000000..32265a2c564d
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/a_rdocu.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: a_rdocu.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_A_RDOCU_HXX
+#define ADC_ADOC_A_RDOCU_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+class DocuDealer;
+
+
+
+namespace adoc
+{
+
+class Token;
+class Adoc_PE;
+
+class DocuExplorer
+
+{
+ public:
+ DocuExplorer();
+ ~DocuExplorer();
+ void StartNewFile(
+ DocuDealer & o_rDocuDistributor );
+
+ void Process_Token(
+ DYN adoc::Token & let_drToken );
+ private:
+ DocuDealer * pDocuDistributor;
+ Dyn<Adoc_PE> pPE;
+ bool bIsPassedFirstDocu;
+};
+
+
+} // namespace adoc
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/adoc/adoc_tok.hxx b/autodoc/source/parser/inc/adoc/adoc_tok.hxx
new file mode 100644
index 000000000000..77b53cb1cce2
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/adoc_tok.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: adoc_tok.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_ADOC_TOK_HXX
+#define ADC_ADOC_ADOC_TOK_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/token.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace adoc {
+
+
+class TokenInterpreter;
+
+
+class Token : public TextToken
+{
+ public:
+ // LIFECYCLE
+ virtual ~Token() {}
+
+ // OPERATIONS
+ virtual void DealOut(
+ ::TokenDealer & o_rDealer );
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const = 0;
+};
+
+
+} // namespace adoc
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/adoc/atokdeal.hxx b/autodoc/source/parser/inc/adoc/atokdeal.hxx
new file mode 100644
index 000000000000..2b3ca53a3a8d
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/atokdeal.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: atokdeal.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_ATOKDEAL_HXX
+#define ADC_ADOC_ATOKDEAL_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tokdeal.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+
+namespace adoc
+{
+
+class Token;
+
+class TokenDealer : virtual public ::TokenDealer
+{
+ public:
+
+ virtual void Deal_AdcDocu(
+ adoc::Token & let_drToken ) = 0;
+};
+
+
+} // namespace adoc
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/adoc/cx_a_std.hxx b/autodoc/source/parser/inc/adoc/cx_a_std.hxx
new file mode 100644
index 000000000000..189cc3f2321e
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/cx_a_std.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_a_std.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_CX_A_STD_HXX
+#define ADC_ADOC_CX_A_STD_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+ // COMPONENTS
+#include <tokens/tkpstama.hxx>
+ // PARAMETERS
+
+class TextToken;
+
+
+namespace adoc {
+
+class Cx_LineStart;
+class Cx_CheckStar;
+class Cx_AtTagCompletion;
+
+
+/**
+@descr
+*/
+class Context_AdocStd : public autodoc::TkpDocuContext,
+ private StateMachineContext
+{
+ public:
+ // LIFECYCLE
+ Context_AdocStd();
+ virtual void SetParentContext(
+ TkpContext & io_rParentContext,
+ const char * i_sMultiLineEndToken );
+ ~Context_AdocStd();
+
+ // OPERATIONS
+ virtual void AssignDealer(
+ TokenDealer & o_rDealer );
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual bool PassNewToken();
+ virtual void SetMode_IsMultiLine(
+ bool i_bTrue );
+ // INQUIRY
+ virtual TkpContext &
+ FollowUpContext();
+ private:
+ // SERVICE FUNCTIONS
+ virtual void PerformStatusFunction(
+ uintt i_nStatusSignal,
+ F_CRTOK i_fTokenCreateFunction,
+ CharacterSource & io_rText );
+
+ void SetupStateMachine();
+
+ // DATA
+ StateMachine aStateMachine;
+ TokenDealer * pDealer;
+
+ // Contexts
+ TkpContext * pParentContext;
+ TkpContext * pFollowUpContext;
+ Dyn<Cx_LineStart> pCx_LineStart;
+ Dyn<Cx_CheckStar> pCx_CheckStar;
+ Dyn<Cx_AtTagCompletion>
+ pCx_AtTagCompletion;
+
+ // Temporary data, used during ReadCharChain()
+ Dyn<TextToken> pNewToken;
+ bool bIsMultiline;
+};
+
+
+} // namespace adoc
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/adoc/cx_a_sub.hxx b/autodoc/source/parser/inc/adoc/cx_a_sub.hxx
new file mode 100644
index 000000000000..1691cfe79fcc
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/cx_a_sub.hxx
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cx_a_sub.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_CX_A_SUB_HXX
+#define ADC_ADOC_CX_A_SUB_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+ // COMPONENTS
+#include <tokens/tkpstama.hxx>
+ // PARAMETERS
+#include <tokens/token.hxx>
+
+
+namespace adoc {
+
+
+
+
+class Cx_LineStart : public TkpContext
+{
+ public:
+ Cx_LineStart(
+ TkpContext & i_rFollowUpContext );
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual bool PassNewToken();
+ virtual TkpContext &
+ FollowUpContext();
+
+ void SetCurToken(
+ TextToken::F_CRTOK i_fTokenCreateFunction )
+ { fCur_TokenCreateFunction = i_fTokenCreateFunction; }
+ void AssignDealer(
+ TokenDealer & o_rDealer )
+ { pDealer = &o_rDealer; }
+ private:
+ // DATA
+ TokenDealer * pDealer;
+ TkpContext * pFollowUpContext;
+
+ Dyn<TextToken> pNewToken;
+
+ TextToken::F_CRTOK fCur_TokenCreateFunction;
+};
+
+
+/**
+@descr
+*/
+
+class Cx_CheckStar : public TkpContext
+{
+ public:
+ // LIFECYCLE
+ Cx_CheckStar(
+ TkpContext & i_rFollowUpContext );
+ void Set_End_FollowUpContext(
+ TkpContext & i_rEnd_FollowUpContext )
+ { pEnd_FollowUpContext = &i_rEnd_FollowUpContext; }
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual bool PassNewToken();
+
+ void SetCanBeEnd(
+ bool i_bCanBeEnd )
+ { bCanBeEnd = i_bCanBeEnd; }
+ virtual TkpContext &
+ FollowUpContext();
+ void AssignDealer(
+ TokenDealer & o_rDealer )
+ { pDealer = &o_rDealer; }
+ private:
+ // DATA
+ TokenDealer * pDealer;
+ TkpContext * pFollowUpContext;
+ TkpContext * pEnd_FollowUpContext;
+
+ Dyn<TextToken> pNewToken;
+
+ bool bCanBeEnd;
+ bool bEndTokenFound;
+};
+
+
+class Cx_AtTagCompletion : public TkpContext
+{
+ public:
+ Cx_AtTagCompletion(
+ TkpContext & i_rFollowUpContext );
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual bool PassNewToken();
+ virtual TkpContext &
+ FollowUpContext();
+
+ void SetCurToken(
+ TextToken::F_CRTOK i_fTokenCreateFunction )
+ { fCur_TokenCreateFunction = i_fTokenCreateFunction; }
+ void AssignDealer(
+ TokenDealer & o_rDealer )
+ { pDealer = &o_rDealer; }
+ private:
+ // DATA
+ TokenDealer * pDealer;
+ TkpContext * pFollowUpContext;
+
+ Dyn<TextToken> pNewToken;
+
+ TextToken::F_CRTOK fCur_TokenCreateFunction;
+};
+
+
+} // namespace adoc
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/adoc/docu_pe.hxx b/autodoc/source/parser/inc/adoc/docu_pe.hxx
new file mode 100644
index 000000000000..171074e244d5
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/docu_pe.hxx
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: docu_pe.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_DOCU_PE_HXX
+#define ADC_DOCU_PE_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <adoc/tokintpr.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace ary
+{
+namespace doc
+{
+ class OldCppDocu;
+}
+namespace info
+{
+ class AtTag;
+}
+}
+
+
+
+namespace adoc
+{
+
+
+class Adoc_PE : public TokenInterpreter
+{
+ public:
+ Adoc_PE();
+ ~Adoc_PE();
+
+ virtual void Hdl_at_std(
+ const Tok_at_std & i_rTok );
+ virtual void Hdl_at_base(
+ const Tok_at_base & i_rTok );
+ virtual void Hdl_at_exception(
+ const Tok_at_exception &
+ i_rTok );
+ virtual void Hdl_at_impl(
+ const Tok_at_impl & i_rTok );
+ virtual void Hdl_at_key(
+ const Tok_at_key & i_rTok );
+ virtual void Hdl_at_param(
+ const Tok_at_param &
+ i_rTok );
+ virtual void Hdl_at_see(
+ const Tok_at_see & i_rTok );
+ virtual void Hdl_at_template(
+ const Tok_at_template &
+ i_rTok );
+ virtual void Hdl_at_interface(
+ const Tok_at_interface &
+ i_rTok );
+ virtual void Hdl_at_internal(
+ const Tok_at_internal &
+ i_rTok );
+ virtual void Hdl_at_obsolete(
+ const Tok_at_obsolete &
+ i_rTok );
+ virtual void Hdl_at_module(
+ const Tok_at_module &
+ i_rTok );
+ virtual void Hdl_at_file(
+ const Tok_at_file & i_rTok );
+ virtual void Hdl_at_gloss(
+ const Tok_at_gloss &
+ i_rTok );
+ virtual void Hdl_at_global(
+ const Tok_at_global &
+ i_rTok );
+ virtual void Hdl_at_include(
+ const Tok_at_include &
+ i_rTok );
+ virtual void Hdl_at_label(
+ const Tok_at_label &
+ i_rTok );
+ virtual void Hdl_at_since(
+ const Tok_at_since &
+ i_rTok );
+ virtual void Hdl_at_HTML(
+ const Tok_at_HTML &
+ i_rTok );
+ virtual void Hdl_at_NOHTML(
+ const Tok_at_NOHTML &
+ i_rTok );
+
+ virtual void Hdl_DocWord(
+ const Tok_DocWord & i_rTok );
+
+ virtual void Hdl_Whitespace(
+ const Tok_Whitespace &
+ i_rTok );
+ virtual void Hdl_LineStart(
+ const Tok_LineStart &
+ i_rTok );
+ virtual void Hdl_Eol(
+ const Tok_Eol & i_rTok );
+
+ virtual void Hdl_EoDocu(
+ const Tok_EoDocu & i_rTok );
+
+
+ DYN ary::doc::OldCppDocu *
+ ReleaseJustParsedDocu();
+
+ bool IsComplete() const;
+
+ private:
+ void InstallAtTag(
+ DYN ary::info::AtTag *
+ let_dpTag,
+ bool i_bImplicit = false ); /// True for implicit @short and @descr.
+ ary::doc::OldCppDocu &
+ CurDocu();
+ ary::info::AtTag & CurAtTag();
+ bool UsesHtmlInDocuText();
+
+ void RenameCurShortTag();
+ void FinishCurShortTag();
+
+
+ // DATA
+ enum E_TagState
+ {
+ ts_new,
+ ts_std
+ };
+ enum E_DocuState
+ {
+ ds_wait_for_short = 0,
+ ds_in_short,
+ ds_1newline_after_short,
+ ds_in_descr,
+ ds_std
+ };
+
+ Dyn<ary::doc::OldCppDocu>
+ pCurDocu;
+ ary::info::AtTag * pCurAtTag;
+ uintt nLineCountInDocu;
+ UINT8 nCurSpecialMeaningTokens;
+ UINT8 nCurSubtractFromLineStart;
+ E_TagState eCurTagState;
+ E_DocuState eDocuState;
+ bool bIsComplete;
+ bool bUsesHtmlInDocuText;
+};
+
+
+// IMPLEMENTATION
+inline bool
+Adoc_PE::IsComplete() const
+{
+ return bIsComplete;
+}
+
+
+
+
+} // namespace adoc
+#endif
diff --git a/autodoc/source/parser/inc/adoc/prs_adoc.hxx b/autodoc/source/parser/inc/adoc/prs_adoc.hxx
new file mode 100644
index 000000000000..549180071b40
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/prs_adoc.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: prs_adoc.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_PRS_ADOC_HXX
+#define ADC_ADOC_PRS_ADOC_HXX
+
+
+
+#include <autodoc/prs_docu.hxx>
+
+namespace adoc
+{
+
+
+class DocuParser_AutodocStyle : public autodoc::DocumentationParser_Ifc
+{
+ public:
+ DocuParser_AutodocStyle();
+ virtual ~DocuParser_AutodocStyle();
+
+ virtual DYN autodoc::TkpDocuContext *
+ Create_DocuContext() const;
+};
+
+
+
+} // namespace adoc
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/adoc/tk_attag.hxx b/autodoc/source/parser/inc/adoc/tk_attag.hxx
new file mode 100644
index 000000000000..323a8d96a712
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/tk_attag.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tk_attag.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_TK_ATTAG_HXX
+#define ADC_ADOC_TK_ATTAG_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <adoc/adoc_tok.hxx>
+ // COMPONENTS
+ // PARAMETERS
+#include <ary/info/inftypes.hxx>
+
+namespace adoc {
+
+typedef ary::info::E_AtTagId E_AtTagId;
+
+
+class Tok_at_std : public Token
+{
+ public:
+ Tok_at_std(
+ E_AtTagId i_nId )
+ : eId(i_nId) {}
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ virtual const char *
+ Text() const;
+ E_AtTagId Id() const { return eId; }
+
+ private:
+ E_AtTagId eId;
+};
+
+
+#define DECL_TOKEN_CLASS(name) \
+class Tok_##name : public Token \
+{ public: \
+ virtual void Trigger( \
+ TokenInterpreter & io_rInterpreter ) const; \
+ virtual const char * \
+ Text() const; \
+}
+
+
+DECL_TOKEN_CLASS(at_base);
+DECL_TOKEN_CLASS(at_exception);
+DECL_TOKEN_CLASS(at_impl);
+DECL_TOKEN_CLASS(at_key);
+DECL_TOKEN_CLASS(at_param);
+DECL_TOKEN_CLASS(at_see);
+DECL_TOKEN_CLASS(at_template);
+DECL_TOKEN_CLASS(at_interface);
+DECL_TOKEN_CLASS(at_internal);
+DECL_TOKEN_CLASS(at_obsolete);
+DECL_TOKEN_CLASS(at_module);
+DECL_TOKEN_CLASS(at_file);
+DECL_TOKEN_CLASS(at_gloss);
+DECL_TOKEN_CLASS(at_global);
+DECL_TOKEN_CLASS(at_include);
+DECL_TOKEN_CLASS(at_label);
+DECL_TOKEN_CLASS(at_HTML);
+DECL_TOKEN_CLASS(at_NOHTML);
+DECL_TOKEN_CLASS(at_since);
+
+
+#undef DECL_TOKEN_CLASS
+
+
+
+} // namespace adoc
+
+#endif
+
diff --git a/autodoc/source/parser/inc/adoc/tk_docw.hxx b/autodoc/source/parser/inc/adoc/tk_docw.hxx
new file mode 100644
index 000000000000..eceaa67e92c9
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/tk_docw.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tk_docw.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_TK_DOCW_HXX
+#define ADC_ADOC_TK_DOCW_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <adoc/adoc_tok.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace adoc {
+
+
+class Tok_DocWord : public Token
+{
+ public:
+ // Spring and Fall
+ Tok_DocWord(
+ const char * i_sText )
+ : sText(i_sText) {}
+ // OPERATIONS
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ // INQUIRY
+ virtual const char* Text() const;
+ uintt Length() const { return sText.length(); }
+
+ private:
+ // DATA
+ String sText;
+};
+
+class Tok_Whitespace : public Token
+{
+ public:
+ // Spring and Fall
+ Tok_Whitespace(
+ UINT8 i_nSize )
+ : nSize(i_nSize) {}
+ // OPERATIONS
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ // INQUIRY
+ virtual const char* Text() const;
+ UINT8 Size() const { return nSize; }
+
+ private:
+ // DATA
+ UINT8 nSize;
+};
+
+class Tok_LineStart : public Token
+{
+ public:
+ // Spring and Fall
+ Tok_LineStart(
+ UINT8 i_nSize )
+ : nSize(i_nSize) {}
+ // OPERATIONS
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ // INQUIRY
+ virtual const char* Text() const;
+ UINT8 Size() const { return nSize; }
+
+ private:
+ // DATA
+ UINT8 nSize;
+};
+
+class Tok_Eol : public Token
+{ public:
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ virtual const char *
+ Text() const;
+};
+
+class Tok_EoDocu : public Token
+{ public:
+ virtual void Trigger(
+ TokenInterpreter & io_rInterpreter ) const;
+ virtual const char *
+ Text() const;
+};
+
+
+} // namespace adoc
+
+#endif
+
diff --git a/autodoc/source/parser/inc/adoc/tokintpr.hxx b/autodoc/source/parser/inc/adoc/tokintpr.hxx
new file mode 100644
index 000000000000..a593761a611e
--- /dev/null
+++ b/autodoc/source/parser/inc/adoc/tokintpr.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tokintpr.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_ADOC_TOKINTPR_HXX
+#define ADC_ADOC_TOKINTPR_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+namespace adoc {
+
+
+class Tok_at_std;
+class Tok_at_base;
+class Tok_at_exception;
+class Tok_at_impl;
+class Tok_at_key;
+class Tok_at_param;
+class Tok_at_see;
+class Tok_at_template;
+class Tok_at_interface;
+class Tok_at_internal;
+class Tok_at_obsolete;
+class Tok_at_module;
+class Tok_at_file;
+class Tok_at_gloss;
+class Tok_at_global;
+class Tok_at_include;
+class Tok_at_label;
+class Tok_at_since;
+class Tok_at_HTML; // Sets default to: Use HTML in DocuText
+class Tok_at_NOHTML; // Sets default to: Don't use HTML in DocuText
+
+class Tok_DocWord;
+class Tok_LineStart;
+class Tok_Whitespace;
+class Tok_Eol;
+class Tok_EoDocu;
+
+
+#define DECL_TOK_HANDLER(token) \
+ virtual void Hdl_##token( \
+ const Tok_##token & i_rTok ) = 0
+
+
+
+class TokenInterpreter
+{
+ public:
+ virtual ~TokenInterpreter() {}
+
+ DECL_TOK_HANDLER(at_std);
+ DECL_TOK_HANDLER(at_base);
+ DECL_TOK_HANDLER(at_exception);
+ DECL_TOK_HANDLER(at_impl);
+ DECL_TOK_HANDLER(at_key);
+ DECL_TOK_HANDLER(at_param);
+ DECL_TOK_HANDLER(at_see);
+ DECL_TOK_HANDLER(at_template);
+ DECL_TOK_HANDLER(at_interface);
+ DECL_TOK_HANDLER(at_internal);
+ DECL_TOK_HANDLER(at_obsolete);
+ DECL_TOK_HANDLER(at_module);
+ DECL_TOK_HANDLER(at_file);
+ DECL_TOK_HANDLER(at_gloss);
+ DECL_TOK_HANDLER(at_global);
+ DECL_TOK_HANDLER(at_include);
+ DECL_TOK_HANDLER(at_label);
+ DECL_TOK_HANDLER(at_since);
+ DECL_TOK_HANDLER(at_HTML);
+ DECL_TOK_HANDLER(at_NOHTML);
+ DECL_TOK_HANDLER(DocWord);
+ DECL_TOK_HANDLER(Whitespace);
+ DECL_TOK_HANDLER(LineStart);
+ DECL_TOK_HANDLER(Eol);
+ DECL_TOK_HANDLER(EoDocu);
+};
+
+#undef DECL_TOK_HANDLER
+
+
+// IMPLEMENTATION
+
+
+} // namespace adoc
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/cpp/ctokdeal.hxx b/autodoc/source/parser/inc/cpp/ctokdeal.hxx
new file mode 100644
index 000000000000..82330d465c82
--- /dev/null
+++ b/autodoc/source/parser/inc/cpp/ctokdeal.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ctokdeal.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CTOKDEAL_HXX
+#define ADC_CPP_CTOKDEAL_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tokdeal.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace cpp
+{
+
+class Token;
+class Tok_UnblockMacro;
+
+
+class TokenDealer : virtual public ::TokenDealer
+{
+ public:
+
+ virtual void Deal_CppCode(
+ cpp::Token & let_drToken ) = 0;
+
+ /** This is to be used only by the internal macro expander
+ ( ::cpp::PreProcessor ).
+ These tokens are inserted into the source text temporary to make clear,
+ where a specific macro replacement ends and therefore the macro's name
+ becomes valid again.
+
+ @see ::cpp::Tok_UnblockMacro
+ @see ::cpp::PreProcessor
+ */
+ virtual void Deal_Cpp_UnblockMacro(
+ Tok_UnblockMacro & let_drToken ) = 0;
+};
+
+
+
+} // namespace cpp
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/cpp/prs_cpp.hxx b/autodoc/source/parser/inc/cpp/prs_cpp.hxx
new file mode 100644
index 000000000000..665b0e2ef23a
--- /dev/null
+++ b/autodoc/source/parser/inc/cpp/prs_cpp.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: prs_cpp.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_PRS_CPP_HXX
+#define ADC_CPP_PRS_CPP_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <autodoc/prs_code.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp
+{
+
+struct S_RunningData;
+
+class Cpluplus_Parser : public autodoc::CodeParser_Ifc
+{
+ public:
+ Cpluplus_Parser();
+ virtual ~Cpluplus_Parser();
+
+
+ virtual void Setup(
+ ary::Repository & o_rRepository,
+ const autodoc::DocumentationParser_Ifc &
+ i_rDocumentationInterpreter );
+
+ virtual void Run(
+ const autodoc::FileCollector_Ifc &
+ i_rFiles );
+ private:
+ Dyn<S_RunningData> pRunningData;
+};
+
+
+
+
+} // namespace cpp
+#endif
diff --git a/autodoc/source/parser/inc/doc_deal.hxx b/autodoc/source/parser/inc/doc_deal.hxx
new file mode 100644
index 000000000000..8e21051de8fe
--- /dev/null
+++ b/autodoc/source/parser/inc/doc_deal.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: doc_deal.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_DOC_DEAL_HXX
+#define ADC_DOC_DEAL_HXX
+
+// BASE CLASSES
+#include <tokens/tokproct.hxx>
+// USED SERVICES
+#include <ary/cpp/c_types4cpp.hxx>
+
+namespace ary
+{
+namespace doc
+{
+ class OldCppDocu;
+}
+}
+
+
+
+
+class DocuDealer
+{
+ public:
+ // INQUIRY
+ virtual ~DocuDealer() {}
+
+ // OPERATIONS
+ /** @descr
+ This distributes the let_drDocu to the matching ary::RepositoryEntity .
+
+ If the docu is not inline, it will be saved and later given to the next
+ ary::CodeEntity. Or it will be discarded, if there does not come a matching
+ ary::CodeEntity .
+
+ If the docu is inline after a function header or after an enum value
+ or after a function parameter or after a base class, it will be stored
+ together with the matching function, enum value, parameter or base class.
+
+ If the documentation is @file or @project or @glos(sary) it will be
+ stored at the matching ary::cpp::FileGroup, ary::cpp::ProjectGroup
+ or ary::Glossary.
+ */
+ void TakeDocu(
+ DYN ary::doc::OldCppDocu &
+ let_drInfo );
+ private:
+ virtual void do_TakeDocu(
+ DYN ary::doc::OldCppDocu &
+ let_drInfo ) = 0;
+};
+
+
+
+
+// IMPLEMENTATION
+inline void
+DocuDealer::TakeDocu( DYN ary::doc::OldCppDocu & let_drInfo )
+ { do_TakeDocu(let_drInfo); }
+
+
+
+
+#endif
diff --git a/autodoc/source/parser/inc/semantic/callf.hxx b/autodoc/source/parser/inc/semantic/callf.hxx
new file mode 100644
index 000000000000..5739e93c2b10
--- /dev/null
+++ b/autodoc/source/parser/inc/semantic/callf.hxx
@@ -0,0 +1,290 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: callf.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_CALLF_HXX
+#define ADC_CPP_CALLF_HXX
+
+// USED SERVICES
+
+
+
+
+/** This represents a function to be called, if a specific kind of token
+ arrives in the semantic parser.
+
+ @descr This class is only to be used as member of PeStatus<PE>.
+ @template PE
+ The owning ParseEnvironment.
+ @see PeStatus, ParseEnvironment
+*/
+template <class PE>
+class CallFunction
+{
+ public:
+ typedef void (PE::*F_Tok)(const char *);
+
+ CallFunction(
+ F_Tok i_f2Call,
+ INT16 i_nTokType );
+
+ F_Tok GetF() const;
+ INT16 TokType() const;
+
+ private:
+ // DATA
+ F_Tok f2Call;
+ INT16 nTokType;
+};
+
+
+/** One state within a ParseEnvironment.
+
+ @template PE
+ The owning ParseEnvironment.
+*/
+template <class PE>
+class PeStatus
+{
+ public:
+ typedef typename CallFunction<PE>::F_Tok F_Tok;
+
+ PeStatus(
+ PE & i_rMyPE,
+ uintt i_nSize,
+ F_Tok * i_pFuncArray,
+ INT16 * i_pTokTypeArray,
+ F_Tok i_pDefault );
+ virtual ~PeStatus();
+
+ virtual void Call_Handler(
+ INT16 i_nTokTypeId,
+ const char * i_sTokenText ) const;
+
+ private:
+ bool CheckForCall(
+ uintt i_nPos,
+ INT16 i_nTokTypeId,
+ const char * i_sTokenText ) const;
+
+ PE * pMyPE;
+ std::vector< CallFunction<PE> >
+ aBranches;
+ F_Tok fDefault;
+};
+
+
+template <class PE>
+class PeStatusArray
+{
+ public:
+ typedef typename PE::E_State State;
+
+ PeStatusArray();
+ void InsertState(
+ State i_ePosition,
+ DYN PeStatus<PE> & let_drState );
+ ~PeStatusArray();
+
+ const PeStatus<PE> &
+ operator[](
+ State i_ePosition ) const;
+
+ void SetCur(
+ State i_eCurState );
+ const PeStatus<PE> &
+ Cur() const;
+
+ private:
+ DYN PeStatus<PE> * aStati[PE::size_of_states];
+ State eState;
+};
+
+
+
+// IMPLEMENTATION
+
+
+// CallFunction
+
+template <class PE>
+CallFunction<PE>::CallFunction( F_Tok i_f2Call,
+ INT16 i_nTokType )
+ : f2Call(i_f2Call),
+ nTokType(i_nTokType)
+{
+}
+
+template <class PE>
+inline typename CallFunction<PE>::F_Tok
+CallFunction<PE>::GetF() const
+{
+ return f2Call;
+}
+
+template <class PE>
+inline INT16
+CallFunction<PE>::TokType() const
+{
+ return nTokType;
+}
+
+
+
+// PeStatus
+
+template <class PE>
+PeStatus<PE>::PeStatus( PE & i_rMyPE,
+ uintt i_nSize,
+ F_Tok * i_pFuncArray,
+ INT16 * i_pTokTypeArray,
+ F_Tok i_fDefault )
+ : pMyPE(&i_rMyPE),
+ fDefault(i_fDefault)
+{
+ aBranches.reserve(i_nSize);
+ for ( uintt i = 0; i < i_nSize; ++i )
+ {
+// csv_assert(i > 0 ? i_pTokTypeArray[i] > i_pTokTypeArray[i-1] : true);
+ aBranches.push_back( CallFunction<PE>( i_pFuncArray[i], i_pTokTypeArray[i]) );
+ } // end for
+}
+
+template <class PE>
+PeStatus<PE>::~PeStatus()
+{
+
+}
+
+template <class PE>
+void
+PeStatus<PE>::Call_Handler( INT16 i_nTokTypeId,
+ const char * i_sTokenText ) const
+{
+ uintt nSize = aBranches.size();
+ uintt nPos = nSize / 2;
+
+ if ( i_nTokTypeId < aBranches[nPos].TokType() )
+ {
+ for ( --nPos; intt(nPos) >= 0; --nPos )
+ {
+ if (CheckForCall(nPos, i_nTokTypeId, i_sTokenText))
+ return;
+ }
+ }
+ else
+ {
+ for ( ; nPos < nSize; ++nPos )
+ {
+ if (CheckForCall(nPos, i_nTokTypeId, i_sTokenText))
+ return;
+ }
+ }
+
+ (pMyPE->*fDefault)(i_sTokenText);
+}
+
+template <class PE>
+bool
+PeStatus<PE>::CheckForCall( uintt i_nPos,
+ INT16 i_nTokTypeId,
+ const char * i_sTokenText ) const
+{
+ if ( aBranches[i_nPos].TokType() == i_nTokTypeId )
+ {
+ (pMyPE->*aBranches[i_nPos].GetF())(i_sTokenText);
+ return true;
+ }
+ return false;
+}
+
+// PeStatusArray
+
+template <class PE>
+PeStatusArray<PE>::PeStatusArray()
+ : eState(PE::size_of_states)
+{
+ memset(aStati, 0, sizeof aStati);
+}
+
+template <class PE>
+void
+PeStatusArray<PE>::InsertState( State i_ePosition,
+ DYN PeStatus<PE> & let_drState )
+{
+ csv_assert(aStati[i_ePosition] == 0);
+ aStati[i_ePosition] = &let_drState;
+}
+
+template <class PE>
+PeStatusArray<PE>::~PeStatusArray()
+{
+ int i_max = PE::size_of_states;
+ for (int i = 0; i < i_max; i++)
+ {
+ delete aStati[i];
+ } // end for
+}
+
+template <class PE>
+inline const PeStatus<PE> &
+PeStatusArray<PE>::operator[]( State i_ePosition ) const
+{
+ csv_assert( uintt(i_ePosition) < PE::size_of_states );
+ csv_assert( aStati[i_ePosition] != 0 );
+ return *aStati[i_ePosition];
+}
+
+template <class PE>
+inline void
+PeStatusArray<PE>::SetCur( State i_eCurState )
+{
+ eState = i_eCurState;
+}
+
+
+template <class PE>
+const PeStatus<PE> &
+PeStatusArray<PE>::Cur() const
+{
+ return (*this)[eState];
+}
+
+#define SEMPARSE_CREATE_STATUS(penv, state, default_function) \
+ pStati->InsertState( state, \
+ *new PeStatus<penv>( \
+ *this, \
+ sizeof( stateT_##state ) / sizeof (INT16), \
+ stateF_##state, \
+ stateT_##state, \
+ &penv::default_function ) )
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/semantic/parseenv.hxx b/autodoc/source/parser/inc/semantic/parseenv.hxx
new file mode 100644
index 000000000000..a001a6f1f80c
--- /dev/null
+++ b/autodoc/source/parser/inc/semantic/parseenv.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: parseenv.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_PARSEENV_HXX
+#define ADC_PARSEENV_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tokproct.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace ary
+{
+namespace info
+{
+class CodeInfo;
+} // namespace info
+} // namespace ary)
+
+
+
+class SubPeUseIfc;
+
+
+class ParseEnvironment : protected TokenProcessing_Types
+{
+ public:
+ virtual ~ParseEnvironment() {}
+
+ // Parsing
+ void Enter(
+ E_EnvStackAction i_eWayOfEntering );
+ void Leave(
+ E_EnvStackAction i_eWayOfLeaving );
+ void SetCurSPU(
+ const SubPeUseIfc * i_pCurSPU );
+
+ ParseEnvironment * Parent() const;
+
+
+ // ACCESS
+ protected:
+ ParseEnvironment(
+ ParseEnvironment * i_pParent );
+ const SubPeUseIfc * CurSubPeUse() const;
+ private:
+ virtual void InitData() = 0;
+ virtual void TransferData() = 0;
+
+ ParseEnvironment * pParent;
+ const SubPeUseIfc * pCurSubPe;
+};
+
+class SubPeUseIfc
+{
+ public:
+ virtual ~SubPeUseIfc() {}
+
+ virtual void InitParse() const = 0;
+ virtual void GetResults() const = 0;
+};
+
+
+
+// IMPLEMENTATION
+
+inline void
+ParseEnvironment::SetCurSPU( const SubPeUseIfc * i_pCurSPU )
+ { pCurSubPe = i_pCurSPU; }
+
+inline ParseEnvironment *
+ParseEnvironment::Parent() const
+ { return pParent; }
+
+inline const SubPeUseIfc *
+ParseEnvironment::CurSubPeUse() const
+ { return pCurSubPe; }
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/semantic/sub_pe.hxx b/autodoc/source/parser/inc/semantic/sub_pe.hxx
new file mode 100644
index 000000000000..0dca38060ddb
--- /dev/null
+++ b/autodoc/source/parser/inc/semantic/sub_pe.hxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sub_pe.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_SUB_PE_HXX
+#define ADC_CPP_SUB_PE_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+
+class ParseEnvironment;
+
+template <class PE, class SUB>
+class SubPe
+{
+ public:
+ typedef SubPe< PE, SUB > self;
+
+ SubPe(
+ PE & i_rParent );
+ PE & Parent() const;
+ SUB & Child() const;
+
+ ParseEnvironment & Get() const;
+
+ private:
+ SUB & CreateChild() const;
+
+ PE & rParent;
+ Dyn<SUB> pChild;
+};
+
+
+
+// IMPLEMENTATION
+
+
+// SubPe
+
+template <class PE, class SUB>
+SubPe<PE,SUB>::SubPe( PE & i_rParent )
+ : rParent(i_rParent)
+{
+}
+
+template <class PE, class SUB>
+PE &
+SubPe<PE,SUB>::Parent() const
+{
+ return rParent;
+}
+
+template <class PE, class SUB>
+inline SUB &
+SubPe<PE,SUB>::Child() const
+{
+ return pChild ? *pChild.MutablePtr() : CreateChild();
+}
+
+template <class PE, class SUB>
+ParseEnvironment &
+SubPe<PE,SUB>::Get() const
+{
+ return Child();
+}
+
+template <class PE, class SUB>
+SUB &
+SubPe<PE,SUB>::CreateChild() const
+{
+ self * pThis = const_cast< self* >(this);
+
+ SUB * pNewChild = new SUB( &rParent);
+
+ pThis->pChild = pNewChild;
+
+ return *pChild.MutablePtr();
+}
+
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/semantic/sub_peu.hxx b/autodoc/source/parser/inc/semantic/sub_peu.hxx
new file mode 100644
index 000000000000..13d891d9c483
--- /dev/null
+++ b/autodoc/source/parser/inc/semantic/sub_peu.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sub_peu.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_SUB_PEU_HXX
+#define ADC_CPP_SUB_PEU_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <semantic/parseenv.hxx>
+#include <tokens/tokproct.hxx>
+ // COMPONENTS
+ // PARAMETERS
+#include <semantic/sub_pe.hxx>
+
+
+
+template <class PE, class SUB>
+class SubPeUse : public SubPeUseIfc,
+ private TokenProcessing_Types
+{
+ public:
+ typedef void (PE::*F_INIT)();
+ typedef void (PE::*F_RETURN)();
+
+ SubPeUse(
+ SubPe<PE,SUB> & i_rSubPeCreator,
+ F_INIT i_fInit,
+ F_RETURN i_fReturn );
+ ~SubPeUse();
+
+ void Push(
+ E_TokenDone i_eDone );
+ virtual void InitParse() const;
+ virtual void GetResults() const;
+
+ PE & Parent() const;
+ SUB & Child() const;
+
+ private:
+ // DATA
+ SubPe<PE,SUB> & rSubPeCreator;
+ F_INIT fInit;
+ F_RETURN fReturn;
+};
+
+
+// IMPLEMENTATION
+
+
+template <class PE, class SUB>
+SubPeUse<PE,SUB>::SubPeUse( SubPe<PE,SUB> & i_rSubPeCreator,
+ F_INIT i_fInit,
+ F_RETURN i_fReturn )
+ : rSubPeCreator(i_rSubPeCreator),
+ fInit(i_fInit),
+ fReturn(i_fReturn)
+{
+}
+
+template <class PE, class SUB>
+SubPeUse<PE,SUB>::~SubPeUse()
+{
+}
+
+template <class PE, class SUB>
+void
+SubPeUse<PE,SUB>::Push( E_TokenDone i_eDone )
+{
+ Parent().SetTokenResult( i_eDone, push, &rSubPeCreator.Get() );
+ Parent().SetCurSPU(this);
+}
+
+template <class PE, class SUB>
+void
+SubPeUse<PE,SUB>::InitParse() const
+{
+ if (fInit != 0)
+ (Parent().*fInit)();
+}
+
+template <class PE, class SUB>
+void
+SubPeUse<PE,SUB>::GetResults() const
+{
+ if (fReturn != 0)
+ (Parent().*fReturn)();
+}
+
+template <class PE, class SUB>
+inline PE &
+SubPeUse<PE,SUB>::Parent() const
+{
+ return rSubPeCreator.Parent();
+}
+
+template <class PE, class SUB>
+inline SUB &
+SubPeUse<PE,SUB>::Child() const
+{
+ return rSubPeCreator.Child();
+}
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/tokens/parseinc.hxx b/autodoc/source/parser/inc/tokens/parseinc.hxx
new file mode 100644
index 000000000000..9b2d6d512f77
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/parseinc.hxx
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: parseinc.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_PARSEINC_HXX
+#define ADC_PARSEINC_HXX
+
+
+#include <tools/tkpchars.hxx>
+
+inline char
+jumpOver( CharacterSource & io_rText,
+ char in_c )
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext == in_c;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpTo( CharacterSource & io_rText,
+ char in_c )
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext != in_c AND cNext != 0;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpTo( CharacterSource & io_rText,
+ char in_c1,
+ char in_c2 )
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext != in_c1 AND cNext != in_c2 AND cNext != 0;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpTo( CharacterSource & io_rText,
+ char in_c1,
+ char in_c2,
+ char in_c3 )
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext != in_c1 AND cNext != in_c2 AND cNext != in_c3 AND cNext != 0;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpTo( CharacterSource & io_rText,
+ char in_c1,
+ char in_c2,
+ char in_c3,
+ char in_c4 )
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext != in_c1 AND cNext != in_c2 AND cNext != in_c3
+ AND cNext != in_c4 AND cNext != 0;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpOverWhite(CharacterSource & io_rText)
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ static_cast<UINT8>(cNext) < 33
+ AND cNext != 0 AND cNext != 13 AND cNext != 10;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpToWhite(CharacterSource & io_rText)
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ static_cast<UINT8>(cNext) > 32;
+ cNext = io_rText.MoveOn() )
+ { }
+
+ return cNext;
+}
+
+inline char
+jumpToEol(CharacterSource & io_rText, int & o_rCount_BackslashedLineBreaks )
+{
+ o_rCount_BackslashedLineBreaks = 0;
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext != 13 AND cNext != 10 AND cNext != NULCH;
+ cNext = io_rText.MoveOn() )
+ {
+ if ( cNext == '\\')
+ {
+ cNext = io_rText.MoveOn();
+ if ( cNext == 13 )
+ io_rText.MoveOn();
+ if ( cNext == 10 )
+ ++o_rCount_BackslashedLineBreaks;
+ }
+ }
+ return cNext;
+}
+
+inline char
+jumpToEol(CharacterSource & io_rText)
+{
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ cNext != 13 AND cNext != 10 AND cNext != NULCH;
+ cNext = io_rText.MoveOn() )
+ {
+ if ( cNext == '\\')
+ io_rText.MoveOn();
+ }
+ return cNext;
+}
+
+inline char
+jumpOverEol(CharacterSource & io_rText)
+{
+ char cNext = io_rText.CurChar();
+
+ if (cNext == 13)
+ io_rText.MoveOn();
+ if (cNext == 10)
+ io_rText.MoveOn();
+ return cNext;
+}
+
+
+inline char // Finds a matching closing bracket after the opening one is passed
+jumpToMatchingBracket( CharacterSource & io_rText,
+ char in_cBegin,
+ char in_cEnd )
+{
+ intt nCounter = 1;
+ char cNext;
+ for ( cNext = io_rText.CurChar();
+ nCounter - (cNext == in_cEnd ? 1 : 0) > 0 AND cNext != NULCH;
+ cNext = io_rText.MoveOn() )
+ {
+ if (cNext == in_cEnd)
+ nCounter++;
+ else if (cNext == in_cBegin)
+ nCounter--;
+ }
+
+ return cNext;
+}
+
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/tokens/stmstarr.hxx b/autodoc/source/parser/inc/tokens/stmstarr.hxx
new file mode 100644
index 000000000000..cf6586729e82
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/stmstarr.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stmstarr.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_STMSTARR_HXX
+#define ADC_STMSTARR_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/stmstate.hxx>
+ // COMPONENTS
+ // PARAMETERS
+#include <tokens/token.hxx>
+
+
+class StmArrayStatus : public StmStatus
+{
+ public:
+ typedef TextToken::F_CRTOK F_CRTOK;
+
+ // LIFECYCLE
+ StmArrayStatus(
+ intt i_nStatusSize,
+ const INT16 * in_aArrayModel,
+ F_CRTOK i_fTokenCreateFunction,
+ bool in_bIsDefault );
+ ~StmArrayStatus();
+
+ // INQUIRY
+ StmStatus::Branch NextBy(
+ intt in_nFollowersIndex) const;
+ F_CRTOK TokenCreateFunction() const
+ { return fTokenCreateFunction; }
+ virtual bool IsADefault() const;
+
+ // ACCESS
+ virtual StmArrayStatus *
+ AsArray();
+ bool SetBranch(
+ intt in_nBranchIx,
+ StmStatus::Branch in_nBranch );
+ void SetTokenCreateFunction(
+ F_CRTOK i_fTokenCreateFunction );
+ private:
+ StmStatus::Branch * dpBranches;
+ intt nNrOfBranches;
+ F_CRTOK fTokenCreateFunction;
+ bool bIsADefault;
+};
+
+
+// IMPLEMENTATION
+
+inline void
+StmArrayStatus::SetTokenCreateFunction( F_CRTOK i_fTokenCreateFunction )
+ { fTokenCreateFunction = i_fTokenCreateFunction; }
+
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/stmstate.hxx b/autodoc/source/parser/inc/tokens/stmstate.hxx
new file mode 100644
index 000000000000..fae4fff344a6
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/stmstate.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stmstate.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_STMSTATE_HXX
+#define ADC_STMSTATE_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+class StmArrayStatus;
+class StmBoundsStatus;
+
+/** A StmStatus is a state within a StateMachine.
+ There are two kinds of it. Either its an array of pointers to
+ other states within the state machine - an ArrayStatus.
+
+ Or it is a BoundsStatus, which shows, the token cannot be
+ followed further within the StateMachine.
+**/
+class StmStatus // := "State machine status"
+{
+ public:
+ typedef intt Branch; /// Values >= 0 give a next #Status' ID.
+ /// Values <= 0 tell, that a token is finished.
+ /// a value < 0 returns the status back to an upper level state machine.
+ // LIFECYCLE
+ virtual ~StmStatus() {}
+
+ // OPERATIONS
+ virtual StmArrayStatus *
+ AsArray();
+ virtual StmBoundsStatus *
+ AsBounds();
+
+ // INQUIRY
+ virtual bool IsADefault() const = 0;
+};
+
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/stmstfin.hxx b/autodoc/source/parser/inc/tokens/stmstfin.hxx
new file mode 100644
index 000000000000..a8be55e8dbf8
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/stmstfin.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stmstfin.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_STMSTFIN_HXX
+#define ADC_STMSTFIN_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/stmstate.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+class TkpContext;
+class StateMachineContext;
+
+/**
+**/
+class StmBoundsStatus : public StmStatus
+{
+ public:
+ // LIFECYCLE
+ StmBoundsStatus(
+ StateMachineContext &
+ o_rOwner,
+ TkpContext & i_rFollowUpContext,
+ uintt i_nStatusFunctionNr,
+ bool i_bIsDefault );
+ // INQUIRY
+ TkpContext * FollowUpContext();
+ uintt StatusFunctionNr() const;
+ virtual bool IsADefault() const;
+
+ // ACCESS
+ virtual StmBoundsStatus *
+ AsBounds();
+
+ private:
+ StateMachineContext *
+ pOwner;
+ TkpContext * pFollowUpContext;
+ uintt nStatusFunctionNr;
+ bool bIsDefault;
+};
+
+inline TkpContext *
+StmBoundsStatus::FollowUpContext()
+ { return pFollowUpContext; }
+inline uintt
+StmBoundsStatus::StatusFunctionNr() const
+ { return nStatusFunctionNr; }
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/tkp.hxx b/autodoc/source/parser/inc/tokens/tkp.hxx
new file mode 100644
index 000000000000..7b2071fc7b5b
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/tkp.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkp.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_TKP_HXX
+#define ADC_TKP_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+class CharacterSource;
+class TkpContext;
+ // PARAMETRS
+
+
+
+/** This is the interface for parser classes, which get a sequence of tokens from
+ a text.
+
+ Start() starts to parse the text from the given i_rSource.
+ GetNextToken() returns a Token on the heap as long as there are
+ still characters in the text left. This can be checked by
+ HasMore().
+
+ The algorithms for parsing tokens from the text are an issue of
+ the derived classes.
+*/
+#if 0
+/**
+ Parsing can be interrupted for a different source by PushSource().
+ The parsing before interruption is continued after PopSource().
+*/
+#endif // 0
+
+class TokenParser
+{
+ public:
+ // LIFECYCLE
+ TokenParser();
+ virtual ~TokenParser() {}
+
+ // OPERATIONS
+ /** Start parsing a character source. Any previously parsed sources
+ are discarded.
+ */
+ virtual void Start(
+ CharacterSource &
+ i_rSource );
+
+ /** @short Gets the next identifiable token out of the
+ source code.
+ */
+ void GetNextToken();
+
+ /// @return true, if there are more tokens to parse.
+ bool HasMore() const { return bHasMore; }
+
+ private:
+ void InitSource(
+ CharacterSource &
+ i_rSource );
+
+ virtual void SetStartContext() = 0;
+ virtual void SetCurrentContext(
+ TkpContext & io_rContext ) = 0;
+ virtual TkpContext &
+ CurrentContext() = 0;
+ // DATA
+ CharacterSource * pChars;
+ bool bHasMore;
+};
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/tkpcontx.hxx b/autodoc/source/parser/inc/tokens/tkpcontx.hxx
new file mode 100644
index 000000000000..ed2a7d9ec1ca
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/tkpcontx.hxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkpcontx.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_TKPCONTX_HXX
+#define ADC_TKPCONTX_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+#include <tokens/token.hxx>
+class CharacterSource;
+class TkpNullContext;
+
+/** @task
+ Specifies a context within which tokens are interpreted in a special
+ way. For example in parsing C++ there could be a context for code,
+ one for comments and a third one for preprocessor statements, because
+ each of these would give the same token different meanings.
+
+ The three functions
+ ReadCharChain()
+ PassNewToken()
+ FollowUpContext()
+ have to be called in this sequence.
+
+**/
+class TkpContext
+{
+ public:
+ // LIFECYCLE
+ virtual ~TkpContext() {}
+
+ // OPERATIONS
+ /** @descr
+ The functions starts to parse with the CurChar() of io_rText.
+ It leaves io_rText.CurChar() at the first char of the following Token or
+ the following Context.
+
+ This function returns, when a context has parsed some characterss
+ and completed a token OR left the context.
+ If the token is to be ignored, it is cut from io_rText.
+
+ If the token is to be parsed further in a different context,
+ it is NOT cut from io_rText.
+
+ After this function PassNewToken() has to be called.
+
+ If the function has found a valid and complete token, PassNewToken()
+ passes the parsed token to the internally known receiver and
+ returns true. The token is cut from io_rText.
+ **/
+ virtual void ReadCharChain(
+ CharacterSource & io_rText ) = 0;
+ /** Has to pass the parsed token to a known receiver.
+ If the token is to be parsed further in a different context,
+ PassNewToken() returns false, but the token is NOT cut from io_rText.
+
+ @return true, if a token was passed.
+ false, if the token was not parsed completely by this context
+ or if the token is to be ignored.
+ */
+ virtual bool PassNewToken() = 0;
+ virtual TkpContext &
+ FollowUpContext() = 0;
+
+ static TkpNullContext &
+ Null_();
+};
+
+class StateMachineContext
+{
+ public:
+ typedef TextToken::F_CRTOK F_CRTOK;
+
+ virtual ~StateMachineContext() {}
+
+ /// Is used by StmBoundsStatus only.
+ virtual void PerformStatusFunction(
+ uintt i_nStatusSignal,
+ F_CRTOK i_fTokenCreateFunction,
+ CharacterSource & io_rText ) = 0;
+};
+
+class TkpNullContext : public TkpContext
+{
+ public:
+ ~TkpNullContext();
+
+ virtual void ReadCharChain(
+ CharacterSource & io_rText );
+ virtual bool PassNewToken();
+ virtual TkpContext &
+ FollowUpContext();
+};
+
+namespace autodoc
+{
+
+class TkpDocuContext : public TkpContext
+{
+ public:
+ virtual void SetParentContext(
+ TkpContext & io_rParentContext,
+ const char * i_sMultiLineEndToken ) = 0;
+ virtual void AssignDealer(
+ TokenDealer & o_rDealer ) = 0;
+ virtual void SetMode_IsMultiLine(
+ bool i_bTrue ) = 0;
+};
+
+} // namespace autodoc
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/tkpstama.hxx b/autodoc/source/parser/inc/tokens/tkpstama.hxx
new file mode 100644
index 000000000000..79391154ff72
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/tkpstama.hxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkpstama.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_TKPSTAMA_HXX
+#define ADC_TKPSTAMA_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <tokens/tkpcontx.hxx>
+ // COMPONENTS
+#include <tokens/stmstarr.hxx>
+#include <tokens/stmstfin.hxx>
+
+/** @descr
+ This state-machine models state transitions from one state to another
+ per indices of branches. If the indices represent ascii-char-values,
+ the state-machine can be used for recognising tokens of text.
+
+ The state-machine can be a status itself.
+
+ StateMachine needs the array-size of all stati as a guess, how many stati
+ the state machine will contain, when at work.
+
+
+**/
+class StateMachine
+{
+ public:
+ // Types
+ typedef StmStatus::Branch Branch;
+ typedef StmStatus * * StatusList;
+
+ //# Interface self
+ // LIFECYCLE
+ StateMachine(
+ intt in_nStatusSize,
+ intt in_nInitial_StatusListSize ); /// The user of the constructor should guess
+ /// the approximate number of stati here to
+ /// avoid multiple reallocations.
+ /// @#AddStatus
+ intt AddStatus( /// @return the new #Status' ID
+ DYN StmStatus * let_dpStatus);
+ /// @#AddToken
+ void AddToken(
+ const char * in_sToken,
+ TextToken::F_CRTOK in_fTokenCreateFunction,
+ const INT16 * in_aBranches,
+ INT16 in_nBoundsStatus );
+ ~StateMachine();
+
+
+ // OPERATIONS
+ StmBoundsStatus &
+ GetCharChain(
+ TextToken::F_CRTOK &
+ o_nTokenCreateFunction,
+ CharacterSource & io_rText );
+ private:
+ // SERVICE FUNCTIONS
+ StmStatus & Status(
+ intt in_nStatusNr) const;
+ StmArrayStatus &
+ CurrentStatus() const;
+ StmBoundsStatus *
+ BoundsStatus() const;
+
+ /// Sets the PeekedStatus.
+ void Peek(
+ intt in_nBranch);
+
+ void ResizeStati(); // Adds space for 32 stati.
+
+ // DATA
+ StatusList pStati; /// List of Status, implemented as simple C-array of length #nStatiSpace
+ /// with nStatiLength valid members (beginning from zero).
+ intt nCurrentStatus;
+ intt nPeekedStatus;
+
+ intt nStatusSize; /// Size of the branch array of a single status.
+
+ intt nNrofStati; /// Nr of Stati so far.
+ intt nStatiSpace; /// Size of allocated array for #pStati (size in items).
+};
+
+
+
+/** @#AddToken
+ @descr
+ Adds a token, which will be recogniszeds by the
+ statemachine.
+
+
+**/
+
+
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/tokdeal.hxx b/autodoc/source/parser/inc/tokens/tokdeal.hxx
new file mode 100644
index 000000000000..72eaa0a23cb6
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/tokdeal.hxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tokdeal.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_TOKDEAL_HXX
+#define ADC_TOKDEAL_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+namespace cpp
+{
+ class Distributor;
+}
+
+
+class TokenDealer
+
+{
+ public:
+ virtual ~TokenDealer() {}
+
+ virtual void Deal_Eol() = 0;
+ virtual void Deal_Eof() = 0;
+ virtual cpp::Distributor *
+ AsDistributor() = 0;
+};
+
+
+#if 0
+class TokenDealer
+
+{
+ public:
+ virtual void Deal_IdlCode(
+ idl::Token & let_drToken );
+ virtual void Deal_UdkDocu(
+ udoc::Token & let_drToken );
+ virtual void Deal_JavaCode(
+ java::Token & let_drToken );
+ virtual void Deal_SBasicCode(
+ sbasic::Token & let_drToken );
+};
+
+#endif // 0
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/tokens/token.hxx b/autodoc/source/parser/inc/tokens/token.hxx
new file mode 100644
index 000000000000..deed6083205b
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/token.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: token.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_TOKEN_HXX
+#define ADC_TOKEN_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETRS
+
+
+class TokenDealer;
+
+/**
+*/
+class TextToken
+{
+ public:
+ typedef TextToken * (*F_CRTOK)(const char*);
+
+ // LIFECYCLE
+ virtual ~TextToken() {}
+
+
+ // INQUIRY
+ virtual const char* Text() const = 0;
+
+ virtual void DealOut(
+ ::TokenDealer & o_rDealer ) = 0;
+};
+
+class Tok_Eof : public TextToken
+{
+ virtual void DealOut( // Implemented in tokdeal.cxx
+ TokenDealer & o_rDealer );
+ virtual const char* Text() const;
+};
+
+#endif
+
+
diff --git a/autodoc/source/parser/inc/tokens/tokproct.hxx b/autodoc/source/parser/inc/tokens/tokproct.hxx
new file mode 100644
index 000000000000..8ab16ef41234
--- /dev/null
+++ b/autodoc/source/parser/inc/tokens/tokproct.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tokproct.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_CPP_TOKPROCT_HXX
+#define ADC_CPP_TOKPROCT_HXX
+
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+
+class ParseEnvironment;
+
+/** is a parent class for classes, which take part in parsing tokens semantically.
+ It provides some types for them.
+*/
+class TokenProcessing_Types
+{
+ public:
+ enum E_TokenDone
+ {
+ not_done = 0,
+ done = 1
+ };
+
+ enum E_EnvStackAction
+ {
+ stay, // same parse environment
+ push, // push sub environment
+ pop_success, // return to parent environment, parsing was successful
+ pop_failure // return to parent environment, but an error occured.
+ };
+
+ struct TokenProcessing_Result
+ {
+ E_TokenDone eDone;
+ E_EnvStackAction eStackAction;
+ ParseEnvironment * pEnv2Push;
+
+ TokenProcessing_Result()
+ : eDone(not_done), eStackAction(stay), pEnv2Push(0) {}
+ void Reset() { eDone = not_done; eStackAction = stay; pEnv2Push = 0; }
+ };
+
+ enum E_ParseResult
+ {
+ res_error,
+ res_complete,
+ res_predeclaration
+ };
+};
+
+
+
+#endif
+
diff --git a/autodoc/source/parser/inc/x_docu.hxx b/autodoc/source/parser/inc/x_docu.hxx
new file mode 100644
index 000000000000..36185dbac4ab
--- /dev/null
+++ b/autodoc/source/parser/inc/x_docu.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x_parse.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_X_DOCU_HXX
+#define ADC_X_DOCU_HXX
+
+// BASE CLASSES
+#include <autodoc/x_parsing.hxx>
+
+
+
+
+class X_Docu : public autodoc::X_Parser_Ifc
+{
+ public:
+ // LIFECYCLE
+ X_Docu(
+ const char * i_tag,
+ const char * i_explanation );
+ ~X_Docu();
+ // INQUIRY
+ virtual E_Event GetEvent() const;
+ virtual void GetInfo(
+ std::ostream & o_rOutputMedium ) const;
+
+ private:
+ String sTagName;
+ String sExplanation;
+};
+
+
+
+
+#endif
diff --git a/autodoc/source/parser/inc/x_parse.hxx b/autodoc/source/parser/inc/x_parse.hxx
new file mode 100644
index 000000000000..6cee49494f5b
--- /dev/null
+++ b/autodoc/source/parser/inc/x_parse.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x_parse.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_X_PARSE_HXX
+#define ADC_X_PARSE_HXX
+
+// BASE CLASSES
+#include <autodoc/x_parsing.hxx>
+
+
+
+
+class X_Parser : public autodoc::X_Parser_Ifc
+{
+ public:
+ // LIFECYCLE
+ X_Parser(
+ E_Event i_eEvent,
+ const char * i_sObject,
+ const String & i_sCausingFile_FullPath,
+ uintt i_nCausingLineNr );
+ ~X_Parser();
+ // INQUIRY
+ virtual E_Event GetEvent() const;
+ virtual void GetInfo(
+ std::ostream & o_rOutputMedium ) const;
+
+ private:
+ E_Event eEvent;
+ String sObject;
+ String sCausingFile_FullPath;
+ uintt nCausingLineNr;
+
+};
+
+
+
+
+#endif
diff --git a/autodoc/source/parser/kernel/makefile.mk b/autodoc/source/parser/kernel/makefile.mk
new file mode 100644
index 000000000000..340136565c7d
--- /dev/null
+++ b/autodoc/source/parser/kernel/makefile.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# 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_kernel
+TARGETTYPE=CUI
+
+
+# --- Settings -----------------------------------------------------
+
+ENABLE_EXCEPTIONS=true
+PRJINC=$(PRJ)$/source
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk
+
+
+
+# --- Files --------------------------------------------------------
+
+OBJFILES= \
+ $(OBJ)$/parsefct.obj \
+ $(OBJ)$/x_docu.obj \
+ $(OBJ)$/x_parse.obj
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+
diff --git a/autodoc/source/parser/kernel/parsefct.cxx b/autodoc/source/parser/kernel/parsefct.cxx
new file mode 100644
index 000000000000..e0a60ae17c54
--- /dev/null
+++ b/autodoc/source/parser/kernel/parsefct.cxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: parsefct.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 "parsefct.hxx"
+
+
+// NOT FULLY DECLARED SERVICES
+#include <cpp/prs_cpp.hxx>
+#include <adoc/prs_adoc.hxx>
+#include <tools/filecoll.hxx>
+
+
+DYN ParseToolsFactory * ParseToolsFactory::dpTheInstance_ = 0;
+
+
+namespace autodoc
+{
+
+ParseToolsFactory_Ifc &
+ParseToolsFactory_Ifc::GetIt_()
+{
+ if ( ParseToolsFactory::dpTheInstance_ == 0 )
+ ParseToolsFactory::dpTheInstance_ = new ParseToolsFactory;
+ return *ParseToolsFactory::dpTheInstance_;
+}
+
+} // namespace autodoc
+
+
+ParseToolsFactory::ParseToolsFactory()
+{
+}
+
+ParseToolsFactory::~ParseToolsFactory()
+{
+}
+
+DYN autodoc::CodeParser_Ifc *
+ParseToolsFactory::Create_Parser_Cplusplus() const
+{
+ return new cpp::Cpluplus_Parser;
+}
+
+DYN autodoc::DocumentationParser_Ifc *
+ParseToolsFactory::Create_DocuParser_AutodocStyle() const
+{
+ return new adoc::DocuParser_AutodocStyle;
+}
+
+DYN autodoc::FileCollector_Ifc *
+ParseToolsFactory::Create_FileCollector( uintt i_nEstimatedNrOfFiles ) const
+{
+ return new FileCollector(i_nEstimatedNrOfFiles);
+}
+
+
diff --git a/autodoc/source/parser/kernel/parsefct.hxx b/autodoc/source/parser/kernel/parsefct.hxx
new file mode 100644
index 000000000000..caa2f6077409
--- /dev/null
+++ b/autodoc/source/parser/kernel/parsefct.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: parsefct.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef ADC_PARSER_PARSEFCT_HXX
+#define ADC_PARSER_PARSEFCT_HXX
+
+
+#include <autodoc/parsing.hxx>
+
+
+/** Interface for parsing code of a programming language and
+ delivering the information into an Autodoc Repository.
+**/
+class ParseToolsFactory : public autodoc::ParseToolsFactory_Ifc
+{
+ public:
+ ParseToolsFactory();
+ virtual ~ParseToolsFactory();
+
+ virtual DYN autodoc::CodeParser_Ifc *
+ Create_Parser_Cplusplus() const;
+ virtual DYN autodoc::DocumentationParser_Ifc *
+ Create_DocuParser_AutodocStyle() const;
+ virtual DYN autodoc::FileCollector_Ifc *
+ Create_FileCollector(
+ uintt i_nEstimatedNrOfFiles ) const;
+ private:
+ static DYN ParseToolsFactory *
+ dpTheInstance_;
+
+ friend class autodoc::ParseToolsFactory_Ifc;
+};
+
+
+#endif
+
diff --git a/autodoc/source/parser/kernel/x_docu.cxx b/autodoc/source/parser/kernel/x_docu.cxx
new file mode 100644
index 000000000000..992d1cb511d0
--- /dev/null
+++ b/autodoc/source/parser/kernel/x_docu.cxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x_parse.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 <x_docu.hxx>
+
+// NOT FULLY DECLARED SERVICES
+
+
+
+X_Docu::X_Docu( const char * i_tag,
+ const char * i_explanation )
+ : sTagName(i_tag),
+ sExplanation(i_explanation)
+{
+}
+
+X_Docu::~X_Docu()
+{
+}
+
+X_Docu::E_Event
+X_Docu::GetEvent() const
+{
+ return x_Any;
+}
+
+void
+X_Docu::GetInfo( std::ostream & o_rOutputMedium ) const
+{
+ o_rOutputMedium
+ << "Error in tag '"
+ << sTagName
+ << "': "
+ << sExplanation
+ << Endl();
+}
diff --git a/autodoc/source/parser/kernel/x_parse.cxx b/autodoc/source/parser/kernel/x_parse.cxx
new file mode 100644
index 000000000000..72eee3a60ef7
--- /dev/null
+++ b/autodoc/source/parser/kernel/x_parse.cxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x_parse.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 <x_parse.hxx>
+
+// NOT FULLY DECLARED SERVICES
+
+
+
+X_Parser::X_Parser( E_Event i_eEvent,
+ const char * i_sObject,
+ const String & i_sCausingFile_FullPath,
+ uintt i_nCausingLineNr )
+ : eEvent(i_eEvent),
+ sObject(i_sObject),
+ sCausingFile_FullPath(i_sCausingFile_FullPath),
+ nCausingLineNr(i_nCausingLineNr)
+{
+}
+
+X_Parser::~X_Parser()
+{
+}
+
+X_Parser::E_Event
+X_Parser::GetEvent() const
+{
+ return eEvent;
+}
+
+void
+X_Parser::GetInfo( std::ostream & o_rOutputMedium ) const
+{
+ o_rOutputMedium << "Error in file "
+ << sCausingFile_FullPath
+ << " in line "
+ << nCausingLineNr
+ << ": ";
+
+
+ switch (eEvent)
+ {
+ case x_InvalidChar:
+ o_rOutputMedium << "Unknown character '"
+ << sObject
+ << "'";
+ break;
+ case x_UnexpectedToken:
+ o_rOutputMedium << "Unexpected token \""
+ << sObject
+ << "\"";
+ break;
+ case x_UnexpectedEOF:
+ o_rOutputMedium << "Unexpected end of file.";
+ break;
+ case x_UnspecifiedSyntaxError:
+ o_rOutputMedium << "Unspecified syntax problem in file.";
+ break;
+ case x_Any:
+ default:
+ o_rOutputMedium << "Unspecified parsing exception.";
+ } // end switch
+ o_rOutputMedium << Endl();
+}
+
+
+std::ostream &
+operator<<( std::ostream & o_rOut,
+ const autodoc::X_Parser_Ifc & i_rException )
+{
+ i_rException.GetInfo(o_rOut);
+ return o_rOut;
+}
diff --git a/autodoc/source/parser/semantic/makefile.mk b/autodoc/source/parser/semantic/makefile.mk
new file mode 100644
index 000000000000..d1bcfbd4532e
--- /dev/null
+++ b/autodoc/source/parser/semantic/makefile.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# 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_semantic
+
+
+# --- Settings -----------------------------------------------------
+
+ENABLE_EXCEPTIONS=true
+PRJINC=$(PRJ)$/source
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk
+
+
+
+# --- Files --------------------------------------------------------
+
+
+OBJFILES= \
+ $(OBJ)$/parseenv.obj
+
+
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+
diff --git a/autodoc/source/parser/semantic/parseenv.cxx b/autodoc/source/parser/semantic/parseenv.cxx
new file mode 100644
index 000000000000..5ba364086944
--- /dev/null
+++ b/autodoc/source/parser/semantic/parseenv.cxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: parseenv.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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 <semantic/parseenv.hxx>
+
+
+// NOT FULLY DECLARED SERVICES
+#include <ary/doc/d_oldcppdocu.hxx>
+#include <x_parse.hxx>
+
+
+void
+ParseEnvironment::Enter( E_EnvStackAction i_eWayOfEntering )
+{
+ switch (i_eWayOfEntering)
+ {
+ case push:
+ InitData();
+ if ( Parent() != 0 )
+ {
+ csv_assert( Parent()->CurSubPeUse() != 0 );
+ Parent()->CurSubPeUse()->InitParse();
+ }
+ break;
+ case pop_success:
+ break;
+ case pop_failure:
+ break;
+ default:
+ csv_assert(false);
+ } // end switch
+}
+
+void
+ParseEnvironment::Leave( E_EnvStackAction i_eWayOfLeaving )
+{
+ switch (i_eWayOfLeaving)
+ {
+ case push:
+ break;
+ case pop_success:
+ TransferData();
+ if ( Parent() != 0 )
+ {
+ csv_assert( Parent()->CurSubPeUse() != 0 );
+ Parent()->CurSubPeUse()->GetResults();
+ }
+ break;
+ case pop_failure:
+ break;
+ default:
+ csv_assert(false);
+ } // end switch
+}
+
+ParseEnvironment::ParseEnvironment( ParseEnvironment * i_pParent )
+ : pParent(i_pParent),
+ // pDocu,
+ pCurSubPe(0)
+{
+}
diff --git a/autodoc/source/parser/tokens/makefile.mk b/autodoc/source/parser/tokens/makefile.mk
new file mode 100644
index 000000000000..596357c5d8af
--- /dev/null
+++ b/autodoc/source/parser/tokens/makefile.mk
@@ -0,0 +1,66 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# 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=garden
+TARGET=parser_tokens
+TARGETTYPE=CUI
+
+
+# --- Settings -----------------------------------------------------
+
+ENABLE_EXCEPTIONS=true
+PRJINC=$(PRJ)$/source
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk
+
+
+
+# --- Files --------------------------------------------------------
+
+OBJFILES= \
+ $(OBJ)$/stmstarr.obj \
+ $(OBJ)$/stmstate.obj \
+ $(OBJ)$/stmstfin.obj \
+ $(OBJ)$/tkpstama.obj \
+ $(OBJ)$/tkp.obj \
+ $(OBJ)$/tkpcontx.obj \
+ $(OBJ)$/tokdeal.obj
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+
diff --git a/autodoc/source/parser/tokens/stmstarr.cxx b/autodoc/source/parser/tokens/stmstarr.cxx
new file mode 100644
index 000000000000..fe9444375e70
--- /dev/null
+++ b/autodoc/source/parser/tokens/stmstarr.cxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stmstarr.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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 <tokens/stmstarr.hxx>
+
+
+// NOT FULLY DECLARED SERVICES
+#include <x_parse.hxx>
+
+
+
+StmArrayStatus::StmArrayStatus( intt i_nStatusSize,
+ const INT16 * in_aArrayModel,
+ F_CRTOK i_fTokenCreateFunction,
+ bool in_bIsDefault )
+ : dpBranches(new StmStatus::Branch[i_nStatusSize]),
+ nNrOfBranches(i_nStatusSize),
+ fTokenCreateFunction(i_fTokenCreateFunction),
+ bIsADefault(in_bIsDefault)
+{
+ if (in_aArrayModel != 0)
+ {
+ intt count = 0;
+ for (const INT16 * get = in_aArrayModel; count < nNrOfBranches; count++, get++)
+ dpBranches[count] = *get;
+ }
+ else //
+ {
+ memset(dpBranches, 0, nNrOfBranches);
+ } // endif
+}
+
+StmArrayStatus::~StmArrayStatus()
+{
+ delete [] dpBranches;
+}
+
+bool
+StmArrayStatus::SetBranch( intt in_nBranchIx,
+ StmStatus::Branch in_nBranch )
+{
+ if ( csv::in_range(intt(0), in_nBranchIx, intt(nNrOfBranches) ) )
+ {
+ dpBranches[in_nBranchIx] = in_nBranch;
+ return true;
+ }
+ return false;
+}
+
+
+StmStatus::Branch
+StmArrayStatus::NextBy(intt in_nIndex) const
+{
+ if (in_nIndex < 0)
+ throw X_Parser(X_Parser::x_InvalidChar, "", String::Null_(), 0);
+
+ return in_nIndex < nNrOfBranches
+ ? dpBranches[in_nIndex]
+ : dpBranches[nNrOfBranches - 1];
+}
+
+
+bool
+StmArrayStatus::IsADefault() const
+{
+ return bIsADefault;
+}
+
+StmArrayStatus *
+StmArrayStatus::AsArray()
+{
+ return this;
+}
+
diff --git a/autodoc/source/parser/tokens/stmstate.cxx b/autodoc/source/parser/tokens/stmstate.cxx
new file mode 100644
index 000000000000..8f065235db4b
--- /dev/null
+++ b/autodoc/source/parser/tokens/stmstate.cxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stmstate.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 <tokens/stmstate.hxx>
+
+
+// NOT FULLY DECLARED SERVICES
+
+StmArrayStatus *
+StmStatus::AsArray()
+{
+ return 0;
+}
+
+StmBoundsStatus *
+StmStatus::AsBounds()
+{
+ return 0;
+}
+
+
diff --git a/autodoc/source/parser/tokens/stmstfin.cxx b/autodoc/source/parser/tokens/stmstfin.cxx
new file mode 100644
index 000000000000..5a0c1309f660
--- /dev/null
+++ b/autodoc/source/parser/tokens/stmstfin.cxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stmstfin.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 <tokens/stmstfin.hxx>
+
+
+// NOT FULLY DECLARED SERVICES
+#include <tokens/tkpcontx.hxx>
+
+
+StmBoundsStatus::StmBoundsStatus( StateMachineContext &
+ o_rOwner,
+ TkpContext & i_rFollowUpContext,
+ uintt i_nStatusFunctionNr,
+ bool i_bIsDefault )
+ : pOwner(&o_rOwner),
+ pFollowUpContext(&i_rFollowUpContext),
+ nStatusFunctionNr(i_nStatusFunctionNr),
+ bIsDefault(i_bIsDefault)
+{
+}
+
+bool
+StmBoundsStatus::IsADefault() const
+{
+ return bIsDefault;
+}
+
+StmBoundsStatus *
+StmBoundsStatus::AsBounds()
+{
+ return this;
+}
+
+
+
diff --git a/autodoc/source/parser/tokens/tkp.cxx b/autodoc/source/parser/tokens/tkp.cxx
new file mode 100644
index 000000000000..d4a1258ea47d
--- /dev/null
+++ b/autodoc/source/parser/tokens/tkp.cxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkp.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 <tokens/tkp.hxx>
+
+// NOT FULLY DECLARED SERVICES
+#include <tools/tkpchars.hxx>
+#include <tokens/tkpcontx.hxx>
+
+
+
+TokenParser::TokenParser()
+ : pChars(0),
+ bHasMore(false)
+{
+}
+
+void
+TokenParser::Start( CharacterSource & i_rSource )
+{
+ InitSource(i_rSource);
+}
+
+void
+TokenParser::GetNextToken()
+{
+ csv_assert(pChars != 0);
+
+ bHasMore = NOT pChars->IsFinished();
+
+ for ( bool bDone = NOT bHasMore; NOT bDone; )
+ {
+ CurrentContext().ReadCharChain(*pChars);
+ bDone = CurrentContext().PassNewToken();
+ SetCurrentContext(CurrentContext().FollowUpContext());
+ }
+}
+
+void
+TokenParser::InitSource( CharacterSource & i_rSource )
+{
+ pChars = &i_rSource;
+ bHasMore = true;
+ SetStartContext();
+}
+
+
diff --git a/autodoc/source/parser/tokens/tkpcontx.cxx b/autodoc/source/parser/tokens/tkpcontx.cxx
new file mode 100644
index 000000000000..0f7703a9921a
--- /dev/null
+++ b/autodoc/source/parser/tokens/tkpcontx.cxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkpcontx.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 <tokens/tkpcontx.hxx>
+
+// NOT FULLY DECLARED SERVICES
+
+
+
+TkpNullContext G_aNullContext;
+
+TkpNullContext &
+TkpContext::Null_()
+{
+ return G_aNullContext;
+}
+
+TkpNullContext::~TkpNullContext()
+{
+}
+
+void
+TkpNullContext::ReadCharChain( CharacterSource & )
+{
+}
+
+bool
+TkpNullContext::PassNewToken()
+{
+ return false;
+}
+
+TkpContext &
+TkpNullContext::FollowUpContext()
+{
+ return *this;
+}
+
+
+
+
+
+
diff --git a/autodoc/source/parser/tokens/tkpstama.cxx b/autodoc/source/parser/tokens/tkpstama.cxx
new file mode 100644
index 000000000000..8a141a16eb3f
--- /dev/null
+++ b/autodoc/source/parser/tokens/tkpstama.cxx
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tkpstama.cxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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 <tokens/tkpstama.hxx>
+
+// NOT FULLY DECLARED SERVICES
+// #include <srcfind.hxx>
+#include <tokens/stmstarr.hxx>
+//#include <parseinc.hxx>
+#include <tools/tkpchars.hxx>
+
+
+const intt C_nStatuslistResizeValue = 32;
+const intt C_nTopStatus = 0;
+
+StateMachine::StateMachine( intt in_nStatusSize,
+ intt in_nInitial_StatusListSize )
+ : pStati(new StmStatus*[in_nInitial_StatusListSize]),
+ nCurrentStatus(C_nTopStatus),
+ nPeekedStatus(C_nTopStatus),
+ nStatusSize(in_nStatusSize),
+ nNrofStati(0),
+ nStatiSpace(in_nInitial_StatusListSize)
+{
+ csv_assert(in_nStatusSize > 0);
+ csv_assert(in_nInitial_StatusListSize > 0);
+
+ memset(pStati, 0, sizeof(StmStatus*) * nStatiSpace);
+}
+
+intt
+StateMachine::AddStatus(StmStatus * let_dpStatus)
+{
+ if (nNrofStati == nStatiSpace)
+ {
+ ResizeStati();
+ }
+ pStati[nNrofStati] = let_dpStatus;
+ return nNrofStati++;
+}
+
+void
+StateMachine::AddToken( const char * in_sToken,
+ TextToken::F_CRTOK in_fTokenCreateFunction,
+ const INT16 * in_aBranches,
+ INT16 in_nBoundsStatus )
+{
+ if (csv::no_str(in_sToken))
+ return;
+
+ // Durch existierende Stati durchhangeln:
+ nCurrentStatus = 0;
+ nPeekedStatus = 0;
+
+ for ( const char * pChar = in_sToken;
+ *pChar != NULCH;
+ ++pChar )
+ {
+ Peek(*pChar);
+ StmStatus & rPst = Status(nPeekedStatus);
+ if ( rPst.IsADefault() OR rPst.AsBounds() != 0 )
+ {
+ nPeekedStatus = AddStatus( new StmArrayStatus(nStatusSize, in_aBranches, 0, false ) );
+ CurrentStatus().SetBranch( *pChar, nPeekedStatus );
+ }
+ nCurrentStatus = nPeekedStatus;
+ } // end for
+ StmArrayStatus & rLastStatus = CurrentStatus();
+ rLastStatus.SetTokenCreateFunction(in_fTokenCreateFunction);
+ for (intt i = 0; i < nStatusSize; i++)
+ {
+ if (Status(rLastStatus.NextBy(i)).AsBounds() != 0)
+ rLastStatus.SetBranch(i,in_nBoundsStatus);
+ } // end for
+}
+
+StateMachine::~StateMachine()
+{
+ for (intt i = 0; i < nNrofStati; i++)
+ {
+ delete pStati[i];
+ }
+ delete [] pStati;
+}
+
+StmBoundsStatus &
+StateMachine::GetCharChain( TextToken::F_CRTOK & o_nTokenCreateFunction,
+ CharacterSource & io_rText )
+{
+ nCurrentStatus = C_nTopStatus;
+
+ Peek(io_rText.CurChar());
+ while (BoundsStatus() == 0)
+ {
+ nCurrentStatus = nPeekedStatus;
+ Peek(io_rText.MoveOn());
+ }
+ o_nTokenCreateFunction = CurrentStatus().TokenCreateFunction();
+
+ return *BoundsStatus();
+}
+
+void
+StateMachine::ResizeStati()
+{
+ intt nNewSize = nStatiSpace + C_nStatuslistResizeValue;
+ intt i = 0;
+ StatusList pNewStati = new StmStatus*[nNewSize];
+
+ for ( ; i < nNrofStati; i++)
+ {
+ pNewStati[i] = pStati[i];
+ }
+ memset( pNewStati+i,
+ 0,
+ (nNewSize-i) * sizeof(StmStatus*) );
+
+ delete [] pStati;
+ pStati = pNewStati;
+ nStatiSpace = nNewSize;
+}
+
+StmStatus &
+StateMachine::Status(intt in_nStatusNr) const
+{
+ csv_assert( csv::in_range(intt(0), in_nStatusNr, intt(nNrofStati)) );
+ return *pStati[in_nStatusNr];
+}
+
+StmArrayStatus &
+StateMachine::CurrentStatus() const
+{
+ StmArrayStatus * pCurSt = Status(nCurrentStatus).AsArray();
+
+ csv_assert(pCurSt != 0);
+// if(pCurSt == 0)
+// csv_assert(false);
+ return *pCurSt;
+}
+
+StmBoundsStatus *
+StateMachine::BoundsStatus() const
+{
+ return Status(nPeekedStatus).AsBounds();
+}
+
+void
+StateMachine::Peek(intt in_nBranch)
+{
+ StmArrayStatus & rSt = CurrentStatus();
+ nPeekedStatus = rSt.NextBy(in_nBranch);
+}
diff --git a/autodoc/source/parser/tokens/tokdeal.cxx b/autodoc/source/parser/tokens/tokdeal.cxx
new file mode 100644
index 000000000000..801d4dda2552
--- /dev/null
+++ b/autodoc/source/parser/tokens/tokdeal.cxx
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tokdeal.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * 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 <tokens/tokdeal.hxx>
+#include <tokens/token.hxx>
+
+
+// NOT FULLY DEFINED SERVICES
+
+
+
+void
+Tok_Eof::DealOut( TokenDealer & o_rDealer )
+{
+ o_rDealer.Deal_Eof();
+};
+
+const char *
+Tok_Eof::Text() const
+{
+ return "";
+}
+
+
+