diff options
author | Nikolai Pretzell <np@openoffice.org> | 2002-03-08 13:45:36 +0000 |
---|---|---|
committer | Nikolai Pretzell <np@openoffice.org> | 2002-03-08 13:45:36 +0000 |
commit | d566f38f8a38739595fd8edb89eaa48c1c4b8f9b (patch) | |
tree | cbf47b13e83d60334fcd68872bd4c26791a39a0e /autodoc | |
parent | 1710683406e72de5458733231636e8fdb2c2c0bc (diff) |
Moving Autodoc to OpenOffice.org, module autodoc: sourcecode repository and documentation generator
Diffstat (limited to 'autodoc')
368 files changed, 70440 insertions, 0 deletions
diff --git a/autodoc/inc/ary/ary.hxx b/autodoc/inc/ary/ary.hxx new file mode 100644 index 000000000000..85210c470239 --- /dev/null +++ b/autodoc/inc/ary/ary.hxx @@ -0,0 +1,158 @@ +/************************************************************************* + * + * $RCSfile: ary.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:13 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_ARY_HXX +#define ARY_ARY_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + namespace cpp + { + class RwGate; + class DisplayGate; + } + namespace uidl + { + class Gate; + } +// namespace java +// { +// class RwGate; +// } + + class IdGenerator; + +/** Starting point for work with the repository. + + @short + From here you get handles for all work on the + repository. + + @descr + In the whole repository interface the abbreviation + "Ce" means "CodeEntity". A CodeEntity is + one of the items that can be found in the repository + and that is able to have a documentation. +**/ + +class Repository +{ + public: + // LIFECYCLE + virtual ~Repository() { } + static Repository & Create_( + const udmstri & i_sName, + DYN IdGenerator * let_dpIds ); /// May be 0. Then a default is used. + static Repository & The_(); + static void Destroy_(); /// Destroys the Repository. + + // INQUIRY + const cpp::DisplayGate & + DisplayGate_Cpp() const; + const udmstri & Name() const; + + // ACCESS + cpp::RwGate & RwGate_Cpp(); + uidl::Gate & RwGate_Idl(); + + + private: + virtual const cpp::DisplayGate & + inq_DisplayGate_Cpp() const = 0; + virtual const udmstri & + inq_Name() const = 0; + virtual cpp::RwGate & + access_RwGate_Cpp() = 0; + virtual uidl::Gate & + access_RwGate_Idl() = 0; +}; + + + +// IMPLEMENTATION +inline const cpp::DisplayGate & +Repository::DisplayGate_Cpp() const + { return inq_DisplayGate_Cpp(); } +inline const udmstri & +Repository::Name() const + { return inq_Name(); } +inline cpp::RwGate & +Repository::RwGate_Cpp() + { return access_RwGate_Cpp(); } +inline uidl::Gate & +Repository::RwGate_Idl() + { return access_RwGate_Idl(); } + + +} // namespace ary + + +#endif + + + diff --git a/autodoc/inc/ary/ary_disp.hxx b/autodoc/inc/ary/ary_disp.hxx new file mode 100644 index 000000000000..292b49c24599 --- /dev/null +++ b/autodoc/inc/ary/ary_disp.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: ary_disp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:13 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_ARY_DISP_HXX +#define ARY_ARY_DISP_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> + +namespace ary +{ + class DisplayGate; + +class Display +{ + public: + virtual ~Display() {} + + // OPERATIONS + void StartSlot(); + void FinishSlot(); + + /** This method depends on the result of Get_ReFinder(). + If Get_ReFinder() != 0, then DisplayGate::Find_Re() is called + and if valid, RepositoryEntity::StoreAt( *this ) is called. + If Get_ReFinder() == 0, simply do_DisplaySlot_Rid() is called + with just the id as parameter. + */ + void DisplaySlot_Rid( + ary::Rid i_nId ); + void DisplaySlot_Lid( + ary::Lid i_nId ); + /** This method depends on the result of Get_ReFinder(). + If Get_ReFinder() != 0, then DisplayGate::Find_Re() is called + and if valid, RepositoryEntity::StoreAt( *this ) is called. + If Get_ReFinder() == 0, simply do_DisplaySlot_LocalCe() is called + with just the id as parameter. + */ + void DisplaySlot_LocalCe( + ary::Rid i_nId, + const udmstri & i_sName ); + // INQUIRY + const DisplayGate * Get_ReFinder() const; + + private: + virtual void do_StartSlot(); + virtual void do_FinishSlot(); + + + virtual void do_DisplaySlot_Rid( + ary::Rid i_nId ); + virtual void do_DisplaySlot_Lid( + ary::Lid i_nId ); + virtual void do_DisplaySlot_LocalCe( + ary::Rid i_nId, + const udmstri & i_sName ); + virtual const DisplayGate * + inq_Get_ReFinder() const; +}; + + +// IMPLEMENTATION + + +inline void +Display::StartSlot() + { do_StartSlot(); } +inline void +Display::FinishSlot() + { do_FinishSlot(); } +inline void +Display::DisplaySlot_Lid( ary::Lid i_nId ) + { do_DisplaySlot_Lid( i_nId ); } +inline const DisplayGate * +Display::Get_ReFinder() const + { return inq_Get_ReFinder(); } + + +} // namespace ary + + +#endif + + diff --git a/autodoc/inc/ary/arygroup.hxx b/autodoc/inc/ary/arygroup.hxx new file mode 100644 index 000000000000..c893fb233699 --- /dev/null +++ b/autodoc/inc/ary/arygroup.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: arygroup.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:13 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_ARYGROUP_HXX +#define ARY_ARYGROUP_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> + +namespace ary +{ + class RepositoryEntity; + class Slot; + +namespace group +{ + typedef std::vector< SlotAccessId > SlotList; +} + +class AryGroup +{ + public: + // LIFECYCLE + virtual ~AryGroup() {} + + // INQUIRY + Gid Id_Group() const; + const RepositoryEntity & + RE_Group() const; + const group::SlotList & + Slots() const; + DYN Slot * Create_Slot( + SlotAccessId i_nSlot ) const; + + + private: + virtual Gid inq_Id_Group() const = 0; + virtual const RepositoryEntity & + inq_RE_Group() const = 0; + virtual const group::SlotList & + inq_Slots() const = 0; + virtual DYN Slot * inq_Create_Slot( + SlotAccessId i_nSlot ) const = 0; +}; + + +// IMPLEMENTATION + +inline Gid +AryGroup::Id_Group() const + { return inq_Id_Group(); } +inline const RepositoryEntity & +AryGroup::RE_Group() const + { return inq_RE_Group(); } +inline const group::SlotList & +AryGroup::Slots() const + { return inq_Slots(); } +inline DYN Slot * +AryGroup::Create_Slot( SlotAccessId i_nSlot ) const + { return inq_Create_Slot(i_nSlot); } + + + +} // namespace ary + + +#endif + + + diff --git a/autodoc/inc/ary/ceslot.hxx b/autodoc/inc/ary/ceslot.hxx new file mode 100644 index 000000000000..bc62dff47c92 --- /dev/null +++ b/autodoc/inc/ary/ceslot.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * $RCSfile: ceslot.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:13 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CESLOT_HXX +#define ARY_CESLOT_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +namespace ary +{ + +class Display; + +/** Unterscheidungen von Slots + + Slots: + - ReadWrite or ReadOnly + - ContentType + - Groups + - MemberLink 'EnumValue from Enum' or 'Class from Namespace' + - MemberData 'Parameter from Operation' + - SimpleLink + - CommentedLink 'Baseclass from Class' + - DefaultCommentedLink 'Class from GlobaIndex' +*/ + +class Slot +{ + public: + virtual ~Slot() {} + + virtual void StoreAt( + Display & o_rDestination ) const; + virtual uintt Size() const = 0; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const = 0; +}; + +class Slot_AutoPtr +{ + public: + Slot_AutoPtr( + Slot * i_pSlot = 0 ) + : pSlot(i_pSlot) {} + ~Slot_AutoPtr() { if (pSlot != 0) delete pSlot; } + + Slot_AutoPtr & operator=( + Slot * i_pSlot ) + { if (pSlot != 0) delete pSlot; + pSlot = i_pSlot; + return *this; } + operator bool() const { return pSlot != 0; } + + const Slot & operator*() { csv_assert(pSlot != 0); + return *pSlot; } + const Slot * operator->() { csv_assert(pSlot != 0); + return pSlot; } + + private: + // Forbidden functions + Slot_AutoPtr(const Slot_AutoPtr &); + Slot_AutoPtr & operator=(const Slot_AutoPtr &); + + // DATA + Slot * pSlot; +}; + + +#if 0 +/* +class CeIteratingSlot +{ + public: + + // LIFECYCLE + virtual ~CeIteratingSlot() {} + + // OPERATORS + virtual CeIteratingSlot & + operator++() = 0; + virtual operator bool() const = 0; + + // OPERATIONS + virtual void Start() = 0; + virtual void StoreCurrentElementAt( + Display & o_rDestination ) const = 0; + private: + // Forbidden + void operator++(int) const {} +}; +*/ +#endif // 0 + + +} // namespace ary + + +#endif + + + diff --git a/autodoc/inc/ary/cessentl.hxx b/autodoc/inc/ary/cessentl.hxx new file mode 100644 index 000000000000..22b23c9d8bf8 --- /dev/null +++ b/autodoc/inc/ary/cessentl.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * $RCSfile: cessentl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:13 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CESSENTL_HXX +#define ARY_CESSENTL_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> +#include <ary/docu.hxx> + +namespace udm +{ +class Agent; +} + + + + +namespace ary +{ + + +class CeEssentials +{ // Non inline functions are implemented in ceworker.cxx . + public: + // LIFECYCLE + CeEssentials(); + CeEssentials( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + Lid i_nLocation ); + ~CeEssentials(); + // INQUIRY + Cid Id() const; + const udmstri & LocalName() const; + Cid Owner() const; + Lid Location() const; + const ary::Documentation & + Info() const; + + // ACCESS + void SetInfo( + DYN ary::Documentation & + let_drInfo ) + { pInfo = &let_drInfo; } + private: + udmstri sLocalName; + Cid nId; + Cid nOwner; + Lid nLocation; + Dyn<ary::Documentation> + pInfo; +}; + + + +inline Cid +CeEssentials::Id() const + { return nId; } +inline const udmstri & +CeEssentials::LocalName() const + { return sLocalName; } +inline Cid +CeEssentials::Owner() const + { return nOwner; } +inline Lid +CeEssentials::Location() const + { return nLocation; } +inline const ary::Documentation & +CeEssentials::Info() const + { return pInfo ? *pInfo : ary::Documentation::Null_(); } + + +} // namespace ary + + +#endif + + diff --git a/autodoc/inc/ary/cpp/c_class.hxx b/autodoc/inc/ary/cpp/c_class.hxx new file mode 100644 index 000000000000..be9ecba529da --- /dev/null +++ b/autodoc/inc/ary/cpp/c_class.hxx @@ -0,0 +1,253 @@ +/************************************************************************* + * + * $RCSfile: c_class.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_CLASS_HXX +#define ARY_CPP_C_CLASS_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> +#include <ary/cpp/ca_type.hxx> +#include <ary/arygroup.hxx> +#include <ary/re.hxx> + // COMPONENTS +#include <ary/cessentl.hxx> +#include <ary/cpp/c_idlist.hxx> +#include <ary/opertype.hxx> +#include <ary/cpp/c_etypes.hxx> + // PARAMETERS +#include <ary/idlists.hxx> + + + +namespace ary +{ +namespace cpp +{ + class Enum; + class Typedef; + class Function; + class Variable; + + + +class Class : public CodeEntity, + public AryGroup +{ + public: + enum E_Slots + { + SLOT_Bases = 1, + SLOT_NestedClasses, + SLOT_Enums, + SLOT_Typedefs, + SLOT_Operations, + SLOT_StaticOperations, + SLOT_Data, + SLOT_StaticData, + SLOT_FriendClasses, + SLOT_FriendOperations + }; + + // LIFECYCLE + Class(); + Class( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + E_ClassKey i_eClassKey ); + ~Class(); + + // OPERATIONS + void Add_BaseClass( + const S_Classes_Base & + i_rBaseClass ); + void Add_TemplateParameterType( + const udmstri & i_sLocalName, + Tid i_nIdAsType ); + void Add_KnownDerivative( + Rid i_nId ) + { aKnownDerivatives.push_back(i_nId); } + + void Add_LocalClass( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalEnum( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalTypedef( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalOperation( + const udmstri & i_sLocalName, + OSid i_nOS, + Cid i_nId ); + void Add_LocalStaticOperation( + const udmstri & i_sLocalName, + OSid i_nOS, + Cid i_nId ); + void Add_LocalData( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalStaticData( + const udmstri & i_sLocalName, + Cid i_nId ); + + void UpdateVirtuality( + E_Virtuality i_eVirtuality ) + { if ( int(i_eVirtuality) > int(eVirtuality) ) + eVirtuality = i_eVirtuality; } + const List_TplParam & + TemplateParameters() const + { return aTemplateParameterTypes; } + const List_Bases & BaseClasses() const { return aBaseClasses; } + const List_Rid & KnownDerivatives() const + { return aKnownDerivatives; } + + // INQUIRY + static RCid RC_() { return 0x1002; } + + E_ClassKey ClassKey() const; + E_Protection Protection() const; + E_Virtuality Virtuality() const { return eVirtuality; } + + Rid Search_LocalClass( + const udmstri & i_sName ) const; + + private: + // Interface ary::CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const ary::Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN ary::Documentation & + let_drInfo ); + // Interface ary::AryGroup + virtual Gid inq_Id_Group() const; + virtual const RepositoryEntity & + inq_RE_Group() const; + virtual const group::SlotList & + inq_Slots() const; + virtual DYN Slot * inq_Create_Slot( + SlotAccessId i_nSlot ) const; + // Local + typedef List_LocalCe::const_iterator CIterator_Locals; + typedef List_LocalCe::iterator Iterator_Locals; + + CIterator_Locals PosOfName( + const List_LocalCe& i_rList, + const udmstri & i_sName ) const; + Iterator_Locals PosOfName( + List_LocalCe & io_rList, + const udmstri & i_sName ); + // DATA + CeEssentials aEssentials; + + List_Bases aBaseClasses; + List_TplParam aTemplateParameterTypes; + + List_LocalCe aClasses; + List_LocalCe aEnums; + List_LocalCe aTypedefs; + List_LocalOperation aOperations; + List_LocalOperation aStaticOperations; + List_LocalCe aData; + List_LocalCe aStaticData; + List_Rid aFriendClasses; + List_Rid aFriendOperations; + List_Rid aKnownDerivatives; + + E_ClassKey eClassKey; + E_Protection eProtection; + E_Virtuality eVirtuality; +}; + + + +// IMPLEMENTATION + +inline E_ClassKey +Class::ClassKey() const + { return eClassKey; } +inline E_Protection +Class::Protection() const + { return eProtection; } + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_define.hxx b/autodoc/inc/ary/cpp/c_define.hxx new file mode 100644 index 000000000000..dcfc6ec66e21 --- /dev/null +++ b/autodoc/inc/ary/cpp/c_define.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: c_define.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_DEFINE_HXX +#define ARY_CPP_C_DEFINE_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_defs.hxx> + // COMPONENTS + // PARAMETERS + + + +namespace ary +{ +namespace cpp +{ + + +/** Describes a C/C++ #define <DEFINE_BUT_NO_MACRO> statement. +*/ +class Define : public CppDefinition +{ + public: + Define( /// Used for: #define DEFINE xyz + Did i_nId, + const udmstri & i_sName, + const str_vector & i_rDefinition, + Lid i_nDeclaringFile ); + ~Define(); + + // INQUIRY + void GetText( + csv::StreamStr & o_rText ) const; + + private: + // Interface RepositoryEntity: + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + + // Interface CppDefinition: + virtual const str_vector & + inq_DefinitionText() const; + + // DATA + str_vector aDefinition; +}; + + + +// IMPLEMENTATION + + + +} // namespace cpp +} // namespace ary + + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_enum.hxx b/autodoc/inc/ary/cpp/c_enum.hxx new file mode 100644 index 000000000000..ee8c89050adb --- /dev/null +++ b/autodoc/inc/ary/cpp/c_enum.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * $RCSfile: c_enum.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_ENUM_HXX +#define ARY_CPP_C_ENUM_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> +#include <ary/arygroup.hxx> + // COMPONENTS +#include <ary/cessentl.hxx> +#include <ary/idlists.hxx> +#include <ary/cpp/c_etypes.hxx> + // PARAMETERS + +namespace ary +{ +namespace cpp +{ + + +class Enum : public CodeEntity, + public AryGroup +{ + public: + enum E_Slots + { + SLOT_Values = 1 + }; + + // LIFECYCLE + Enum(); + Enum( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile ); + ~Enum(); + + // OPERATIONS + void Add_Value( + Cid i_nId ); + + // INQUIRY + static RCid RC_() { return 0x1003; } + + E_Protection Protection() const { return eProtection; } + + private: + // Interface ary::CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const ary::Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN ary::Documentation & + let_drInfo ); + // Interface ary::AryGroup + virtual Gid inq_Id_Group() const; + virtual const RepositoryEntity & + inq_RE_Group() const; + virtual const group::SlotList & + inq_Slots() const; + virtual DYN Slot * inq_Create_Slot( + SlotAccessId i_nSlot ) const; + + // DATA + CeEssentials aEssentials; + List_Rid aValues; + E_Protection eProtection; +}; + + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_enuval.hxx b/autodoc/inc/ary/cpp/c_enuval.hxx new file mode 100644 index 000000000000..909c96549d13 --- /dev/null +++ b/autodoc/inc/ary/cpp/c_enuval.hxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * $RCSfile: c_enuval.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_ENUVAL_HXX +#define ARY_CPP_C_ENUVAL_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> + // COMPONENTS +#include <ary/cessentl.hxx> +#include <ary/cpp/c_etypes.hxx> + // PARAMETERS + + + +namespace ary +{ +namespace cpp +{ + + +class EnumValue : public CodeEntity +{ + public: + // LIFECYCLE + EnumValue(); + EnumValue( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + udmstri i_sInitialisation ); + ~EnumValue(); + // INQUIRY + static RCid RC_() { return 0x1007; } + + const udmstri & Initialisation() const; + + + private: + // Interface ary::CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const ary::Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN ary::Documentation & + let_drInfo ); + + // DATA + CeEssentials aEssentials; + udmstri sInitialisation; +}; + + + +// IMPLEMENTATION + +inline const udmstri & +EnumValue::Initialisation() const + { return sInitialisation; } + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_funct.hxx b/autodoc/inc/ary/cpp/c_funct.hxx new file mode 100644 index 000000000000..70f7393aec58 --- /dev/null +++ b/autodoc/inc/ary/cpp/c_funct.hxx @@ -0,0 +1,184 @@ +/************************************************************************* + * + * $RCSfile: c_funct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_FUNCT_HXX +#define ARY_CPP_C_FUNCT_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> + // COMPONENTS +#include <ary/ids.hxx> +#include <ary/cessentl.hxx> +#include <ary/cpp/c_etypes.hxx> +#include <ary/cpp/c_vfflag.hxx> +#include <ary/cpp/c_osigna.hxx> +#include <ary/cpp/c_idlist.hxx> + // PARAMETERS + + + +namespace ary +{ +namespace cpp +{ + + +class Function : public CodeEntity +{ + public: + Function(); + Function( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + Tid i_nReturnType, + OSid i_nSignature, + StringVector & + i_rNonType_ParameterInfos, /// Is non const, because the contents are swap'ped with aParameterInfos. + E_Virtuality i_eVirtuality, + FunctionFlags i_aFlags, + bool i_bThrowExists, + const std::vector<Tid> & + i_rExceptions ); + ~Function(); + + // OPERATIONS + void Add_TemplateParameterType( + const udmstri & i_sLocalName, + Tid i_nIdAsType ); + + // INQUIRY + static RCid RC_() { return 0x1005; } + + OSid Signature() const; + Tid ReturnType() const; + E_Protection Protection() const { return eProtection; } + E_Virtuality Virtuality() const { return eVirtuality; } + const FunctionFlags & + Flags() const { return aFlags; } + const StringVector & + ParamInfos() const { return aParameterInfos; } + const std::vector<Tid> * + Exceptions() const { return pExceptions.Ptr(); } + + const List_TplParam & + TemplateParameters() const + { return aTemplateParameterTypes; } + + private: + // Interface ary::CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN Documentation & let_drInfo ); + + // Local Types + typedef StringVector ParameterInfoList; + typedef std::vector<Tid> ExceptionTypeList; + + // DATA + CeEssentials aEssentials; + + List_TplParam aTemplateParameterTypes; + + OSid nSignature; + Tid nReturnType; + E_Protection eProtection; + E_Virtuality eVirtuality; + FunctionFlags aFlags; + ParameterInfoList aParameterInfos; + Dyn<ExceptionTypeList> + pExceptions; // if (NOT pExceptions) there is no throw, + // else, there is one, but the list still may be empty. +}; + + + +// IMPLEMENTATION +inline OSid +Function::Signature() const + { return nSignature; } +inline Tid +Function::ReturnType() const + { return nReturnType; } + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_macro.hxx b/autodoc/inc/ary/cpp/c_macro.hxx new file mode 100644 index 000000000000..994377ae27fb --- /dev/null +++ b/autodoc/inc/ary/cpp/c_macro.hxx @@ -0,0 +1,125 @@ +/************************************************************************* + * + * $RCSfile: c_macro.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_MACRO_HXX +#define ARY_CPP_C_MACRO_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_defs.hxx> + // COMPONENTS + // PARAMETERS + + + +namespace ary +{ + +namespace cpp +{ + + + +/** Describes a C/C++ #define MACRO(a,b, ...) statement. +*/ +class Macro : public CppDefinition +{ + public: + Macro(); + Macro( /// Used for: #define DEFINE xyz + Did i_nId, + const udmstri & i_sName, + const str_vector & i_rParams, + const str_vector & i_rDefinition, + Lid i_nDeclaringFile ); + ~Macro(); + // INQUIRY + void GetText( + csv::StreamStr & o_rText, + const StringVector & + i_rGivenArguments ) const; + const str_vector & Params() const { return aParams; } + + private: + // Interface RepositoryEntity: + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + + // Interface CppDefinition: + virtual const str_vector & + inq_DefinitionText() const; + + // DATA + str_vector aParams; + str_vector aDefinition; +}; + + + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_namesp.hxx b/autodoc/inc/ary/cpp/c_namesp.hxx new file mode 100644 index 000000000000..edbca54b5e0e --- /dev/null +++ b/autodoc/inc/ary/cpp/c_namesp.hxx @@ -0,0 +1,192 @@ +/************************************************************************* + * + * $RCSfile: c_namesp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_NAMESP_HXX +#define ARY_CPP_C_NAMESP_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> +#include <ary/arygroup.hxx> + // COMPONENTS +#include <ary/cessentl.hxx> +#include <ary/opertype.hxx> +#include <ary/cpp/c_idlist.hxx> + // PARAMETERS +#include <ary/idlists.hxx> + + + +namespace ary +{ +namespace cpp +{ + + +class Namespace : public CodeEntity, + public AryGroup +{ + public: + enum E_Slots + { + SLOT_SubNamespaces = 1, + SLOT_Classes, + SLOT_Enums, + SLOT_Typedefs, + SLOT_Operations, + SLOT_Variables, + SLOT_Constants + }; + Namespace(); + Namespace( /// Used only for the global namespace. + Rid i_nId ); + Namespace( + Cid i_nId, + const udmstri & i_sName, + Namespace & i_rParent ); + ~Namespace(); + // OPERATIONS + void Add_LocalNamespace( + Namespace & io_rLocalNamespace ); + void Add_LocalClass( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalEnum( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalTypedef( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalOperation( + const udmstri & i_sLocalName, + OSid i_nOS, + Cid i_nId ); + void Add_LocalVariable( + const udmstri & i_sLocalName, + Cid i_nId ); + void Add_LocalConstant( + const udmstri & i_sLocalName, + Cid i_nId ); + + // INQUIRY + static RCid RC_() { return 0x1001; } + virtual uintt Depth() const; + Namespace * Parent() const; + + Namespace * Search_LocalNamespace( + const udmstri & i_sLocalName ) const; + uintt Get_SubNamespaces( + std::vector< const Namespace* > & + o_rResultList ) const; + Rid Search_LocalClass( + const udmstri & i_sName ) const; + private: + // Interface CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const ary::Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN ary::Documentation & + let_drInfo ); + // Interface AryGroup + virtual Gid inq_Id_Group() const; + virtual const RepositoryEntity & + inq_RE_Group() const; + virtual const ary::group::SlotList & + inq_Slots() const; + virtual DYN Slot * inq_Create_Slot( + SlotAccessId i_nSlot ) const; + + // Local + + // DATA + CeEssentials aEssentials; + + Map_NamespacePtr aLocalNamespaces; + Map_LocalCe aLocalClasses; + Map_LocalCe aLocalEnums; + Map_LocalCe aLocalTypedefs; + Set_LocalOperation aLocalOperations; + Map_LocalCe aLocalVariables; + Map_LocalCe aLocalConstants; + + Namespace * pParent; + uintt nDepth; +}; + + +} // namespace cpp +} // ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_osigna.hxx b/autodoc/inc/ary/cpp/c_osigna.hxx new file mode 100644 index 000000000000..f3f84fcbe6d1 --- /dev/null +++ b/autodoc/inc/ary/cpp/c_osigna.hxx @@ -0,0 +1,149 @@ +/************************************************************************* + * + * $RCSfile: c_osigna.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_OSIGNA_HXX +#define ARY_CPP_C_OSIGNA_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <ary/ids.hxx> +#include <ary/cpp/c_etypes.hxx> + // PARAMETERS + + + +namespace ary +{ + +namespace cpp +{ + +class OperationSignature +{ + public: + typedef std::vector<Tid> ParameterTypeList; + + OperationSignature(); + OperationSignature( + std::vector<Tid> & i_rParameterTypes, // Non const, because it will be swapped with aParameterTypes. + E_ConVol i_eConVol ); + + bool operator<( + const OperationSignature & + i_rSig ) const; + + // INQUIRY + const ParameterTypeList & + Parameters() const; + E_ConVol ConVol() const; + + /** Compares the signatures by length an then by ids of + parameter types. So the result is not always human + reconstructable. + @return like in strcmp(). + */ + int Compare( + const OperationSignature & + i_rSig ) const; + private: + + // DATA + ParameterTypeList aParameterTypes; + E_ConVol eConVol; +}; + +#if 0 // Vielleicht noch gebraucht, vielleicht auch nicht. DO NOT delete! +struct S_VariableInfo +{ + udmstri sName; + udmstri sSizeExpression; + udmstri sInitExpression; + + void Empty() + { sName.clear(); + sSizeExpression.clear(); + sInitExpression.clear(); } +}; +#endif + + +// IMPLEMENTATION + +inline bool +OperationSignature::operator<( const OperationSignature & i_rSign ) const + { return Compare(i_rSign) < 0; } +inline const OperationSignature::ParameterTypeList & +OperationSignature::Parameters() const + { return aParameterTypes; } +inline E_ConVol +OperationSignature::ConVol() const + { return eConVol; } + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_slntry.hxx b/autodoc/inc/ary/cpp/c_slntry.hxx new file mode 100644 index 000000000000..e98c129ec3b4 --- /dev/null +++ b/autodoc/inc/ary/cpp/c_slntry.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * $RCSfile: c_slntry.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_SLNTRY_HXX +#define ARY_CPP_C_SLNTRY_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> +#include <ary/cpp/c_etypes.hxx> + + +namespace ary +{ +namespace cpp +{ + class Namespace; + + +typedef Namespace * NamespacePtr; +struct Less_NamespacePtr +{ + bool operator()( /// @return true if (i_p1->Name() < i_p2->Name()) . + const NamespacePtr& i_p1, + const NamespacePtr& i_p2 ); +}; + + + + +struct S_Classes_Base +{ + Tid nId; + E_Protection eProtection; + E_Virtuality eVirtuality; + udmstri sComment; + + S_Classes_Base() + : nId(0), + eProtection(PROTECT_global), + eVirtuality(VIRTUAL_none) + // sComent + { } +}; + +struct S_TplParam +{ + udmstri sName; + Tid nId; + + S_TplParam( + udmstri i_sName, + Tid i_nId ) + : sName(i_sName), nId(i_nId) {} + const udmstri & Name() const { return sName; } + +}; + + + +} // namespace cpp +} // namespace ary + + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_tydef.hxx b/autodoc/inc/ary/cpp/c_tydef.hxx new file mode 100644 index 000000000000..dbf94ed212f0 --- /dev/null +++ b/autodoc/inc/ary/cpp/c_tydef.hxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * $RCSfile: c_tydef.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_TYDEF_HXX +#define ARY_CPP_C_TYDEF_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> + // COMPONENTS +#include <ary/cessentl.hxx> +#include <ary/cpp/c_etypes.hxx> + // PARAMETERS + + + +namespace ary +{ +namespace cpp +{ + + +class Typedef : public CodeEntity +{ + public: + // LIFECYCLE + Typedef(); + Typedef( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + Tid i_nDescribingType ); + ~Typedef(); + // INQUIRY + static RCid RC_() { return 0x1004; } + + Tid DescribingType() const; + E_Protection Protection() const { return eProtection; } + + private: + // Interface ary::CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN Documentation & let_drInfo ); + + // DATA + CeEssentials aEssentials; + Tid nDescribingType; + E_Protection eProtection; +}; + + + +// IMPLEMENTATION + +inline Tid +Typedef::DescribingType() const + { return nDescribingType; } + + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_vari.hxx b/autodoc/inc/ary/cpp/c_vari.hxx new file mode 100644 index 000000000000..08d333de49ee --- /dev/null +++ b/autodoc/inc/ary/cpp/c_vari.hxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * $RCSfile: c_vari.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_VARI_HXX +#define ARY_CPP_C_VARI_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/ce.hxx> + // COMPONENTS +#include <ary/cessentl.hxx> +#include <ary/cpp/c_etypes.hxx> +#include <ary/cpp/c_vfflag.hxx> + // PARAMETERS + + + +namespace ary +{ + +namespace cpp +{ + + +class Variable : public CodeEntity +{ + public: + // LIFECYCLE + Variable(); + Variable( + Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + Tid i_nType, + VariableFlags i_aFlags, + const udmstri & i_sArraySize, + const udmstri & i_sInitValue ); + ~Variable(); + + + // INQUIRY + static RCid RC_() { return 0x1006; } + + Tid Type() const; + const udmstri & ArraySize() const; + const udmstri & Initialisation() const; + E_Protection Protection() const { return eProtection; } + + // ACCESS + + private: + // Interface ary::CodeEntity + virtual Cid inq_Id() const; + virtual const udmstri & + inq_LocalName() const; + virtual Cid inq_Owner() const; + virtual Lid inq_Location() const; + + // Interface ary::RepositoryEntity + virtual void do_StoreAt( + ary::Display & o_rOut ) const; + virtual RCid inq_RC() const; + virtual const ary::Documentation & + inq_Info() const; + virtual void do_Add_Documentation( + DYN ary::Documentation & + let_drInfo ); + + // DATA + CeEssentials aEssentials; + Tid nType; + E_Protection eProtection; + VariableFlags aFlags; + udmstri sArraySize; + udmstri sInitialisation; +}; + + + +// IMPLEMENTATION + +inline Tid +Variable::Type() const + { return nType; } +inline const udmstri & +Variable::ArraySize() const + { return sArraySize; } +inline const udmstri & +Variable::Initialisation() const + { return sInitialisation; } + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/c_vfflag.hxx b/autodoc/inc/ary/cpp/c_vfflag.hxx new file mode 100644 index 000000000000..ef67a63f330b --- /dev/null +++ b/autodoc/inc/ary/cpp/c_vfflag.hxx @@ -0,0 +1,177 @@ +/************************************************************************* + * + * $RCSfile: c_vfflag.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_VFFLAG_HXX +#define ARY_CPP_C_VFFLAG_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + + +namespace ary +{ +namespace cpp +{ + + +struct VariableFlags +{ + public: + enum E_Flags + { + f_static_local = 0x0001, + f_static_member = 0x0002, + f_extern = 0x0004, + f_mutable = 0x0008 + }; + + VariableFlags( + UINT16 i_nFlags = 0 ) + : nFlags(i_nFlags) {} + + void Reset() { nFlags = 0; } + + void SetStaticLocal() { nFlags |= f_static_local; } + void SetStaticMember() { nFlags |= f_static_member; } + void SetExtern() { nFlags |= f_extern; } + void SetMutable() { nFlags |= f_mutable; } + + bool IsStaticLocal() const { return (nFlags & f_static_local) != 0; } + bool IsStaticMember() const { return (nFlags & f_static_member) != 0; } + bool IsExtern() const { return (nFlags & f_extern) != 0; } + bool IsMutable() const { return (nFlags & f_mutable) != 0; } + + private: + UINT16 nFlags; +}; + + +struct FunctionFlags +{ + public: + enum E_Flags + { + f_static_local = 0x0001, + f_static_member = 0x0002, + f_extern = 0x0004, + f_externC = 0x0008, + f_mutable = 0x0010, + f_inline = 0x0100, + f_register = 0x0200, + f_explicit = 0x0400 + }; + + FunctionFlags( + UINT16 i_nFlags = 0 ) + : nFlags(i_nFlags) {} + + void Reset() { nFlags = 0; } + + void SetStaticLocal() { nFlags |= f_static_local; } + void SetStaticMember() { nFlags |= f_static_member; } + void SetExtern() { nFlags |= f_extern; } + void SetExternC() { nFlags |= f_externC; } + void SetMutable() { nFlags |= f_mutable; } + void SetInline() { nFlags |= f_inline; } + void SetRegister() { nFlags |= f_register; } + void SetExplicit() { nFlags |= f_explicit; } + + bool IsStaticLocal() const { return (nFlags & f_static_local) != 0; } + bool IsStaticMember() const { return (nFlags & f_static_member) != 0; } + bool IsExtern() const { return (nFlags & f_extern) != 0; } + bool IsExternC() const { return (nFlags & f_externC) != 0; } + bool IsMutable() const { return (nFlags & f_mutable) != 0; } + bool IsInline() const { return (nFlags & f_inline) != 0; } + bool IsRegister() const { return (nFlags & f_register) != 0; } + bool IsExplicit() const { return (nFlags & f_explicit) != 0; } + + private: + UINT16 nFlags; +}; + +struct S_Parameter +{ + udmstri sName; + udmstri sSizeExpression; + udmstri sInitExpression; + Tid nType; + + S_Parameter() : nType(0) {} + ~S_Parameter() {} + void Empty() { nType = 0; + sName.clear(); + sSizeExpression.clear(); + sInitExpression.clear(); } +}; + + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/inpcontx.hxx b/autodoc/inc/ary/cpp/inpcontx.hxx new file mode 100644 index 000000000000..f26b9afae704 --- /dev/null +++ b/autodoc/inc/ary/cpp/inpcontx.hxx @@ -0,0 +1,245 @@ +/************************************************************************* + * + * $RCSfile: inpcontx.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_INPCONTX_HXX +#define ARY_CPP_INPCONTX_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> +#include <ary/cpp/c_etypes.hxx> + + + +namespace ary +{ +namespace cpp +{ + class Namespace; + class Class; + class Enum; + + class ProjectGroup; + class FileGroup; + +/** 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. +*/ +class InputContext +{ + public: + class Owner + { + public: + // LIFECYCLE + virtual ~Owner() {} + + // OPERATIONS + /// Adds Class data to current inner scope (Namespace or Class). + void Add_Class( + const udmstri & i_sLocalName, + Cid i_nId ); + /// Adds Enum data to current inner scope (Namespace or Class). + void Add_Enum( + const udmstri & i_sLocalName, + Cid i_nId ); + /// Adds Typedef data to current inner scope (Namespace or Class). + void Add_Typedef( + const udmstri & i_sLocalName, + Cid i_nId ); + /// Adds Operation data to current inner scope (Namespace or Class). + void Add_Operation( + const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStaticMember ); /// True only for static class members. + /// Adds Variable data to current inner scope (Namespace or Class). + void Add_Variable( + const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + bool i_bIsStaticMember ); /// True only for static class members. + // INQUIRY + Cid Id() const; + + private: + virtual void do_Add_Class( + const udmstri & i_sLocalName, + Cid i_nId ) = 0; + virtual void do_Add_Enum( + const udmstri & i_sLocalName, + Cid i_nId ) = 0; + virtual void do_Add_Typedef( + const udmstri & i_sLocalName, + Cid i_nId ) = 0; + virtual void do_Add_Operation( + const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStatic ) = 0; + virtual void do_Add_Variable( + const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + bool i_bIsStatic ) = 0; + virtual Cid inq_Id() const = 0; + }; + + // LIFECYCLE + virtual ~InputContext() {} + + // OPERATIONS + + // INQUIRY + ProjectGroup & CurProjectGroup() const; + FileGroup & CurFileGroup() const; + + Namespace & CurNamespace() const; + Class * CurClass() const; + Enum * CurEnum() const; + + Owner & CurOwner() const; + E_Protection CurProtection() const; + + private: + virtual ProjectGroup & + inq_CurProjectGroup() const = 0; + virtual FileGroup & inq_CurFileGroup() const = 0; + + virtual Namespace & inq_CurNamespace() const = 0; + virtual Class * inq_CurClass() const = 0; + virtual Enum * inq_CurEnum() const = 0; + + virtual Owner & inq_CurOwner() const = 0; + virtual E_Protection + inq_CurProtection() const = 0; +}; + + + +// IMPLEMENTATION + +inline ProjectGroup & +InputContext::CurProjectGroup() const + { return inq_CurProjectGroup(); } +inline FileGroup & +InputContext::CurFileGroup() const + { return inq_CurFileGroup(); } + +inline Namespace & +InputContext::CurNamespace() const + { return inq_CurNamespace(); } +inline Class * +InputContext::CurClass() const + { return inq_CurClass(); } +inline Enum * +InputContext::CurEnum() const + { return inq_CurEnum(); } +inline InputContext::Owner & +InputContext::CurOwner() const + { return inq_CurOwner(); } +inline E_Protection +InputContext::CurProtection() const + { return inq_CurProtection(); } + + +inline void +InputContext::Owner::Add_Class( const udmstri & i_sLocalName, + Cid i_nId ) + { do_Add_Class(i_sLocalName, i_nId); } +inline void +InputContext::Owner::Add_Enum( const udmstri & i_sLocalName, + Cid i_nId ) + { do_Add_Enum(i_sLocalName, i_nId); } +inline void +InputContext::Owner::Add_Typedef( const udmstri & i_sLocalName, + Cid i_nId ) + { do_Add_Typedef(i_sLocalName, i_nId); } +inline void +InputContext::Owner::Add_Operation( const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStatic ) + { do_Add_Operation( i_sLocalName, i_nSignature, i_nId, i_bIsStatic ); } +inline void +InputContext::Owner::Add_Variable( const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + bool i_bIsStatic ) + { do_Add_Variable( i_sLocalName, i_nId, i_bIsConst, i_bIsStatic ); } +inline Cid +InputContext::Owner::Id() const + { return inq_Id(); } + + + + +} // namespace cpp +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/cpp/usedtype.hxx b/autodoc/inc/ary/cpp/usedtype.hxx new file mode 100644 index 000000000000..845639db09b7 --- /dev/null +++ b/autodoc/inc/ary/cpp/usedtype.hxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * $RCSfile: usedtype.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_USEDTYPE_HXX +#define ARY_CPP_USEDTYPE_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/ca_type.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace cpp +{ + namespace ut + { + class List_TplParameter; + } + + class DisplayGate; + class Gate; + +/** This class represents a type in textual form, like it is parsed out of + source code as a variable type or function return type. +*/ +class UsedType : public Type +{ + public: + UsedType(); + ~UsedType(); + // OPERATORS + bool operator<( + const UsedType & i_rType ) const; + // OPERATIONS + + // Operations to build up the used type from parsing: + void Set_Id( + Tid i_nId ); + void Set_Absolute(); /// "::" is in front. + void Add_NameSegment( + const char * i_sSeg ); + ut::List_TplParameter & + Enter_Template(); + void LeaveTemplate(); + + void Set_Unsigned(); + void Set_Signed(); + void Set_BuiltIn( + const char * i_sType ); + void Set_Const(); /// Sets CV to the type or the present pointer level, whatever is highest. + void Set_Volatile(); /// Sets CV to the type or the present pointer level, whatever is highest. + void Add_PtrLevel(); /// For an '*'. + void Set_Reference(); /// For an '&'. + + // Operations to find the relating CodeEntity: + /** This needs to be called only one time. After that + RelatedCe() will return the value. + */ + Rid Connect2Ce( + const Gate & i_rGate ); + + // INQUIRY + /** @return True, if type consists of one built-in typename and + nothing else. + */ + bool IsBuiltInType() const; + /** @return the full local name, including template instantiation, but without + '*','&' or modifiers. + */ + const udmstri & LocalName() const; + E_TypeSpecialisation + TypeSpecialisation() const; + + private: + // Forbidden functions + UsedType( + const UsedType & i_rType ); + bool operator=( + const UsedType & i_rType ); + + // Interface ary::cpp::Type + virtual Tid inq_Id_Type() const; + virtual Rid inq_RelatedCe() const; + virtual bool inq_IsConst() const; + virtual void inq_Get_Text( + StreamStr & o_rPreName, + StreamStr & o_rName, + StreamStr & o_rPostName, + const ary::cpp::DisplayGate & + i_rGate ) const; + // Local + struct CheshireCat; + + bool DoesMatch_Ce( + Rid i_nId, + const Gate & i_rGate ) const; + + // DATA + Dyn<CheshireCat> pi; +}; + + +namespace ut +{ + class TemplateParameter; + +class List_TplParameter +{ + public: + typedef std::vector< DYN TemplateParameter * >::const_iterator const_iterator; + + List_TplParameter(); + ~List_TplParameter(); + + void AddParam_Type( + Tid i_nType ); + void AddParam_Constant( + const udmstri & i_sConst ); + + const_iterator Begin() const; + const_iterator End() const; + + /// puts "< " TemplateArgumentList " >" to o_rOut. + void Get_Text( + StreamStr & o_rOut, + const ary::cpp::DisplayGate & + i_rGate ) const; + /// @return as strcmp(). + intt Compare( + const List_TplParameter & + i_rOther ) const; + + private: + typedef std::vector< DYN TemplateParameter * > Vector_TplArgument; + + Vector_TplArgument aTplParameters; +}; + + +} // namespace ut + + + +} // namespace cpp +} // namespace ary + + + +#endif + diff --git a/autodoc/inc/ary/info/all_dts.hxx b/autodoc/inc/ary/info/all_dts.hxx new file mode 100644 index 000000000000..c4d8d122fb44 --- /dev/null +++ b/autodoc/inc/ary/info/all_dts.hxx @@ -0,0 +1,194 @@ +/************************************************************************* + * + * $RCSfile: all_dts.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_ALL_DTS_HXX +#define ARY_INFO_ALL_DTS_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace info +{ + +class DocuDisplay; + +class DocuToken +{ + public: + virtual ~DocuToken() {} + + void StoreAt( + DocuDisplay & o_rDisplay ) const; + bool IsWhite() const; + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const = 0; + virtual bool inq_IsWhite() const = 0; +}; + +class DT_Text : public DocuToken +{ + public: + DT_Text( + const char * i_sText ) + : sText( i_sText ) {} + + const udmstri & Text() const { return sText; } + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual bool inq_IsWhite() const; + + udmstri sText; +}; + +class DT_MaybeLink : public DocuToken +{ + public: + DT_MaybeLink( + const char * i_sText, + bool i_bIsGlobal, + bool i_bIsFunction ) + : sText( i_sText ), + bIsGlobal(i_bIsGlobal), + bIsFunction(i_bIsFunction) { } + + const udmstri & Text() const { return sText; } + bool IsAbsolute() const { return bIsGlobal; } + bool IsFunction() const { return bIsFunction; } + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual bool inq_IsWhite() const; + + udmstri sText; + bool bIsGlobal; + bool bIsFunction; +}; + +class DT_Whitespace : public DocuToken +{ + public: + DT_Whitespace( + UINT8 i_nLength ) + : nLength( i_nLength ) {} + UINT8 Length() const { return nLength; } + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual bool inq_IsWhite() const; + + UINT8 nLength; +}; + + +class DT_Eol : public DocuToken +{ + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual bool inq_IsWhite() const; +}; + +class DT_Xml : public DocuToken +{ + public: + DT_Xml( + const char * i_sText ) + : sText( i_sText ) {} + + const udmstri & Text() const { return sText; } + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual bool inq_IsWhite() const; + + udmstri sText; +}; + + +// IMPLEMENTATION + +inline void +DocuToken::StoreAt( DocuDisplay & o_rDisplay ) const + { do_StoreAt(o_rDisplay); } +inline bool +DocuToken::IsWhite() const + { return inq_IsWhite(); } + + + +} +} + +#endif + diff --git a/autodoc/inc/ary/info/all_tags.hxx b/autodoc/inc/ary/info/all_tags.hxx new file mode 100644 index 000000000000..e33da7d1cf0a --- /dev/null +++ b/autodoc/inc/ary/info/all_tags.hxx @@ -0,0 +1,300 @@ +/************************************************************************* + * + * $RCSfile: all_tags.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_ALL_TAGS_HXX +#define ARY_INFO_ALL_TAGS_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/info/ci_attag.hxx> + // COMPONENTS +#include <ary/info/inftypes.hxx> +#include <ary/info/ci_text.hxx> +#include <ary/quname.hxx> + // PARAMETERS +#include <ary/ids.hxx> + + + +namespace ary +{ +namespace info +{ + + +class StdTag : public AtTag +{ + public: + StdTag( + E_AtTagId i_eId ); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + void ChangeId2( + E_AtTagId i_eId ) + { eId = i_eId; } + + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + E_AtTagId Std_Id() const { return eId; } + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual DocuText * Text(); + + E_AtTagId eId; + DocuText aText; + StdTag * pNext; +}; + +class BaseTag : public AtTag +{ + public: + BaseTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + virtual const char * + Title() const; + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + private: + virtual DocuText * Text(); + + QualifiedName sBase; + DocuText aText; + AtTag * pNext; +}; + +class ExceptionTag : public AtTag +{ + public: + ExceptionTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + virtual const char * + Title() const; + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + private: + virtual DocuText * Text(); + + QualifiedName sException; + DocuText aText; + AtTag * pNext; +}; + +class ImplementsTag : public AtTag +{ + public: + ImplementsTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + virtual const char * + Title() const; + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + private: + virtual DocuText * Text(); + + QualifiedName sName; + AtTag * pNext; +}; + +class KeywordTag : public AtTag +{ + public: + KeywordTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + virtual const char * + Title() const; + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + private: + virtual DocuText * Text(); + + StringVector sKeys; +}; + +class ParameterTag : public AtTag +{ + public: + ParameterTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + + const udmstri & ParamName() const { return sName; } + const DocuText & CText() const { return aText; } + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual const ParameterTag * + GetNext() const { return dynamic_cast< ParameterTag* >(pNext); } + virtual AtTag * GetFollower(); + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual DocuText * Text(); + + udmstri sName; + udmstri sValidRange; + DocuText aText; + AtTag * pNext; +}; + +class SeeTag : public AtTag +{ + public: + SeeTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + virtual const char * + Title() const; + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + const std::vector< QualifiedName > & + References() const { return sReferences; } + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual DocuText * Text(); + + std::vector< QualifiedName > + sReferences; +}; + +class TemplateTag : public AtTag +{ + public: + TemplateTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + const DocuText & CText() const { return aText; } + virtual const char * + Title() const; + const udmstri & TplParamName() const { return sName; } + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual const TemplateTag * + GetNext() const { return dynamic_cast< TemplateTag* >(pNext); } + virtual AtTag * GetFollower(); + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; + virtual DocuText * Text(); + + udmstri sName; + DocuText aText; + AtTag * pNext; +}; + +class LabelTag : public AtTag +{ + public: + LabelTag(); + + virtual bool Add_SpecialMeaningToken( + const char * i_sText, + intt i_nNr ); + virtual const char * + Title() const; + virtual UINT8 NrOfSpecialMeaningTokens() const; + virtual AtTag * GetFollower(); + + private: + virtual DocuText * Text(); + + udmstri sLabel; +}; + + + +// IMPLEMENTATION + + +} +} + +#endif + diff --git a/autodoc/inc/ary/info/ci_attag.hxx b/autodoc/inc/ary/info/ci_attag.hxx new file mode 100644 index 000000000000..2bc1ac6f5241 --- /dev/null +++ b/autodoc/inc/ary/info/ci_attag.hxx @@ -0,0 +1,135 @@ +/************************************************************************* + * + * $RCSfile: ci_attag.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_CI_ATTAG_HXX +#define ARY_INFO_CI_ATTAG_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + + +namespace ary +{ +namespace info +{ + +class DocuText; +class DocuDisplay; + +class AtTag +{ + public: + virtual ~AtTag() {} + + void Set_HtmlUseInDocuText( + bool i_bUseIt ); + virtual bool Add_SpecialMeaningToken( /// @return false, if token was not spüecial. + const char * i_sText, + intt i_nNr ) = 0; + virtual void Add_Token( + const char * i_sText ); + virtual void Add_PotentialLink( + const char * i_sText, + bool i_bIsGlobal, + bool i_bIsFunction ); + virtual void Add_Whitespace( + UINT8 i_nLength ); + virtual void Add_Eol(); + + virtual UINT8 NrOfSpecialMeaningTokens() const = 0; + virtual AtTag * GetFollower() = 0; + + void StoreAt( + DocuDisplay & o_rDisplay ) const; + const DocuText & CText() const; + + private: + virtual void do_StoreAt( + DocuDisplay & o_rDisplay ) const; // later becoming abstract + + virtual DocuText * Text() = 0; +}; + + + +// IMPLEMENTATION + +inline void +AtTag::StoreAt( DocuDisplay & o_rDisplay ) const + { do_StoreAt(o_rDisplay); } +inline const DocuText & +AtTag::CText() const + { DocuText * ret = const_cast< AtTag* >(this)->Text(); + csv_assert( ret != 0 ); + return *ret; + } + + +} +} + +#endif + diff --git a/autodoc/inc/ary/info/ci_text.hxx b/autodoc/inc/ary/info/ci_text.hxx new file mode 100644 index 000000000000..fb821205d494 --- /dev/null +++ b/autodoc/inc/ary/info/ci_text.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * $RCSfile: ci_text.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_CI_TEXT_HXX +#define ARY_INFO_CI_TEXT_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace info +{ + +class DocuToken; +class DocuDisplay; + + +class DocuText +{ + public: + typedef std::vector< DocuToken * > TokenList; + + DocuText(); + ~DocuText(); + + void Set_HtmlUse( + bool i_bUseIt ) + { bUsesHtml = i_bUseIt; } + void Add_Token( + DYN DocuToken & let_drToken ) + { aTokens.push_back(&let_drToken); } + const TokenList & Tokens() const { return aTokens; } + void StoreAt( + DocuDisplay & o_rDisplay ) const; + bool IsNoHtml() const { return NOT bUsesHtml; } + bool IsEmpty() const { return aTokens.size() == 0; } + + private: + TokenList aTokens; + bool bUsesHtml; +}; + + + + + + +// IMPLEMENTATION + + +} +} + +#endif + diff --git a/autodoc/inc/ary/info/docstore.hxx b/autodoc/inc/ary/info/docstore.hxx new file mode 100644 index 000000000000..eeee4002ee11 --- /dev/null +++ b/autodoc/inc/ary/info/docstore.hxx @@ -0,0 +1,153 @@ +/************************************************************************* + * + * $RCSfile: docstore.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_DOCSTORE_HXX +#define ARY_INFO_DOCSTORE_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/info/inftypes.hxx> + +namespace ary +{ + class Documentation; + +namespace info +{ + +class DocuStore +{ + public: + virtual ~DocuStore() {} + + void Store2CurProject( + DYN Documentation & let_drDocu ); + void Store2CurFile( + DYN Documentation & let_drDocu ); + void Store2CurNamespace( + DYN Documentation & let_drDocu ); + + void Store2ConnectedDeclaration( + DYN Documentation & let_drDocu ); + + void Store2Glossary( + DYN Documentation & let_drDocu, + const udmstri & i_sExplainedTerm ); + void Store2GlobalTexts( + DYN Documentation & let_drDocu, + ary::info::GlobalTextId + i_nId ); + private: + virtual void do_Store2CurProject( + DYN Documentation & let_drDocu ) = 0; + virtual void do_Store2CurFile( + DYN Documentation & let_drDocu ) = 0; + virtual void do_Store2CurNamespace( + DYN Documentation & let_drDocu ) = 0; + + virtual void do_Store2ConnectedDeclaration( + DYN Documentation & let_drDocu ) = 0; + + virtual void do_Store2Glossary( + DYN Documentation & let_drDocu, + const udmstri & i_sExplainedTerm ) = 0; + virtual void do_Store2GlobalTexts( + DYN Documentation & let_drDocu, + ary::info::GlobalTextId + i_nId ) = 0; +}; + + +// IMPLEMENTATION + + +inline void +DocuStore::Store2CurProject( DYN Documentation & let_drDocu ) + { do_Store2CurProject(let_drDocu); } +inline void +DocuStore::Store2CurFile( DYN Documentation & let_drDocu ) + { do_Store2CurFile(let_drDocu); } +inline void +DocuStore::Store2CurNamespace( DYN Documentation & let_drDocu ) + { do_Store2CurNamespace(let_drDocu); } +inline void +DocuStore::Store2ConnectedDeclaration( DYN Documentation & let_drDocu ) + { do_Store2ConnectedDeclaration(let_drDocu); } +inline void +DocuStore::Store2Glossary( DYN Documentation & let_drDocu, + const udmstri & i_sExplainedTerm ) + { do_Store2Glossary(let_drDocu, i_sExplainedTerm); } +inline void +DocuStore::Store2GlobalTexts( DYN Documentation & let_drDocu, + ary::info::GlobalTextId i_nId ) + { do_Store2GlobalTexts(let_drDocu, i_nId); } + + +} // namespace info +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/info/infodisp.hxx b/autodoc/inc/ary/info/infodisp.hxx new file mode 100644 index 000000000000..8125ed6dceda --- /dev/null +++ b/autodoc/inc/ary/info/infodisp.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * $RCSfile: infodisp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_INFODISP_HXX +#define ARY_INFO_INFODISP_HXX + +// USED SERVICES + // BASE CLASSES +// #include <udm/display.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ +namespace info +{ + +class CodeInfo; +class StdTag; +class BaseTag; +class ExceptionTag; +class ImplementsTag; +class KeywordTag; +class ParameterTag; +class SeeTag; +class TemplateTag; +class LabelTag; +class DT_Text; +class DT_MaybeLink; +class DT_Whitespace; +class DT_Eol; +class DT_Xml; + + + +/** Displaying an ary::info::CodeInfo. + + @descr + This class is an interface, but the functions are defaulted, + to do nothing. so a derived class needn't implement all of them. +*/ +class DocuDisplay +{ + public: + virtual ~DocuDisplay() {} + + virtual void Display_CodeInfo( + const CodeInfo & i_rData ); + + virtual void Display_StdTag( + const StdTag & i_rData ); + virtual void Display_BaseTag( + const BaseTag & i_rData ); + virtual void Display_ExceptionTag( + const ExceptionTag & + i_rData ); + virtual void Display_ImplementsTag( + const ImplementsTag & + i_rData ); + virtual void Display_KeywordTag( + const KeywordTag & i_rData ); + virtual void Display_ParameterTag( + const ParameterTag & + i_rData ); + virtual void Display_SeeTag( + const SeeTag & i_rData ); + virtual void Display_TemplateTag( + const TemplateTag & i_rData ); + virtual void Display_LabelTag( + const LabelTag & i_rData ); + + virtual void Display_DT_Text( + const DT_Text & i_rData ); + virtual void Display_DT_MaybeLink( + const DT_MaybeLink& i_rData ); + virtual void Display_DT_Whitespace( + const DT_Whitespace & + i_rData ); + virtual void Display_DT_Eol( + const DT_Eol & i_rData ); + virtual void Display_DT_Xml( + const ary::info::DT_Xml & + i_rData ); +}; + + +} +} + +#endif + + diff --git a/autodoc/inc/ary/info/inftypes.hxx b/autodoc/inc/ary/info/inftypes.hxx new file mode 100644 index 000000000000..19ee4be34300 --- /dev/null +++ b/autodoc/inc/ary/info/inftypes.hxx @@ -0,0 +1,155 @@ +/************************************************************************* + * + * $RCSfile: inftypes.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INFO_INFTYPES_HXX +#define ARY_INFO_INFTYPES_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace info +{ + + + + +typedef uintt GlobalTextId; + + + +/** Because this enum is used as index list for displayed + tag headlines, the items must neither be moved nor deleted. + Only adding to the end is allowed. atid_MAX always has to exist + and to be the last used value. + Also assigning numbers to the values is forbidden. +*/ +enum E_AtTagId +{ + atid_ATT = 0, + atid_author, + atid_change, + atid_collab, + atid_contact, + + atid_copyright, + atid_deprecated, + atid_descr, + atid_docdate, + atid_derive, + + atid_dyn, + atid_instance, + atid_interface, + atid_invariant, + atid_life, + + atid_multi, + atid_onerror, + atid_persist, + atid_postcond, + atid_precond, + + atid_resp, + atid_return, + atid_short, + atid_todo, + atid_version, + + atid_MAX +}; + +/** Because this enum is used as index list for displayed + tag headlines, the items must neither be moved nor deleted. + Only adding to the end is allowed. C_eAtTag_NrOfClasses always has to exist + and to be the last used value. + Also assigning other numbers to the values, than in this + existing scheme, is forbidden. +*/ +enum E_AtTagClass +{ + atc_std = 0, + + atc_base = atid_MAX, + atc_exception = atid_MAX + 1, + atc_implements = atid_MAX + 2, + atc_keyword = atid_MAX + 3, + atc_parameter = atid_MAX + 4, + + atc_see = atid_MAX + 5, + atc_template = atid_MAX + 6, + atc_label = atid_MAX + 7, + C_eAtTag_NrOfClasses +}; + + + +} // namespace info +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary/loc/loc_dir.hxx b/autodoc/inc/ary/loc/loc_dir.hxx new file mode 100644 index 000000000000..6e7b9be9ae2c --- /dev/null +++ b/autodoc/inc/ary/loc/loc_dir.hxx @@ -0,0 +1,156 @@ +/************************************************************************* + * + * $RCSfile: loc_dir.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_LOC_LOC_DIR_HXX +#define ARY_LOC_LOC_DIR_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <ary/ids.hxx> + // PARAMETERS + + +namespace ary +{ +namespace loc +{ + + +class Directory +{ + public: + typedef std::map< udmstri, Lid > Map_Children; + + // LIFECYCLE + virtual ~Directory() {} + + + // OPERATIONS + void Add_ChildDir( + const udmstri & i_sName, + Lid i_nId ); + void Add_File( + const udmstri & i_sName, + Lid i_nId ); + //INQUIRY + Lid Id() const; + const Map_Children & + ChildDirs() const; + + const Map_Children & + Files() const; + // ACCESS + Map_Children & ChildDirs(); + Map_Children & Files(); + + protected: + Directory( + Lid i_nId ); + private: + Map_Children aChildDirs; + Map_Children aFiles; + Lid nId; +}; + +class SubDirectory : public Directory +{ + public: + SubDirectory( + Lid i_nId, + const udmstri & i_sName, + Lid i_nParentDirectory ); + //INQUIRY + const udmstri & Name() const; + + private: + udmstri sName; + Lid nParentDirectory; +}; + + +// IMPLEMENTATION + +inline Lid +Directory::Id() const + { return nId; } +inline const Directory::Map_Children & +Directory::ChildDirs() const + { return aChildDirs; } +inline const Directory::Map_Children & +Directory::Files() const + { return aFiles; } +inline Directory::Map_Children & +Directory::ChildDirs() + { return aChildDirs; } +inline Directory::Map_Children & +Directory::Files() + { return aFiles; } +inline const udmstri & +SubDirectory::Name() const + { return sName; } + + +} // namespace loc +} // namespace ary + +#endif + diff --git a/autodoc/inc/ary/loc/loc_file.hxx b/autodoc/inc/ary/loc/loc_file.hxx new file mode 100644 index 000000000000..3feb05fc82db --- /dev/null +++ b/autodoc/inc/ary/loc/loc_file.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: loc_file.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_LOC_LOC_FILE_HXX +#define ARY_LOC_LOC_FILE_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <ary/ids.hxx> + // PARAMETERS + + +namespace ary +{ +namespace loc +{ + + +class SourceCodeFile +{ + public: + SourceCodeFile( + Lid i_nId, + Lid i_nRoot, + Lid i_nDirectory, + const udmstri & i_sName ); + //INQUIRY + Lid Id() const; + Lid Root() const; + const udmstri & Name() const; + + private: + Lid nId; + Lid nRoot; + Lid nDirectory; + udmstri sName; +}; + +// IMPLEMENTATION + +inline Lid +SourceCodeFile::Id() const + { return nId; } +inline Lid +SourceCodeFile::Root() const + { return nRoot; } +inline const udmstri & +SourceCodeFile::Name() const + { return sName; } + + +} // namespace loc +} // namespace ary + +#endif + diff --git a/autodoc/inc/ary/loc/loc_root.hxx b/autodoc/inc/ary/loc/loc_root.hxx new file mode 100644 index 000000000000..984dcc7e302f --- /dev/null +++ b/autodoc/inc/ary/loc/loc_root.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: loc_root.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_LOC_PROJECT_HXX +#define ARY_LOC_PROJECT_HXX + +// USED SERVICES + // BASE CLASSES +#include <ary/loc/loc_dir.hxx> + // COMPONENTS +#include <ary/ids.hxx> +#include <cosv/ploc.hxx> + // PARAMETERS + + +namespace ary +{ +namespace loc +{ + + +class LocationRoot : public Directory +{ + public: + LocationRoot( + Lid i_nId, + const csv::ploc::Path & + i_rRootDirectoryPath ); + // INQUIRY + const csv::ploc::Path & + RootDirectoryPath() const; + + private: + csv::ploc::Path aRootDirectoryPath; +}; + + + +// IMPLEMENTATION + +inline const csv::ploc::Path & +LocationRoot::RootDirectoryPath() const + { return aRootDirectoryPath; } + + + +} // namespace loc +} // namespace ary + +#endif + diff --git a/autodoc/inc/ary_i/ci_atag2.hxx b/autodoc/inc/ary_i/ci_atag2.hxx new file mode 100644 index 000000000000..3456882ce159 --- /dev/null +++ b/autodoc/inc/ary_i/ci_atag2.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: ci_atag2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CI_ATAG2_HXX +#define ARY_CI_ATAG2_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <ary_i/ci_text2.hxx> + // PARAMETERS + + + +namespace ary +{ +namespace info +{ + + +class DocumentationDisplay; + +class AtTag2 +{ + public: + virtual ~AtTag2() {} + + virtual void DisplayAt( + DocumentationDisplay & + o_rDisplay ) const = 0; + + const char * Title() const { return sTitle; } + const DocuTex2 & Text() const { return aText; } + + protected: + AtTag2( + const char * i_sTitle) + : sTitle(i_sTitle) {} + udmstri sTitle; + DocuTex2 aText; +}; + + + +// IMPLEMENTATION + +} // namespace info +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary_i/ci_text2.hxx b/autodoc/inc/ary_i/ci_text2.hxx new file mode 100644 index 000000000000..25c8e8b4f6e9 --- /dev/null +++ b/autodoc/inc/ary_i/ci_text2.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * $RCSfile: ci_text2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:15 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CINFO_CI_TEXT2_HXX +#define ARY_CINFO_CI_TEXT2_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace info +{ + + +class DocumentationDisplay; + + +class DocuToken +{ + public: + virtual ~DocuToken() {} + virtual void DisplayAt( + DocumentationDisplay & + o_rDisplay ) const = 0; +}; + + +class DocuTex2 +{ + public: + typedef std::vector< DocuToken * > TokenList; + + DocuTex2(); + ~DocuTex2(); + + virtual void DisplayAt( + DocumentationDisplay & + o_rDisplay ) const; + + void AddToken( + DYN DocuToken & let_drToken ) + { aTokens.push_back(&let_drToken); } + const TokenList & Tokens() const { return aTokens; } + bool IsEmpty() const; + + + private: + TokenList aTokens; +}; + + + +// IMPLEMENTATION + +} // namespace info +} // namespace ary + + +#endif + diff --git a/autodoc/inc/ary_i/disdocum.hxx b/autodoc/inc/ary_i/disdocum.hxx new file mode 100644 index 000000000000..63eb62ab7dfc --- /dev/null +++ b/autodoc/inc/ary_i/disdocum.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: disdocum.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_DISDOCUM_HXX +#define ARY_DISDOCUM_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace dsapi +{ +class DT_TextToken; +class DT_MupType; +class DT_MupMember; +class DT_MupConst; +class DT_Style; +class DT_EOL; +class DT_StdAtTag; +class DT_SeeAlsoAtTag; +class DT_ParameterAtTag; +} // namespace dsapi +} // namespace csi + + +namespace ary +{ +namespace info +{ + + + +class DocumentationDisplay +{ + public: + + virtual ~DocumentationDisplay() { } + + virtual void Display_TextToken( + const csi::dsapi::DT_TextToken & + i_rToken ) = 0; + virtual void Display_MupType( + const csi::dsapi::DT_MupType & i_rToken ) = 0; + virtual void Display_MupMember( + const csi::dsapi::DT_MupMember & + i_rToken ) = 0; + virtual void Display_MupConst( + const csi::dsapi::DT_MupConst & + i_rToken ) = 0; + virtual void Display_Style( + const csi::dsapi::DT_Style & i_rToken ) = 0; + virtual void Display_EOL() = 0; + virtual void Display_StdAtTag( + const csi::dsapi::DT_StdAtTag & + i_rToken ) = 0; + virtual void Display_SeeAlsoAtTag( + const csi::dsapi::DT_SeeAlsoAtTag & + i_rToken ) = 0; + virtual void Display_ParameterAtTag( + const csi::dsapi::DT_ParameterAtTag & + i_rToken ) = 0; +}; + +} // namespace info +} // namespace ary + + +#endif + diff --git a/autodoc/inc/autodoc/displaying.hxx b/autodoc/inc/autodoc/displaying.hxx new file mode 100644 index 000000000000..e49f54609b07 --- /dev/null +++ b/autodoc/inc/autodoc/displaying.hxx @@ -0,0 +1,107 @@ +/************************************************************************* + * + * $RCSfile: displaying.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef AUTODOC_DISPLAYING_HXX +#define AUTODOC_DISPLAYING_HXX + + +namespace display +{ + class CorporateFrame; +} + + + +namespace autodoc +{ + +class HtmlDisplay_UdkStd; +// class TextDisplay_FunctionList_Ifc; + + +/** Interface for parsing code of a programming language and + delivering the information into an Autodoc Repository. +**/ +class DisplayToolsFactory_Ifc +{ + public: + virtual ~DisplayToolsFactory_Ifc() {} + static DisplayToolsFactory_Ifc & + GetIt_(); + +// virtual DYN autodoc::TextDisplay_FunctionList_Ifc * +// Create_TextDisplay_FunctionList() const = 0; + + + virtual DYN autodoc::HtmlDisplay_UdkStd * + Create_HtmlDisplay_UdkStd() const = 0; + + virtual const display::CorporateFrame & + Create_StdFrame() const = 0; +}; + + +} // namespace autodoc + + + +#endif + diff --git a/autodoc/inc/autodoc/dsp_html_std.hxx b/autodoc/inc/autodoc/dsp_html_std.hxx new file mode 100644 index 000000000000..c913cabd46f4 --- /dev/null +++ b/autodoc/inc/autodoc/dsp_html_std.hxx @@ -0,0 +1,213 @@ +/************************************************************************* + * + * $RCSfile: dsp_html_std.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef AUTODOC_DSP_HTML_STD_HXX +#define AUTODOC_DSP_HTML_STD_HXX + + + +namespace ary +{ + namespace cpp + { + class DisplayGate; + } +} + +namespace display +{ + class CorporateFrame; +} + + +namespace autodoc +{ + + +class HtmlDisplay_UdkStd +{ + public: + virtual ~HtmlDisplay_UdkStd() {} + + /** Displays the names of several C++ code entities within the + given namespace (or the global namespace as default). All + subnamespaces are included. + + Output has following format: + + ========================================================================= + OutputDirectory + index.html + def-all.html + prj\ + sal\ + index.html // Overview about project + + f-FileName[1,2,...] // Overview about file + f-OtherFileName[1,2,...] + ... + def-FileName[1,2,...] // #defines and macros in file + def-OtherFileName[1,2,...] + ... + rtl\ + ... + cppu\ + ... + cppuhelper\ + ... + ... + ix\ + ix-a.html + ix-b.html + ... + ix-z.html + ix-_.html + ix-other.html + + cpp\ + index.html // Overview about global namespace + + Namespace_A\ + Namespace_C\ + index.html // Overview about namespace C + ... + ... + + index.html // Overview about namespace A + + c-ClassName_X.html // Description of class + ... + e-EnumName.html // Description of enum + ... + t-TypedefName.html // Description of typedef + ... + o-Filename.html // Descriptions of operations in this file in this namespace + ... + d-Filename.html // Descriptions of data in this file in this namespace + ... + + ClassName_X\ + c-ClassName_Y.html + e-EnumName.html + t-TypedefName.html + o.html // Descriptions of operations in class X + d.html // Descriptions of data in class X + + ClassName_Y\ + ... + ... + + idl\ + ... + java\ + ... + ========================================================================= + + + @param i_sOutputDirectory + Directory for output. Path must be given in correct + syntax for the actual operating system without final + path delimiter. If this is 0 or "", the current + working directory is chosen. + @param i_rAryGate + The access to the Autodoc Repository. + @param i_rLayout + Gives parameters for the appearance of the HTML output. + @param i_pProjectList + If this is != 0, then only code entities which are declared + in this projects are displayed. + */ + void Run( + const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & + i_rAryGate, + const display::CorporateFrame & + i_rLayout, + const StringVector * + i_pProjectList = 0 ); + private: + virtual void do_Run( + const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & + i_rAryGate, + const display::CorporateFrame & + i_rLayout, + const StringVector * + i_pProjectList ) = 0; +}; + +// IMPLEMENTATION + +inline void +HtmlDisplay_UdkStd::Run( const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & i_rAryGate, + const display::CorporateFrame & i_rLayout, + const StringVector * i_pProjectList ) + { do_Run( i_sOutputDirectory, i_rAryGate, i_rLayout, i_pProjectList ); } + + + +} // namespace autodoc + + +#endif + + diff --git a/autodoc/inc/autodoc/dsp_txt_flist.hxx b/autodoc/inc/autodoc/dsp_txt_flist.hxx new file mode 100644 index 000000000000..343ea0d4e044 --- /dev/null +++ b/autodoc/inc/autodoc/dsp_txt_flist.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * $RCSfile: dsp_txt_flist.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef AUTODOC_DSP_TXT_FLIST_HXX +#define AUTODOC_DSP_TXT_FLIST_HXX + +#include <iostream> + + +namespace ary +{ + namespace cpp + { + class DisplayGate; + } +} + + +namespace autodoc +{ + +class TextDisplay_FunctionList_Ifc +{ + public: + virtual ~TextDisplay_FunctionList_Ifc() {} + + /** Displays the names of all C++ functions and methods within the + given namespace (or the global namespace as default). All + subnamespaces are included. + */ + virtual void Run( + ostream & o_rStream, + const ary::cpp::DisplayGate & + i_rAryGate ) = 0; /// If i_pNamespace == 0, the global namespace is displayed. +}; + + +} // namespace autodoc + +#endif + diff --git a/autodoc/inc/autodoc/filecoli.hxx b/autodoc/inc/autodoc/filecoli.hxx new file mode 100644 index 000000000000..710ae8930fd7 --- /dev/null +++ b/autodoc/inc/autodoc/filecoli.hxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * $RCSfile: filecoli.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_PARSER_FILECOLI_HXX +#define ADC_PARSER_FILECOLI_HXX + + +namespace autodoc +{ + +class FileCollector_Ifc +{ + public: + // TYPES + typedef StringVector::const_iterator const_iterator; + + enum E_SearchMode + { + flat, + recursive + }; + + // LIFECYCLE + virtual ~FileCollector_Ifc() {} + + // OPERATIONS + virtual uintt AddFilesFrom( + const char * i_sRootDir, + const char * i_sFilter, + E_SearchMode i_eSearchMode ) = 0; + virtual uintt AddFile( + const char * i_sFilePath ) = 0; + virtual void EraseAll() = 0; + + // INQUIRY + virtual const_iterator + Begin() const = 0; + virtual const_iterator + End() const = 0; + virtual uintt Size() const = 0; +}; + + +} // namespace autodoc + + +#endif + diff --git a/autodoc/inc/autodoc/parsing.hxx b/autodoc/inc/autodoc/parsing.hxx new file mode 100644 index 000000000000..988583bf4f83 --- /dev/null +++ b/autodoc/inc/autodoc/parsing.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: parsing.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef AUTODOC_PARSING_HXX +#define AUTODOC_PARSING_HXX + + + +namespace autodoc +{ + +class CodeParser_Ifc; +class DocumentationParser_Ifc; +class FileCollector_Ifc; + + +/** Interface for parsing code of a programming language and + delivering the information into an Autodoc Repository. +**/ +class ParseToolsFactory_Ifc +{ + public: + virtual ~ParseToolsFactory_Ifc() {} + static ParseToolsFactory_Ifc & + GetIt_(); + + virtual DYN autodoc::CodeParser_Ifc * + Create_Parser_Cplusplus() const = 0; + +// virtual DYN autodoc::CodeParser_Ifc * +// CreateParser_UnoIDL() const = 0; +// virtual DYN autodoc::CodeParser_Ifc * +// CreateParser_Java() const = 0; +// virtual DYN autodoc::CodeParser_Ifc * +// CreateParser_StoredProcedures() const = 0; + + virtual DYN autodoc::DocumentationParser_Ifc * + Create_DocuParser_AutodocStyle() const = 0; + +// virtual DYN autodoc::DocumentationParser_Ifc * +// CreateDocuParser_StarOfficeAPIStyle() const = 0; + + virtual DYN autodoc::FileCollector_Ifc * + Create_FileCollector( + uintt i_nEstimatedNrOfFiles ) const = 0; /// Should be somewhat larger than the maximal estimated number of files. +}; + + +} // namespace autodoc + + + +#endif + diff --git a/autodoc/inc/autodoc/prs_code.hxx b/autodoc/inc/autodoc/prs_code.hxx new file mode 100644 index 000000000000..9c4ede5c90ba --- /dev/null +++ b/autodoc/inc/autodoc/prs_code.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * $RCSfile: prs_code.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef AUTODOC_PRS_CODE_HXX +#define AUTODOC_PRS_CODE_HXX + + + +namespace csv +{ + namespace ploc + { + class Path; + } +} + +namespace ary +{ + class Repository; +} + +namespace autodoc +{ + +class FileCollector_Ifc; +class DocumentationParser_Ifc; + + +/** Interface for parsing code of a programming language and + delivering the information into an Autodoc Repository. +**/ +class CodeParser_Ifc +{ + public: + virtual ~CodeParser_Ifc() {} + + virtual void Setup( + ary::Repository & o_rRepository, + const autodoc::DocumentationParser_Ifc & + i_rDocumentationInterpreter ) = 0; + + virtual void Run( + const udmstri & i_sProjectName, + csv::ploc::Path & i_rProjectRootDirectory, + const autodoc::FileCollector_Ifc & + i_rFiles ) = 0; +}; + + +} // namespace autodoc + + + +#endif + diff --git a/autodoc/inc/autodoc/prs_docu.hxx b/autodoc/inc/autodoc/prs_docu.hxx new file mode 100644 index 000000000000..257b8f8b6321 --- /dev/null +++ b/autodoc/inc/autodoc/prs_docu.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: prs_docu.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_PARSER_PRS_DOCU_HXX +#define ADC_PARSER_PRS_DOCU_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + + +namespace autodoc +{ + +class TkpDocuContext; + +class DocumentationParser_Ifc +{ + public: + virtual ~DocumentationParser_Ifc() {} + + virtual DYN TkpDocuContext * + Create_DocuContext() const = 0; +}; + + +} // namespace autodoc + + +#endif + diff --git a/autodoc/inc/autodoc/x_parsing.hxx b/autodoc/inc/autodoc/x_parsing.hxx new file mode 100644 index 000000000000..6624f4a3ced0 --- /dev/null +++ b/autodoc/inc/autodoc/x_parsing.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: x_parsing.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef AUTODOC_X_PARSING_HXX +#define AUTODOC_X_PARSING_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +#include <iostream> + + +namespace autodoc +{ + +class X_Parser_Ifc +{ + public: + // TYPES + enum E_Event + { + x_Any = 0, + x_InvalidChar, + x_UnexpectedToken, + x_UnexpectedEOF, + x_UnspecifiedSyntaxError + }; + + // LIFECYCLE + virtual ~X_Parser_Ifc() {} + + // INQUIRY + virtual E_Event GetEvent() const = 0; + virtual void GetInfo( + ostream & o_rOutputMedium ) const = 0; +}; + + +} // namespace autodoc + +ostream & operator<<( + ostream & o_rOut, + const autodoc::X_Parser_Ifc & + i_rException ); + + + +#endif + diff --git a/autodoc/inc/parser/parser.hxx b/autodoc/inc/parser/parser.hxx new file mode 100644 index 000000000000..51f8a6a6c395 --- /dev/null +++ b/autodoc/inc/parser/parser.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: parser.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:17 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_PARSER_HXX +#define ADC_PARSER_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +namespace autodoc +{ + class FileCollector_Ifc; +} + + +class CodeParser +{ + public: + virtual ~CodeParser() {} + + virtual void Run( + const autodoc::FileCollector_Ifc & + i_rFiles ) = 0; +}; + + + +#endif + diff --git a/autodoc/inc/parser/unoidl.hxx b/autodoc/inc/parser/unoidl.hxx new file mode 100644 index 000000000000..d4683297fb3e --- /dev/null +++ b/autodoc/inc/parser/unoidl.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * $RCSfile: unoidl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:17 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UNOIDL_HXX +#define ADC_UNOIDL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <parser/parser.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + class Repository; +} +namespace autodoc +{ + class FileCollector_Ifc; +} + +namespace csi +{ +namespace uidl +{ + + +class Uidl_Parser : public ::CodeParser +{ + public: + Uidl_Parser( + ary::Repository & io_rRepository ); + + virtual void Run( + const autodoc::FileCollector_Ifc & + i_rFiles ); + + private: + // DATA + ary::Repository * pRepository; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/prj/build.lst b/autodoc/prj/build.lst new file mode 100644 index 000000000000..3f773fd26d4b --- /dev/null +++ b/autodoc/prj/build.lst @@ -0,0 +1,84 @@ +#==================================================================================== +ar autodoc : cosv NULL +ar autodoc usr1 - all ar_mkout NULL +ar autodoc\inc get - all ar_i NULL +ar autodoc\inc\ary get - all ar_ir NULL +ar autodoc\inc\ary\cpp get - all ar_ir_cpp NULL +ar autodoc\inc\ary\info get - all ar_ir_info NULL +ar autodoc\inc\ary\loc get - all ar_ir_loc NULL +ar autodoc\inc\ary\task get - all ar_ir_task NULL +ar autodoc\inc\ary_i get - all ar_ir2 NULL +ar autodoc\inc\ary_i\uidl get - all ar_ir2_uidl NULL +ar autodoc\inc\autodoc get - all ar_iau NULL +ar autodoc\inc\csi get - all ar_ic NULL +ar autodoc\inc\csi\d_sapi get - all ar_ic_idoc2 NULL +ar autodoc\inc\csi\dis_html get - all ar_ic_html2 NULL +ar autodoc\inc\csi\html get - all ar_ic_html NULL +ar autodoc\inc\csi\l_uidl get - all ar_ic_idl2 NULL +ar autodoc\inc\csi\prl get - all ar_ic_prl2 NULL +ar autodoc\inc\display get - all ar_idispl2 NULL +ar autodoc\inc\parser get - all ar_iparse2 NULL +ar autodoc\source get - all ar_s NULL +ar autodoc\source\inc get - all ar_si NULL +ar autodoc\source\inc\display get - all ar_si_display NULL +ar autodoc\source\inc\oodb get - all ar_si_oodb2 NULL +ar autodoc\source\inc\tools get - all ar_si_tools NULL +ar autodoc\source\inc\utility get - all ar_si_util2 NULL +ar autodoc\source\ary get - all ar_sr NULL +ar autodoc\source\ary\inc get - all ar_sri NULL +ar autodoc\source\ary\inc\cpp get - all ar_sri_cpp NULL +ar autodoc\source\ary\inc\loc get - all ar_sri_loc NULL +ar autodoc\source\ary\inc\store get - all ar_sri_store NULL +ar autodoc\source\ary\cpp nmake - all ar_sr_cpp NULL +ar autodoc\source\ary\info nmake - all ar_sr_info NULL +ar autodoc\source\ary\kernel nmake - all ar_sr_kernel NULL +ar autodoc\source\ary\loc nmake - all ar_sr_loc NULL +ar autodoc\source\ary\store nmake - all ar_sr_store NULL +ar autodoc\source\ary_i get - all ar_sr2 NULL +ar autodoc\source\ary_i\inc get - all ar_sr2i_inc NULL +ar autodoc\source\ary_i\inc\uidl get - all ar_sr2i_uidl NULL +ar autodoc\source\ary_i\idl nmake - all ar_sr2_idl NULL +ar autodoc\source\ary_i\kernel nmake - all ar_sr2_krnl NULL +ar autodoc\source\csi get - all ar_sc NULL +ar autodoc\source\csi\html nmake - all ar_sc_html NULL +ar autodoc\source\csi_i get - all ar_sc2 NULL +ar autodoc\source\csi_i\d_sapi nmake - all ar_sc2_idoc NULL +ar autodoc\source\csi_i\dis_html nmake - all ar_sc2_html NULL +ar autodoc\source\csi_i\l_uidl nmake - all ar_sc2_idl NULL +ar autodoc\source\displa_i get - all ar_sd2 NULL +ar autodoc\source\displa_i\idoc nmake - all ar_sd2_idoc NULL +ar autodoc\source\display get - all ar_sd NULL +ar autodoc\source\display\inc get - all ar_sdi NULL +ar autodoc\source\display\inc\funclist get - all ar_sdi_flist NULL +ar autodoc\source\display\inc\html get - all ar_sdi_html NULL +ar autodoc\source\display\html nmake - all ar_sd_html NULL +ar autodoc\source\display\kernel nmake - all ar_sd_kernel NULL +ar autodoc\source\parser get - all ar_sp NULL +ar autodoc\source\parser\inc get - all ar_spi NULL +ar autodoc\source\parser\inc\adoc get - all ar_spi_adoc NULL +ar autodoc\source\parser\inc\cpp get - all ar_spi_cpp NULL +ar autodoc\source\parser\inc\semantic get - all ar_spi_sem NULL +ar autodoc\source\parser\inc\tokens get - all ar_spi_tok NULL +ar autodoc\source\parser\adoc nmake - all ar_sp_adoc NULL +ar autodoc\source\parser\cpp nmake - all ar_sp_cpp NULL +ar autodoc\source\parser\kernel nmake - all ar_sp_krnl NULL +ar autodoc\source\parser\semantic nmake - all ar_sp_sem NULL +ar autodoc\source\parser\tokens nmake - all ar_sp_tok NULL +ar autodoc\source\parser_i get - all ar_sp2 NULL +ar autodoc\source\parser_i\inc get - all ar_sp2i NULL +ar autodoc\source\parser_i\inc\s2_dsapi get - all ar_sp2i_idoc NULL +ar autodoc\source\parser_i\inc\s2_luidl get - all ar_sp2i_cpp NULL +ar autodoc\source\parser_i\inc\semantic get - all ar_sp2i_sem NULL +ar autodoc\source\parser_i\inc\tokens get - all ar_sp2i_tok NULL +ar autodoc\source\parser_i\idl nmake - all ar_sp2_idl NULL +ar autodoc\source\parser_i\idoc nmake - all ar_sp2_idoc NULL +ar autodoc\source\parser_i\tokens nmake - all ar_sp2_tok NULL +ar autodoc\source\tools nmake - all ar_st NULL +ar autodoc\prj get - all ar_prj NULL +ar autodoc\source\mkinc get - all ar_smk NULL +ar autodoc\util get - all ar_util NULL +ar autodoc\source\exes get - all ar_se NULL +ar autodoc\source\exes\comphelp nmake - all ar_se_chelp NULL +ar autodoc\source\exes\adc_uni nmake - all ar_se_uni ar_sr_cpp ar_sr_info ar_sr_kernel ar_sr_loc ar_sr_store ar_sr2_idl ar_sr2_krnl ar_sc_html ar_sc2_idoc ar_sc2_html ar_sc2_idl ar_sd2_idoc ar_sd_html ar_sd_kernel ar_sp_adoc ar_sp_cpp ar_sp_krnl ar_sp_sem ar_sp_tok ar_sp2_idl ar_sp2_idoc ar_sp2_tok ar_st ar_se_chelp NULL +#==================================================================================== + diff --git a/autodoc/prj/d.lst b/autodoc/prj/d.lst new file mode 100644 index 000000000000..c73e559f0729 --- /dev/null +++ b/autodoc/prj/d.lst @@ -0,0 +1,3 @@ +..\%__SRC%\bin\autodoc.exe %_DEST%\bin%_EXT%\autodoc.exe +..\%__SRC%\bin\autodoc %_DEST%\bin%_EXT%\autodoc + diff --git a/autodoc/source/ary/cpp/c_class.cxx b/autodoc/source/ary/cpp/c_class.cxx new file mode 100644 index 000000000000..d3beb062d88a --- /dev/null +++ b/autodoc/source/ary/cpp/c_class.cxx @@ -0,0 +1,396 @@ +/************************************************************************* + * + * $RCSfile: c_class.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_class.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> +#include <slots.hxx> +#include "c_slots.hxx" + + + + +namespace ary +{ +namespace cpp +{ + +Class::Class() + : // aEssentials, + // aBaseClasses, + // aClasses, + // aOperations, + // aData, + eClassKey(CK_class), + eProtection(PROTECT_global), + eVirtuality(VIRTUAL_none) +{ +} + +Class::Class( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + E_ClassKey i_eClassKey ) + : aEssentials( i_nId, + i_sLocalName, + i_nOwner, + i_nFile ), + // aBaseClasses, + // aClasses, + // aOperations, + // aData, + eClassKey(i_eClassKey), + eProtection(i_eProtection), + eVirtuality(VIRTUAL_none) +{ +} + +Class::~Class() +{ +} + +void +Class::Add_BaseClass( const S_Classes_Base & i_rBaseClass ) +{ + aBaseClasses.push_back(i_rBaseClass); +} + +void +Class::Add_TemplateParameterType( const udmstri & i_sLocalName, + Tid i_nIdAsType ) +{ + aTemplateParameterTypes.push_back( + List_TplParam::value_type(i_sLocalName,i_nIdAsType) ); +} + +void +Class::Add_LocalClass( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aClasses.push_back( S_LocalCe(i_sLocalName, i_nId) ); +} + +void +Class::Add_LocalEnum( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aEnums.push_back( S_LocalCe(i_sLocalName, i_nId) ); +} + +void +Class::Add_LocalTypedef( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aTypedefs.push_back( S_LocalCe(i_sLocalName, i_nId) ); +} + +void +Class::Add_LocalOperation( const udmstri & i_sLocalName, + OSid i_nOS, + Cid i_nId ) +{ + aOperations.push_back( S_LocalOperation(i_sLocalName, i_nOS, i_nId) ); +} + +void +Class::Add_LocalStaticOperation( const udmstri & i_sLocalName, + OSid i_nOS, + Cid i_nId ) +{ + aStaticOperations.push_back( S_LocalOperation(i_sLocalName, i_nOS, i_nId) ); +} + +void +Class::Add_LocalData( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aData.push_back( S_LocalCe(i_sLocalName, i_nId) ); +} + +void +Class::Add_LocalStaticData( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aStaticData.push_back( S_LocalCe(i_sLocalName, i_nId) ); +} + +Rid +Class::Search_LocalClass( const udmstri & i_sName ) const +{ + CIterator_Locals itFound = PosOfName(aClasses, i_sName); + if (itFound != aClasses.end()) + return (*itFound).nId; + return 0; +} + +Cid +Class::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +Class::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +Class::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +Class::inq_Location() const +{ + return aEssentials.Location(); +} + +void +Class::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Class(*this); + } +} + +RCid +Class::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +Class::inq_Info() const +{ + return aEssentials.Info(); +} + +void +Class::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + +Gid +Class::inq_Id_Group() const +{ + return static_cast<Gid>(aEssentials.Id()); +} + +const RepositoryEntity & +Class::inq_RE_Group() const +{ + return *this; +} + +const group::SlotList & +Class::inq_Slots() const +{ + static const SlotAccessId aProjectSlotData[] + = { SLOT_Bases, + SLOT_NestedClasses, + SLOT_Enums, + SLOT_Typedefs, + SLOT_Operations, + SLOT_StaticOperations, + SLOT_Data, + SLOT_StaticData, + SLOT_FriendClasses, + SLOT_FriendOperations }; + static const std::vector< SlotAccessId > + aSlots( &aProjectSlotData[0], + &aProjectSlotData[0] + + sizeof aProjectSlotData / sizeof (SlotAccessId) ); + return aSlots; +} + + +DYN Slot * +Class::inq_Create_Slot( SlotAccessId i_nSlot ) const +{ + switch ( i_nSlot ) + { + case SLOT_Bases: return new Slot_BaseClass(aBaseClasses); + case SLOT_NestedClasses: return new Slot_ListLocalCe(aClasses); + case SLOT_Enums: return new Slot_ListLocalCe(aEnums); + case SLOT_Typedefs: return new Slot_ListLocalCe(aTypedefs); + case SLOT_Operations: return new Slot_OperationList(aOperations); + case SLOT_StaticOperations: return new Slot_OperationList(aStaticOperations); + case SLOT_Data: return new Slot_ListLocalCe(aData); + case SLOT_StaticData: return new Slot_ListLocalCe(aStaticData); + case SLOT_FriendClasses: return new Slot_RidList(aFriendClasses); + case SLOT_FriendOperations: return new Slot_RidList(aFriendOperations); + default: + return new Slot_Null; + } // end switch +} + + +#if 0 +uintt +Class::Get_LocalClasses( ary::List_Rid & o_rResultList ) const +{ + for ( CIterator_Locals it = aClasses.begin(); + it != aClasses.end(); + ++it ) + { + o_rResultList.push_back((*it).nId); + } + return o_rResultList.size(); +} + +uintt +Class::Get_LocalFunctions( ary::List_Rid & o_rResultList ) const +{ + for ( List_LocalOperation::const_iterator its = aStaticOperations.begin(); + its != aStaticOperations.end(); + ++its ) + { + o_rResultList.push_back((*its).nId); + } + for ( List_LocalOperation::const_iterator it = aOperations.begin(); + it != aOperations.end(); + ++it ) + { + o_rResultList.push_back((*it).nId); + } + return o_rResultList.size(); +} + +const udmstri & +Class::LocalNameOfOwner() const +{ + return LocalName(); +} +#endif // 0 + +#if 0 +Cid +Class::Find_LocalClass( const udmstri & i_sLocalName ) const +{ + CIterator_Locals ret = PosOfName(aClasses, i_sLocalName); + if (ret != aTypes.end()) + return static_cast<Cid>( (*ret).nId ); + return 0; +} + +Tid +Class::Find_LocalType( const udmstri & i_sLocalName ) const +{ + CIterator_Locals ret = PosOfName(aEnums, i_sLocalName); + if (ret != aEnums.end()) + return (*ret).nId; + ret = PosOfName(aTypedefs, i_sLocalName); + if (ret != aTypedefs.end()) + return (*ret).nId; + ret = PosOfName(aClasses, i_sLocalName); + if (ret != aClasses.end()) + return (*ret).nId; + return 0; +} +#endif // 0 + + +Class::CIterator_Locals +Class::PosOfName( const List_LocalCe & i_rList, + const udmstri & i_sName ) const +{ + for ( CIterator_Locals ret = i_rList.begin(); + ret != i_rList.end(); + ++ret ) + { + if ( (*ret).sLocalName == i_sName ) + return ret; + } + return i_rList.end(); +} + +Class::Iterator_Locals +Class::PosOfName( List_LocalCe & i_rList, + const udmstri & i_sName ) +{ + for ( Iterator_Locals ret = i_rList.begin(); + ret != i_rList.end(); + ++ret ) + { + if ( (*ret).sLocalName == i_sName ) + return ret; + } + return i_rList.end(); +} + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/c_define.cxx b/autodoc/source/ary/cpp/c_define.cxx new file mode 100644 index 000000000000..2d2fb67b0774 --- /dev/null +++ b/autodoc/source/ary/cpp/c_define.cxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: c_define.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_define.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> +#include <ary/cpp/prpr.hxx> + + + + +namespace ary +{ +namespace cpp +{ + + +Define::Define( Did i_nId, + const udmstri & i_sName, + const str_vector & i_rDefinition, + Lid i_nDeclaringFile ) + : CppDefinition(i_nId, i_sName, i_nDeclaringFile), + aDefinition(i_rDefinition) +{ +} + +Define::~Define() +{ +} + +void +Define::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Define(*this); + } +} + +RCid +Define::inq_RC() const +{ + return RCID_DEFINE; +} + +const CppDefinition::str_vector & +Define::inq_DefinitionText() const +{ + return aDefinition; +} + +void +Define::GetText( StreamStr & o_rText ) const +{ + if ( aDefinition.begin() == aDefinition.end() ) + 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); +} + + + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/c_enum.cxx b/autodoc/source/ary/cpp/c_enum.cxx new file mode 100644 index 000000000000..2759bcab4233 --- /dev/null +++ b/autodoc/source/ary/cpp/c_enum.cxx @@ -0,0 +1,207 @@ +/************************************************************************* + * + * $RCSfile: c_enum.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_enum.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> +#include <slots.hxx> +#include "c_slots.hxx" + + + + +namespace ary +{ +namespace cpp +{ + + +Enum::Enum() + : // aEssentials, + // aValues, + eProtection(PROTECT_global) +{ +} + +Enum::Enum( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile ) + : aEssentials( i_nId, + i_sLocalName, + i_nOwner, + i_nFile ), + // aValues + eProtection(i_eProtection) +{ + +} + +Enum::~Enum() +{ +} + +void +Enum::Add_Value( Cid i_nId ) +{ + aValues.push_back( i_nId ); +} + +Cid +Enum::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +Enum::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +Enum::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +Enum::inq_Location() const +{ + return aEssentials.Location(); +} + +void +Enum::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Enum(*this); + } +} + +RCid +Enum::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +Enum::inq_Info() const +{ + return aEssentials.Info(); +} + +void +Enum::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + +Gid +Enum::inq_Id_Group() const +{ + return static_cast<Gid>(Id()); +} + +const RepositoryEntity & +Enum::inq_RE_Group() const +{ + return *this; +} + +const group::SlotList & +Enum::inq_Slots() const +{ + static const SlotAccessId aProjectSlotData[] + = { SLOT_Values }; + static const std::vector< SlotAccessId > + aSlots( &aProjectSlotData[0], + &aProjectSlotData[0] + + sizeof aProjectSlotData / sizeof (SlotAccessId) ); + return aSlots; +} + +DYN Slot * +Enum::inq_Create_Slot( SlotAccessId i_nSlot ) const +{ + switch ( i_nSlot ) + { + case SLOT_Values: return new Slot_RidList(aValues); + default: + return new Slot_Null; + } // end switch +} + + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/c_enuval.cxx b/autodoc/source/ary/cpp/c_enuval.cxx new file mode 100644 index 000000000000..9bec8eb13a1b --- /dev/null +++ b/autodoc/source/ary/cpp/c_enuval.cxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * $RCSfile: c_enuval.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_enuval.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> + + + + +namespace ary +{ +namespace cpp +{ + + +EnumValue::EnumValue() +// : aEssentials, + // sInitialisation +{ +} + +EnumValue::EnumValue( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + udmstri i_sInitialisation ) + : aEssentials( i_nId, + i_sLocalName, + i_nOwner, + 0 ), + sInitialisation(i_sInitialisation) +{ +} + +EnumValue::~EnumValue() +{ +} + +Cid +EnumValue::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +EnumValue::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +EnumValue::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +EnumValue::inq_Location() const +{ + return aEssentials.Location(); +} + +void +EnumValue::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_EnumValue(*this); + } +} + +RCid +EnumValue::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +EnumValue::inq_Info() const +{ + return aEssentials.Info(); +} + +void +EnumValue::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/c_funct.cxx b/autodoc/source/ary/cpp/c_funct.cxx new file mode 100644 index 000000000000..c98cd8435f3d --- /dev/null +++ b/autodoc/source/ary/cpp/c_funct.cxx @@ -0,0 +1,189 @@ +/************************************************************************* + * + * $RCSfile: c_funct.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_funct.hxx> + + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> + + + +namespace ary +{ +namespace cpp +{ + +Function::Function() + : // aEssentials, + nSignature(0), + nReturnType(0), + eProtection(PROTECT_global), + eVirtuality(VIRTUAL_none) + // aFlags, + // aParameterInfos, + // pExceptions +{ +} + +Function::Function( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + Tid i_nReturnType, + OSid i_nSignature, + StringVector & i_rNonType_ParameterInfos, + E_Virtuality i_eVirtuality, + FunctionFlags i_aFlags, + bool i_bThrowExists, + const std::vector<Tid> & i_rExceptions ) + + : aEssentials( i_nId, + i_sLocalName, + i_nOwner, + i_nFile ), + // aTemplateParameterTypes + nSignature(i_nSignature), + nReturnType(i_nReturnType), + eProtection(i_eProtection), + eVirtuality(i_eVirtuality), + aFlags(i_aFlags), + // aParameterInfos, + pExceptions( i_bThrowExists ? new ExceptionTypeList(i_rExceptions) : 0 ) +{ + std::swap( aParameterInfos, i_rNonType_ParameterInfos ); +} + +Function::~Function() +{ +} + +void +Function::Add_TemplateParameterType( const udmstri & i_sLocalName, + Tid i_nIdAsType ) +{ + aTemplateParameterTypes.push_back( + List_TplParam::value_type(i_sLocalName, i_nIdAsType) ); +} + + +Cid +Function::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +Function::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +Function::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +Function::inq_Location() const +{ + return aEssentials.Location(); +} + +void +Function::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Function(*this); + } +} + +RCid +Function::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +Function::inq_Info() const +{ + return aEssentials.Info(); +} + +void +Function::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + + + +} // namespace cpp +} // namespace ary + diff --git a/autodoc/source/ary/cpp/c_macro.cxx b/autodoc/source/ary/cpp/c_macro.cxx new file mode 100644 index 000000000000..469dcf91c976 --- /dev/null +++ b/autodoc/source/ary/cpp/c_macro.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * $RCSfile: c_macro.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_macro.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> +#include <ary/cpp/prpr.hxx> + + + + + +namespace ary +{ +namespace cpp +{ + + +Macro::Macro( Did i_nId, + const udmstri & i_sName, + const str_vector & i_rParams, + const str_vector & i_rDefinition, + Lid i_nDeclaringFile ) + : CppDefinition(i_nId, i_sName, i_nDeclaringFile), + aParams(i_rParams), + aDefinition(i_rDefinition) +{ +} + +Macro::~Macro() +{ +} + +void +Macro::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Macro(*this); + } +} + +RCid +Macro::inq_RC() const +{ + return RCID_MACRO; +} + +const CppDefinition::str_vector & +Macro::inq_DefinitionText() const +{ + return aDefinition; +} + +void +Macro::GetText( StreamStr & o_rText, + const StringVector & i_rGivenArguments ) const +{ + bool bSwitch_Stringify = false; + bool bSwitch_Concatenate = false; + intt nActiveParamNr = -1; + + if ( aDefinition.begin() == aDefinition.end() ) + 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); +} + + + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/c_namesp.cxx b/autodoc/source/ary/cpp/c_namesp.cxx new file mode 100644 index 000000000000..2688dbb52461 --- /dev/null +++ b/autodoc/source/ary/cpp/c_namesp.cxx @@ -0,0 +1,360 @@ +/************************************************************************* + * + * $RCSfile: c_namesp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_namesp.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/template/tpltools.hxx> +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> +#include <slots.hxx> +#include "c_slots.hxx" + + +namespace ary +{ +namespace cpp +{ + + + +Namespace::Namespace() + : // aEssentials, + // aLocalNamespaces, + // aLocalClasses, + // aLocalEnums, + // aLocalTypedefs, + // aLocalOperations, + // aLocalVariables, + // aLocalConstants, + pParent(0), + nDepth(0) +{ +} + +Namespace::Namespace( Rid i_nId ) + : aEssentials( i_nId, udmstri::Null_(), 0, 0 ), + // aLocalNamespaces, + // aLocalClasses, + // aLocalEnums, + // aLocalTypedefs, + // aLocalOperations, + // aLocalVariables, + // aLocalConstants, + pParent(0), + nDepth(0) +{ +} + +Namespace::Namespace( Cid i_nId, + const udmstri & i_sLocalName, + Namespace & i_rParent ) + : aEssentials( i_nId, + i_sLocalName, + i_rParent.Id(), + 0 ), + // aLocalNamespaces, + // aLocalClasses, + // aLocalEnums, + // aLocalTypedefs, + // aLocalOperations, + // aLocalVariables, + // aLocalConstants, + pParent(&i_rParent), + nDepth(i_rParent.Depth()+1) +{ +} + +Namespace::~Namespace() +{ +} + +void +Namespace::Add_LocalNamespace( DYN Namespace & io_rLocalNamespace ) +{ + aLocalNamespaces[io_rLocalNamespace.LocalName()] = &io_rLocalNamespace; +} + +void +Namespace::Add_LocalClass( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aLocalClasses[i_sLocalName] = i_nId; +} + +void +Namespace::Add_LocalEnum( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aLocalEnums[i_sLocalName] = i_nId; +} + +void +Namespace::Add_LocalTypedef( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aLocalTypedefs[i_sLocalName] = i_nId; +} + +void +Namespace::Add_LocalOperation( const udmstri & i_sLocalName, + OSid i_nOS, + Cid i_nId ) +{ + aLocalOperations.insert( + S_LocalOperation(i_sLocalName, i_nOS, i_nId) ); +} + + +void +Namespace::Add_LocalVariable( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aLocalVariables[i_sLocalName] = i_nId; +} + +void +Namespace::Add_LocalConstant( const udmstri & i_sLocalName, + Cid i_nId ) +{ + aLocalConstants[i_sLocalName] = i_nId; +} + +uintt +Namespace::Depth() const +{ + return nDepth; +} + +Namespace * +Namespace::Parent() const +{ + return pParent; +} + +Namespace * +Namespace::Search_LocalNamespace( const udmstri & i_sLocalName ) const +{ + return csv::value_from_map(aLocalNamespaces, i_sLocalName); +} + +uintt +Namespace::Get_SubNamespaces( std::vector< const Namespace* > & o_rResultList ) const +{ + for ( Map_NamespacePtr::const_iterator it = aLocalNamespaces.begin(); + it != aLocalNamespaces.end(); + ++it ) + { + o_rResultList.push_back( (*it).second ); + } + return o_rResultList.size(); +} + +Rid +Namespace::Search_LocalClass( const udmstri & i_sName ) const +{ + return csv::value_from_map(aLocalClasses, i_sName); +} + +Cid +Namespace::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +Namespace::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +Namespace::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +Namespace::inq_Location() const +{ + return 0; +} + +void +Namespace::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Namespace(*this); + } +} + +RCid +Namespace::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +Namespace::inq_Info() const +{ + return aEssentials.Info(); +} + +void +Namespace::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + +Gid +Namespace::inq_Id_Group() const +{ + return static_cast<Gid>(aEssentials.Id()); +} + +const RepositoryEntity & +Namespace::inq_RE_Group() const +{ + return *this; +} + +const ary::group::SlotList & +Namespace::inq_Slots() const +{ + static const SlotAccessId aProjectSlotData[] + = { SLOT_SubNamespaces, SLOT_Classes, SLOT_Enums, SLOT_Typedefs, SLOT_Operations, + SLOT_Variables, SLOT_Constants }; + static const std::vector< SlotAccessId > + aSlots( &aProjectSlotData[0], + &aProjectSlotData[0] + + sizeof aProjectSlotData / sizeof (SlotAccessId) ); + return aSlots; +} + +DYN Slot * +Namespace::inq_Create_Slot( SlotAccessId i_nSlot ) const +{ + switch ( i_nSlot ) + { + case SLOT_SubNamespaces: return new Slot_SubNamespaces(aLocalNamespaces); + case SLOT_Classes: return new Slot_MapLocalCe(aLocalClasses); + case SLOT_Enums: return new Slot_MapLocalCe(aLocalEnums); + case SLOT_Typedefs: return new Slot_MapLocalCe(aLocalTypedefs); + case SLOT_Operations: return new Slot_OperationSet(aLocalOperations); + case SLOT_Variables: return new Slot_MapLocalCe(aLocalVariables); + case SLOT_Constants: return new Slot_MapLocalCe(aLocalConstants); + default: + return new Slot_Null; + } // end switch +} + + +} // namespace cpp +} // namespace ary + + + +#if 0 +/* +uintt +Namespace::Get_LocalNamespaces( ary::List_Cid& o_rResultList ) const +{ + for ( Map_NamespacePtr::const_iterator it = aLocalNamespaces.begin(); + it != aLocalNamespaces.end(); + ++it ) + { + o_rResultList.push_back((*it).second->Id()); + } + return o_rResultList.size(); +} + +uintt +Namespace::Get_LocalClasses( ary::List_Cid& o_rResultList ) const +{ + for ( Map_LocalCe::const_iterator it = aLocalClasses.begin(); + it != aLocalClasses.end(); + ++it ) + { + o_rResultList.push_back((*it).second); + } + return o_rResultList.size(); +} + +uintt +Namespace::Get_LocalFunctions( ary::List_Cid & o_rResultList ) const +{ + for ( Set_LocalOperation::const_iterator it = aLocalOperations.begin(); + it != aLocalOperations.end(); + ++it ) + { + o_rResultList.push_back((*it).nId); + } + return o_rResultList.size(); +} +*/ +#endif // 0 + + diff --git a/autodoc/source/ary/cpp/c_osigna.cxx b/autodoc/source/ary/cpp/c_osigna.cxx new file mode 100644 index 000000000000..a48fe7c1364e --- /dev/null +++ b/autodoc/source/ary/cpp/c_osigna.cxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * $RCSfile: c_osigna.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/cpp/c_osigna.hxx> + + +// NOT FULLY DEFINED SERVICES + + +namespace ary +{ +namespace cpp +{ + + +OperationSignature::OperationSignature() + : // aParameterTypes, + eConVol(CONVOL_none) +{ +} + +OperationSignature::OperationSignature( std::vector<Tid> & i_rParameterTypes, + E_ConVol i_eConVol ) + : // aParameterTypes, + eConVol(i_eConVol) +{ + std::swap( aParameterTypes, i_rParameterTypes ); +} + +int +OperationSignature::Compare( const OperationSignature & i_rSig ) const +{ + if ( aParameterTypes.size() < i_rSig.aParameterTypes.size() ) + return -1; + else if ( i_rSig.aParameterTypes.size() < aParameterTypes.size() ) + return 1; + + ParameterTypeList::const_iterator iMe = aParameterTypes.begin(); + ParameterTypeList::const_iterator iOther = i_rSig.aParameterTypes.begin(); + for ( ; iMe != aParameterTypes.end(); ++iMe, ++iOther ) + { + if ( *iMe < *iOther ) + return -1; + else if ( *iOther < *iMe ) + return 1; + } + + if ( eConVol < i_rSig.eConVol ) + return -1; + else if ( eConVol != i_rSig.eConVol ) + return 1; + + return 0; +} + + +} // namespace cpp +} // namespace ary + + diff --git a/autodoc/source/ary/cpp/c_slots.cxx b/autodoc/source/ary/cpp/c_slots.cxx new file mode 100644 index 000000000000..6bee855f1d4b --- /dev/null +++ b/autodoc/source/ary/cpp/c_slots.cxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: c_slots.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <c_slots.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/cpp_disp.hxx> + + + +namespace ary +{ +namespace cpp +{ + + + +//*********************** Slot_SubNamespaces ********************// + + +Slot_SubNamespaces::Slot_SubNamespaces( const Map_NamespacePtr & i_rData ) + : pData( &i_rData ) +{ +} + +Slot_SubNamespaces::~Slot_SubNamespaces() +{ +} + +uintt +Slot_SubNamespaces::Size() const +{ + return pData->size(); +} + +void +Slot_SubNamespaces::StoreEntries( ary::Display & o_rDestination ) const +{ + ary::cpp::Display * pDisp + = dynamic_cast< ary::cpp::Display* >( &o_rDestination ); + if ( pDisp == 0 ) + return; + + for ( Map_NamespacePtr::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + pDisp->Display_Namespace( *(*it).second ); + } +} + + +//*********************** Slot_BaseClass ********************// + +Slot_BaseClass::Slot_BaseClass( const List_Bases & i_rData ) + : pData( &i_rData ) +{ +} + +Slot_BaseClass::~Slot_BaseClass() +{ +} + +uintt +Slot_BaseClass::Size() const +{ + return pData->size(); +} + +void +Slot_BaseClass::StoreEntries( ary::Display & o_rDestination ) const +{ + ary::cpp::Display * pDisp + = dynamic_cast< ary::cpp::Display* >( &o_rDestination ); + if ( pDisp == 0 ) + return; + + for ( List_Bases::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + pDisp->DisplaySlot_BaseClass( *it ); + } +} + + + +} // namespace cpp +} // namespace ary + + diff --git a/autodoc/source/ary/cpp/c_slots.hxx b/autodoc/source/ary/cpp/c_slots.hxx new file mode 100644 index 000000000000..d59b555ad88f --- /dev/null +++ b/autodoc/source/ary/cpp/c_slots.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: c_slots.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_C_SLOTS_HXX +#define ARY_CPP_C_SLOTS_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/ceslot.hxx> + // COMPONENTS +#include <ary/cpp/c_idlist.hxx> + // PARAMETERS + + + +namespace ary +{ +namespace cpp +{ + +class Slot_SubNamespaces : public ary::Slot +{ + public: + Slot_SubNamespaces( + const Map_NamespacePtr & + i_rData ); + virtual ~Slot_SubNamespaces(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + ary::Display & o_rDestination ) const; + // DATA + const Map_NamespacePtr * + pData; +}; + +class Slot_BaseClass : public ary::Slot +{ + public: + Slot_BaseClass( + const List_Bases & i_rData ); + virtual ~Slot_BaseClass(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + ary::Display & o_rDestination ) const; + // DATA + const List_Bases * pData; +}; + + +} // namespace cpp +} // namespace ary + + +#endif + + + diff --git a/autodoc/source/ary/cpp/c_tydef.cxx b/autodoc/source/ary/cpp/c_tydef.cxx new file mode 100644 index 000000000000..a55fde096dc0 --- /dev/null +++ b/autodoc/source/ary/cpp/c_tydef.cxx @@ -0,0 +1,167 @@ +/************************************************************************* + * + * $RCSfile: c_tydef.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_tydef.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> +#include <slots.hxx> +#include "c_slots.hxx" + + + + +namespace ary +{ +namespace cpp +{ + + +Typedef::Typedef() + : // aEssentials, + nDescribingType(0), + eProtection(PROTECT_global) +{ +} + +Typedef::Typedef( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + Tid i_nDescribingType ) + : aEssentials( i_nId, + i_sLocalName, + i_nOwner, + i_nFile ), + nDescribingType(i_nDescribingType), + eProtection(i_eProtection) +{ +} + +Typedef::~Typedef() +{ + +} + +Cid +Typedef::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +Typedef::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +Typedef::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +Typedef::inq_Location() const +{ + return aEssentials.Location(); +} + +void +Typedef::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Typedef(*this); + } +} + +RCid +Typedef::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +Typedef::inq_Info() const +{ + return aEssentials.Info(); +} + +void +Typedef::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/c_vari.cxx b/autodoc/source/ary/cpp/c_vari.cxx new file mode 100644 index 000000000000..d518fa595ff2 --- /dev/null +++ b/autodoc/source/ary/cpp/c_vari.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * $RCSfile: c_vari.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/cpp/c_vari.hxx> + + +// NOT FULLY DECLARED SERVICES +#include "rcids.hxx" +#include <ary/cpp/cpp_disp.hxx> + + + + +namespace ary +{ +namespace cpp +{ + + +Variable::Variable() + : // aEssentials, + nType(0), + eProtection(PROTECT_global) + // aFlags +{ +} + +Variable::Variable( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + E_Protection i_eProtection, + Lid i_nFile, + Tid i_nType, + VariableFlags i_aFlags, + const udmstri & i_sArraySize, + const udmstri & i_sInitValue ) + : aEssentials( i_nId, + i_sLocalName, + i_nOwner, + i_nFile ), + nType(i_nType), + eProtection(i_eProtection), + aFlags(i_aFlags), + sArraySize(i_sArraySize), + sInitialisation(i_sInitValue) +{ +} + +Variable::~Variable() +{ +} + +Cid +Variable::inq_Id() const +{ + return aEssentials.Id(); +} + +const udmstri & +Variable::inq_LocalName() const +{ + return aEssentials.LocalName(); +} + +Cid +Variable::inq_Owner() const +{ + return aEssentials.Owner(); +} + +Lid +Variable::inq_Location() const +{ + return aEssentials.Location(); +} + +void +Variable::do_StoreAt( ary::Display & o_rOut ) const +{ + ary::cpp::Display * pD = dynamic_cast< ary::cpp::Display* >(&o_rOut); + if (pD != 0) + { + pD->Display_Variable(*this); + } +} + +RCid +Variable::inq_RC() const +{ + return RC_(); +} + + +const ary::Documentation & +Variable::inq_Info() const +{ + return aEssentials.Info(); +} + +void +Variable::do_Add_Documentation( DYN ary::Documentation & let_drInfo ) +{ + aEssentials.SetInfo(let_drInfo); +} + + + +} // namespace cpp +} // namespace ary + + + diff --git a/autodoc/source/ary/cpp/ca_type.cxx b/autodoc/source/ary/cpp/ca_type.cxx new file mode 100644 index 000000000000..dd6864ea4e2e --- /dev/null +++ b/autodoc/source/ary/cpp/ca_type.cxx @@ -0,0 +1,313 @@ +/************************************************************************* + * + * $RCSfile: ca_type.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:17 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/cpp/ca_type.hxx> + + +// NOT FULLY DEFINED SERVICES + + +namespace ary +{ +namespace cpp +{ + + + + +//********************** Type **************************// +Rid +Type::inq_RelatedCe() const +{ + return 0; +} + + +//********************** BuiltInType **************************// + +BuiltInType::BuiltInType( Tid i_nId, + const udmstri & i_sName, + E_TypeSpecialisation i_eSpecialisation ) + : nId( i_nId ), + sName( i_sName ), + eSpecialisation( i_eSpecialisation ) +{ +} + +Tid +BuiltInType::inq_Id_Type() const +{ + return nId; +} + +bool +BuiltInType::inq_IsConst() const +{ + return false; +} + +void +BuiltInType::inq_Get_Text( StreamStr & o_rPreName, + StreamStr & o_rName, + StreamStr & o_rPostName, + const DisplayGate & i_rGate ) const +{ + switch (eSpecialisation) + { + case TYSP_unsigned: o_rName << "unsigned "; break; + case TYSP_signed: o_rName << "signed "; break; + + // default: Does nothing. + } + o_rName << sName; +} + + +//********************** NullType **************************// + +Tid +NullType::inq_Id_Type() const +{ + return 0; +} + +bool +NullType::inq_IsConst() const +{ + return false; +} + +void +NullType::inq_Get_Text( StreamStr & o_rPreName, + StreamStr & o_rName, + StreamStr & o_rPostName, + const DisplayGate & i_rGate ) const +{ +} + + + + +#if 0 +void +NamedType::GetText( StreamStr & o_rOut, + const Gate & i_rGate ) const +{ + i_rGate.Get_QualifiedName(o_rOut, Name(), "::"); +} + + +BuiltInType::BuiltInType( const S_InitData & i_rData ) + : nId(i_rData.nId), + aName(i_rData.aName) +{ +} + +Tid +BuiltInType::IdAsType() const +{ + return nId; +} + +const QName & +BuiltInType::Name() const +{ + return aName; +} + +#if 0 +PredeclaredType::PredeclaredType( Tid i_nId, + const char * i_sName, + Cid i_nOwner ) + : nId(i_nId), + aName(i_sName,i_nOwner) +{ +} + +Tid +PredeclaredType::IdAsType() const +{ + return nId; +} + +const QName & +PredeclaredType::Name() const +{ + return aName; +} +#endif // 0 + +Tid +ReferingType::IdAsType() const +{ + return nId; +} + +Tid +ReferingType::ReferedType() const +{ + return nReferedType; +} + +ReferingType::ReferingType( Tid i_nId, + Tid i_nReferedType ) + : nId(i_nId), + nReferedType(i_nReferedType) +{ +} + +ConstType::ConstType( Tid nId, + Tid nReferedType ) + : ReferingType(nId, nReferedType) +{ +} + +void +ConstType::GetText( ostream & o_rOut, + const Gate & i_rGate ) const +{ + i_rGate.Get_TypeText(o_rOut,ReferedType()); + o_rOut << " const"; +} + +VolatileType::VolatileType( Tid nId, + Tid nReferedType ) + : ReferingType(nId, nReferedType) +{ +} + +void +VolatileType::GetText( ostream & o_rOut, + const Gate & i_rGate ) const +{ + i_rGate.Get_TypeText(o_rOut,ReferedType()); + o_rOut << " volatile"; +} + +PtrType::PtrType( Tid nId, + Tid nReferedType ) + : ReferingType(nId, nReferedType) +{ +} + +void +PtrType::GetText( ostream & o_rOut, + const Gate & i_rGate ) const +{ + i_rGate.Get_TypeText(o_rOut,ReferedType()); + o_rOut << " *"; +} + +RefType::RefType( Tid nId, + Tid nReferedType ) + : ReferingType(nId, nReferedType) +{ +} + +void +RefType::GetText( ostream & o_rOut, + const Gate & i_rGate ) const +{ + i_rGate.Get_TypeText(o_rOut,ReferedType()); + o_rOut << " &"; +} + +TemplateInstance::TemplateInstance( Tid i_nId, + Cid i_nReferedClass, + const char * i_sInstantiation ) + : nId(i_nId), + nReferedClass(i_nReferedClass), + sInstantiation(i_sInstantiation) +{ +} + +bool +TemplateInstance::operator<( const TemplateInstance & i_r ) const +{ + if ( nReferedClass < i_r.nReferedClass ) + return true; + if ( nReferedClass == i_r.nReferedClass + AND sInstantiation < i_r.sInstantiation ) + return true; + return false; +} + +Tid +TemplateInstance::IdAsType() const +{ + return nId; +} + +void +TemplateInstance::GetText( ostream & o_rOut, + const Gate & i_rGate ) const +{ + i_rGate.Get_TypeText(o_rOut,nReferedClass); + o_rOut << "< " << sInstantiation << " >"; +} +#endif // 0 + + +} // namespace cpp +} // namespace ary + diff --git a/autodoc/source/ary/cpp/makefile.mk b/autodoc/source/ary/cpp/makefile.mk new file mode 100644 index 000000000000..fba387a420a3 --- /dev/null +++ b/autodoc/source/ary/cpp/makefile.mk @@ -0,0 +1,116 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=ary_cpp + + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/c_class.obj \ + $(OBJ)$/c_define.obj \ + $(OBJ)$/c_enum.obj \ + $(OBJ)$/c_enuval.obj \ + $(OBJ)$/c_funct.obj \ + $(OBJ)$/c_gate.obj \ + $(OBJ)$/c_macro.obj \ + $(OBJ)$/c_namesp.obj \ + $(OBJ)$/c_osigna.obj \ + $(OBJ)$/c_slots.obj \ + $(OBJ)$/c_tydef.obj \ + $(OBJ)$/c_vari.obj \ + $(OBJ)$/ca_type.obj \ + $(OBJ)$/cdf_gate.obj \ + $(OBJ)$/cg_file.obj \ + $(OBJ)$/cg_gate.obj \ + $(OBJ)$/cg_proj.obj \ + $(OBJ)$/cpp_defs.obj \ + $(OBJ)$/cpp_disp.obj \ + $(OBJ)$/namechai.obj \ + $(OBJ)$/predecla.obj \ + $(OBJ)$/prpr.obj \ + $(OBJ)$/tplparam.obj \ + $(OBJ)$/usedtype.obj + + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/ary/cpp/tplparam.cxx b/autodoc/source/ary/cpp/tplparam.cxx new file mode 100644 index 000000000000..aee883a13c88 --- /dev/null +++ b/autodoc/source/ary/cpp/tplparam.cxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * $RCSfile: tplparam.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "tplparam.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cpp/c_gate.hxx> + + +namespace ary +{ +namespace cpp +{ +namespace ut +{ + +TplParameter_Type::TplParameter_Type( Tid i_nType ) + : nType(i_nType) +{ +} + +TplParameter_Type::~TplParameter_Type() +{ +} + +intt +TplParameter_Type::Compare( const TemplateParameter & i_rOther ) const +{ + const TplParameter_Type * pOther + = dynamic_cast< const TplParameter_Type* >( &i_rOther ); + if (pOther == 0) + return -1; + + return nType - pOther->nType; +} + +void +TplParameter_Type::Get_Text( StreamStr & o_rOut, + const ary::cpp::DisplayGate & i_rGate ) const +{ + i_rGate.Get_TypeText( o_rOut, nType ); +} + +TplParameter_Const::TplParameter_Const( const udmstri & i_sConst ) + : sConstant(i_sConst) +{ +} + +TplParameter_Const::~TplParameter_Const() +{ +} + +intt +TplParameter_Const::Compare( const TemplateParameter & i_rOther ) const +{ + const TplParameter_Const * pOther + = dynamic_cast< const TplParameter_Const* >( &i_rOther ); + if (pOther == 0) + return +1; + + return strcmp( sConstant.c_str(), pOther->sConstant.c_str() ); +} + +void +TplParameter_Const::Get_Text( StreamStr & o_rOut, + const ary::cpp::DisplayGate & i_rGate ) const +{ + o_rOut << sConstant; +} + + + +} // namespace ut +} // namespace cpp +} // namespace ary + + diff --git a/autodoc/source/ary/cpp/tplparam.hxx b/autodoc/source/ary/cpp/tplparam.hxx new file mode 100644 index 000000000000..e58f60d4f9c2 --- /dev/null +++ b/autodoc/source/ary/cpp/tplparam.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * $RCSfile: tplparam.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_TPLPARAM_HXX +#define ARY_CPP_TPLPARAM_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> + + + +namespace ary +{ +namespace cpp +{ + class UsedType; + class DisplayGate; + +namespace ut +{ + +class TemplateParameter +{ + public: + virtual ~TemplateParameter() {} + + virtual intt Compare( + const TemplateParameter & + i_rOther ) const = 0; + virtual void Get_Text( + StreamStr & o_rOut, + const ary::cpp::DisplayGate & + i_rGate ) const = 0; +}; + + +class TplParameter_Type : public TemplateParameter +{ + public: + TplParameter_Type( + Tid i_nType ); + ~TplParameter_Type(); + + virtual intt Compare( + const TemplateParameter & + i_rOther ) const; + virtual void Get_Text( + StreamStr & o_rOut, + const ary::cpp::DisplayGate & + i_rGate ) const; + private: + Tid nType; +}; + +class TplParameter_Const : public TemplateParameter +{ + public: + TplParameter_Const( + const udmstri & i_sConst ); + ~TplParameter_Const(); + + virtual intt Compare( + const TemplateParameter & + i_rOther ) const; + virtual void Get_Text( + StreamStr & o_rOut, + const ary::cpp::DisplayGate & + i_rGate ) const; + private: + udmstri sConstant; +}; + +} // namespace ut +} // namespace cpp +} // namespace ary + + + +#endif + diff --git a/autodoc/source/ary/cpp/usedtype.cxx b/autodoc/source/ary/cpp/usedtype.cxx new file mode 100644 index 000000000000..2b684bf101b6 --- /dev/null +++ b/autodoc/source/ary/cpp/usedtype.cxx @@ -0,0 +1,602 @@ +/************************************************************************* + * + * $RCSfile: usedtype.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/cpp/usedtype.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/ce.hxx> +#include <ary/cpp/c_etypes.hxx> +#include <cpp/c_gate.hxx> +#include <instlist.hxx> +#include "namechai.hxx" +#include "tplparam.hxx" + + + +namespace ary +{ +namespace cpp +{ + +typedef std::vector< ary::cpp::E_ConVol > PtrLevelVector; + +struct UsedType::CheshireCat +{ + + ut::NameChain aPath; + PtrLevelVector aPtrLevels; + ary::cpp::E_ConVol eConVol_Type; + bool bIsReference; + bool bIsAbsolute; + bool bRefers2BuiltInType; + E_TypeSpecialisation + eTypeSpecialisation; + Tid nId; + Rid nRelatedCe; + + // Operations + uintt PtrLevel() const { return uintt(aPtrLevels.size()); } + + CheshireCat(); +}; + + + +UsedType:: +CheshireCat::CheshireCat() + : // aPath, + // aPtrLevels, + eConVol_Type(CONVOL_none), + bIsReference(false), + bIsAbsolute(false), + bRefers2BuiltInType(false), + eTypeSpecialisation(TYSP_none), + nId(0), + nRelatedCe(0) +{ +} + +UsedType::UsedType() + : pi(new CheshireCat) +{ +} + +UsedType::~UsedType() +{ +} + +namespace +{ + +inline bool +result2bool( intt i_nResult ) + { return i_nResult < 0; } + +intt compare_PtrLevelVector( + const PtrLevelVector & + i_r1, + const PtrLevelVector & + i_r2 ); +inline intt +compare_ConVol( E_ConVol i_e1, + E_ConVol i_e2 ) + { return intt(i_e1) - intt(i_e2); } + +inline intt +compare_bool( bool i_b1, + bool i_b2 ) + { return i_b1 == i_b2 + ? 0 + : NOT i_b1 + ? -1 + : +1; } +inline intt +compare_Specialisation( E_TypeSpecialisation i_e1, + E_TypeSpecialisation i_e2 ) + { return intt(i_e1) - intt(i_e2); } + +inline bool +is_const( E_ConVol i_eCV ) + { return ( intt(i_eCV) & intt(CONVOL_const) ) != 0; } + +inline bool +is_volatile( E_ConVol i_eCV ) + { return ( intt(i_eCV) & intt(CONVOL_volatile) ) != 0; } + + +intt +compare_PtrLevelVector( const PtrLevelVector & i_r1, + const PtrLevelVector & i_r2 ) +{ + intt nResult = i_r1.size() - i_r2.size(); + if ( nResult != 0 ) + return nResult; + + PtrLevelVector::const_iterator it1 = i_r1.begin(); + PtrLevelVector::const_iterator it1End = i_r1.end(); + PtrLevelVector::const_iterator it2 = i_r2.begin(); + + for ( ; it1 != it1End; ++it1, ++it2 ) + { + nResult = compare_ConVol(*it1, *it2); + if ( nResult != 0 ) + return nResult; + } + + return 0; +} + +} // anonymous namespace + +bool +UsedType::operator<( const UsedType & i_rType ) const +{ + intt nResult = pi->aPath.Compare( i_rType.pi->aPath ); + if ( nResult != 0 ) + return result2bool(nResult); + + nResult = compare_ConVol( pi->eConVol_Type, i_rType.pi->eConVol_Type ); + if ( nResult != 0 ) + return result2bool(nResult); + + nResult = compare_PtrLevelVector( pi->aPtrLevels, i_rType.pi->aPtrLevels ); + if ( nResult != 0 ) + return result2bool(nResult); + + nResult = compare_bool( pi->bIsReference, i_rType.pi->bIsReference ); + if ( nResult != 0 ) + return result2bool(nResult); + + nResult = compare_bool( pi->bIsAbsolute, i_rType.pi->bIsAbsolute ); + if ( nResult != 0 ) + return result2bool(nResult); + + nResult = compare_Specialisation( pi->eTypeSpecialisation, i_rType.pi->eTypeSpecialisation ); + if ( nResult != 0 ) + return result2bool(nResult); + + return false; +} + +void +UsedType::Set_Id( Tid i_nId ) +{ + pi->nId = i_nId; +} + +void +UsedType::Set_Absolute() +{ + pi->bIsAbsolute = true; +} + +void +UsedType::Add_NameSegment( const char * i_sSeg ) +{ + pi->aPath.Add_Segment(i_sSeg); +} + +ut::List_TplParameter & +UsedType::Enter_Template() +{ + return pi->aPath.Templatize_LastSegment(); +} + +void +UsedType::LeaveTemplate() +{ +} + +void +UsedType::Set_Unsigned() +{ + pi->eTypeSpecialisation = TYSP_unsigned; +} + +void +UsedType::Set_Signed() +{ + pi->eTypeSpecialisation = TYSP_signed; +} + +void +UsedType::Set_BuiltIn( const char * i_sType ) +{ + pi->aPath.Add_Segment(i_sType); + pi->bRefers2BuiltInType = true; +} + +void +UsedType::Set_Const() +{ + if (pi->PtrLevel() == 0) + pi->eConVol_Type = E_ConVol(pi->eConVol_Type | CONVOL_const); + else + pi->aPtrLevels.back() = E_ConVol(pi->aPtrLevels.back() | CONVOL_const); +} + +void +UsedType::Set_Volatile() +{ + if (pi->PtrLevel() == 0) + pi->eConVol_Type = E_ConVol(pi->eConVol_Type | CONVOL_volatile); + else + pi->aPtrLevels.back() = E_ConVol(pi->aPtrLevels.back() | CONVOL_volatile); +} + +void +UsedType::Add_PtrLevel() +{ + pi->aPtrLevels.push_back(CONVOL_none); +} + +void +UsedType::Set_Reference() +{ + pi->bIsReference = true; +} + +Rid +UsedType::Connect2Ce( const Gate & i_rGate ) +{ + Rid ret = 0; + const InstanceList & + rInstances = i_rGate.Search_TypeName( LocalName() ); + if ( rInstances.empty() ) + return 0; + + uintt nMatchCounter = 0; + for ( InstanceList::const_iterator it = rInstances.begin(); + it != rInstances.end() AND nMatchCounter < 2; + ++it ) + { + if ( DoesMatch_Ce(*it, i_rGate) ) + { + ret = *it; + nMatchCounter++; + } + } // end for + if ( nMatchCounter == 1 ) + { + pi->nRelatedCe = ret; + return ret; + } + if ( nMatchCounter > 1 ) + { +#if 0 // Only for debugging, yet. + Cerr() << "Warning: Type " + << LocalName() + << " found more than one time." + << Endl(); +#endif // 0 + pi->nRelatedCe = ret; + return ret; + } + + return 0; +} + +bool +UsedType::IsBuiltInType() const +{ + return pi->bRefers2BuiltInType + AND pi->aPtrLevels.size() == 0 + AND NOT pi->bIsReference + AND pi->eConVol_Type == ary::cpp::CONVOL_none; +} + +const udmstri & +UsedType::LocalName() const +{ + return pi->aPath.LastSegment(); +} + +E_TypeSpecialisation +UsedType::TypeSpecialisation() const +{ + return pi->eTypeSpecialisation; +} + +Rid +UsedType::inq_RelatedCe() const +{ + return pi->nRelatedCe; +} + + +Tid +UsedType::inq_Id_Type() const +{ + return pi->nId; +} + +bool +UsedType::inq_IsConst() const +{ + if ( is_const(pi->eConVol_Type) ) + return true; + for ( PtrLevelVector::const_iterator it = pi->aPtrLevels.begin(); + it != pi->aPtrLevels.end(); + ++it ) + { + if ( is_const(*it) ) + return true; + } + + return false; +} + +void +UsedType::inq_Get_Text( StreamStr & o_rPreName, + StreamStr & o_rName, + StreamStr & o_rPostName, + const DisplayGate & i_rGate ) const +{ + if ( is_const(pi->eConVol_Type) ) + o_rPreName << "const "; + if ( is_volatile(pi->eConVol_Type) ) + o_rPreName << "volatile "; + if ( pi->bIsAbsolute ) + o_rPreName << "::"; + + pi->aPath.Get_Text( o_rPreName, o_rName, o_rPostName, i_rGate ); + + for ( PtrLevelVector::const_iterator it = pi->aPtrLevels.begin(); + it != pi->aPtrLevels.end(); + ++it ) + { + o_rPostName << " *"; + if ( is_const(*it) ) + o_rPostName << " const"; + if ( is_volatile(*it) ) + o_rPostName << " volatile"; + } + if ( pi->bIsReference ) + o_rPostName << " &"; +} + + +namespace +{ + +class NameScope_const_iterator +{ + public: + NameScope_const_iterator( + Rid i_nId, + const Gate & i_rGate ); + + operator bool() const { return pCe != 0; } + const udmstri & operator*() const; + + void go_up(); + + private: + const CodeEntity * pCe; + const Gate * pGate; +}; + + +NameScope_const_iterator::NameScope_const_iterator( Rid i_nId, + const Gate & i_rGate ) + : pCe(i_rGate.Find_Ce(i_nId)), + pGate(&i_rGate) +{ +} + +const udmstri & +NameScope_const_iterator::operator*() const +{ + return pCe ? pCe->LocalName() + : udmstri::Null_(); +} + +void +NameScope_const_iterator::go_up() +{ + if (pCe == 0) + return; + pCe = pGate->Find_Ce(pCe->Owner()); + + if (pCe != 0 ? pCe->Owner() == 0 : false) + pCe = 0; // Global namespace provides no scope name. +} + + + +} // anonymous namespace + + + +bool +UsedType::DoesMatch_Ce( Rid i_nId, + const Gate & i_rGate ) const +{ + NameScope_const_iterator + itScope( i_nId, i_rGate ); + ut::NameChain::const_iterator + itPath = pi->aPath.end(); + if ( itPath == pi->aPath.begin() ) + return false; + itPath--; + if (itPath == pi->aPath.begin()) + { + if ( NOT pi->bIsAbsolute ) + return true; + itScope.go_up(); + return NOT itScope; + } + + for ( itScope.go_up(), --itPath; + itScope ; + itScope.go_up(), --itPath ) + { + if ( (*itPath).Name() != *itScope ) + return false; + if ( itPath == pi->aPath.begin() ) + { + if ( NOT pi->bIsAbsolute ) + return true; + itScope.go_up(); + return NOT itScope; + } + } + return false; +} + + + + + +namespace ut +{ + +List_TplParameter::List_TplParameter() +// : aTplParameters +{ +} + +List_TplParameter::~List_TplParameter() +{ + csv::erase_container_of_heap_ptrs(aTplParameters); +} + +void +List_TplParameter::AddParam_Type( Tid i_nType ) +{ + aTplParameters.push_back( new TplParameter_Type(i_nType) ); +} + +void +List_TplParameter::AddParam_Constant( const udmstri & i_sConst ) +{ + aTplParameters.push_back( new TplParameter_Const(i_sConst) ); +} + +List_TplParameter::const_iterator +List_TplParameter::Begin() const +{ + return aTplParameters.begin(); +} + +List_TplParameter::const_iterator +List_TplParameter::End() const +{ + return aTplParameters.end(); +} + +void +List_TplParameter::Get_Text( StreamStr & o_rOut, + const ary::cpp::DisplayGate & i_rGate ) const +{ + Vector_TplArgument::const_iterator it = aTplParameters.begin(); + Vector_TplArgument::const_iterator itEnd = aTplParameters.end(); + + if ( it == itEnd ) + { + o_rOut << "<>"; + return; + } + + o_rOut << "< "; + + (*it)->Get_Text( o_rOut, i_rGate ); + + for ( ++it; it != itEnd; ++it ) + { + o_rOut << ", "; + (*it)->Get_Text( o_rOut, i_rGate ); + } + + o_rOut << " >"; +} + +intt +List_TplParameter::Compare( const List_TplParameter & i_rOther ) const +{ + intt nResult = intt(aTplParameters.size()) - intt(i_rOther.aTplParameters.size()); + + if (nResult != 0) + return nResult; + + Vector_TplArgument::const_iterator it1 = aTplParameters.begin(); + Vector_TplArgument::const_iterator it1End = aTplParameters.end(); + Vector_TplArgument::const_iterator it2 = i_rOther.aTplParameters.begin(); + + for ( ; it1 != it1End; ++it1, ++it2 ) + { + nResult = (*it1)->Compare( *(*it2) ); + if (nResult != 0) + return nResult; + } + + return 0; +} + + +} // namespace ut +} // namespace cpp +} // namespace ary + diff --git a/autodoc/source/ary/inc/instlist.hxx b/autodoc/source/ary/inc/instlist.hxx new file mode 100644 index 000000000000..2e88516012fa --- /dev/null +++ b/autodoc/source/ary/inc/instlist.hxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * $RCSfile: instlist.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_INSTLIST_HXX +#define ARY_INSTLIST_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <ary/ids.hxx> + // PARAMETERS + + +namespace ary +{ + +class InstanceList : public std::vector< ary::Rid > +{ + public: + InstanceList(); + ~InstanceList(); +}; + + +// IMPLEMENTATION + + +} // namespace ary + + +#endif + diff --git a/autodoc/source/ary/inc/nametree.hxx b/autodoc/source/ary/inc/nametree.hxx new file mode 100644 index 000000000000..0fb76629c3ca --- /dev/null +++ b/autodoc/source/ary/inc/nametree.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: nametree.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_NAMETREE_HXX +#define ARY_NAMETREE_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <ary/ids.hxx> +#include "instlist.hxx" + // PARAMETERS + + +namespace ary +{ + + +class NameTree +{ + public: + struct Less_Name + { + bool operator()( + const udmstri & i_r1, + const udmstri & i_r2 ) const; + }; + typedef std::map< udmstri, + InstanceList, + Less_Name > Map_Name2Inst; + + typedef Map_Name2Inst::const_iterator const_iterator; + typedef Map_Name2Inst::iterator iterator; + + + NameTree(); + ~NameTree(); + + const InstanceList & + operator[]( + const udmstri & i_rName ) const; + + void insert( + const udmstri & i_rName, + ary::Rid i_nId ); + + const_iterator find( + const udmstri & i_rName ); + const_iterator lower_bound( + const udmstri & i_rName ) const; + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + + private: + // DATA + Map_Name2Inst aNames; +}; + + + +// IMPLEMENTATION + + +} // namespace ary + + +#endif + diff --git a/autodoc/source/ary/inc/reposy.hxx b/autodoc/source/ary/inc/reposy.hxx new file mode 100644 index 000000000000..acd4c724e18f --- /dev/null +++ b/autodoc/source/ary/inc/reposy.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: reposy.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_REPOSY_HXX +#define ARY_REPOSY_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ary.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ + + +/** @task +*/ + +class RepositoryCenter : public Repository +{ + public: + // LIFECYCLE + RepositoryCenter( + const udmstri & i_sName, + DYN IdGenerator & let_drIds ); + virtual ~RepositoryCenter(); + + + private: + // Interface Repository: + virtual const cpp::DisplayGate & + inq_DisplayGate_Cpp() const; + virtual const udmstri & + inq_Name() const; + virtual cpp::RwGate & + access_RwGate_Cpp(); + virtual uidl::Gate & + access_RwGate_Idl(); + + struct CheshireCat; + + // DATA + Dyn<CheshireCat> pi; +}; + + +} // namespace ary + +#endif + + diff --git a/autodoc/source/ary/inc/slots.hxx b/autodoc/source/ary/inc/slots.hxx new file mode 100644 index 000000000000..00dca8e70e0a --- /dev/null +++ b/autodoc/source/ary/inc/slots.hxx @@ -0,0 +1,217 @@ +/************************************************************************* + * + * $RCSfile: slots.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_SLOTS_HXX +#define ARY_SLOTS_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/ceslot.hxx> + // COMPONENTS +#include <ary/opertype.hxx> + // PARAMETERS +#include <ary/idlists.hxx> + + + +namespace ary +{ + + +class Slot_Null : public Slot +{ + public: + virtual ~Slot_Null(); + + virtual void StoreAt( + Display & o_rDestination ) const; + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; +}; + + +class Slot_RidSet : public Slot +{ + public: + Slot_RidSet( + const Set_Rid & i_rData ); + virtual ~Slot_RidSet(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const Set_Rid * pData; +}; + +class Slot_LidSet : public Slot +{ + public: + Slot_LidSet( + const Set_Lid & i_rData ); + virtual ~Slot_LidSet(); + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const Set_Lid * pData; +}; + +class Slot_MapLocalCe : public Slot +{ + public: + Slot_MapLocalCe( + const Map_LocalCe & i_rData ); + virtual ~Slot_MapLocalCe(); + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const Map_LocalCe * pData; +}; + +class Slot_OperationSet : public Slot +{ + public: + Slot_OperationSet( + const Set_LocalOperation & + i_rData ); + virtual ~Slot_OperationSet(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const Set_LocalOperation * + pData; +}; + +class Slot_RidList : public Slot +{ + public: + Slot_RidList( + const List_Rid & i_rData ); + virtual ~Slot_RidList(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const List_Rid * pData; +}; + +class Slot_ListLocalCe : public Slot +{ + public: + Slot_ListLocalCe( + const List_LocalCe& i_rData ); + virtual ~Slot_ListLocalCe(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const List_LocalCe* pData; +}; + +class Slot_OperationList : public Slot +{ + public: + Slot_OperationList( + const List_LocalOperation & + i_rData ); + virtual ~Slot_OperationList(); + + virtual uintt Size() const; + + private: + virtual void StoreEntries( + Display & o_rDestination ) const; + // DATA + const List_LocalOperation * + pData; +}; + + + +} // namespace ary + + +#endif + + + diff --git a/autodoc/source/ary/info/all_dts.cxx b/autodoc/source/ary/info/all_dts.cxx new file mode 100644 index 000000000000..dfde6295a78f --- /dev/null +++ b/autodoc/source/ary/info/all_dts.cxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * $RCSfile: all_dts.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/info/all_dts.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/info/infodisp.hxx> + + +namespace ary +{ +namespace info +{ + + +void +DT_Text::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_DT_Text(*this); +} + +bool +DT_Text::inq_IsWhite() const +{ + return false; +} + +void +DT_MaybeLink::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_DT_MaybeLink(*this); +} + +bool +DT_MaybeLink::inq_IsWhite() const +{ + return false; +} + +void +DT_Whitespace::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_DT_Whitespace(*this); +} + +bool +DT_Whitespace::inq_IsWhite() const +{ + return true; +} + +void +DT_Eol::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_DT_Eol(*this); +} + +bool +DT_Eol::inq_IsWhite() const +{ + return true; +} + +void +DT_Xml::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_DT_Xml(*this); +} + +bool +DT_Xml::inq_IsWhite() const +{ + return false; +} + + +} // namespace info +} // namespace ary + diff --git a/autodoc/source/ary/info/all_tags.cxx b/autodoc/source/ary/info/all_tags.cxx new file mode 100644 index 000000000000..06e017313fcf --- /dev/null +++ b/autodoc/source/ary/info/all_tags.cxx @@ -0,0 +1,539 @@ +/************************************************************************* + * + * $RCSfile: all_tags.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/info/all_tags.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/info/infodisp.hxx> + + +namespace ary +{ +namespace info +{ + + + +//***************************** StdTag ***********************// + + +StdTag::StdTag( E_AtTagId i_eId ) + : eId(i_eId), + // aText, + pNext(0) +{ +} + +bool +StdTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + // Does nothing + + // KORR + // Should be a logical exception: + // csv_assert(false); + return false; +} + +UINT8 +StdTag::NrOfSpecialMeaningTokens() const +{ + return 0; +} + +AtTag * +StdTag::GetFollower() +{ + if (pNext != 0) + return pNext->GetFollower(); + pNext = new StdTag(eId); + return pNext; +} + +void +StdTag::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_StdTag( *this ); +} + +DocuText * +StdTag::Text() +{ + return &aText; +} + + + +//***************************** BaseTag ***********************// + +BaseTag::BaseTag() + : // sBase + // aText + pNext(0) +{ +} + +bool +BaseTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + if ( i_nNr == 1 ) + { + sBase.AssignText(i_sText,"::"); + return true; + } + return false; +} + +const char * +BaseTag::Title() const +{ + return "Base Classes"; +} + +UINT8 +BaseTag::NrOfSpecialMeaningTokens() const +{ + return 1; +} + +AtTag * +BaseTag::GetFollower() +{ + if (pNext != 0) + return pNext->GetFollower(); + pNext = new BaseTag; + return pNext; +} + +DocuText * +BaseTag::Text() +{ + return &aText; +} + + + +//***************************** ExceptionTag ***********************// + +ExceptionTag::ExceptionTag() + : // sException, + // aText + pNext(0) +{ +} + +bool +ExceptionTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + if ( i_nNr == 1 ) + { + sException.AssignText(i_sText,"::"); + return true; + } + return false; +} + +const char * +ExceptionTag::Title() const +{ + return "Thrown Exceptions"; +} + +UINT8 +ExceptionTag::NrOfSpecialMeaningTokens() const +{ + return 1; +} + +AtTag * +ExceptionTag::GetFollower() +{ + if (pNext != 0) + return pNext->GetFollower(); + pNext = new ExceptionTag; + return pNext; +} + +DocuText * +ExceptionTag::Text() +{ + return &aText; +} + + +//***************************** ImplementsTag ***********************// + +ImplementsTag::ImplementsTag() + : // sBase + // aText + pNext(0) +{ +} + +bool +ImplementsTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + if ( i_nNr == 1 ) + { + sName.AssignText(i_sText,"::"); + } + else + { + GetFollower()->Add_SpecialMeaningToken(i_sText,1); + } + return true; +} + +const char * +ImplementsTag::Title() const +{ + return "Implements"; +} + +UINT8 +ImplementsTag::NrOfSpecialMeaningTokens() const +{ + return UINT8(-1); +} + +AtTag * +ImplementsTag::GetFollower() +{ + if (pNext != 0) + return pNext->GetFollower(); + pNext = new ImplementsTag; + return pNext; +} + +DocuText * +ImplementsTag::Text() +{ + return 0; +} + + +//***************************** KeywordTag ***********************// + + +KeywordTag::KeywordTag() +// : sKeys +{ +} + +bool +KeywordTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + sKeys.push_back(i_sText); + return true; +} + +const char * +KeywordTag::Title() const +{ + return "Keywords"; +} + +UINT8 +KeywordTag::NrOfSpecialMeaningTokens() const +{ + return UINT8(-1); +} + +AtTag * +KeywordTag::GetFollower() +{ + return this; +} + +DocuText * +KeywordTag::Text() +{ + return 0; +} + + + +//***************************** ParameterTag ***********************// + + +ParameterTag::ParameterTag() + : // sName + // aText + pNext(0) +{ +} + +bool +ParameterTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + if ( i_nNr == 1 ) + { + sName = i_sText; + return true; + } + else if (i_nNr == 2) + { + uintt nLen = strlen(i_sText); + if (*i_sText == '[' AND i_sText[nLen-1] == ']') + { + sValidRange = udmstri(i_sText+1, nLen-2); + return true; + } + } + return false; +} + +UINT8 +ParameterTag::NrOfSpecialMeaningTokens() const +{ + return 2; +} + +AtTag * +ParameterTag::GetFollower() +{ + if (pNext != 0) + return pNext->GetFollower(); + return pNext = new ParameterTag; +} + +DocuText * +ParameterTag::Text() +{ + return &aText; +} + +void +ParameterTag::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_ParameterTag( *this ); +} + + + +//***************************** SeeTag ***********************// + + + +SeeTag::SeeTag() +// : sReferences +{ +} + +bool +SeeTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + static QualifiedName aNull_; + sReferences.push_back(aNull_); + sReferences.back().AssignText(i_sText,"::"); + + return true; +} + +const char * +SeeTag::Title() const +{ + return "See Also"; +} + +UINT8 +SeeTag::NrOfSpecialMeaningTokens() const +{ + return UINT8(-1); +} + +AtTag * +SeeTag::GetFollower() +{ + return this; +} + +void +SeeTag::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_SeeTag( *this ); +} + +DocuText * +SeeTag::Text() +{ + return 0; +} + + + +//***************************** TemplateTag ***********************// + + +TemplateTag::TemplateTag() + : // sName + // aText + pNext(0) +{ +} + +bool +TemplateTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + if ( i_nNr == 1 ) + { + sName = i_sText; + return true; + } + return false; +} + +const char * +TemplateTag::Title() const +{ + return "Template Parameters"; +} + +UINT8 +TemplateTag::NrOfSpecialMeaningTokens() const +{ + return 1; +} + +AtTag * +TemplateTag::GetFollower() +{ + if (pNext != 0) + return pNext->GetFollower(); + return pNext = new TemplateTag; +} + +void +TemplateTag::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + o_rDisplay.Display_TemplateTag( *this ); +} + + +DocuText * +TemplateTag::Text() +{ + return &aText; +} + + +//***************************** LabelTag ***********************// + + + +LabelTag::LabelTag() +// : sLabel +{ +} + +bool +LabelTag::Add_SpecialMeaningToken( const char * i_sText, + intt i_nNr ) +{ + if ( i_nNr == 1 AND sLabel.length() == 0 ) + { + sLabel = i_sText; + return true; + } + // KORR_FUTURE +// else // Throw exception because of double label. + return false; +} + +const char * +LabelTag::Title() const +{ + return "Label"; +} + +UINT8 +LabelTag::NrOfSpecialMeaningTokens() const +{ + return 1; +} + +AtTag * +LabelTag::GetFollower() +{ + return this; +} + +DocuText * +LabelTag::Text() +{ + return 0; +} + + +} // namespace info +} // namespace ary + diff --git a/autodoc/source/ary/info/ci_attag.cxx b/autodoc/source/ary/info/ci_attag.cxx new file mode 100644 index 000000000000..c6253895ff55 --- /dev/null +++ b/autodoc/source/ary/info/ci_attag.cxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * $RCSfile: ci_attag.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/info/ci_attag.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/info/all_dts.hxx> +#include <ary/info/ci_text.hxx> + + +namespace ary +{ +namespace info +{ + +void +AtTag::Set_HtmlUseInDocuText( bool i_bUseIt ) +{ + DocuText * pText = Text(); + if ( pText != 0 ) + pText->Set_HtmlUse(i_bUseIt); +} + +void +AtTag::Add_Token( const char * i_sText ) +{ + DocuText * pText = Text(); + if (pText != 0) + pText->Add_Token( *new DT_Text(i_sText) ); +} + +void +AtTag::Add_PotentialLink( const char * i_sText, + bool i_bIsGlobal, + bool i_bIsFunction ) +{ + DocuText * pText = Text(); + if (pText != 0) + pText->Add_Token( *new DT_MaybeLink(i_sText, i_bIsGlobal, i_bIsFunction) ); +} + +void +AtTag::Add_Whitespace( UINT8 i_nLength ) +{ + DocuText * pText = Text(); + if (pText != 0) + pText->Add_Token( *new DT_Whitespace(i_nLength) ); +} + +void +AtTag::Add_Eol() +{ + DocuText * pText = Text(); + if (pText != 0) + pText->Add_Token( *new DT_Eol ); +} + +void +AtTag::do_StoreAt( DocuDisplay & o_rDisplay ) const +{ + // Dummy +} + +} // namespace info +} // namespace ary + + diff --git a/autodoc/source/ary/info/ci_text.cxx b/autodoc/source/ary/info/ci_text.cxx new file mode 100644 index 000000000000..70ea3a5e26c7 --- /dev/null +++ b/autodoc/source/ary/info/ci_text.cxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * $RCSfile: ci_text.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/info/ci_text.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/info/all_dts.hxx> + + +namespace ary +{ +namespace info +{ + +DocuText::DocuText() + : bUsesHtml(false) +{ +} + +DocuText::~DocuText() +{ + for ( TokenList::iterator iter = aTokens.begin(); + iter != aTokens.end(); + ++iter ) + { + delete (*iter); + } +} + +void +DocuText::StoreAt( DocuDisplay & o_rDisplay ) const +{ + ary::info::DocuText::TokenList::const_iterator itEnd = aTokens.end(); + for ( ary::info::DocuText::TokenList::const_iterator it = aTokens.begin(); + it != itEnd; + ++it ) + { + (*it)->StoreAt(o_rDisplay); + } +} + +} // namespace info +} // namespace ary + + diff --git a/autodoc/source/ary/info/makefile.mk b/autodoc/source/ary/info/makefile.mk new file mode 100644 index 000000000000..458a477e9237 --- /dev/null +++ b/autodoc/source/ary/info/makefile.mk @@ -0,0 +1,97 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=ary_info + + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/all_dts.obj \ + $(OBJ)$/all_tags.obj \ + $(OBJ)$/ci_attag.obj \ + $(OBJ)$/ci_text.obj \ + $(OBJ)$/codeinfo.obj \ + $(OBJ)$/infodisp.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/ary/kernel/ary_disp.cxx b/autodoc/source/ary/kernel/ary_disp.cxx new file mode 100644 index 000000000000..7fb2df76f567 --- /dev/null +++ b/autodoc/source/ary/kernel/ary_disp.cxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * $RCSfile: ary_disp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/ary_disp.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary/re.hxx> +#include <ary/r_disply.hxx> + + + +namespace ary +{ + +void +Display::DisplaySlot_Rid( ary::Rid i_nId ) +{ + const DisplayGate * pGate = Get_ReFinder(); + if (pGate != 0) + { + const RepositoryEntity * pRE = pGate->Find_Re( i_nId ); + if (pRE != 0) + { + pRE->StoreAt( *this ); + return; + } + } + + do_DisplaySlot_Rid( i_nId ); +} + + +void +Display::DisplaySlot_LocalCe( ary::Rid i_nId, + const udmstri & i_sName ) +{ + const DisplayGate * pGate = Get_ReFinder(); + if (pGate != 0) + { + const RepositoryEntity * pRE = pGate->Find_Re( i_nId ); + if (pRE != 0) + { + pRE->StoreAt( *this ); + return; + } + } + + do_DisplaySlot_LocalCe( i_nId, i_sName ); +} + + + +// Dummy implementations for class Display + +void +Display::do_StartSlot() +{ +} + +void +Display::do_FinishSlot() +{ +} + +void +Display::do_DisplaySlot_Rid( ary::Rid ) +{ +} + +void +Display::do_DisplaySlot_Lid( ary::Lid i_nId ) +{ +} + +void +Display::do_DisplaySlot_LocalCe( ary::Rid i_nId, + const udmstri & i_sName ) +{ +} + +const DisplayGate * +Display::inq_Get_ReFinder() const +{ + return 0; +} + + + +} // namespace ary + + diff --git a/autodoc/source/ary/kernel/cessentl.cxx b/autodoc/source/ary/kernel/cessentl.cxx new file mode 100644 index 000000000000..c7ca060b35bc --- /dev/null +++ b/autodoc/source/ary/kernel/cessentl.cxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * $RCSfile: cessentl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/cessentl.hxx> + + +// NOT FULLY DEFINED SERVICES + +namespace ary { + + +CeEssentials::CeEssentials() + : nId(0), + // sLocalName, + nOwner(0), + nLocation(0), + pInfo(0) +{ +} + +CeEssentials::CeEssentials( Cid i_nId, + const udmstri & i_sLocalName, + Cid i_nOwner, + Lid i_nLocation ) + : nId(i_nId), + sLocalName(i_sLocalName), + nOwner(i_nOwner), + nLocation(i_nLocation), + pInfo(0) +{ +} + +CeEssentials::~CeEssentials() +{ +} + + +} // namespace ary + + + diff --git a/autodoc/source/ary/kernel/instlist.cxx b/autodoc/source/ary/kernel/instlist.cxx new file mode 100644 index 000000000000..659513d32534 --- /dev/null +++ b/autodoc/source/ary/kernel/instlist.cxx @@ -0,0 +1,86 @@ +/************************************************************************* + * + * $RCSfile: instlist.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <instlist.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <instlist.hxx> + + + +namespace ary +{ + +InstanceList::InstanceList() +{ +} + +InstanceList::~InstanceList() +{ +} + + +} // namespace ary + + + diff --git a/autodoc/source/ary/kernel/makefile.mk b/autodoc/source/ary/kernel/makefile.mk new file mode 100644 index 000000000000..5ff48f90d73f --- /dev/null +++ b/autodoc/source/ary/kernel/makefile.mk @@ -0,0 +1,103 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:19 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=ary_kernel + + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/ary_disp.obj \ + $(OBJ)$/ce_null.obj \ + $(OBJ)$/cessentl.obj \ + $(OBJ)$/id_gener.obj \ + $(OBJ)$/instlist.obj \ + $(OBJ)$/nametree.obj \ + $(OBJ)$/opertype.obj \ + $(OBJ)$/project.obj \ + $(OBJ)$/quname.obj \ + $(OBJ)$/reposy.obj \ + $(OBJ)$/slots.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/ary/kernel/nametree.cxx b/autodoc/source/ary/kernel/nametree.cxx new file mode 100644 index 000000000000..2c8cc602ff29 --- /dev/null +++ b/autodoc/source/ary/kernel/nametree.cxx @@ -0,0 +1,186 @@ +/************************************************************************* + * + * $RCSfile: nametree.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <nametree.hxx> + + +// NOT FULLY DECLARED SERVICES + + + +namespace ary +{ + + +/** Lexigraphical sequence is: AaBbCc ... Zz_0123456789. +*/ +int cCompareValues[128] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, 0, 0, + + 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, + 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 0, 0, 0, 0, 53, + + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, + 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 0, 0, 0, 0 +}; + + +bool +NameTree:: +Less_Name::operator()( const udmstri & i_r1, + const udmstri & i_r2 ) const +{ + const unsigned char * + p1 = reinterpret_cast< const unsigned char* >( i_r1.c_str() ); + const unsigned char * + p2 = reinterpret_cast< const unsigned char* >( i_r2.c_str() ); + int cp = 0; + + do { + cp = cCompareValues[*p1] - cCompareValues[*p2++]; + if ( cp < 0 ) + return true; + if ( cp > 0 ) + return false; + } while (*p1++ != 0); + + return false; +} + + +NameTree::NameTree() +{ +} + +NameTree::~NameTree() +{ +} + +const InstanceList & +NameTree::operator[]( const udmstri & i_rName ) const +{ + static InstanceList aNull_; + + const_iterator itFound = aNames.find(i_rName); + if ( itFound != aNames.end() ) + return (*itFound).second; + return aNull_; +} + +void +NameTree::insert( const udmstri & i_rName, + ary::Rid i_nId ) +{ + + + aNames[i_rName].push_back(i_nId); +} + +NameTree::const_iterator +NameTree::find( const udmstri & i_rName ) +{ + return aNames.find( i_rName ); +} + +NameTree::const_iterator +NameTree::lower_bound( const udmstri & i_rName ) const +{ + return aNames.lower_bound(i_rName); +} + +NameTree::const_iterator +NameTree::begin() const +{ + return aNames.begin(); +} + +NameTree::const_iterator +NameTree::end() const +{ + return aNames.end(); +} + +NameTree::iterator +NameTree::begin() +{ + return aNames.begin(); +} + +NameTree::iterator +NameTree::end() +{ + return aNames.end(); +} + + + + + + +} // namespace ary + + + diff --git a/autodoc/source/ary/kernel/reposy.cxx b/autodoc/source/ary/kernel/reposy.cxx new file mode 100644 index 000000000000..8f6070212114 --- /dev/null +++ b/autodoc/source/ary/kernel/reposy.cxx @@ -0,0 +1,198 @@ +/************************************************************************* + * + * $RCSfile: reposy.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <reposy.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <store/storage.hxx> +#include <store/strg_ifc.hxx> +#include <id_gener.hxx> +#include <cpp/c_gate.hxx> +#include <loc/l_gate.hxx> +#include <store/storage.hxx> +#include "../../ary_i/inc/uidl/gate_i.hxx" + + + +namespace ary +{ + +namespace +{ + static Dyn<RepositoryCenter> pTheInstance_(0); +} + +struct RepositoryCenter::CheshireCat +{ + // DATA + udmstri sName; + Dyn<store::Storage> pStorage; + Dyn<Storage_Ifc> pStorage_Ifc; + Dyn<IdGenerator> pIdGenerator; + + Dyn<cpp::Gate> pGate_Cpp; + Dyn<uidl::Gate_Impl> + pGate_Idl; + Dyn<loc::Gate> pGate_Locations; + + CheshireCat( + const udmstri & i_sName, + DYN IdGenerator & let_drIds ); + ~CheshireCat(); +}; + + +Repository & +Repository::Create_( const udmstri & i_sName, + DYN IdGenerator * let_dpIds ) +{ + csv_assert( NOT pTheInstance_ ); + + DYN IdGenerator * dpIds = + let_dpIds != 0 + ? let_dpIds + : new Std_IdGenerator; + pTheInstance_ = new RepositoryCenter( i_sName, *dpIds ); + return *pTheInstance_; +} + +Repository & +Repository::The_() +{ + csv_assert( pTheInstance_ ); + return *pTheInstance_; +} + +void +Repository::Destroy_() +{ + pTheInstance_ = 0; +} + +RepositoryCenter::RepositoryCenter( const udmstri & i_sName, + DYN IdGenerator & let_drIds ) + : pi( new CheshireCat(i_sName, let_drIds) ) +{ +} + +RepositoryCenter::~RepositoryCenter() +{ +} + +const cpp::DisplayGate & +RepositoryCenter::inq_DisplayGate_Cpp() const +{ + return *pi->pGate_Cpp; +} + +const udmstri & +RepositoryCenter::inq_Name() const +{ + return pi->sName; +} + +cpp::RwGate & +RepositoryCenter::access_RwGate_Cpp() +{ + return *pi->pGate_Cpp; +} + +uidl::Gate & +RepositoryCenter::access_RwGate_Idl() +{ + return *pi->pGate_Idl; +} + + +RepositoryCenter:: +CheshireCat::CheshireCat( const udmstri & i_sName, + DYN IdGenerator & let_drIds ) + : sName(i_sName), + pStorage(0), + pStorage_Ifc(0), + pIdGenerator( &let_drIds ), + pGate_Cpp(0), + pGate_Idl(0), + pGate_Locations(0) +{ + pStorage = new store::Storage; + pStorage_Ifc = new Storage_Ifc( *pStorage ); + pGate_Locations = new loc::Gate( + pStorage_Ifc->Ifc_Locations(), + *pIdGenerator ); + pGate_Cpp = new cpp::Gate( + *pStorage_Ifc, + *pIdGenerator, + *pGate_Locations ); + pGate_Idl = new uidl::Gate_Impl; +} + +RepositoryCenter:: +CheshireCat::~CheshireCat() +{ +} + + +} // namespace ary + + diff --git a/autodoc/source/ary/kernel/slots.cxx b/autodoc/source/ary/kernel/slots.cxx new file mode 100644 index 000000000000..a166bbbfffc8 --- /dev/null +++ b/autodoc/source/ary/kernel/slots.cxx @@ -0,0 +1,325 @@ +/************************************************************************* + * + * $RCSfile: slots.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <slots.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/ary_disp.hxx> + + + +namespace ary +{ + + +//*********************** Slot ********************// + + +void +Slot::StoreAt( Display & o_rDestination ) const +{ + o_rDestination.StartSlot(); + StoreEntries(o_rDestination); + o_rDestination.FinishSlot(); +} + + +//*********************** Slot_Null ********************// + +Slot_Null::~Slot_Null() +{ +} + +void +Slot_Null::StoreAt( Display & ) const +{ + // Does nothing +} + +uintt +Slot_Null::Size() const +{ + return 0; +} + +void +Slot_Null::StoreEntries( Display & ) const +{ + // Does nothing +} + + +//*********************** Slot_RidSet ********************// + +Slot_RidSet::Slot_RidSet( const Set_Rid & i_rData ) + : pData(&i_rData) +{ +} + +Slot_RidSet::~Slot_RidSet() +{ +} + +uintt +Slot_RidSet::Size() const +{ + return pData->size();; +} + +void +Slot_RidSet::StoreEntries( Display & o_rDestination ) const +{ + for ( Set_Rid::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_Rid( *it ); + } +} + + + +//*********************** Slot_LidSet ********************// + +Slot_LidSet::Slot_LidSet( const Set_Lid & i_rData ) + : pData(&i_rData) +{ +} + +Slot_LidSet::~Slot_LidSet() +{ +} + +uintt +Slot_LidSet::Size() const +{ + return pData->size();; +} + +void +Slot_LidSet::StoreEntries( Display & o_rDestination ) const +{ + for ( Set_Lid::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_Lid( *it ); + } +} + +//*********************** Slot_MapLocalCe ********************// + +Slot_MapLocalCe::Slot_MapLocalCe( const Map_LocalCe & i_rData ) + : pData(&i_rData) +{ +} + +Slot_MapLocalCe::~Slot_MapLocalCe() +{ +} + +uintt +Slot_MapLocalCe::Size() const +{ + return pData->size();; +} + +void +Slot_MapLocalCe::StoreEntries( Display & o_rDestination ) const +{ + for ( Map_LocalCe::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_LocalCe( (*it).second, (*it).first ); + } +} + + + +//*********************** Slot_OperationSet ********************// + +Slot_OperationSet::Slot_OperationSet( const Set_LocalOperation & i_rData ) + : pData(&i_rData) +{ +} + +Slot_OperationSet::~Slot_OperationSet() +{ +} + +uintt +Slot_OperationSet::Size() const +{ + return pData->size();; +} + +void +Slot_OperationSet::StoreEntries( Display & o_rDestination ) const +{ + for ( Set_LocalOperation::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_Rid( (*it).nId ); + } +} + + + +//*********************** Slot_RidList ********************// + +Slot_RidList::Slot_RidList( const List_Rid & i_rData ) + : pData(&i_rData) +{ +} + +Slot_RidList::~Slot_RidList() +{ +} + +uintt +Slot_RidList::Size() const +{ + return pData->size();; +} + +void +Slot_RidList::StoreEntries( Display & o_rDestination ) const +{ + for ( List_Rid::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_Rid( *it ); + } +} + + + +//*********************** Slot_ListLocalCe ********************// + +Slot_ListLocalCe::Slot_ListLocalCe( const List_LocalCe & i_rData ) + : pData(&i_rData) +{ +} + +Slot_ListLocalCe::~Slot_ListLocalCe() +{ +} + +uintt +Slot_ListLocalCe::Size() const +{ + return pData->size();; +} + +void +Slot_ListLocalCe::StoreEntries( Display & o_rDestination ) const +{ + for ( List_LocalCe::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_LocalCe( (*it).nId, (*it).sLocalName ); + } +} + + + +//*********************** Slot_OperationList ********************// + +Slot_OperationList::Slot_OperationList( const List_LocalOperation & i_rData ) + : pData(&i_rData) +{ +} + +Slot_OperationList::~Slot_OperationList() +{ +} + +uintt +Slot_OperationList::Size() const +{ + return pData->size();; +} + +void +Slot_OperationList::StoreEntries( Display & o_rDestination ) const +{ + for ( List_LocalOperation::const_iterator it = pData->begin(); + it != pData->end(); + ++it ) + { + o_rDestination.DisplaySlot_Rid( (*it).nId ); + } +} + + + + +} // namespace ary + + + diff --git a/autodoc/source/ary/loc/loc_dir.cxx b/autodoc/source/ary/loc/loc_dir.cxx new file mode 100644 index 000000000000..ddc8b833cd10 --- /dev/null +++ b/autodoc/source/ary/loc/loc_dir.cxx @@ -0,0 +1,110 @@ +/************************************************************************* + * + * $RCSfile: loc_dir.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/loc/loc_dir.hxx> + + +// NOT FULLY DEFINED SERVICES + + +namespace ary +{ +namespace loc +{ + + +void +Directory::Add_ChildDir( const udmstri & i_sName, + Lid i_nId ) +{ + aChildDirs[i_sName] = i_nId; +} + +void +Directory::Add_File( const udmstri & i_sName, + Lid i_nId ) +{ + aFiles[i_sName] = i_nId; +} + +Directory::Directory( Lid i_nId ) + : // aChildDirs, + // aFiles, + nId( i_nId ) +{ +} + +SubDirectory::SubDirectory( Lid i_nId, + const udmstri & i_sName, + Lid i_nParentDirectory ) + : Directory(i_nId), + sName(i_sName), + nParentDirectory(i_nParentDirectory) +{ +} + + + +} // namespace loc +} // namespace ary + diff --git a/autodoc/source/ary/loc/loc_file.cxx b/autodoc/source/ary/loc/loc_file.cxx new file mode 100644 index 000000000000..b6e54add556c --- /dev/null +++ b/autodoc/source/ary/loc/loc_file.cxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: loc_file.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/loc/loc_file.hxx> + + +// NOT FULLY DEFINED SERVICES + + + +namespace ary +{ +namespace loc +{ + + +SourceCodeFile::SourceCodeFile( Lid i_nId, + Lid i_nRoot, + Lid i_nDirectory, + const udmstri & i_sName ) + : nId(i_nId), + nRoot(i_nRoot), + nDirectory(i_nDirectory), + sName(i_sName) +{ +} + + +} // namespace loc +} // namespace ary + diff --git a/autodoc/source/ary/loc/loc_root.cxx b/autodoc/source/ary/loc/loc_root.cxx new file mode 100644 index 000000000000..195e2cd6114f --- /dev/null +++ b/autodoc/source/ary/loc/loc_root.cxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * $RCSfile: loc_root.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary/loc/loc_root.hxx> + + +// NOT FULLY DEFINED SERVICES + + +namespace ary +{ +namespace loc +{ + + +LocationRoot::LocationRoot( Lid i_nId, + const csv::ploc::Path & i_rRootDirectoryPath ) + : Directory(i_nId), + aRootDirectoryPath(i_rRootDirectoryPath) +{ +} + + + +} // namespace loc +} // namespace ary + diff --git a/autodoc/source/ary/loc/makefile.mk b/autodoc/source/ary/loc/makefile.mk new file mode 100644 index 000000000000..ee292a36d934 --- /dev/null +++ b/autodoc/source/ary/loc/makefile.mk @@ -0,0 +1,96 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:20 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=ary_loc + + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/l_gate.obj \ + $(OBJ)$/loc_dir.obj \ + $(OBJ)$/loc_file.obj \ + $(OBJ)$/loc_root.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/ary_i/kernel/ci_atag2.cxx b/autodoc/source/ary_i/kernel/ci_atag2.cxx new file mode 100644 index 000000000000..4767112656f7 --- /dev/null +++ b/autodoc/source/ary_i/kernel/ci_atag2.cxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * $RCSfile: ci_atag2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:21 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary_i/ci_atag2.hxx> + + +// NOT FULLY DEFINED SERVICES + + + diff --git a/autodoc/source/ary_i/kernel/ci_text2.cxx b/autodoc/source/ary_i/kernel/ci_text2.cxx new file mode 100644 index 000000000000..d052a65bc002 --- /dev/null +++ b/autodoc/source/ary_i/kernel/ci_text2.cxx @@ -0,0 +1,126 @@ +/************************************************************************* + * + * $RCSfile: ci_text2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:21 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <ary_i/ci_text2.hxx> + + +// NOT FULLY DEFINED SERVICES + + +namespace ary +{ +namespace info +{ + +DocuTex2::DocuTex2() +{ +} + +DocuTex2::~DocuTex2() +{ + for ( TokenList::iterator iter = aTokens.begin(); + iter != aTokens.end(); + ++iter ) + { + delete (*iter); + } +} + +void +DocuTex2::DisplayAt( DocumentationDisplay & o_rDisplay ) const +{ + for ( ary::info::DocuTex2::TokenList::const_iterator + iter = aTokens.begin(); + iter != aTokens.end(); + ++iter ) + { + (*iter)->DisplayAt(o_rDisplay); + } +} + +bool +DocuTex2::IsEmpty() const +{ + if ( aTokens.size() == 0 ) + return true; + + return false; + +/* + bool bIsWhite = true; + for ( TokenIterator it = rText.begin(); + it != rText.end(); + ++it ) + { + if (bIsWhite) + bIsWhite = (*it)->IsWhite(); + } + if (bIsWhite) + return; +*/ +} + + +} // namespace info +} // namespace ary + diff --git a/autodoc/source/ary_i/kernel/makefile.mk b/autodoc/source/ary_i/kernel/makefile.mk new file mode 100644 index 000000000000..c1dcd78ec968 --- /dev/null +++ b/autodoc/source/ary_i/kernel/makefile.mk @@ -0,0 +1,95 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:21 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=ary2_kernel + + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/ci_atag2.obj \ + $(OBJ)$/ci_text2.obj \ + $(OBJ)$/codeinf2.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/display/html/aryattrs.cxx b/autodoc/source/display/html/aryattrs.cxx new file mode 100644 index 000000000000..9db898370fcb --- /dev/null +++ b/autodoc/source/display/html/aryattrs.cxx @@ -0,0 +1,307 @@ +/************************************************************************* + * + * $RCSfile: aryattrs.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "aryattrs.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/info/codeinfo.hxx> +#include "strconst.hxx" + + + +//******************** HtmlDisplay_Impl *********************// + + + +const char * +Get_ClassTypeKey( const ary::cpp::Class & i_rClass ) +{ + return i_rClass.ClassKey() == ary::cpp::CK_class + ? C_sHFTypeTitle_Class + : i_rClass.ClassKey() == ary::cpp::CK_struct + ? C_sHFTypeTitle_Struct + : C_sHFTypeTitle_Union; + +} + +const char * +Get_TypeKey( const ary::CodeEntity & i_rCe ) +{ + if ( i_rCe.RC() == ary::cpp::Class::RC_() ) + { + csv_assert( dynamic_cast< const ary::cpp::Class* >(&i_rCe) != 0 ); + return Get_ClassTypeKey( + static_cast< const ary::cpp::Class& >(i_rCe) ); + } + if ( i_rCe.RC() == ary::cpp::Enum::RC_() ) + { + return "enum"; + } + return ""; +} + +bool +Ce_IsInternal( const ary::CodeEntity & i_rCe ) +{ + return static_cast< const ary::info::CodeInfo& >(i_rCe.Info()).IsInternal(); +} + +const char * +Namespace_DisplayName( const ary::cpp::Namespace & i_rNsp ) +{ + return i_rNsp.Depth() > 0 + ? i_rNsp.LocalName().c_str() + : "GlobalNamespace of C++"; +} + +const char * +TypeText( ary::Tid i_nId, + const ary::cpp::DisplayGate & i_rAryGate ) +{ + static StreamStr sResult(2000); + sResult.seekp(0); + i_rAryGate.Get_TypeText(sResult, i_nId); + + return sResult.c_str(); +} + +const char * +SyntaxText_PreName( const ary::cpp::Function & i_rFunction, + const ary::cpp::DisplayGate & i_rAryGate ) +{ + static StreamStr sResult( 150 ); + sResult.seekp(0); + + // write pre-name: + const ary::cpp::FunctionFlags & rFlags = i_rFunction.Flags(); + if ( rFlags.IsStaticLocal() OR rFlags.IsStaticMember() ) + sResult << "static "; + if ( rFlags.IsExplicit() ) + sResult << "explicit "; + if ( rFlags.IsMutable() ) + sResult << "mutable "; + if ( i_rFunction.Virtuality() != ary::cpp::VIRTUAL_none ) + sResult << "virtual "; + i_rAryGate.Get_TypeText( sResult, i_rFunction.ReturnType() ); + sResult << " "; + + return sResult.c_str(); +} + +const char * +SyntaxText_PostName( const ary::cpp::Function & i_rFunction, + const ary::cpp::DisplayGate & i_rAryGate ) +{ + static StreamStr sResult( 850 ); + sResult.seekp(0); + + // parameters and con_vol + i_rAryGate.Get_SignatureText( sResult, i_rFunction.Signature(), &i_rFunction.ParamInfos() ); + + // write Exceptions: + const std::vector< ary::Tid > * + pThrow = i_rFunction.Exceptions(); + if ( pThrow) + { + + std::vector< ary::Tid >::const_iterator + it = pThrow->begin(); + std::vector< ary::Tid >::const_iterator + it_end = pThrow->end(); + + if (it != it_end) + { + sResult << " throw( "; + i_rAryGate.Get_TypeText(sResult, *it); + + for ( ++it; it != it_end; ++it ) + { + sResult << ", "; + i_rAryGate.Get_TypeText(sResult, *it); + } + sResult << " )"; + } + else + { + sResult << " throw( )"; + } + } // endif // pThrow + + // abstractness: + if ( i_rFunction.Virtuality() == ary::cpp::VIRTUAL_abstract ) + sResult << " = 0"; + + // finish: + sResult << ";"; + + return sResult.c_str(); +} + +bool +Get_TypeText( const char * & o_rPreName, + const char * & o_rName, + const char * & o_rPostName, + ary::Tid i_nTypeid, + const ary::cpp::DisplayGate & i_rAryGate ) +{ + static StreamStr sResult_PreName(250); + static StreamStr sResult_Name(250); + static StreamStr sResult_PostName(250); + + sResult_PreName.seekp(0); + sResult_Name.seekp(0); + sResult_PostName.seekp(0); + + bool ret = i_rAryGate.Get_TypeText( + sResult_PreName, + sResult_Name, + sResult_PostName, + i_nTypeid ); + if ( sResult_PreName.tellp() > 0 ) + { + char cLast = *( sResult_PreName.c_str() + (sResult_PreName.tellp() - 1) ); + if (cLast != ':' AND cLast != ' ') + sResult_PreName << " "; + } + + + if (ret) + { + o_rPreName = sResult_PreName.c_str(); + o_rName = sResult_Name.c_str(); + o_rPostName = sResult_PostName.c_str(); + } + else + { + o_rPreName = o_rName = o_rPostName = ""; + } + return ret; +} + + + + +//********************* FunctionParam_Iterator *****************// + + +FunctionParam_Iterator::FunctionParam_Iterator() + : // itTypes + // itTypes_end + // itNames_andMore + // itNames_andMore_end + eConVol(ary::cpp::CONVOL_none) +{ + static std::vector<ary::Tid> aTypesNull_; + static StringVector aNamesNull_; + + itTypes = itTypes_end = aTypesNull_.end(); + itNames_andMore = itNames_andMore_end = aNamesNull_.end(); +} + +FunctionParam_Iterator::~FunctionParam_Iterator() +{ +} + +FunctionParam_Iterator & +FunctionParam_Iterator::operator++() +{ + if ( IsValid() ) + { + ++itTypes; + ++itNames_andMore; + } + return *this; +} + +void +FunctionParam_Iterator::Assign( const ary::cpp::Function & i_rFunction, + const ary::cpp::DisplayGate & i_rAryGate ) +{ + const ary::cpp::OperationSignature * + pSigna = i_rAryGate.Find_Signature( i_rFunction.Signature() ); + if (pSigna == 0 ) + return; + + const std::vector<ary::Tid> & + rTypes = pSigna->Parameters(); + const StringVector & + rNames = i_rFunction.ParamInfos(); + + if ( rTypes.size() != rNames.size() OR rTypes.size() == 0 ) + return; + + itTypes = rTypes.begin(); + itTypes_end = rTypes.end(); + itNames_andMore = rNames.begin(); + itNames_andMore_end = rNames.end(); + + eConVol = pSigna->ConVol(); +} + + diff --git a/autodoc/source/display/html/aryattrs.hxx b/autodoc/source/display/html/aryattrs.hxx new file mode 100644 index 000000000000..c6e0f8261846 --- /dev/null +++ b/autodoc/source/display/html/aryattrs.hxx @@ -0,0 +1,194 @@ +/************************************************************************* + * + * $RCSfile: aryattrs.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_ARYATTRS_HXX +#define ADC_DISPLAY_ARYATTRS_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> +#include <ary/cpp/c_etypes.hxx> + +namespace ary +{ + namespace cpp + { + class Class; + class DisplayGate; + class Function; + class Namespace; + } + class CodeEntity; +} + +const char * Get_ClassTypeKey( + const ary::cpp::Class & + i_rClass ); +const char * Get_TypeKey( + const ary::CodeEntity & + i_rCe ); +bool Ce_IsInternal( + const ary::CodeEntity & + i_rCe ); + +const char * Namespace_DisplayName( + const ary::cpp::Namespace & + i_rNsp ); + +const char * TypeText( + ary::Tid i_nId, + const ary::cpp::DisplayGate & + i_rAryGate ); + +const char * SyntaxText_PreName( + const ary::cpp::Function & + i_rFunction, + const ary::cpp::DisplayGate & + i_rAryGate ); +const char * SyntaxText_PostName( + const ary::cpp::Function & + i_rFunction, + const ary::cpp::DisplayGate & + i_rAryGate ); + +bool Get_TypeText( + const char * & o_rPreName, + const char * & o_rName, + const char * & o_rPostName, + ary::Tid i_nTypeid, + const ary::cpp::DisplayGate & + i_rAryGate ); + + + +class FunctionParam_Iterator +{ + public: + FunctionParam_Iterator(); + ~FunctionParam_Iterator(); + + operator bool() const; + FunctionParam_Iterator & + operator++(); + + void Assign( + const ary::cpp::Function & + i_rFunction, + const ary::cpp::DisplayGate & + i_rAryGate ); + + ary::Tid CurType() const; + const udmstri & CurName() const; + + bool IsFunctionConst() const; + bool IsFunctionVolatile() const; + + private: + typedef std::vector<ary::Tid>::const_iterator Type_Iterator; + typedef StringVector::const_iterator Name_Iterator; + + bool IsValid() const; + + // Forbidden + FunctionParam_Iterator & + operator++(int); + // DATA + Type_Iterator itTypes; + Type_Iterator itTypes_end; + Name_Iterator itNames_andMore; /// Name, init-value. + Name_Iterator itNames_andMore_end; + + ary::cpp::E_ConVol eConVol; +}; + +inline +FunctionParam_Iterator::operator bool() const + { return IsValid(); } + +inline bool +FunctionParam_Iterator::IsValid() const +{ + // By C'tor and Assign(), it is assured, that + // both iterators are valid, if one is valid. + return itTypes != itTypes_end; +} + +inline ary::Tid +FunctionParam_Iterator::CurType() const + { return IsValid() ? *itTypes : 0; } +inline const udmstri & +FunctionParam_Iterator::CurName() const + { return IsValid() ? *itNames_andMore : udmstri::Null_(); } +inline bool +FunctionParam_Iterator::IsFunctionConst() const + { return (eConVol & ary::cpp::CONVOL_const) != 0; } +inline bool +FunctionParam_Iterator::IsFunctionVolatile() const + { return (eConVol & ary::cpp::CONVOL_volatile) != 0; } + + +#endif + + diff --git a/autodoc/source/display/html/cfrstd.cxx b/autodoc/source/display/html/cfrstd.cxx new file mode 100644 index 000000000000..0fe24d1a01c4 --- /dev/null +++ b/autodoc/source/display/html/cfrstd.cxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * $RCSfile: cfrstd.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <html/cfrstd.hxx> + + +// NOT FULLY DEFINED SERVICES + + + +DYN Html_Image * +StdFrame::LogoSrc() const +{ + return 0; + +// return new Html_Image( "logodot-blu.gif", +// "109", +// "54", +// "RIGHT", +// "0", +// "OpenOffice" ); + +} + +const char * +StdFrame::LogoLink() const +{ + return ""; +// return "http://www.sun.com"; +// return "http://www.openoffice.org"; +} + +const char * +StdFrame::CopyrightText() const +{ + return "Copyright 2001-2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA."; +// return "Copyright 2001 OpenOffice.org Foundation. All Rights Reserved."; + +} + diff --git a/autodoc/source/display/html/chd_udk2.cxx b/autodoc/source/display/html/chd_udk2.cxx new file mode 100644 index 000000000000..34160865dace --- /dev/null +++ b/autodoc/source/display/html/chd_udk2.cxx @@ -0,0 +1,328 @@ +/************************************************************************* + * + * $RCSfile: chd_udk2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <html/chd_udk2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> + +#include <ary/ary_disp.hxx> +#include <ary/project.hxx> +#include <ary/ceslot.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/crog_grp.hxx> +#include <ary/cpp/cg_proj.hxx> +#include <ary/cpp/c_namesp.hxx> + +#include "dsply_cl.hxx" +#include "dsply_da.hxx" +#include "dsply_op.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" + + + + + +namespace +{ + + +//******************** S_ProjectListFiller ********************// +struct S_ProjectListFiller : public ary::Display +{ + public: + S_ProjectListFiller( + std::vector< const ary::cpp::ProjectGroup * > & + o_rList, + const ary::cpp::DisplayGate & + i_rAryGate ); + ~S_ProjectListFiller(); + + virtual void DisplaySlot_CppProject( + ary::Gid i_nId ); + void Fill_FromNameList( + const StringVector & + i_sNameList ); + private: + std::vector< const ary::cpp::ProjectGroup * > * + pList; + const ary::cpp::RoGate_Groups * + pGroupGate; +}; + + +S_ProjectListFiller::S_ProjectListFiller( + std::vector< const ary::cpp::ProjectGroup * > & o_rList, + const ary::cpp::DisplayGate & i_rAryGate ) + : pList(&o_rList), + pGroupGate(&i_rAryGate.RoGroups()) +{ +} + +S_ProjectListFiller::~S_ProjectListFiller() +{ +} + +void +S_ProjectListFiller::DisplaySlot_CppProject( ary::Gid i_nId ) +{ + const ary::cpp::ProjectGroup * + p = pGroupGate->Find_ProjectGroup( i_nId ); + if ( p != 0 ) + pList->push_back( p ); +} + +void +S_ProjectListFiller::Fill_FromNameList( const StringVector & i_sNameList ) +{ + for ( StringVector::const_iterator it = i_sNameList.begin(); + it != i_sNameList.end(); + ++it ) + { + const ary::cpp::ProjectGroup * p = pGroupGate->Search_ProjectGroup( *it ); + if ( p != 0 ) + pList->push_back( p ); + } // end for +} + +} // anonymus namespace + + +//******************** CppHtmlDisplay_Udk2 ********************// + + +CppHtmlDisplay_Udk2::CppHtmlDisplay_Udk2() + : pCurPageEnv(0), + // aProjectList, + bFilterByProjectList(false) +{ +} + +CppHtmlDisplay_Udk2::~CppHtmlDisplay_Udk2() +{ +} + +void +CppHtmlDisplay_Udk2::do_Run( const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & i_rAryGate, + const display::CorporateFrame & i_rLayout, + const StringVector * i_pProjectList ) +{ + SetRunData( i_sOutputDirectory, i_rAryGate, i_rLayout, i_pProjectList ); + + Create_Overview_File(); + Create_Help_File(); + Create_AllDefs_File(); + + CreateFiles_InSubTree_Projects(); + CreateFiles_InSubTree_Namespaces(); + CreateFiles_InSubTree_Index(); +} + +void +CppHtmlDisplay_Udk2::SetRunData( const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & i_rAryGate, + const display::CorporateFrame & i_rLayout, + const StringVector * i_pProjectList ) +{ + csv::ploc::Path aOutputDir( i_sOutputDirectory, true ); + + pCurPageEnv = new OuputPage_Environment( aOutputDir, i_rAryGate, i_rLayout ); + + csv::erase_container( aProjectList ); + S_ProjectListFiller aPrjGetter( aProjectList, i_rAryGate ); + + if ( i_pProjectList != 0 ) + { + aPrjGetter.Fill_FromNameList( *i_pProjectList ); + + bFilterByProjectList = true; + } + else + { + const ary::TopProject & + rTop = i_rAryGate.RoGroups().Get_TopProject(); + ary::Slot_AutoPtr + pSlot_Projects( rTop.Create_Slot(ary::TopProject::SLOT_CppLocationBases) ); + pSlot_Projects->StoreAt( aPrjGetter ); + + bFilterByProjectList = false; + } +} + +void +CppHtmlDisplay_Udk2::Create_Overview_File() +{ + PageDisplay aPageMaker( *pCurPageEnv ); + aPageMaker.Create_OverviewFile(); +} + +void +CppHtmlDisplay_Udk2::Create_Help_File() +{ + PageDisplay aPageMaker( *pCurPageEnv ); + aPageMaker.Create_HelpFile(); +} + +void +CppHtmlDisplay_Udk2::Create_AllDefs_File() +{ + PageDisplay aPageMaker( *pCurPageEnv ); + aPageMaker.Create_AllDefsFile(); +} + +void +CppHtmlDisplay_Udk2::CreateFiles_InSubTree_Projects() +{ + Cout() << "\nCreate files in subtree projects" << Endl(); + Cout() << Endl(); +} + +void +CppHtmlDisplay_Udk2::CreateFiles_InSubTree_Namespaces() +{ + Cout() << "\nCreate files in subtree namespaces" << Endl(); + + const ary::cpp::Namespace & rGlobalNsp = Gate().GlobalNamespace(); + + RecursiveDisplay_Namespace(rGlobalNsp); + Cout() << Endl(); +} + +void +CppHtmlDisplay_Udk2::CreateFiles_InSubTree_Index() +{ + Cout() << "\nCreate files in subtree index" << Endl(); + Cout() << Endl(); + + PageDisplay aPageMaker( *pCurPageEnv ); + aPageMaker.Create_IndexFiles(); +} + +void +CppHtmlDisplay_Udk2::RecursiveDisplay_Namespace( const ary::cpp::Namespace & i_rNsp ) +{ + if ( NOT CheckFilters(i_rNsp) ) + return; + + pCurPageEnv->MoveDir_Down2( i_rNsp ); + DisplayFiles_InNamespace( i_rNsp ); + + typedef std::vector< const ary::cpp::Namespace* > NspList; + NspList aSubNspList; + i_rNsp.Get_SubNamespaces( aSubNspList ); + for ( NspList::const_iterator it = aSubNspList.begin(); + it != aSubNspList.end(); + ++it ) + { + RecursiveDisplay_Namespace( *(*it) ); + } // end for + + pCurPageEnv->MoveDir_Up(); +} + +void +CppHtmlDisplay_Udk2::DisplayFiles_InNamespace( const ary::cpp::Namespace & i_rNsp ) +{ + PageDisplay aPageMaker( *pCurPageEnv ); + + ary::Slot_AutoPtr pSlot; + + // Namespace + aPageMaker.Create_NamespaceFile(); + + // Classes + ClassDisplayer aClassDisplayer( *pCurPageEnv ); + DisplaySlot( aClassDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Classes ); + + // Enums + DisplaySlot( aPageMaker, i_rNsp, ary::cpp::Namespace::SLOT_Enums ); + + // Typedefs + DisplaySlot( aPageMaker, i_rNsp, ary::cpp::Namespace::SLOT_Typedefs ); + + // Operations + OperationsDisplay aOperationsDisplayer( *pCurPageEnv ); + DisplaySlot( aOperationsDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Operations ); + aOperationsDisplayer.Create_Files(); + + // Data + DataDisplay aDataDisplayer( *pCurPageEnv ); + + aDataDisplayer.PrepareForConstants(); + DisplaySlot( aDataDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Constants ); + + aDataDisplayer.PrepareForVariables(); + DisplaySlot( aDataDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Variables ); + + aDataDisplayer.Create_Files(); +} + +const ary::cpp::DisplayGate & +CppHtmlDisplay_Udk2::Gate() const +{ + return pCurPageEnv->Gate(); +} + diff --git a/autodoc/source/display/html/cre_link.cxx b/autodoc/source/display/html/cre_link.cxx new file mode 100644 index 000000000000..5d56137102b7 --- /dev/null +++ b/autodoc/source/display/html/cre_link.cxx @@ -0,0 +1,312 @@ +/************************************************************************* + * + * $RCSfile: cre_link.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "cre_link.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_define.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/c_macro.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_vari.hxx> +#include <ary/cpp/c_enuval.hxx> +#include <ary/cpp/cg_file.hxx> +#include <ary/cpp/crog_grp.hxx> +#include "hdimpl.hxx" +#include "opageenv.hxx" +#include "strconst.hxx" + + + + + +LinkCreator::LinkCreator( char * o_rOutput, + uintt i_nOutputSize ) + : pOut(o_rOutput), + nOutMaxSize(i_nOutputSize), + pEnv(0) +{ +} + +LinkCreator::~LinkCreator() +{ +} + +void +LinkCreator::Display_Namespace( const ary::cpp::Namespace & i_rData ) +{ + Create_PrePath( i_rData ); + strcat( pOut, "index.html" ); // KORR +} + +void +LinkCreator::Display_Class( const ary::cpp::Class & i_rData ) +{ + Create_PrePath( i_rData ); + strcat( pOut, ClassFileName(i_rData.LocalName().c_str()) ); +} + +void +LinkCreator::Display_Enum( const ary::cpp::Enum & i_rData ) +{ + Create_PrePath( i_rData ); + strcat( pOut, EnumFileName(i_rData.LocalName().c_str()) ); +} + +void +LinkCreator::Display_Typedef( const ary::cpp::Typedef & i_rData ) +{ + Create_PrePath( i_rData ); + strcat( pOut, TypedefFileName(i_rData.LocalName().c_str()) ); +} + +void +LinkCreator::Display_Function( const ary::cpp::Function & i_rData ) +{ + Create_PrePath( i_rData ); + + if ( i_rData.Protection() != ary::cpp::PROTECT_global ) + { + strcat( pOut, "o.html" ); + } + else + { + const ary::cpp::FileGroup * + pFile = pEnv->Gate().RoGroups().Search_FileGroup(i_rData.Location()); + if ( pFile == 0 ) + { + *pOut = NULCH; + return; + } + strcat( pOut, HtmlFileName("o-", pFile->FileName().c_str()) ); + } + + strcat( pOut, OperationLink(i_rData.LocalName(), i_rData.Signature()) ); +} + +void +LinkCreator::Display_Variable( const ary::cpp::Variable & i_rData ) +{ + Create_PrePath( i_rData ); + + if ( i_rData.Protection() != ary::cpp::PROTECT_global ) + { + strcat( pOut, "d.html" ); + } + else + { + const ary::cpp::FileGroup * + pFile = pEnv->Gate().RoGroups().Search_FileGroup(i_rData.Location()); + if ( pFile == 0 ) + { + *pOut = NULCH; + return; + } + strcat( pOut, HtmlFileName("d-", pFile->FileName().c_str()) ); + } + + strcat( pOut, DataLink(i_rData.LocalName()) ); +} + +void +LinkCreator::Display_EnumValue( const ary::cpp::EnumValue & i_rData ) +{ + const ary::CodeEntity * + pEnum = pEnv->Gate().Find_Ce(i_rData.Owner()); + if (pEnum == 0) + return; + + pEnum->StoreAt(*this); + strcat(pOut, "#"); + strcat(pOut, i_rData.LocalName().c_str()); +} + +void +LinkCreator::Display_Define( const ary::cpp::Define & i_rData ) +{ + // KORR + // Only valid from Index: + + *pOut = '\0'; + strcat(pOut, "../def-all.html#"); + strcat(pOut, i_rData.DefinedName().c_str()); +} + +void +LinkCreator::Display_Macro( const ary::cpp::Macro & i_rData ) +{ + // KORR + // Only valid from Index: + + *pOut = '\0'; + strcat(pOut, "../def-all.html#"); + strcat(pOut, i_rData.DefinedName().c_str()); +} + + +namespace +{ + +class NameScope_const_iterator +{ + public: + NameScope_const_iterator( + ary::Rid i_nId, + const ary::cpp::DisplayGate & + i_rGate ); + + operator bool() const { return pCe != 0; } + const udmstri & operator*() const; + + void go_up(); + + private: + const ary::CodeEntity * + pCe; + const ary::cpp::DisplayGate * + pGate; +}; + + +NameScope_const_iterator::NameScope_const_iterator( + ary::Rid i_nId, + const ary::cpp::DisplayGate & i_rGate ) + : pCe(i_rGate.Find_Ce(i_nId)), + pGate(&i_rGate) +{ +} + +const udmstri & +NameScope_const_iterator::operator*() const +{ + return pCe ? pCe->LocalName() + : udmstri::Null_(); +} + +void +NameScope_const_iterator::go_up() +{ + if (pCe == 0) + return; + pCe = pGate->Find_Ce(pCe->Owner()); +} + + +void Recursive_CreatePath( + char * o_pOut, + const NameScope_const_iterator & + i_it ); + +void +Recursive_CreatePath( char * o_pOut, + const NameScope_const_iterator & i_it ) +{ + if (NOT i_it) + return; + + NameScope_const_iterator it( i_it ); + it.go_up(); + if (NOT it) + return; // Global Namespace + Recursive_CreatePath( o_pOut, it ); + + strcat( o_pOut, (*i_it).c_str() ); + strcat( o_pOut, "/" ); +} + + +} // anonymous namespace + + + + + +void +LinkCreator::Create_PrePath( const ary::CodeEntity & i_rData ) +{ + *pOut = NULCH; + + if ( pEnv->CurNamespace() != 0 ) + { + if ( pEnv->CurClass() + ? pEnv->CurClass()->Id() == i_rData.Owner() + : pEnv->CurNamespace()->Id() == i_rData.Owner() ) + return; + + strcat( pOut, PathUp(pEnv->Depth() - 1) ); + } + else + { // Within Index + strcat( pOut, "../names/" ); + } + + NameScope_const_iterator it( i_rData.Owner(), pEnv->Gate() ); + Recursive_CreatePath( pOut, it ); +} + + diff --git a/autodoc/source/display/html/cre_link.hxx b/autodoc/source/display/html/cre_link.hxx new file mode 100644 index 000000000000..70119d8f637c --- /dev/null +++ b/autodoc/source/display/html/cre_link.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: cre_link.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_CRE_LINK_HXX +#define ADC_DISPLAY_CRE_LINK_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ + class CodeEntity; +} + + +class OuputPage_Environment; + +class LinkCreator : public ary::cpp::Display +{ + public: + LinkCreator( + char * o_rOutput, + uintt i_nOutputSize ); + ~LinkCreator(); + + + void SetEnv( + const OuputPage_Environment & + i_rEnv ); + + virtual void Display_Namespace( + const ary::cpp::Namespace & + i_rData ); + virtual void Display_Class( + const ary::cpp::Class & + i_rData ); + virtual void Display_Enum( + const ary::cpp::Enum & + i_rData ); + virtual void Display_Typedef( + const ary::cpp::Typedef & + i_rData ); + virtual void Display_Function( + const ary::cpp::Function & + i_rData ); + virtual void Display_Variable( + const ary::cpp::Variable & + i_rData ); + virtual void Display_EnumValue( + const ary::cpp::EnumValue & + i_rData ); + + virtual void Display_Define( + const ary::cpp::Define & + i_rData ); + virtual void Display_Macro( + const ary::cpp::Macro & + i_rData ); + + private: + void Create_PrePath( + const ary::CodeEntity & + i_rData ); + + // DATA + char * pOut; + uintt nOutMaxSize; + const OuputPage_Environment * + pEnv; +}; + + +// IMPLEMENTATION + +inline void +LinkCreator::SetEnv( const OuputPage_Environment & i_rEnv ) + { pEnv = &i_rEnv; } + + + + +#endif + diff --git a/autodoc/source/display/html/dsply_cl.cxx b/autodoc/source/display/html/dsply_cl.cxx new file mode 100644 index 000000000000..df8437ddaea3 --- /dev/null +++ b/autodoc/source/display/html/dsply_cl.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: dsply_cl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "dsply_cl.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_class.hxx> +#include "dsply_da.hxx" +#include "dsply_op.hxx" +#include "hdimpl.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" + + + + +ClassDisplayer::ClassDisplayer( OuputPage_Environment & io_rEnv ) + : pEnv(&io_rEnv) +{ +} + +ClassDisplayer::~ClassDisplayer() +{ +} + +void +ClassDisplayer::Display_Class( const ary::cpp::Class & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + PageDisplay aPageMaker( Env() ); + aPageMaker.Display_Class(i_rData); + + Env().MoveDir_Down2( i_rData ); + DisplayFiles_InClass( i_rData, aPageMaker ); + Env().MoveDir_Up(); +} + +void +ClassDisplayer::DisplayFiles_InClass( const ary::cpp::Class & i_rData, + PageDisplay & io_rPageMaker ) +{ + // Classes + ClassDisplayer aClassDisplayer( Env() ); + DisplaySlot( aClassDisplayer, i_rData, ary::cpp::Class::SLOT_NestedClasses ); + + // Enums + DisplaySlot( io_rPageMaker, i_rData, ary::cpp::Class::SLOT_Enums ); + + // Typedefs + DisplaySlot( io_rPageMaker, i_rData, ary::cpp::Class::SLOT_Typedefs ); + + // Operations + OperationsDisplay aOperationsDisplayer( Env() ); + + aOperationsDisplayer.PrepareForStdMembers(); + DisplaySlot( aOperationsDisplayer, i_rData, ary::cpp::Class::SLOT_Operations ); + + aOperationsDisplayer.PrepareForStaticMembers(); + DisplaySlot( aOperationsDisplayer, i_rData, ary::cpp::Class::SLOT_StaticOperations ); + + aOperationsDisplayer.Create_Files(); + + // Data + DataDisplay aDataDisplayer( Env() ); + + aDataDisplayer.PrepareForStdMembers(); + DisplaySlot( aDataDisplayer, i_rData, ary::cpp::Class::SLOT_Data ); + + aDataDisplayer.PrepareForStaticMembers(); + DisplaySlot( aDataDisplayer, i_rData, ary::cpp::Class::SLOT_StaticData ); + + aDataDisplayer.Create_Files(); +} + +const ary::DisplayGate * +ClassDisplayer::inq_Get_ReFinder() const +{ + return & pEnv->Gate(); +} + + diff --git a/autodoc/source/display/html/dsply_cl.hxx b/autodoc/source/display/html/dsply_cl.hxx new file mode 100644 index 000000000000..aebc2a175ea0 --- /dev/null +++ b/autodoc/source/display/html/dsply_cl.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: dsply_cl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_HD_PAGE_HXX +#define ADC_DISPLAY_HTML_HD_PAGE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/ary_disp.hxx> +#include <ary/cpp/cpp_disp.hxx> + // COMPONENTS + // PARAMETERS +#include <ary/idlists.hxx> + + + +class OuputPage_Environment; + +namespace ary +{ + namespace cpp + { + class Class; + } +} + + +class PageDisplay; + +class ClassDisplayer : public ary::cpp::Display +{ + public: + ClassDisplayer( // TODO + OuputPage_Environment & + io_rEnv ); + virtual ~ClassDisplayer(); + + virtual void Display_Class( + const ary::cpp::Class & + i_rData ); + private: + // Interface ary::cpp::Display: + virtual const ary::DisplayGate * + inq_Get_ReFinder() const; + + // Locals + void DisplayFiles_InClass( + const ary::cpp::Class & + i_rData, + PageDisplay & io_rPageMaker ); + + OuputPage_Environment & + Env() { return *pEnv; } + + // DATA + OuputPage_Environment * + pEnv; +}; + + + +#endif + diff --git a/autodoc/source/display/html/dsply_da.cxx b/autodoc/source/display/html/dsply_da.cxx new file mode 100644 index 000000000000..627014f89beb --- /dev/null +++ b/autodoc/source/display/html/dsply_da.cxx @@ -0,0 +1,235 @@ +/************************************************************************* + * + * $RCSfile: dsply_da.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "dsply_da.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/crog_grp.hxx> +#include <ary/cpp/c_vari.hxx> +#include <udm/html/htmlitem.hxx> +#include "hd_docu.hxx" +#include "hdimpl.hxx" +#include "html_kit.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" + + +using namespace csi; + + + +DataDisplay::DataDisplay( OuputPage_Environment & io_rEnv ) + : // aMap_GlobalDataDisplay, + // pClassMembersDisplay, + pEnv( &io_rEnv ), + pDocuShow( new Docu_Display(io_rEnv) ) +{ +} + +DataDisplay::~DataDisplay() +{ + csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay ); +} + +void +DataDisplay::Display_Variable( const ary::cpp::Variable & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + PageDisplay & rPage = FindPage_for( i_rData ); + + csi::xml::Element & rOut = rPage.CurOut(); + Display_SglDatum( rOut, i_rData ); +} + +void +DataDisplay::PrepareForConstants() +{ + if (pClassMembersDisplay) + pClassMembersDisplay = 0; + + csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay ); +} + +void +DataDisplay::PrepareForVariables() +{ + // Doesn't need to do anything yet. +} + +void +DataDisplay::PrepareForStdMembers() +{ + csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay ); + + pClassMembersDisplay = new PageDisplay(*pEnv); + const ary::cpp::Class * pClass = pEnv->CurClass(); + csv_assert( pClass != 0 ); + pClassMembersDisplay->Setup_DataFile_for(*pClass); +} + +void +DataDisplay::PrepareForStaticMembers() +{ + // Doesn't need to do anything yet. +} + +void +DataDisplay::Create_Files() +{ + if (pClassMembersDisplay) + { + pClassMembersDisplay->Create_File(); + pClassMembersDisplay = 0; + } + else + { + for ( Map_FileId2PagePtr::const_iterator it = aMap_GlobalDataDisplay.begin(); + it != aMap_GlobalDataDisplay.end(); + ++it ) + { + (*it).second->Create_File(); + } + csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay ); + } +} + +const ary::DisplayGate * +DataDisplay::inq_Get_ReFinder() const +{ + return & pEnv->Gate(); +} + +PageDisplay & +DataDisplay::FindPage_for( const ary::cpp::Variable & i_rData ) +{ + if ( pClassMembersDisplay ) + return *pClassMembersDisplay; + + SourceFileId + nSourceFile = i_rData.Location(); + PageDisplay * + pFound = csv::value_from_map( aMap_GlobalDataDisplay, nSourceFile ); + if ( pFound == 0 ) + { + pFound = new PageDisplay( *pEnv ); + const ary::cpp::FileGroup * + pFgr = pEnv->Gate().RoGroups().Search_FileGroup( nSourceFile ); + csv_assert( pFgr != 0 ); + pFound->Setup_DataFile_for( *pFgr ); + aMap_GlobalDataDisplay[nSourceFile] = pFound; + } + + return *pFound; +} + +void +DataDisplay::Display_SglDatum( csi::xml::Element & rOut, + const ary::cpp::Variable & i_rData ) +{ + adcdisp::ExplanationList aDocu(rOut, true); + aDocu.AddEntry( 0 ); + + aDocu.Term() + >> *new html::Label( DataLabel(i_rData.LocalName()) ) + << " "; + aDocu.Term() + << i_rData.LocalName(); + + dshelp::Get_LinkedTypeText( aDocu.Def(), *pEnv, i_rData.Type() ); + aDocu.Def() + << " " + >> *new html::Strong + << i_rData.LocalName(); + if ( i_rData.ArraySize().length() > 0 ) + { + aDocu.Def() + << "[" + << i_rData.ArraySize() + << "]"; + } + if ( i_rData.Initialisation().length() > 0 ) + { + aDocu.Def() + << " = " + << i_rData.Initialisation(); + } + aDocu.Def() + << ";" + << new html::LineBreak + << new html::LineBreak; + + aDocu.AddEntry_NoTerm(); + + pDocuShow->Assign_Out( aDocu.Def() ); + i_rData.Info().StoreAt( *pDocuShow ); + pDocuShow->Unassign_Out(); + + rOut << new html::HorizontalLine; +} + + diff --git a/autodoc/source/display/html/dsply_da.hxx b/autodoc/source/display/html/dsply_da.hxx new file mode 100644 index 000000000000..bef69613d30c --- /dev/null +++ b/autodoc/source/display/html/dsply_da.hxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * $RCSfile: dsply_da.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_DSPLY_DA_HXX +#define ADC_DISPLAY_HTML_DSPLY_DA_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + namespace cpp + { + class Variable; + } +} +namespace csi +{ + namespace xml + { + class Element; + } +} + + +class OuputPage_Environment; +class PageDisplay; +class Docu_Display; + +class DataDisplay : public ary::cpp::Display +{ + public: + DataDisplay( + OuputPage_Environment & + io_rInfo ); + virtual ~DataDisplay(); + + virtual void Display_Variable( + const ary::cpp::Variable & + i_rData ); + void PrepareForConstants(); + void PrepareForVariables(); + void PrepareForStdMembers(); + void PrepareForStaticMembers(); + + void Create_Files(); + + private: + // Interface ary::cpp::Display: + virtual const ary::DisplayGate * + inq_Get_ReFinder() const; + + // Locals + typedef ary::Lid SourceFileId; + typedef std::map< SourceFileId, DYN PageDisplay* > Map_FileId2PagePtr; + + PageDisplay & FindPage_for( + const ary::cpp::Variable & + i_rData ); + void Display_SglDatum( + csi::xml::Element & rOut, + const ary::cpp::Variable & + i_rData ); + // DATA + Map_FileId2PagePtr aMap_GlobalDataDisplay; + Dyn<PageDisplay> pClassMembersDisplay; + + OuputPage_Environment * + pEnv; + Dyn<Docu_Display> pDocuShow; +}; + + + +#endif + diff --git a/autodoc/source/display/html/dsply_op.cxx b/autodoc/source/display/html/dsply_op.cxx new file mode 100644 index 000000000000..bd0759e27186 --- /dev/null +++ b/autodoc/source/display/html/dsply_op.cxx @@ -0,0 +1,251 @@ +/************************************************************************* + * + * $RCSfile: dsply_op.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "dsply_op.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/crog_grp.hxx> +#include <ary/cpp/c_funct.hxx> +#include <udm/html/htmlitem.hxx> +#include "hd_docu.hxx" +#include "hdimpl.hxx" +#include "html_kit.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" + + + +using namespace csi; +using namespace adcdisp; + + + +OperationsDisplay::OperationsDisplay( OuputPage_Environment & io_rEnv ) + : // aMap_GlobalFunctionsDisplay, + // pClassMembersDisplay, + pEnv( &io_rEnv ), + pDocuShow( new Docu_Display(io_rEnv) ) +{ +} + +OperationsDisplay::~OperationsDisplay() +{ + csv::erase_map_of_heap_ptrs( aMap_GlobalFunctionsDisplay ); +} + +void +OperationsDisplay::Display_Function( const ary::cpp::Function & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + PageDisplay & rPage = FindPage_for( i_rData ); + + csi::xml::Element & rOut = rPage.CurOut(); + Display_SglOperation( rOut, i_rData ); +} + +void +OperationsDisplay::PrepareForGlobals() +{ + if (pClassMembersDisplay) + pClassMembersDisplay = 0; + + csv::erase_map_of_heap_ptrs( aMap_GlobalFunctionsDisplay ); +} + +void +OperationsDisplay::PrepareForStdMembers() +{ + csv::erase_map_of_heap_ptrs( aMap_GlobalFunctionsDisplay ); + + pClassMembersDisplay = new PageDisplay(*pEnv); + const ary::cpp::Class * pClass = pEnv->CurClass(); + csv_assert( pClass != 0 ); + pClassMembersDisplay->Setup_OperationsFile_for(*pClass); +} + +void +OperationsDisplay::PrepareForStaticMembers() +{ + // Doesn't need to do anything yet. +} + +void +OperationsDisplay::Create_Files() +{ + if (pClassMembersDisplay) + pClassMembersDisplay->Create_File(); + else + { + for ( Map_FileId2PagePtr::const_iterator it = aMap_GlobalFunctionsDisplay.begin(); + it != aMap_GlobalFunctionsDisplay.end(); + ++it ) + { + (*it).second->Create_File(); + } + } +} + +const ary::DisplayGate * +OperationsDisplay::inq_Get_ReFinder() const +{ + return & pEnv->Gate(); +} + +PageDisplay & +OperationsDisplay::FindPage_for( const ary::cpp::Function & i_rData ) +{ + if ( pClassMembersDisplay ) + return *pClassMembersDisplay; + + SourceFileId + nSourceFile = i_rData.Location(); + PageDisplay * + pFound = csv::value_from_map( aMap_GlobalFunctionsDisplay, nSourceFile ); + if ( pFound == 0 ) + { + pFound = new PageDisplay( *pEnv ); + const ary::cpp::FileGroup * + pFgr = pEnv->Gate().RoGroups().Search_FileGroup( nSourceFile ); + csv_assert( pFgr != 0 ); + pFound->Setup_OperationsFile_for( *pFgr ); + aMap_GlobalFunctionsDisplay[nSourceFile] = pFound; + } + + return *pFound; +} + +void +OperationsDisplay::Display_SglOperation( csi::xml::Element & rOut, + const ary::cpp::Function & i_rData ) +{ + adcdisp::ExplanationList aDocu(rOut, true); + aDocu.AddEntry( 0 ); + + adcdisp::OperationTitle fTitle; + fTitle( aDocu.Term(), i_rData.LocalName(), i_rData.Signature() ); + + // Syntax + adcdisp::ExplanationList aSyntaxHeader(aDocu.Def()); + aSyntaxHeader.AddEntry( 0, "simple" ); + csi::xml::Element & rHeader = aSyntaxHeader.Term(); + + adcdisp::ParameterTable + aParams( aSyntaxHeader.Def() ); + + if (i_rData.TemplateParameters().size() > 0) + { + TemplateClause fTemplateClause; + fTemplateClause( rHeader, i_rData.TemplateParameters() ); + rHeader << new html::LineBreak; + } + if ( i_rData.Flags().IsExternC() ) + { + rHeader + << "extern \"C\"" + << new html::LineBreak; + } + + bool bConst = false; + bool bVolatile = false; + WriteOut_LinkedFunctionText( rHeader, aParams, i_rData, *pEnv, + &bConst, &bVolatile ); + aDocu.Def() << new html::LineBreak; + + // Flags + aDocu.AddEntry_NoTerm(); + adcdisp::FlagTable + aFlags( aDocu.Def(), 8 ); + + const ary::cpp::FunctionFlags & + rFFlags = i_rData.Flags(); + aFlags.SetColumn( 0, "virtual", + i_rData.Virtuality() != ary::cpp::VIRTUAL_none ); + aFlags.SetColumn( 1, "abstract", + i_rData.Virtuality() == ary::cpp::VIRTUAL_abstract ); + aFlags.SetColumn( 2, "const", bConst ); + aFlags.SetColumn( 3, "volatile", bVolatile ); + aFlags.SetColumn( 4, "template", + i_rData.TemplateParameters().size() > 0 ); + aFlags.SetColumn( 5, "static", + rFFlags.IsStaticLocal() OR rFFlags.IsStaticMember() ); + aFlags.SetColumn( 6, "inline", + rFFlags.IsInline() ); + aFlags.SetColumn( 7, "C-linkage", + rFFlags.IsExternC() ); + aDocu.Def() << new html::LineBreak; + + // Docu + aDocu.AddEntry_NoTerm(); + pDocuShow->Assign_Out( aDocu.Def() ); + i_rData.Info().StoreAt( *pDocuShow ); + pDocuShow->Unassign_Out(); + + rOut << new html::HorizontalLine; +} + + diff --git a/autodoc/source/display/html/dsply_op.hxx b/autodoc/source/display/html/dsply_op.hxx new file mode 100644 index 000000000000..e78f110f8e5a --- /dev/null +++ b/autodoc/source/display/html/dsply_op.hxx @@ -0,0 +1,141 @@ +/************************************************************************* + * + * $RCSfile: dsply_op.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_DSPLY_OP_HXX +#define ADC_DISPLAY_HTML_DSPLY_OP_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + namespace cpp + { + class Function; + } +} +namespace csi +{ + namespace xml + { + class Element; + } +} + + +class OuputPage_Environment; +class PageDisplay; +class Docu_Display; + + +class OperationsDisplay : public ary::cpp::Display +{ + public: + OperationsDisplay( + OuputPage_Environment & + io_rInfo ); + virtual ~OperationsDisplay(); + + + virtual void Display_Function( + const ary::cpp::Function & + i_rData ); + + void PrepareForGlobals(); + void PrepareForStdMembers(); + void PrepareForStaticMembers(); + void Create_Files(); + + private: + // Interface ary::cpp::Display: + virtual const ary::DisplayGate * + inq_Get_ReFinder() const; + + // Locals + typedef ary::Lid SourceFileId; + typedef std::map< SourceFileId, DYN PageDisplay* > Map_FileId2PagePtr; + + PageDisplay & FindPage_for( + const ary::cpp::Function & + i_rData ); + void Display_SglOperation( + csi::xml::Element & rOut, + const ary::cpp::Function & + i_rData ); + // DATA + Map_FileId2PagePtr aMap_GlobalFunctionsDisplay; + Dyn<PageDisplay> pClassMembersDisplay; + + OuputPage_Environment * + pEnv; + Dyn<Docu_Display> pDocuShow; +}; + + + +#endif + diff --git a/autodoc/source/display/html/easywri.cxx b/autodoc/source/display/html/easywri.cxx new file mode 100644 index 000000000000..e39663c2042b --- /dev/null +++ b/autodoc/source/display/html/easywri.cxx @@ -0,0 +1,199 @@ +/************************************************************************* + * + * $RCSfile: easywri.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "easywri.hxx" + + +// NOT FULLY DEFINED SERVICES + + +using namespace csi::html; + + +EasyWriter::EasyWriter() +{ +} + +EasyWriter::~EasyWriter() +{ +} + +void +EasyWriter::Open_OutputNode( csi::xml::Element & io_rDestination ) +{ + aCurDestination.push(&io_rDestination); +} + +void +EasyWriter::Finish_OutputNode() +{ + csv_assert( NOT aCurDestination.empty() ); + aCurDestination.pop(); +} + +void +EasyWriter::Add_HorizontalLine() +{ + Out() << new HorizontalLine; +} + +void +EasyWriter::Write( const char * i_sFormatTag, + const char * i_sText ) +{ + DYN csi::xml::Element * dpNew = new csi::xml::APureElement( i_sFormatTag ); + *dpNew << i_sText; + Out() << dpNew; +} + + +csi::xml::Element & +EasyWriter::Out() +{ + if ( aCurDestination.size() <= 0 ) + csv_assert( false ); + + return *aCurDestination.top(); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#if 0 +/* +class Html_Inverse : public Html::Piece +{ + public: + Html_Inverse( + DYN Html::Piece & let_drInhalt, + const udmstri i_sBgColor ); + ~Html_Inverse(); + virtual void WriteOut( + csv::AnyWrite & io_aFile ); + private: + DYN Html::Piece * dpInhalt; + udmstri sBgColor; + udmstri sColor; +}; + +Html_Inverse::Html_Inverse( DYN Html::Piece & let_drInhalt, + const udmstri i_sBgColor ) + : dpInhalt(&let_drInhalt), + sBgColor(i_sBgColor) +{ +} + +Html_Inverse::~Html_Inverse() +{ + Delete_dyn(dpInhalt); +} + + +void +Html_Inverse::WriteOut( csv::File & io_aFile ) +{ + io_aFile.WriteStr( "<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>" + " <TR> <TD BGCOLOR=\""); + io_aFile.WriteStr( sBgColor ); + io_aFile.WriteStr( "\" VALIGN=\"MIDDLE\">\r\n"); + dpInhalt->WriteOut(io_aFile); + io_aFile.WriteStr( "\r\n</TD></TR></TABLE>\r\n" ); +} + + + + +*/ +#endif // 0 + + + + diff --git a/autodoc/source/display/html/easywri.hxx b/autodoc/source/display/html/easywri.hxx new file mode 100644 index 000000000000..73523333b782 --- /dev/null +++ b/autodoc/source/display/html/easywri.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * $RCSfile: easywri.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_EASYWRI_HXX +#define ADC_DISPLAY_HTML_EASYWRI_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <estack.hxx> + // PARAMETERS +#include <udm/html/htmlitem.hxx> + + +class EasyWriter +{ + public: + // LIFECYCLE + EasyWriter(); + ~EasyWriter(); + + // OPERATIONS + /// Pushes csi::xml::Element on stack. + void Open_OutputNode( + csi::xml::Element & io_rDestination ); + /// Pops front csi::xml::Element from stack. + void Finish_OutputNode(); + + void Enter( + csi::xml::Element & io_rDestination ) + { Open_OutputNode(io_rDestination); } + void Leave() { Finish_OutputNode(); } + + void Add_HorizontalLine(); + void Write( + const char * i_sFormatTag, + const char * i_sText ); + + // ACCESS + csi::xml::Element & Out(); // CurOutputNode + + private: + EStack< csi::xml::Element * > + aCurDestination; // The front element is the currently used. + // The later ones are the parents. +}; + +/* +inline csi::xml::Element & +EasyWriter::Out() + { csv_assert( aCurDestination.size() > 0 ); + return *aCurDestination.top(); } +*/ + +// IMPLEMENTATION + + +#endif + + diff --git a/autodoc/source/display/html/hd_chlst.cxx b/autodoc/source/display/html/hd_chlst.cxx new file mode 100644 index 000000000000..97dbd513ee09 --- /dev/null +++ b/autodoc/source/display/html/hd_chlst.cxx @@ -0,0 +1,718 @@ +/************************************************************************* + * + * $RCSfile: hd_chlst.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "hd_chlst.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/ceslot.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/c_vari.hxx> +#include <ary/cpp/c_enuval.hxx> +#include <ary/cpp/cg_file.hxx> +#include <ary/cpp/crog_grp.hxx> +#include <ary/info/codeinfo.hxx> +#include <ary/info/ci_attag.hxx> +#include <ary/info/ci_text.hxx> +#include <ary/info/all_dts.hxx> +#include "hd_docu.hxx" +#include "opageenv.hxx" +#include "protarea.hxx" +#include "strconst.hxx" + + +using namespace csi; +using html::Table; +using html::TableRow; +using html::TableCell; +using html::Font; +using html::SizeAttr; +using html::BgColorAttr; +using html::WidthAttr; + + +const int ixPublic = 0; +const int ixProtected = 1; +const int ixPrivate = 2; + +struct ChildList_Display::S_AreaCo +{ + public: + ProtectionArea aArea; + Area_Result * pResult; + + S_AreaCo( + Area_Result & o_rResult, + const char * i_sLabel, + const char * i_sTitle ); + S_AreaCo( + Area_Result & o_rResult, + const char * i_sLabel, + const char * i_sTitle_classes, + const char * i_sTitle_structs, + const char * i_sTitle_unions ); + ~S_AreaCo(); + + void PerformResult(); + + private: + csi::xml::Element & Out() { return pResult->rOut; } +}; + + +const ary::info::DocuText & +ShortDocu( const ary::CodeEntity & i_rCe ) +{ + static const ary::info::DocuText aNull_; + + const ary::info::CodeInfo * + pInfo = dynamic_cast< const ary::info::CodeInfo* >( &i_rCe.Info() ); + if (pInfo == 0) + return aNull_; + + return pInfo->Short().CText(); +} + + +ChildList_Display::ChildList_Display( OuputPage_Environment & io_rEnv ) + : HtmlDisplay_Impl( io_rEnv ), + pShortDocu_Display( new Docu_Display(io_rEnv) ), + pActiveParentClass(0), + pActiveParentEnum(0), + // pSglArea, + // aMemberAreas, + peClassesFilter(0) +{ +} + +ChildList_Display::ChildList_Display( OuputPage_Environment & io_rEnv, + const ary::cpp::Class & i_rClass ) + : HtmlDisplay_Impl( io_rEnv ), + pShortDocu_Display( new Docu_Display(io_rEnv) ), + pActiveParentClass(&i_rClass), + pActiveParentEnum(0), + // pSglArea, + // aMemberAreas, + peClassesFilter(0) +{ +} + +ChildList_Display::ChildList_Display( OuputPage_Environment & io_rEnv, + const ary::cpp::Enum & i_rEnum ) + : HtmlDisplay_Impl( io_rEnv ), + pShortDocu_Display( new Docu_Display(io_rEnv) ), + pActiveParentClass(0), + pActiveParentEnum(&i_rEnum), + // pSglArea, + // aMemberAreas, + peClassesFilter(0) +{ +} + +ChildList_Display::~ChildList_Display() +{ +} + +void +ChildList_Display::Run_Simple( Area_Result & o_rResult, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel, + const char * i_sListTitle ) +{ + ary::Slot_AutoPtr + pSlot( ActiveParent().Create_Slot( i_nSlot ) ); + if ( pSlot->Size() == 0 ) + return; + + pSglArea = new S_AreaCo( o_rResult, + i_sListLabel, + i_sListTitle ); + + pSlot->StoreAt(*this); + + pSglArea->PerformResult(); + pSglArea = 0; +} + +void +ChildList_Display::Run_GlobalClasses( Area_Result & o_rResult, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel, + const char * i_sListTitle, + ary::cpp::E_ClassKey i_eFilter ) +{ + ary::Slot_AutoPtr + pSlot( ActiveParent().Create_Slot( i_nSlot ) ); + if ( pSlot->Size() == 0 ) + return; + + pSglArea = new S_AreaCo( o_rResult, + i_sListLabel, + i_sListTitle ); + + SetClassesFilter(i_eFilter); + pSlot->StoreAt(*this); + UnsetClassesFilter(); + + pSglArea->PerformResult(); + pSglArea = 0; +} + +#if 0 // old +void +ChildList_Display::Run_GlobalClasses( Area_Result & o_rResult, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel, + const char * i_sListTitle_classes, + const char * i_sListTitle_structs, + const char * i_sListTitle_unions ) +{ + ary::Slot_AutoPtr + pSlot( ActiveParent().Create_Slot( i_nSlot ) ); + if ( pSlot->Size() == 0 ) + return; + + pSglArea = new S_AreaCo( o_rResult, + i_sListLabel, + i_sListTitle_classes, + i_sListTitle_structs, + i_sListTitle_unions ); + + pSlot->StoreAt(*this); + + pSglArea->PerformResult(); + pSglArea = 0; +} + +#endif // 0, old + +void +ChildList_Display::Run_Members( Area_Result & o_rResult_public, + Area_Result & o_rResult_protected, + Area_Result & o_rResult_private, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel_public, + const char * i_sListLabel_protected, + const char * i_sListLabel_private, + const char * i_sListTitle ) +{ + ary::Slot_AutoPtr + pSlot( ActiveParent().Create_Slot(i_nSlot) ); + if ( pSlot->Size() == 0 ) + return; + + aMemberAreas[ixPublic] = new S_AreaCo( o_rResult_public, + i_sListLabel_public, + i_sListTitle ); + aMemberAreas[ixProtected] = new S_AreaCo( o_rResult_protected, + i_sListLabel_protected, + i_sListTitle ); + aMemberAreas[ixPrivate] = new S_AreaCo( o_rResult_private, + i_sListLabel_private, + i_sListTitle ); + + pSlot->StoreAt(*this); + + aMemberAreas[ixPublic]->PerformResult(); + aMemberAreas[ixProtected]->PerformResult(); + aMemberAreas[ixPrivate]->PerformResult(); + + aMemberAreas[ixPublic] = 0; + aMemberAreas[ixProtected] = 0; + aMemberAreas[ixPrivate] = 0; +} + +void +ChildList_Display::Run_MemberClasses( Area_Result & o_rResult_public, + Area_Result & o_rResult_protected, + Area_Result & o_rResult_private, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel_public, + const char * i_sListLabel_protected, + const char * i_sListLabel_private, + const char * i_sListTitle, + ary::cpp::E_ClassKey i_eFilter ) +{ + ary::Slot_AutoPtr + pSlot( ActiveParent().Create_Slot(i_nSlot) ); + if ( pSlot->Size() == 0 ) + return; + + aMemberAreas[ixPublic] = new S_AreaCo( o_rResult_public, + i_sListLabel_public, + i_sListTitle ); + aMemberAreas[ixProtected] = new S_AreaCo( o_rResult_protected, + i_sListLabel_protected, + i_sListTitle ); + aMemberAreas[ixPrivate] = new S_AreaCo( o_rResult_private, + i_sListLabel_private, + i_sListTitle ); + + SetClassesFilter(i_eFilter); + pSlot->StoreAt(*this); + UnsetClassesFilter(); + + aMemberAreas[ixPublic]->PerformResult(); + aMemberAreas[ixProtected]->PerformResult(); + aMemberAreas[ixPrivate]->PerformResult(); + + aMemberAreas[ixPublic] = 0; + aMemberAreas[ixProtected] = 0; + aMemberAreas[ixPrivate] = 0; +} + + +#if 0 // old +void +ChildList_Display::Run_MemberClasses( Area_Result & o_rResult_public, + Area_Result & o_rResult_protected, + Area_Result & o_rResult_private, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel_public, + const char * i_sListLabel_protected, + const char * i_sListLabel_private, + const char * i_sListTitle_classes, + const char * i_sListTitle_structs, + const char * i_sListTitle_unions ) +{ + ary::Slot_AutoPtr + pSlot( ActiveParent().Create_Slot(i_nSlot) ); + if ( pSlot->Size() == 0 ) + return; + + aMemberAreas[ixPublic] = new S_AreaCo( o_rResult_public, + i_sListLabel_public, + i_sListTitle_classes, + i_sListTitle_structs, + i_sListTitle_unions ); + aMemberAreas[ixProtected] = new S_AreaCo( o_rResult_protected, + i_sListLabel_protected, + i_sListTitle_classes, + i_sListTitle_structs, + i_sListTitle_unions ); + aMemberAreas[ixPrivate] = new S_AreaCo( o_rResult_private, + i_sListLabel_private, + i_sListTitle_classes, + i_sListTitle_structs, + i_sListTitle_unions ); + + pSlot->StoreAt(*this); + + aMemberAreas[ixPublic]->PerformResult(); + aMemberAreas[ixProtected]->PerformResult(); + aMemberAreas[ixPrivate]->PerformResult(); + + aMemberAreas[ixPublic] = 0; + aMemberAreas[ixProtected] = 0; + aMemberAreas[ixPrivate] = 0; +} + +#endif // 0, old + + +void +ChildList_Display::Display_Namespace( const ary::cpp::Namespace & i_rData ) +{ + Write_ListItem( i_rData.LocalName(), + Path2ChildNamespace(i_rData.LocalName()), + ShortDocu( i_rData ), + GetArea().GetTable() ); +} + +void +ChildList_Display::Display_Class( const ary::cpp::Class & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + if (peClassesFilter) + { + if (*peClassesFilter != i_rData.ClassKey() ) + return; + } + + udmstri sLink; + if ( i_rData.Protection() == ary::cpp::PROTECT_global ) + { + sLink = ClassFileName(i_rData.LocalName()); + } + else + { + csv_assert( pActiveParentClass != 0 ); + sLink = Path2Child( ClassFileName(i_rData.LocalName()), pActiveParentClass->LocalName() ); + } + + if (peClassesFilter) + { + Write_ListItem( i_rData.LocalName(), + sLink, + ShortDocu( i_rData ), + GetArea(i_rData.Protection()) + .GetTable() ); + } + else + { + Write_ListItem( i_rData.LocalName(), + sLink, + ShortDocu( i_rData ), + GetArea(i_rData.Protection()) + .GetTable(i_rData.ClassKey()) ); + } +} + +void +ChildList_Display::Display_Enum( const ary::cpp::Enum & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + udmstri sLink; + if ( i_rData.Protection() == ary::cpp::PROTECT_global ) + { + sLink = EnumFileName(i_rData.LocalName()); + } + else + { + csv_assert( pActiveParentClass != 0 ); + sLink = Path2Child( EnumFileName(i_rData.LocalName()), + pActiveParentClass->LocalName() ); + } + + Write_ListItem( i_rData.LocalName(), + sLink, + ShortDocu( i_rData ), + GetArea(i_rData.Protection()).GetTable() ); +} + +void +ChildList_Display::Display_Typedef( const ary::cpp::Typedef & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + udmstri sLink; + if ( i_rData.Protection() == ary::cpp::PROTECT_global ) + { + sLink = TypedefFileName(i_rData.LocalName()); + } + else + { + csv_assert( pActiveParentClass != 0 ); + sLink = Path2Child( TypedefFileName(i_rData.LocalName()), + pActiveParentClass->LocalName() ); + } + + Write_ListItem( i_rData.LocalName(), + sLink, + ShortDocu( i_rData ), + GetArea(i_rData.Protection()).GetTable() ); +} + +void +ChildList_Display::Display_Function( const ary::cpp::Function & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + udmstri sLinkPrePath; + if ( i_rData.Protection() == ary::cpp::PROTECT_global ) + { + const ary::cpp::FileGroup * + pFgr = Env().Gate().RoGroups().Search_FileGroup( i_rData.Location() ); + csv_assert( pFgr != 0 ); + sLinkPrePath = HtmlFileName( "o-", pFgr->FileName() ); + } + else + { + csv_assert( pActiveParentClass != 0 ); + sLinkPrePath = Path2Child( HtmlFileName( "o", "" ), + pActiveParentClass->LocalName() ); + } + + // Out + Table & rOut = GetArea(i_rData.Protection()).GetTable(); + TableRow * dpRow = new TableRow; + rOut << dpRow; + TableCell & rCell1 = dpRow->AddCell(); + + rCell1 + << SyntaxText_PreName( i_rData, Env().Gate() ) + << new html::LineBreak; + rCell1 + >> *new html::Link( OperationLink(i_rData.LocalName(), + i_rData.Signature(), + sLinkPrePath) ) + << i_rData.LocalName(); + rCell1 + << SyntaxText_PostName( i_rData, Env().Gate() ); + TableCell & rCell2 = dpRow->AddCell(); + rCell2 + << new WidthAttr("50%") + << " "; + + pShortDocu_Display->Assign_Out( rCell2 ); + ShortDocu( i_rData ).StoreAt( *pShortDocu_Display ); + pShortDocu_Display->Unassign_Out(); +} + +void +ChildList_Display::Display_Variable( const ary::cpp::Variable & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + udmstri sLinkPrePath; + if ( i_rData.Protection() == ary::cpp::PROTECT_global ) + { + const ary::cpp::FileGroup * + pFgr = Env().Gate().RoGroups().Search_FileGroup( i_rData.Location() ); + csv_assert( pFgr != 0 ); + sLinkPrePath = HtmlFileName( "d-", pFgr->FileName() ); + } + else + { + csv_assert( pActiveParentClass != 0 ); + sLinkPrePath = Path2Child( HtmlFileName( "d", "" ), + pActiveParentClass->LocalName() ); + } + + TableRow * dpRow = new TableRow; + GetArea(i_rData.Protection()).GetTable() << dpRow; + + *dpRow << new html::BgColorAttr("white"); + csi::xml::Element & + rCell1 = dpRow->AddCell(); + + dshelp::Get_LinkedTypeText( rCell1, Env(), i_rData.Type() ); + rCell1 + << " " + >> *new html::Link( DataLink(i_rData.LocalName(), sLinkPrePath.c_str()) ) + >> *new html::Strong + << i_rData.LocalName() + << ";"; + + TableCell & rShortDocu = dpRow->AddCell(); + pShortDocu_Display->Assign_Out( rShortDocu ); + ShortDocu( i_rData ).StoreAt( *pShortDocu_Display ); + pShortDocu_Display->Unassign_Out(); +} + +void +ChildList_Display::Display_EnumValue( const ary::cpp::EnumValue & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + Table & rOut = GetArea().GetTable(); + + TableRow * dpRow = new TableRow; + rOut << dpRow; + + *dpRow << new html::BgColorAttr("white"); + dpRow->AddCell() + << new WidthAttr("20%") + << new xml::AnAttribute("valign", "top") + >> *new html::Label(i_rData.LocalName()) + >> *new html::Bold + << i_rData.LocalName(); + + TableCell & rValueDocu = dpRow->AddCell(); + pShortDocu_Display->Assign_Out( rValueDocu ); + i_rData.Info().StoreAt( *pShortDocu_Display ); + pShortDocu_Display->Unassign_Out(); +} + +void +ChildList_Display::do_StartSlot() +{ +} + +void +ChildList_Display::do_FinishSlot() +{ +} + +const ary::DisplayGate * +ChildList_Display::inq_Get_ReFinder() const +{ + return & Env().Gate(); +} + +void +ChildList_Display::Write_ListItem( const udmstri & i_sLeftText, + const char * i_sLink, + const ary::info::DocuText & i_rRightText, + csi::xml::Element & o_rOut ) +{ + TableRow * dpRow = new TableRow; + o_rOut << dpRow; + + *dpRow << new html::BgColorAttr("white"); + dpRow->AddCell() + << new WidthAttr("20%") + >> *new html::Link( i_sLink ) + >> *new html::Bold + << i_sLeftText; + + TableCell & rShortDocu = dpRow->AddCell(); + pShortDocu_Display->Assign_Out( rShortDocu ); + i_rRightText.StoreAt( *pShortDocu_Display ); + pShortDocu_Display->Unassign_Out(); +} + +const ary::AryGroup & +ChildList_Display::ActiveParent() +{ + return pActiveParentClass != 0 + ? static_cast< const ary::AryGroup& >(*pActiveParentClass) + : pActiveParentEnum != 0 + ? static_cast< const ary::AryGroup& >(*pActiveParentEnum) + : static_cast< const ary::AryGroup& >(*Env().CurNamespace()); +} + +ProtectionArea & +ChildList_Display::GetArea() +{ + return pSglArea->aArea; +} + +ProtectionArea & +ChildList_Display::GetArea( ary::cpp::E_Protection i_eProtection ) +{ + switch ( i_eProtection ) + { + case ary::cpp::PROTECT_public: + return aMemberAreas[ixPublic]->aArea; + case ary::cpp::PROTECT_protected: + return aMemberAreas[ixProtected]->aArea; + case ary::cpp::PROTECT_private: + return aMemberAreas[ixPrivate]->aArea; + default: + return pSglArea->aArea; + } +} + + +//******************* ********************// + +ChildList_Display:: +S_AreaCo::S_AreaCo( Area_Result & o_rResult, + const char * i_sLabel, + const char * i_sTitle ) + : aArea(i_sLabel, i_sTitle), + pResult(&o_rResult) +{ +} + +ChildList_Display:: +S_AreaCo::S_AreaCo( Area_Result & o_rResult, + const char * i_sLabel, + const char * i_sTitle_classes, + const char * i_sTitle_structs, + const char * i_sTitle_unions ) + : aArea(i_sLabel, i_sTitle_classes, i_sTitle_structs, i_sTitle_unions ), + pResult(&o_rResult) +{ +} + +ChildList_Display:: +S_AreaCo::~S_AreaCo() +{ +} + +void +ChildList_Display:: +S_AreaCo::PerformResult() +{ + bool bUsed = aArea.WasUsed_Area(); + pResult->rChildrenExist = bUsed; + if ( bUsed ) + { + Create_ChildListLabel( Out(), aArea.Label() ); + + if ( aArea.Size() == 1 ) + { + Out() << aArea.ReleaseTable(); + } + else + { + Table * pTable = aArea.ReleaseTable( ary::cpp::CK_class ); + if (pTable != 0) + Out() << pTable; + pTable = aArea.ReleaseTable( ary::cpp::CK_struct ); + if (pTable != 0) + Out() << pTable; + pTable = aArea.ReleaseTable( ary::cpp::CK_union ); + if (pTable != 0) + Out() << pTable; + } + } +} + + + diff --git a/autodoc/source/display/html/hd_chlst.hxx b/autodoc/source/display/html/hd_chlst.hxx new file mode 100644 index 000000000000..b145302984e6 --- /dev/null +++ b/autodoc/source/display/html/hd_chlst.hxx @@ -0,0 +1,255 @@ +/************************************************************************* + * + * $RCSfile: hd_chlst.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_HD_CHLST_HXX +#define ADC_DISPLAY_HTML_HD_CHLST_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> +#include <ary/cpp/c_etypes.hxx> +#include "hdimpl.hxx" + // COMPONENTS + // PARAMETERS + +namespace ary +{ + namespace cpp + { + class Namespace; + class Class; + class Enum; + class Typedef; + class Function; + class Variable; + class EnumValue; + } + namespace info + { + class DocuText; + } +} + +class Docu_Display; +class ProtectionArea; + +class ChildList_Display : public ary::cpp::Display, + private HtmlDisplay_Impl +{ + public: + struct Area_Result + { + bool & rChildrenExist; + csi::xml::Element & rOut; + + Area_Result( + bool & o_rChildrenExist, + csi::xml::Element & o_rOut ) + : rChildrenExist(o_rChildrenExist), + rOut(o_rOut) {} + }; + + + ChildList_Display( + OuputPage_Environment & + io_rEnv ); + ChildList_Display( + OuputPage_Environment & + io_rEnv, + const ary::cpp::Class & + i_rClass ); + ChildList_Display( + OuputPage_Environment & + io_rEnv, + const ary::cpp::Enum & + i_rEnum ); + + virtual ~ChildList_Display(); + + void Run_Simple( + Area_Result & o_rResult, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel, + const char * i_sListTitle ); + void Run_GlobalClasses( + Area_Result & o_rResult, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel, + const char * i_sListTitle, + ary::cpp::E_ClassKey + i_eFilter ); +#if 0 + void Run_GlobalClasses( + Area_Result & o_rResult, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel, + const char * i_sListTitle_classes, + const char * i_sListTitle_structs, + const char * i_sListTitle_unions ); +#endif + void Run_Members( + Area_Result & o_rResult_public, + Area_Result & o_rResult_protected, + Area_Result & o_rResult_private, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel_public, + const char * i_sListLabel_protected, + const char * i_sListLabel_private, + const char * i_sListTitle ); + void Run_MemberClasses( + Area_Result & o_rResult_public, + Area_Result & o_rResult_protected, + Area_Result & o_rResult_private, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel_public, + const char * i_sListLabel_protected, + const char * i_sListLabel_private, + const char * i_sListTitle, + ary::cpp::E_ClassKey + i_eFilter ); +#if 0 + void Run_MemberClasses( + Area_Result & o_rResult_public, + Area_Result & o_rResult_protected, + Area_Result & o_rResult_private, + ary::SlotAccessId i_nSlot, + const char * i_sListLabel_public, + const char * i_sListLabel_protected, + const char * i_sListLabel_private, + const char * i_sListTitle_classes, + const char * i_sListTitle_structs, + const char * i_sListTitle_unions ); +#endif + + virtual void Display_Namespace( + const ary::cpp::Namespace & + i_rData ); + /** i_rData is showed only, if it passes two filters: + it must have the right protection, checked with pFilter, + and the right class key (class,struct,union), checked with + pClassFilter. A not exsting filter allows i_rData to be + displayed. + */ + virtual void Display_Class( + const ary::cpp::Class & + i_rData ); + virtual void Display_Enum( + const ary::cpp::Enum & + i_rData ); + virtual void Display_Typedef( + const ary::cpp::Typedef & + i_rData ); + virtual void Display_Function( + const ary::cpp::Function & + i_rData ); + virtual void Display_Variable( + const ary::cpp::Variable & + i_rData ); + virtual void Display_EnumValue( + const ary::cpp::EnumValue & + i_rData ); + private: + // Interface ary::Display: + virtual void do_StartSlot(); + virtual void do_FinishSlot(); + virtual const ary::DisplayGate * + inq_Get_ReFinder() const; + + // Locals + struct S_AreaCo; + void Write_ListItem( + const udmstri & i_sLeftText, + const char * i_sLink, + const ary::info::DocuText & + i_rRightText, + csi::xml::Element & rOut ); + const ary::AryGroup & + ActiveParent(); + ProtectionArea & GetArea(); + ProtectionArea & GetArea( + ary::cpp::E_Protection + i_eProtection ); + void SetClassesFilter( + ary::cpp::E_ClassKey + i_eFilter ) + { peClassesFilter = new ary::cpp::E_ClassKey(i_eFilter); } + void UnsetClassesFilter() { peClassesFilter = 0; } + + // DATA + Dyn<Docu_Display> pShortDocu_Display; + const ary::cpp::Class * + pActiveParentClass; + const ary::cpp::Enum * + pActiveParentEnum; + + Dyn<S_AreaCo> pSglArea; + Dyn<S_AreaCo> aMemberAreas[3]; + + Dyn<ary::cpp::E_ClassKey> + peClassesFilter; +}; + + + +#endif + diff --git a/autodoc/source/display/html/hd_docu.cxx b/autodoc/source/display/html/hd_docu.cxx new file mode 100644 index 000000000000..1dcc602ac777 --- /dev/null +++ b/autodoc/source/display/html/hd_docu.cxx @@ -0,0 +1,472 @@ +/************************************************************************* + * + * $RCSfile: hd_docu.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "hd_docu.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/c_vari.hxx> +#include <ary/cpp/c_enuval.hxx> +#include <ary/info/codeinfo.hxx> +#include <ary/info/all_tags.hxx> +#include <ary/info/all_dts.hxx> +#include "html_kit.hxx" + + + +using namespace ary::info; +using namespace csi; + +using html::DefList; +using html::DefListTerm; +using html::DefListDefinition; +using html::Headline; +using html::Link; + + +const char * +C_sTagHeadlines[ ary::info::C_eAtTag_NrOfClasses ] = + { + "ATTENTION!", "Author", "Changes", "Collaborators", + "Contact", // Contact may be unused + "Copyright", "Deprecated", "Description", "Date of Documentation", + "How to Derive from this Class", + "Heap object - owner is responsible for deletion.", + "Important Instances", + "Interface Only", + "Invariant", "Lifecycle", + "Multiplicity", "On Error", "Persistency", "Postcondition", + "Precondition", + "Responsibilities", + "Return", "Summary", "Todos", "Version", + "Base Classes", "Exceptions", "Implements", "Keywords", "Parameters", + "See Also", "Template Parameters", + "" + }; + + + +Docu_Display::Docu_Display( OuputPage_Environment & io_rEnv ) + : HtmlDisplay_Impl(io_rEnv), + bUseHtmlInDocuTokens(false), + pCurClassOverwrite(0) +{ +} + +Docu_Display::~Docu_Display() +{ +} + +void +Docu_Display::Assign_Out( csi::xml::Element & o_rOut ) +{ + Easy().Enter(o_rOut); +} + +void +Docu_Display::Unassign_Out() +{ + Easy().Leave(); +} + +void +Docu_Display::Display_Namespace( const ary::cpp::Namespace & i_rData ) +{ + i_rData.Info().StoreAt( *this ); +} + +void +Docu_Display::Display_Class( const ary::cpp::Class & i_rData ) +{ + pCurClassOverwrite = &i_rData; + i_rData.Info().StoreAt( *this ); + pCurClassOverwrite = 0; +} + +void +Docu_Display::Display_Enum( const ary::cpp::Enum & i_rData ) +{ + i_rData.Info().StoreAt( *this ); +} + +void +Docu_Display::Display_Typedef( const ary::cpp::Typedef & i_rData ) +{ + i_rData.Info().StoreAt( *this ); +} + +void +Docu_Display::Display_Function( const ary::cpp::Function & i_rData ) +{ + i_rData.Info().StoreAt( *this ); +} + +void +Docu_Display::Display_Variable( const ary::cpp::Variable & i_rData ) +{ + i_rData.Info().StoreAt( *this ); +} + + +// -------------- Interface ary::info::DocuDisplay ------------------ // + + +void +Docu_Display::Display_CodeInfo( const CodeInfo & i_rData ) +{ + Start_DocuBlock(); + + if ( i_rData.IsObsolete() ) + { + CurOut() + >> *new html::DefListTerm + >> *new html::Strong + << "D E P R E C A T E D"; + + } + + CodeInfo::TagList::const_iterator itEnd = i_rData.Tags().end(); + for ( CodeInfo::TagList::const_iterator it = i_rData.Tags().begin(); + it != itEnd; + ++it ) + { + (*it)->StoreAt( *this ); + } + + Finish_DocuBlock(); +} + +void +Docu_Display::Display_StdTag( const StdTag & i_rData ) +{ + csv_assert( uintt(i_rData.Std_Id()) < uintt(ary::info::C_eAtTag_NrOfClasses) ); + + const ary::info::DocuText::TokenList & + rText = i_rData.CText().Tokens(); + typedef ary::info::DocuText::TokenList::const_iterator TokenIterator; + + if ( rText.empty() ) + return; + else if ( rText.size() < 3 ) + { + bool bIsWhite = true; + for ( TokenIterator it = rText.begin(); + it != rText.end(); + ++it ) + { + if (bIsWhite) + bIsWhite = (*it)->IsWhite(); + } + if (bIsWhite) + return; + } + + Write_TagTitle( C_sTagHeadlines[i_rData.Std_Id()] ); + Write_TagContents( i_rData.CText() ); +} + +void +Docu_Display::Display_BaseTag( const BaseTag & i_rData ) +{ + +} + +void +Docu_Display::Display_ExceptionTag( const ExceptionTag & i_rData ) +{ +} + +void +Docu_Display::Display_ImplementsTag( const ImplementsTag & i_rData ) +{ +} + +void +Docu_Display::Display_KeywordTag( const KeywordTag & i_rData ) +{ +} + +void +Docu_Display::Display_ParameterTag( const ParameterTag & i_rData ) +{ + Write_TagTitle( "Parameters" ); + + adcdisp::ExplanationTable + aParams( CurOut() >> *new DefListDefinition ); + + for ( const ParameterTag * pParam = &i_rData; + pParam != 0; + pParam = pParam->GetNext() ) // KORR_FUTURE + { + aParams.AddEntry( pParam->ParamName().c_str() ); + + Easy().Enter( aParams.Def() ); + Write_Text( pParam->CText() ); + Easy().Leave(); + } // end for +} + +void +Docu_Display::Display_SeeTag( const SeeTag & i_rData ) +{ + Write_TagTitle( "See Also" ); + + DefListDefinition * dpDef = new DefListDefinition; + CurOut() << dpDef; + Easy().Enter(*dpDef); + + for ( std::vector< ary::QualifiedName >::const_iterator + it = i_rData.References().begin(); + it != i_rData.References().end(); + ++it ) + { + Write_LinkableText( (*it) ); + CurOut() << new html::LineBreak; + } + + Easy().Leave(); +} + +void +Docu_Display::Display_TemplateTag( const TemplateTag & i_rData ) +{ + Write_TagTitle( "Template Parameters" ); + + adcdisp::ExplanationTable + aTplParams( CurOut() >> *new DefListDefinition ); + + for ( const TemplateTag * pTplParam = &i_rData; + pTplParam != 0; + pTplParam = pTplParam->GetNext() ) + { + aTplParams.AddEntry( pTplParam->TplParamName().c_str() ); + + Easy().Enter( aTplParams.Def() ); + Write_Text( pTplParam->CText() ); + Easy().Leave(); + } // end for +} + +void +Docu_Display::Display_LabelTag( const LabelTag & i_rData ) +{ +} + +void +Docu_Display::Display_DT_Text( const DT_Text & i_rData ) +{ + Write_TextToken( i_rData.Text() ); +} + +void +Docu_Display::Display_DT_MaybeLink( const DT_MaybeLink & i_rData ) +{ + // KORR_FUTURE + Write_TextToken( i_rData.Text() ); +} + +void +Docu_Display::Display_DT_Whitespace( const DT_Whitespace & i_rData ) +{ + static char sSpace[300] = + " " + " " + " " + " " + " " + " "; + UINT8 nLength = i_rData.Length(); + sSpace[nLength] = NULCH; + CurOut() << sSpace; + sSpace[nLength] = ' '; +} + +void +Docu_Display::Display_DT_Eol( const DT_Eol & i_rData ) +{ + CurOut() << new html::Sbr; +} + +void +Docu_Display::Display_DT_Xml( const ary::info::DT_Xml & i_rData ) +{ + CurOut() << new xml::XmlCode( i_rData.Text() ); +} + + +void +Docu_Display::Start_DocuBlock() +{ + DYN DefList * dpDefList = new DefList; + CurOut() << dpDefList; + Easy().Enter( *dpDefList ); +} + +void +Docu_Display::Finish_DocuBlock() +{ + Easy().Leave(); +} + +void +Docu_Display::Write_TagTitle( const char * i_sText, + const char * i_nFontSize ) +{ + if ( strcmp(i_sText,"ATTENTION!") == 0 ) + { + CurOut() + >> *new html::DefListTerm + << new html::StyleAttr("color:#dd0000;") + << i_sText; + } + else + { + CurOut() + >> *new html::DefListTerm + << i_sText; + } +} + +void +Docu_Display::Write_TagContents( const DocuText & i_rDocuText ) +{ + DefListDefinition * dpDef = new DefListDefinition; + CurOut() << dpDef; + + Easy().Enter(*dpDef); + Write_Text(i_rDocuText); + Easy().Leave(); +} + +void +Docu_Display::Write_Text( const ary::info::DocuText & i_rDocuText ) +{ + if ( i_rDocuText.IsNoHtml() ) + { + CurOut() + << new xml::XmlCode("<pre>"); + bUseHtmlInDocuTokens = false; + } + else + { + bUseHtmlInDocuTokens = true; + } + i_rDocuText.StoreAt( *this ); + if ( i_rDocuText.IsNoHtml() ) + { + CurOut() + << new xml::XmlCode("</pre>"); + } +} + +void +Docu_Display::Write_TextToken( const udmstri & i_sText ) +{ + if ( bUseHtmlInDocuTokens ) + CurOut() << new xml::XmlCode(i_sText); + else + CurOut() << i_sText; +} + +void +Docu_Display::Write_LinkableText( const ary::QualifiedName & i_sQuName ) +{ + const ary::CodeEntity * + pCe = FindUnambiguousCe( Env(), i_sQuName, pCurClassOverwrite ); + if ( pCe != 0 ) + { + csi::xml::Element * + pLink = new csi::html::Link( Link2Ce(Env(), *pCe) ); + CurOut() << pLink; + Easy().Enter(*pLink); + Write_QualifiedName(i_sQuName); + Easy().Leave(); + } + else + { + Write_QualifiedName(i_sQuName); + } + CurOut() << " "; +} + +void +Docu_Display::Write_QualifiedName( const ary::QualifiedName & i_sQuName ) +{ + if ( i_sQuName.IsAbsolute() ) + CurOut() << "::"; + for ( ary::QualifiedName::namespace_iterator it = i_sQuName.begin(); + it != i_sQuName.end(); + ++it ) + { + CurOut() << (*it) << "::"; + } + CurOut() << i_sQuName.LocalName(); + if ( i_sQuName.IsFunction() ) + CurOut() << "()"; +} + diff --git a/autodoc/source/display/html/hd_docu.hxx b/autodoc/source/display/html/hd_docu.hxx new file mode 100644 index 000000000000..084a82fb84ac --- /dev/null +++ b/autodoc/source/display/html/hd_docu.hxx @@ -0,0 +1,207 @@ +/************************************************************************* + * + * $RCSfile: hd_docu.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_HD_DOCU_HXX +#define ADC_DISPLAY_HTML_HD_DOCU_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> +#include <ary/info/infodisp.hxx> +#include "hdimpl.hxx" + // COMPONENTS + // PARAMETERS + +namespace ary +{ + namespace info + { + class DocuText; + } + + class QualifiedName; +} + + +class OuputPage_Environmen; + + +class Docu_Display : public ary::cpp::Display, + public ary::info::DocuDisplay, + private HtmlDisplay_Impl +{ + public: + Docu_Display( + OuputPage_Environment & + io_rEnv + ); + virtual ~Docu_Display(); + + void Assign_Out( + csi::xml::Element & o_rOut ); + void Unassign_Out(); + + // Interface ary::cpp::Display + virtual void Display_Namespace( + const ary::cpp::Namespace & + i_rData ); + virtual void Display_Class( + const ary::cpp::Class & + i_rData ); + virtual void Display_Enum( + const ary::cpp::Enum & + i_rData ); + virtual void Display_Typedef( + const ary::cpp::Typedef & + i_rData ); + virtual void Display_Function( + const ary::cpp::Function & + i_rData ); + virtual void Display_Variable( + const ary::cpp::Variable & + i_rData ); + + // Interface ary::info::DocuDisplay: + virtual void Display_CodeInfo( + const ary::info::CodeInfo & + i_rData ); + + virtual void Display_StdTag( + const ary::info::StdTag & + i_rData ); + virtual void Display_BaseTag( + const ary::info::BaseTag & + i_rData ); + virtual void Display_ExceptionTag( + const ary::info::ExceptionTag & + i_rData ); + virtual void Display_ImplementsTag( + const ary::info::ImplementsTag & + i_rData ); + virtual void Display_KeywordTag( + const ary::info::KeywordTag & + i_rData ); + virtual void Display_ParameterTag( + const ary::info::ParameterTag & + i_rData ); + virtual void Display_SeeTag( + const ary::info::SeeTag & + i_rData ); + virtual void Display_TemplateTag( + const ary::info::TemplateTag & + i_rData ); + virtual void Display_LabelTag( + const ary::info::LabelTag & + i_rData ); + + virtual void Display_DT_Text( + const ary::info::DT_Text & + i_rData ); + virtual void Display_DT_MaybeLink( + const ary::info::DT_MaybeLink & + i_rData ); + virtual void Display_DT_Whitespace( + const ary::info::DT_Whitespace & + i_rData ); + virtual void Display_DT_Eol( + const ary::info::DT_Eol & + i_rData ); + virtual void Display_DT_Xml( + const ary::info::DT_Xml & + i_rData ); + private: + void Start_DocuBlock(); + void Finish_DocuBlock(); + void Write_TagTitle( + const char * i_sText, + const char * i_nFontSize = "+0" ); + void Write_TagContents( + const ary::info::DocuText & + i_rDocuText ); + void Write_Text( + const ary::info::DocuText & + i_rDocuText ); + void Write_TextToken( + const udmstri & i_sText ); + void Write_LinkableText( + const ary::QualifiedName & + i_sQuName ); + void Write_QualifiedName( + const ary::QualifiedName & + i_sQuName ); + + // DATA + bool bUseHtmlInDocuTokens; + + /** This is used, if a class documentation is displayed, + because for links to members then the "current class" + is not the parent, but this class itself. + */ + const ary::cpp::Class * + pCurClassOverwrite; +}; + + + +#endif + diff --git a/autodoc/source/display/html/hdimpl.cxx b/autodoc/source/display/html/hdimpl.cxx new file mode 100644 index 000000000000..9a3ff8afedd5 --- /dev/null +++ b/autodoc/source/display/html/hdimpl.cxx @@ -0,0 +1,575 @@ +/************************************************************************* + * + * $RCSfile: hdimpl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "hdimpl.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <stdlib.h> +#include <stdio.h> +#include <ary/ceslot.hxx> +#include <ary/quname.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/cpp_defs.hxx> +#include <udm/html/htmlitem.hxx> +#include "cre_link.hxx" +#include "hd_docu.hxx" +#include "html_kit.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" +#include "strconst.hxx" + + +using namespace csi; + + +//******************** HtmlDisplay_Impl *********************// + +HtmlDisplay_Impl::~HtmlDisplay_Impl() +{ +} + +HtmlDisplay_Impl::HtmlDisplay_Impl( OuputPage_Environment & io_rEnv ) + : pEnv(&io_rEnv) + // aWriteHelper +{ +} + + +//******************** Free Functions *********************// + + + +namespace dshelp +{ + +void +DisplaySlot( ary::Display & o_rDisplay, + const ary::AryGroup & i_rGroup, + ary::SlotAccessId i_nSlot ) +{ + ary::Slot_AutoPtr pSlot( i_rGroup.Create_Slot(i_nSlot) ); + pSlot->StoreAt( o_rDisplay ); +} + + +const char * +PathUp( uintt i_nLevels ) +{ + static char sResult[100]; + + sResult[0] = NULCH; + for ( uintt lev = 0; lev < i_nLevels; ++lev ) + { + strcat( sResult, "../"); + } + return sResult; +} + +const char * +PathPerLevelsUp( uintt i_nLevels, + const char * i_nPathBelowDestinationLevel ) +{ + static char sResult[300]; + strcpy( sResult, PathUp(i_nLevels) ); + strcat( sResult, i_nPathBelowDestinationLevel ); + return sResult; +} + + +const char * +PathPerRoot( const OuputPage_Environment & i_rEnv, + const char * i_sPathFromRootDir ) +{ + return PathPerLevelsUp( i_rEnv.Depth(), i_sPathFromRootDir ); +} + +const char * +PathPerNamespace( const OuputPage_Environment & i_rEnv, + const char * i_sPathFromNamespaceDir ) +{ + const ary::cpp::Namespace * pNsp = i_rEnv.CurNamespace(); + if ( pNsp == 0 ) + return ""; + + uintt nCount = i_rEnv.Depth() - (pNsp->Depth() + 1) ; + csv_assert( nCount < 100 ); + return PathPerLevelsUp( nCount, i_sPathFromNamespaceDir ); +} + +const char * +HtmlFileName( const char * i_sPrefix, + const char * i_sEntityName ) +{ + static char sResult[100]; + strcpy( sResult, i_sPrefix ); + strcat( sResult, i_sEntityName ); + strcat( sResult, ".html" ); + return sResult; +} + +const char * +Path2Class( uintt i_nLevelsUp, + const char * i_sClassLocalName ) +{ + return PathPerLevelsUp( i_nLevelsUp, ClassFileName(i_sClassLocalName) ); +} + +const char * +Path2Child( const char * i_sFileName, + const char * i_sSubDir ) +{ + static char sResult[200]; + if ( i_sSubDir != 0 ) + { + strcpy( sResult, i_sSubDir ); + strcat( sResult, "/" ); + } + else + { + sResult[0] = NULCH; + } + + strcat( sResult, i_sFileName ); + return sResult; +} + +const char * +Path2ChildNamespace( const char * i_sLocalName ) +{ + return Path2Child( C_sHFN_Namespace, i_sLocalName ); +} + +const char * +OperationLink( const udmstri & i_sOpName, + ary::OSid i_nSignature, + const char * i_sPrePath ) +{ + static char sResult[200]; + + unsigned long nSignature = (unsigned long) i_nSignature; + sprintf( sResult, "%s#%s-%lu", + i_sPrePath, i_sOpName.c_str(), nSignature ); + return sResult; +} + +const char * +DataLink( const udmstri & i_sLocalName, + const char * i_sPrePath ) +{ + static char sResult[100]; + strcpy( sResult, i_sPrePath ); + strcat( sResult, "#" ); + strcat( sResult, i_sLocalName ); + return sResult; +} + +void +Get_LinkedTypeText( csi::xml::Element & o_rOut, + const OuputPage_Environment & i_rEnv, + ary::Tid i_nId, + bool i_bWithAbsolutifier ) +{ + if (i_nId == 0) + return; + + const char * sPreName = ""; + const char * sName = ""; + const char * sPostName = ""; + + bool bTypeExists = Get_TypeText( sPreName, + sName, + sPostName, + i_nId, + i_rEnv.Gate() ); + if ( NOT bTypeExists ) + return; + + if ( NOT i_bWithAbsolutifier AND strncmp(sPreName,"::",2) == 0 ) + sPreName+=2; + + + const ary::CodeEntity * + pCe = i_rEnv.Gate().Search_RelatedCe(i_nId); + + udmstri sLink; + if ( pCe != 0 ) + { + sLink = Link2Ce(i_rEnv,*pCe); + } + else + { + if ( strstr(sPreName,"com::sun::star") != 0 ) + { + static StreamStr aLink(400); + aLink.seekp(0); + aLink << PathPerRoot(i_rEnv, "../../common/ref"); + if ( *sPreName != ':' ) + aLink << '/'; + for ( const char * s = sPreName; + *s != 0; + ++s ) + { + if ( *s == ':' ) + { + aLink << '/'; + ++s; + } + else + { + aLink << *s; + } + } // end for + aLink << sName + << ".html"; + sLink = aLink.c_str(); + } + } // endif( pCe != 0 ) + + o_rOut + << sPreName; + csi::xml::Element & + o_Goon = sLink.length() > 0 + ? o_rOut >> * new html::Link( sLink.c_str() ) + : o_rOut; + o_Goon + << sName; + o_rOut + << sPostName; +} + + +csi::html::Table & +Create_ChildListTable( csi::xml::Element & o_rParentElement, + const char * i_sTitle, + const char * i_sLabel ) +{ + Create_ChildListLabel(o_rParentElement, i_sLabel); + + csi::html::Table & ret = Create_ChildListTable(i_sTitle); + o_rParentElement << &ret; + + return ret; +} + +void +Create_ChildListLabel( csi::xml::Element & o_rParentElement, + const char * i_sLabel ) +{ + if ( NOT csv::no_str(i_sLabel) ) + { + o_rParentElement + >> *new html::Label(i_sLabel) + << " "; + } +} + +DYN csi::html::Table & +Create_ChildListTable( const char * i_sTitle ) +{ + html::Table * + dpTable = new html::Table; + *dpTable +// << new xml::AnAttribute( "border", "1" ) + << new xml::AnAttribute( "cellpadding", "5" ) + << new xml::AnAttribute( "cellspacing", "0" ) + << new html::WidthAttr( "100%" ); + + html::TableRow & + rRow = dpTable->AddRow(); + rRow + << new html::BgColorAttr("#CCCCFF") + >> *new html::TableCell + << new xml::AnAttribute( "colspan","2" ) + >> *new html::Headline(4) + << i_sTitle; + return *dpTable; +} + + +const char * +Link2Ce( const OuputPage_Environment & i_rEnv, + const ary::CodeEntity & i_rCe ) +{ + const uintt nMaxSize + = 3000; + static char sLink[nMaxSize]; + static LinkCreator aLinkCreator( &sLink[0], nMaxSize ); + sLink[0] = NULCH; + + aLinkCreator.SetEnv(i_rEnv); + i_rCe.StoreAt(aLinkCreator); + + return sLink; +} + +const char * +Link2CppDefinition( const OuputPage_Environment & i_rEnv, + const ary::cpp::CppDefinition & i_rDef ) +{ + const uintt nMaxSize + = 1000; + static char sLink[nMaxSize]; + static LinkCreator aLinkCreator( &sLink[0], nMaxSize ); + sLink[0] = NULCH; + + aLinkCreator.SetEnv(i_rEnv); + i_rDef.StoreAt(aLinkCreator); + + return sLink; +} + +const ary::CodeEntity * +FindUnambiguousCe( const OuputPage_Environment & i_rEnv, + const ary::QualifiedName & i_rQuName, + const ary::cpp::Class * i_pJustDocumentedClass ) +{ + if ( i_rEnv.CurNamespace() == 0 ) + return 0; + + const ary::CodeEntity * ret = 0; + + if ( NOT i_rQuName.IsQualified() ) + { + if ( i_pJustDocumentedClass != 0 ) + ret = i_rEnv.Gate().Search_CeLocal( i_rQuName.LocalName(), + i_rQuName.IsFunction(), + *i_rEnv.CurNamespace(), + i_pJustDocumentedClass ); + if (ret != 0) + return ret; + + ret = i_rEnv.Gate().Search_CeLocal( i_rQuName.LocalName(), + i_rQuName.IsFunction(), + *i_rEnv.CurNamespace(), + i_rEnv.CurClass() ); + } + if (ret != 0) + return ret; + + return i_rEnv.Gate().Search_CeAbsolute( i_rQuName ); +} + +void +ShowDocu_On( csi::xml::Element & o_rOut, + Docu_Display & io_rDisplay, + const ary::RepositoryEntity & i_rRE ) +{ + if ( &i_rRE.Info() != &ary::Documentation::Null_() ) + { + io_rDisplay.Assign_Out( o_rOut ); + i_rRE.Info().StoreAt( io_rDisplay ); + io_rDisplay.Unassign_Out(); + } +} + +void +WriteOut_TokenList( csi::xml::Element & o_rOut, + const StringVector & i_rTokens, + const char * i_sSeparator ) +{ + if ( i_rTokens.size() > 0 ) + { + StringVector::const_iterator + it = i_rTokens.begin(); + StringVector::const_iterator + itEnd = i_rTokens.end(); + + o_rOut << *it; + for ( ++it; it != itEnd; ++it ) + { + o_rOut << i_sSeparator << *it; + } + }; + +} + +void +EraseLeadingSpace( udmstri & io_rStr ) +{ + if ( *io_rStr.c_str() < 33 AND io_rStr.length() > 0 ) + { + for ( const unsigned char * pNew = (const unsigned char * ) io_rStr.c_str(); + *pNew < 33 AND *pNew != 0; + ++pNew ) {} + udmstri sNew( (const char*)pNew ); + io_rStr = sNew; + } +} + +void +WriteOut_LinkedFunctionText( csi::xml::Element & o_rTitleOut, + adcdisp::ParameterTable & o_rParameters, + const ary::cpp::Function & i_rFunction, + const OuputPage_Environment & i_rEnv, + bool * o_bIsConst, + bool * o_bIsVirtual ) +{ + // write pre-name: + const ary::cpp::FunctionFlags & rFlags = i_rFunction.Flags(); + if ( rFlags.IsStaticLocal() OR rFlags.IsStaticMember() ) + o_rTitleOut << "static "; + if ( rFlags.IsExplicit() ) + o_rTitleOut << "explicit "; + if ( rFlags.IsMutable() ) + o_rTitleOut << "mutable "; + if ( i_rFunction.Virtuality() != ary::cpp::VIRTUAL_none ) + o_rTitleOut << "virtual "; +// o_rTitleOut << new html::LineBreak; + + Get_LinkedTypeText( o_rTitleOut, i_rEnv, i_rFunction.ReturnType() ); + + // write name: + o_rTitleOut + << " " + >> *new html::Strong + << i_rFunction.LocalName(); + o_rTitleOut + << "("; + + + csi::xml::Element * pOutLast = &o_rTitleOut; + + // write post-name: + FunctionParam_Iterator fit; + fit.Assign(i_rFunction, i_rEnv.Gate()); + + if (fit) + { + o_rParameters.AddEntry(); + Get_LinkedTypeText( o_rParameters.Type(), i_rEnv, fit.CurType() ); + o_rParameters.Type() << " "; + o_rParameters.Name() << " " << fit.CurName(); + + for ( ++fit; fit; ++fit ) + { + o_rParameters.Name() << ","; + o_rParameters.AddEntry(); + Get_LinkedTypeText( o_rParameters.Type(), i_rEnv, fit.CurType() ); + o_rParameters.Name() << fit.CurName(); + } + + pOutLast = &o_rParameters.Name(); + o_rParameters.Name() << " "; + } + + *pOutLast << ")"; + if ( fit.IsFunctionConst() ) + { + *pOutLast << " const"; + if ( o_bIsConst != 0 ) + *o_bIsConst = true; + } + if ( fit.IsFunctionVolatile() ) + { + *pOutLast << " volatile"; + if ( o_bIsVirtual != 0 ) + *o_bIsVirtual = true; + } + + // write Exceptions: + const std::vector< ary::Tid > * + pThrow = i_rFunction.Exceptions(); + if ( pThrow) + { + std::vector< ary::Tid >::const_iterator + it = pThrow->begin(); + std::vector< ary::Tid >::const_iterator + it_end = pThrow->end(); + + if (it != it_end) + { + o_rParameters.AddEntry(); + pOutLast = &o_rParameters.Name(); + + o_rParameters.Name() << " throw( "; + Get_LinkedTypeText(o_rParameters.Name(), i_rEnv, *it); + + for ( ++it; it != it_end; ++it ) + { + o_rParameters.Name() << ", "; + Get_LinkedTypeText(o_rParameters.Name(), i_rEnv, *it); + } + o_rParameters.Name() << " )"; + } + else + { + *pOutLast << " throw()"; + } + } // endif // pThrow + + // abstractness: + if ( i_rFunction.Virtuality() == ary::cpp::VIRTUAL_abstract ) + *pOutLast << " = 0"; + + // finish: + *pOutLast << ";"; +} + + + +} // namespace dshelp + diff --git a/autodoc/source/display/html/hdimpl.hxx b/autodoc/source/display/html/hdimpl.hxx new file mode 100644 index 000000000000..89b731e94392 --- /dev/null +++ b/autodoc/source/display/html/hdimpl.hxx @@ -0,0 +1,288 @@ +/************************************************************************* + * + * $RCSfile: hdimpl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HDIMPL_HXX +#define ADC_DISPLAY_HDIMPL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <udm/html/htmlitem.hxx> + // COMPONENTS +#include "easywri.hxx" + // PARAMETERS +#include <cosv/bstream.hxx> +#include <ary/ids.hxx> +#include <ary/ary_disp.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/ce.hxx> +#include <ary/info/codeinfo.hxx> +#include "aryattrs.hxx" // For compatibility with earlier times, when those funtions were in this header. + + +namespace ary +{ + namespace cpp + { + class Class; + class DisplayGate; + class Function; + class CppDefinition; + } + + class CodeEntity; + class QualifiedName; +} +namespace csi +{ + namespace xml + { + class Element; + } + namespace html + { + class Table; + } +} + +namespace adcdisp +{ + class ParameterTable; +} + +class OuputPage_Environment; +class Docu_Display; + +class HtmlDisplay_Impl +{ + public: + ~HtmlDisplay_Impl(); + + const OuputPage_Environment & + Env() const { return *pEnv; } + + // ACCESS + OuputPage_Environment & + Env() { return *pEnv; } + EasyWriter & Easy() { return aWriteHelper; } + csi::xml::Element & CurOut() { return aWriteHelper.Out(); } + + protected: + HtmlDisplay_Impl( + OuputPage_Environment & + io_rEnv ); + private: + // DATA + OuputPage_Environment * + pEnv; + EasyWriter aWriteHelper; +}; + + +namespace dshelp +{ + +void DisplaySlot( + ary::Display & o_rDisplay, + const ary::AryGroup & + i_rGroup, + ary::SlotAccessId i_nSlot ); + + +const char * PathUp( + uintt i_nLevels ); +const char * PathPerLevelsUp( + uintt i_nLevels, + const char * i_nPathBelowDestinationLevel ); + +const char * PathPerRoot( + const OuputPage_Environment & + i_rEnv, + const char * i_sPathFromRootDir ); +const char * PathPerNamespace( + const OuputPage_Environment & + i_rEnv, + const char * i_sPathFromNamespaceDir ); + +csi::html::Table & Create_ChildListTable( + csi::xml::Element & o_rParentElement, + const char * i_sTitle, + const char * i_sLabel ); +void Create_ChildListLabel( + csi::xml::Element & o_rParentElement, + const char * i_sLabel ); +DYN csi::html::Table & + Create_ChildListTable( + const char * i_sTitle ); + +const char * HtmlFileName( + const char * i_sPrefix, + const char * i_sEntityName ); + +inline const char * +ClassFileName( const char * i_sClassLocalName ) + { return HtmlFileName( "c-", i_sClassLocalName); } +inline const char * +EnumFileName( const char * i_sEnumLocalName ) + { return HtmlFileName( "e-", i_sEnumLocalName); } +inline const char * +TypedefFileName( const char * i_sTypedefLocalName ) + { return HtmlFileName( "t-", i_sTypedefLocalName); } +inline const char * +FileFileName( const char * i_sFileLocalName ) + { return HtmlFileName( "f-", i_sFileLocalName); } + +const char * Path2Class( + uintt i_nLevelsUp, + const char * i_sClassLocalName ); + +const char * Path2Child( + const char * i_sFileName, + const char * i_sSubDir = 0 ); + +const char * Path2ChildNamespace( + const char * i_sLocalName ); + +const char * OperationLink( + const udmstri & i_sOpName, + ary::OSid i_nSignature, + const char * i_sPrePath = "" ); +const char * DataLink( + const udmstri & i_sLocalName, + const char * i_sPrePath = "" ); + +inline const char * +OperationLabel( const udmstri & i_sOpName, + ary::OSid i_nSignature ) + { return OperationLink(i_sOpName, i_nSignature) + 1; } // Skip '#' in front. +inline const char * +DataLabel( const udmstri & i_sLocalName ) + { return DataLink(i_sLocalName) + 1; } // Skip '#' in front. + + +void Get_LinkedTypeText( + csi::xml::Element & o_rOut, + const OuputPage_Environment & + i_rEnv, + ary::Tid i_nId, + bool i_bWithAbsolutifier = true ); + + +const char * Link2Ce( + const OuputPage_Environment & + i_rEnv, + const ary::CodeEntity & i_rCe ); + +const char * Link2CppDefinition( + const OuputPage_Environment & + i_rEnv, + const ary::cpp::CppDefinition & + i_rDef ); + +const ary::CodeEntity * + FindUnambiguousCe( + const OuputPage_Environment & + i_rEnv, + const ary::QualifiedName & + i_rQuName, + const ary::cpp::Class * i_pJustDocumentedClass ); + +void ShowDocu_On( + csi::xml::Element & o_rOut, + Docu_Display & io_rDisplay, + const ary::RepositoryEntity & + i_rRE ); + +void WriteOut_TokenList( + csi::xml::Element & o_rOut, + const StringVector & i_rTokens, + const char * i_sSeparator ); + +void EraseLeadingSpace( + udmstri & io_rStr ); + +/** @param o_bIsConst + *o_bIsConst will be set to true, if o_bIsConst != 0 and function is const. + If the function is not const, *o_bIsConst remains unchanged! + + @param o_bIsVirtual + The same as o_bIsConst. +*/ +void WriteOut_LinkedFunctionText( + csi::xml::Element & o_rTitleOut, + adcdisp::ParameterTable & + o_rParameters, + const ary::cpp::Function & + i_rFunction, + const OuputPage_Environment & + i_rEnv, + bool * o_bIsConst = 0, + bool * o_bIsVirtual = 0 ); + + + +} // namespace dshelp + +using namespace dshelp; + +#endif + diff --git a/autodoc/source/display/html/html_kit.cxx b/autodoc/source/display/html/html_kit.cxx new file mode 100644 index 000000000000..c148730c3437 --- /dev/null +++ b/autodoc/source/display/html/html_kit.cxx @@ -0,0 +1,365 @@ +/************************************************************************* + * + * $RCSfile: html_kit.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "html_kit.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_slntry.hxx> +#include "hdimpl.hxx" + + +namespace adcdisp +{ + + +using namespace csi::xml; +using namespace csi::html; + + +PageTitle_Central::PageTitle_Central( XmlElement & o_rOwner ) +{ + pOut = new AnElement("h1"); + o_rOwner + >> *pOut + << new AlignAttr("center"); +} + + +void +PageTitle_Left::operator()( XmlElement & o_rOwner, + const char * i_sTypeTitle, + const udmstri & i_sLocalName ) +{ + o_rOwner + >> *new Headline(2) + << i_sTypeTitle + << " " + << i_sLocalName; +} + +void +PageTitle_Std::operator()( XmlElement & o_rOwner, + const char * i_sTypeTitle, + const udmstri & i_sLocalName ) +{ + o_rOwner + >> *new AnElement("div") + << new AlignAttr("center") + << new StyleAttr("background-color:#ccccff; line-height:26pt;") + >> *new Headline(2) + << i_sTypeTitle + << " " + << i_sLocalName; +} + +XmlElement & +PageTitle_Std::operator()( XmlElement & o_rOwner ) +{ + XmlElement & ret = + o_rOwner + >> *new AnElement("div") + << new AlignAttr("center") + << new StyleAttr("background-color:#ccccff; line-height:26pt;") + >> *new Headline(2); + return ret; +} + +void +OperationTitle::operator()( XmlElement & o_rOwner, + const char * i_sItemName, + ary::OSid i_nSignature ) +{ + o_rOwner + >> *new Label( OperationLabel(i_sItemName, i_nSignature) ) + << " "; + o_rOwner + << i_sItemName; +} + + +void +TemplateClause::operator()( XmlElement & o_rOwner, + const List_TplParams & i_rTplParams ) +{ + if ( i_rTplParams.size() == 0 ) + return; + + Element & rOut = + o_rOwner + << new LineBreak + >> *new Paragraph + >> *new Strong + << "template< "; + + List_TplParams::const_iterator + it = i_rTplParams.begin(); + List_TplParams::const_iterator + itEnd = i_rTplParams.end(); + + rOut + << (*it).Name(); + for ( ++it; it != itEnd; ++it ) + { + rOut + << ", " + << (*it).Name(); + } // end for + rOut << " >"; +} + +ExplanationList::ExplanationList( XmlElement & o_rOwner, + bool i_bMemberStyle ) + : pList( new DefList), + pTerm(0), + pDefinition(0), + bMemberStyle(i_bMemberStyle) +{ + if (bMemberStyle) + *pList << new ClassAttr("member"); + + o_rOwner << pList; +} + +void +ExplanationList::AddEntry( const char * i_sTerm, + const char * i_sDifferentClass ) +{ + DefListTerm & rNewTerm = pList->AddTerm(); + if ( i_sDifferentClass != 0 ) + { + rNewTerm << new ClassAttr(i_sDifferentClass); + } + else if (bMemberStyle) + { + rNewTerm << new ClassAttr("member"); + } + if ( i_sTerm != 0 ) + rNewTerm << i_sTerm; + + pTerm = &rNewTerm; + pDefinition = &pList->AddDefinition(); + if (bMemberStyle) + *pDefinition << new ClassAttr("member"); +} + +void +ExplanationList::AddEntry_NoTerm() +{ + pTerm = 0; + pDefinition = &pList->AddDefinition(); + if (bMemberStyle) + *pDefinition << new ClassAttr("member"); +} + +ExplanationTable::ExplanationTable( XmlElement & o_rOwner ) + : pTable(0), + pTerm(0), + pDefinition(0) +{ + pTable = new Table("0", "100%", "3", "0"); + o_rOwner << pTable; +} + +void +ExplanationTable::AddEntry( const char * i_sTerm, + const char * i_sDifferentStyle ) +{ + TableRow & + rNewRow = pTable->AddRow(); + TableCell & + rNewTerm = rNewRow.AddCell(); + TableCell & + rNewDefinition = rNewRow.AddCell(); + + if ( i_sDifferentStyle == 0 ) + { + rNewTerm << new WidthAttr("15%") + << new StyleAttr("vertical-align:top; font-weight:bold"); + } + else + { + rNewTerm << new StyleAttr(i_sDifferentStyle); + } + if ( i_sTerm != 0 ) + rNewTerm << i_sTerm; + + pTerm = &rNewTerm; + pDefinition = & (rNewDefinition >> *new APureElement("pre")); +} + +ParameterTable::ParameterTable( XmlElement & o_rOwner ) + : pTable(0), + pTerm(0), + pDefinition(0) +{ + pTable = new Table; + o_rOwner << pTable; +} + +void +ParameterTable::AddEntry() +{ + TableRow & + rNewRow = pTable->AddRow(); + TableCell & + rNewTerm = rNewRow.AddCell(); + TableCell & + rNewDefinition = rNewRow.AddCell(); + + pTerm = &rNewTerm; + pDefinition = &rNewDefinition; +} + +FlagTable::FlagTable( XmlElement & o_rOwner, + uintt i_nNrOfColumns ) +{ + pTable = new Table; + *pTable << new AnAttribute("border", ""); + *pTable << new AnAttribute("cellspacing", "0"); + o_rOwner << pTable; + + TableRow & rRow1 = pTable->AddRow(); + TableRow & rRow2 = pTable->AddRow(); + + for ( uintt c = 0; c < i_nNrOfColumns; ++c ) + { + TableCell & rCell1 = rRow1.AddCell(); + int nWidth = 100 / i_nNrOfColumns; + static char sWidth[20]; + sprintf( sWidth, "%d%%", nWidth ); + + rCell1 + << new AnAttribute( "bgcolor", "#eeeeff" ) + << new WidthAttr( sWidth ) + << new StyleAttr( "font-family:Arial; font-size:8pt; font-weight:bold;" ); + TableCell & rCell2 = rRow2.AddCell(); + aCells.push_back( CellPair(&rCell1, &rCell2) ); + } // end for +} + +void +FlagTable::SetColumn( uintt i_nColumnPosition, + const char * i_sColumnName, + bool i_bValue ) +{ + csv_assert( i_nColumnPosition < aCells.size() ); + + TableCell & + rCell1 = *aCells[i_nColumnPosition].first; + TableCell & + rCell2 = *aCells[i_nColumnPosition].second; + rCell1 + << i_sColumnName; + if (i_bValue) + { + rCell2 + << new StyleAttr( "font-family:Arial; font-size:8pt; font-weight:bold;" ) + << "YES"; + } + else // + { + rCell2 + << new StyleAttr( "font-family:Arial; font-size:8pt;" ) + << "NO"; + } // endif +} + +void +FlagTable::SetColumn( uintt i_nColumnPosition, + const char * i_sColumnName, + const char * i_sValue ) +{ + csv_assert( i_nColumnPosition < aCells.size() ); + + TableCell & + rCell1 = *aCells[i_nColumnPosition].first; + TableCell & + rCell2 = *aCells[i_nColumnPosition].second; + rCell1 + << i_sColumnName; + rCell2 + << new StyleAttr( "font-family:Arial; font-size:8pt; font-weight:bold;" ) + << i_sValue; +} + +IndexList::IndexList( XmlElement & o_rOwner ) + : pList( new DefList ), + pTerm(0), + pDefinition(0) +{ + o_rOwner << pList; +} + +void +IndexList::AddEntry() +{ + pTerm = &pList->AddTerm(); + pDefinition = &pList->AddDefinition(); +} + + +} // namespace adcdisp + + + diff --git a/autodoc/source/display/html/html_kit.hxx b/autodoc/source/display/html/html_kit.hxx new file mode 100644 index 000000000000..54663cc68fc3 --- /dev/null +++ b/autodoc/source/display/html/html_kit.hxx @@ -0,0 +1,253 @@ +/************************************************************************* + * + * $RCSfile: html_kit.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_KIT_HXX +#define ADC_DISPLAY_HTML_KIT_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <udm/xml/xmlitem.hxx> +#include <udm/html/htmlitem.hxx> + // PARAMETERS +#include <ary/ids.hxx> + +namespace ary +{ + namespace cpp + { + struct S_TplParam; + } +} + + +namespace adcdisp +{ + +typedef csi::xml::Element XmlElement; + +class PageTitle_Central +{ + public: + PageTitle_Central( + XmlElement & o_rOwner ); + XmlElement & Out() { return *pOut; } + + private: + XmlElement * pOut; +}; + +class PageTitle_Left +{ + public: + void operator()( + XmlElement & o_rOwner, + const char * i_sTypeTitle, + const udmstri & i_sLocalName ); +}; + +class PageTitle_Std +{ + public: + void operator()( + XmlElement & o_rOwner, + const char * i_sTypeTitle, + const udmstri & i_sLocalName ); + XmlElement & operator()( + XmlElement & o_rOwner ); +}; + +class OperationTitle +{ + public: + void operator()( + XmlElement & o_rOwner, + const char * i_sItemName, + ary::OSid i_nSignature ); +}; + + +class TemplateClause +{ + public: + typedef std::vector< ary::cpp::S_TplParam> List_TplParams; + + void operator()( + XmlElement & o_rOwner, + const List_TplParams & + i_rTplParams ); +}; + + +class ExplanationList +{ + public: + ExplanationList( + XmlElement & o_rOwner, + bool i_bMemberStyle = false ); + + void AddEntry( + const char * i_sTerm = 0, + const char * i_sDifferentClass = 0 ); + void AddEntry_NoTerm(); + + XmlElement & Term() { return *pTerm; } + XmlElement & Def() { return *pDefinition; } + + private: + csi::html::DefList* pList; + XmlElement * pTerm; + XmlElement * pDefinition; + bool bMemberStyle; +}; + +class ExplanationTable +{ + public: + ExplanationTable( + XmlElement & o_rOwner ); + + void AddEntry( + const char * i_sTerm = 0, + const char * i_sDifferentStyle = 0 ); + + XmlElement & Term() { return *pTerm; } + XmlElement & Def() { return *pDefinition; } + + private: + csi::html::Table* pTable; + XmlElement * pTerm; + XmlElement * pDefinition; +}; + +class ParameterTable +{ + public: + ParameterTable( + XmlElement & o_rOwner ); + + void AddEntry(); + + XmlElement & Type() { return *pTerm; } + XmlElement & Name() { return *pDefinition; } + + private: + csi::html::Table* pTable; + XmlElement * pTerm; + XmlElement * pDefinition; +}; + +class FlagTable +{ + public: + FlagTable( + XmlElement & o_rOwner, + uintt i_nNrOfColumns ); + + void SetColumn( + uintt i_nColumnPosition, /// Starting with 0. + const char * i_sColumnName, + bool i_bValue ); /// "YES" or "NO" + void SetColumn( + uintt i_nColumnPosition, /// Starting with 0. + const char * i_sColumnName, + const char * i_sValue ); + private: + typedef std::pair< csi::html::TableCell*, csi::html::TableCell* > CellPair; + + // DATA + csi::html::Table* pTable; + std::vector<CellPair> + aCells; +}; + +class IndexList +{ + public: + IndexList( + XmlElement & o_rOwner ); + + void AddEntry(); + + XmlElement & Term() { return *pTerm; } + XmlElement & Def() { return *pDefinition; } + + private: + csi::html::DefList* pList; + XmlElement * pTerm; + XmlElement * pDefinition; +}; + + + + +// IMPLEMENTATION + + + +} // namespace adcdisp + + +#endif + + diff --git a/autodoc/source/display/html/makefile.mk b/autodoc/source/display/html/makefile.mk new file mode 100644 index 000000000000..c4a61e36c034 --- /dev/null +++ b/autodoc/source/display/html/makefile.mk @@ -0,0 +1,113 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=display_html + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/aryattrs.obj \ + $(OBJ)$/cfrstd.obj \ + $(OBJ)$/chd_udk2.obj \ + $(OBJ)$/cre_link.obj \ + $(OBJ)$/dsply_cl.obj \ + $(OBJ)$/dsply_da.obj \ + $(OBJ)$/dsply_op.obj \ + $(OBJ)$/easywri.obj \ + $(OBJ)$/hd_chlst.obj \ + $(OBJ)$/hd_docu.obj \ + $(OBJ)$/hdimpl.obj \ + $(OBJ)$/html_kit.obj \ + $(OBJ)$/nav_main.obj \ + $(OBJ)$/navibar.obj \ + $(OBJ)$/outfile.obj \ + $(OBJ)$/opageenv.obj \ + $(OBJ)$/pagemake.obj \ + $(OBJ)$/pm_aldef.obj \ + $(OBJ)$/pm_base.obj \ + $(OBJ)$/pm_class.obj \ + $(OBJ)$/pm_help.obj \ + $(OBJ)$/pm_index.obj \ + $(OBJ)$/pm_namsp.obj \ + $(OBJ)$/pm_start.obj \ + $(OBJ)$/protarea.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/display/html/nav_main.cxx b/autodoc/source/display/html/nav_main.cxx new file mode 100644 index 000000000000..e61660f961cf --- /dev/null +++ b/autodoc/source/display/html/nav_main.cxx @@ -0,0 +1,575 @@ +/************************************************************************* + * + * $RCSfile: nav_main.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "nav_main.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/ce.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/crog_grp.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/cg_proj.hxx> +#include <ary/cpp/cg_file.hxx> +#include <udm/html/htmlitem.hxx> +#include "hdimpl.hxx" +#include "opageenv.hxx" +#include "strconst.hxx" + + +using namespace ::csi::html; +using namespace ::csi::xml; + + +const udmstri sOverview("Overview"); +const udmstri sNamespace("Namespace"); +const udmstri sClass("Class"); +const udmstri sTree("Tree"); +const udmstri sProject("Project"); +const udmstri sFile("File"); +const udmstri sIndex("Index"); +const udmstri sHelp("Help"); + + + +//******************** MainItem and derived ones ***************// +class MainItem +{ + public: + virtual ~MainItem() {} + void Write2( + TableRow & o_rOut ); + private: + virtual void do_Write2( + TableRow & o_rOut ) = 0; +}; + +inline void +MainItem::Write2( TableRow & o_rOut ) + { do_Write2(o_rOut); } + + +namespace +{ + +class MainRowItem : public MainItem +{ + public: + MainRowItem( + const udmstri & i_sText, + const char * i_sLink, + const char * i_sTip ); + ~MainRowItem(); + private: + enum E_Style { eSelf, eNo, eStd }; + + virtual void do_Write2( + TableRow & o_rOut ); + udmstri sText; + udmstri sLink; + udmstri sTip; +}; + +MainRowItem::MainRowItem( const udmstri & i_sText, + const char * i_sLink, + const char * i_sTip ) + : sText(i_sText), + sLink(i_sLink), + sTip(i_sTip) +{ +} + +MainRowItem::~MainRowItem() +{ +} + +void +MainRowItem::do_Write2( TableRow & o_rOut ) +{ + TableCell & rCell = o_rOut.AddCell(); + + rCell + << new AnAttribute( "bgcolor", "#eeeeff" ) + << new XmlCode(" ") + >> *new Link(sLink.c_str()) + << new AnAttribute( "alt", sTip.c_str() ) + >> *new AnElement( "font") + << new AnAttribute( "family", "Arial" ) + << new AnAttribute( "color", "#000000" ) + << new AnAttribute( "size", "+1" ) + >> *new Bold + << sText.c_str(); + rCell + << new XmlCode(" "); +} + + +class SelectedItem : public MainItem +{ + public: + SelectedItem( + const udmstri & i_sText ) + : sText(i_sText) {} + private: + virtual void do_Write2( + TableRow & o_rOut ); + udmstri sText; +}; + +void +SelectedItem::do_Write2( TableRow & o_rOut ) +{ + TableCell & rCell = o_rOut.AddCell(); + + rCell + << new AnAttribute( "bgcolor", "#2222ad" ) + << new XmlCode(" ") + >> *new AnElement( "font") + << new AnAttribute( "family", "Arial" ) + << new AnAttribute( "color", "#ffffff" ) + << new AnAttribute( "size", "+1" ) + >> *new Bold + << sText.c_str(); + rCell + << new XmlCode(" "); +} + +class UnavailableItem : public MainItem +{ + public: + UnavailableItem( + const udmstri & i_sText ) + : sText(i_sText) {} + private: + virtual void do_Write2( + TableRow & o_rOut ); + udmstri sText; +}; + +void +UnavailableItem::do_Write2( TableRow & o_rOut ) +{ + TableCell & rCell = o_rOut.AddCell(); + + rCell + << new AnAttribute( "bgcolor", "#eeeeff" ) + << new XmlCode(" ") + >> *new AnElement( "font") + << new AnAttribute( "family", "Arial" ) + << new AnAttribute( "color", "#000000" ) + << new AnAttribute( "size", "+1" ) + << sText.c_str(); + rCell + << new XmlCode(" "); +} + +} // anonymous namespace + +//************************ MainRow ***************************// + +MainRow::MainRow( const OuputPage_Environment & i_rEnv ) + : // aItems, + pEnv(&i_rEnv) +{ +} + +MainRow::~MainRow() +{ + csv::erase_container_of_heap_ptrs(aItems); +} + +void +MainRow::SetupItems_Overview() +{ + Create_ItemList_Global( eSelf, eStd, eStd ); +} + +void +MainRow::SetupItems_AllDefs() +{ + Create_ItemList_Global( eStd, eStd, eStd ); +} + +void +MainRow::SetupItems_Index() +{ + Create_ItemList_Global( eStd, eSelf, eStd ); +} + +void +MainRow::SetupItems_Help() +{ + Create_ItemList_Global( eStd, eStd, eSelf ); +} + +void +MainRow::SetupItems_Ce( const ary::CodeEntity & i_rCe ) +{ + csv_assert( pEnv->CurNamespace() != 0 ); + bool bIsNamespace = i_rCe.Id() == pEnv->CurNamespace()->Id(); + bool bHasClass = pEnv->CurClass() != 0; + bool bIsClass = dynamic_cast< const ary::cpp::Class * >(&i_rCe) != 0; + const ary::cpp::FileGroup * + pFile = bIsNamespace + ? 0 + : pEnv->Gate().RoGroups().Search_FileGroup( i_rCe.Location() ); + const ary::cpp::ProjectGroup * + pProj = pFile == 0 + ? 0 + : pEnv->Gate().RoGroups().Find_ProjectGroup( pFile->OwningProject() ); + + Create_ItemList_InDirTree_Cpp( + ( bIsNamespace ? eSelf : eStd ), + ( bIsClass ? eSelf : bHasClass ? eStd : eNo ), + eNo, 0, + ( pProj != 0 ? eStd : eNo ), pProj, + ( pFile != 0 ? eStd : eNo ), pFile ); +} + +void +MainRow::SetupItems_FunctionGroup() +{ + csv_assert( pEnv->CurClass() != 0 ); + const ary::cpp::FileGroup * + pFile = pEnv->Gate().RoGroups().Search_FileGroup( pEnv->CurClass()->Location() ); + csv_assert( pFile != 0 ); + const ary::cpp::ProjectGroup * + pProj = pEnv->Gate().RoGroups().Find_ProjectGroup( pFile->OwningProject() ); + csv_assert( pProj != 0 ); + + Create_ItemList_InDirTree_Cpp( + eStd, + eStd, + eNo, 0, + eStd, pProj, + eStd, pFile ); +} + +void +MainRow::SetupItems_FunctionGroup( const ary::cpp::FileGroup & i_rFile ) +{ + csv_assert( pEnv->CurClass() == 0 ); + const ary::cpp::ProjectGroup * + pProj = pEnv->Gate().RoGroups().Find_ProjectGroup( i_rFile.OwningProject() ); + csv_assert( pProj != 0 ); + + Create_ItemList_InDirTree_Cpp( + eStd, + eNo, + eNo, 0, + eStd, pProj, + eStd, &i_rFile ); +} + +void +MainRow::SetupItems_DataGroup() +{ + SetupItems_FunctionGroup(); +} + +void +MainRow::SetupItems_DataGroup( const ary::cpp::FileGroup & i_rFile ) +{ + SetupItems_FunctionGroup(i_rFile); +} + +void +MainRow::SetupItems_Project() +{ + Create_ItemList_InDirTree_Prj( eSelf, 0, eNo, 0 ); +} + +void +MainRow::SetupItems_File( const ary::cpp::ProjectGroup & i_rProj ) +{ + Create_ItemList_InDirTree_Prj( eStd, &i_rProj, eSelf, 0 ); +} + +void +MainRow::SetupItems_DefinitionsGroup( const ary::cpp::ProjectGroup & i_rProj, + const ary::cpp::FileGroup & i_rFile ) +{ + Create_ItemList_InDirTree_Prj( eStd, &i_rProj, eStd, &i_rFile ); +} + + +void +MainRow::Write2( csi::xml::Element & o_rOut ) const +{ + Table * pTable = new Table; + o_rOut + >> *pTable + << new AnAttribute( "border", "0" ) + << new AnAttribute( "cellpadding", "1" ) + << new AnAttribute( "cellspacing", "0" ); + TableRow & rRow = pTable->AddRow(); + rRow + << new AnAttribute( "align", "center" ) + << new AnAttribute( "valign", "top" ); + for ( ItemList::const_iterator it = aItems.begin(); + it != aItems.end(); + ++it ) + { + (*it)->Write2( rRow ); + } +} + +void +MainRow::Create_ItemList_Global( E_Style i_eOverview, + E_Style i_eIndex, + E_Style i_eHelp ) +{ + if ( i_eOverview == eStd ) + { + udmstri sLinkOverview = ( i_eIndex == eSelf + ? dshelp::PathPerLevelsUp( + 1, + C_sHFN_Overview ) + : C_sHFN_Overview ); + Add_Item( i_eOverview, sOverview, sLinkOverview.c_str(), "" ); + } + else + { + Add_Item( i_eOverview, sOverview, "", "" ); + } + + if ( i_eIndex == eSelf ) + Add_Item( eStd, sNamespace, "../names/index.html", "" ); + else + Add_Item( eStd, sNamespace, "names/index.html", "" ); + + Add_Item( eNo, sClass, "", "" ); +#if 0 // Will be implemented later + Add_Item( eNo, sTree, "", "" ); + Add_Item( eNo, sProject, "", "" ); + Add_Item( eNo, sFile, "", "" ); +#endif // Will be implemented later + + if ( i_eIndex == eStd ) + { + Add_Item( i_eIndex, sIndex, C_sPath_Index, "" ); + } + else + { + Add_Item( i_eIndex, sIndex, "", "" ); + } + + if ( i_eHelp == eStd ) + { + udmstri sLinkHelp = ( i_eIndex == eSelf + ? PathPerLevelsUp(1,C_sHFN_Help) + : C_sHFN_Help ); + Add_Item( i_eHelp, sHelp, sLinkHelp.c_str(), "" ); + } + else + { + Add_Item( i_eHelp, sHelp, "", "" ); + } +} + +void +MainRow::Create_ItemList_InDirTree_Cpp( E_Style i_eNsp, + E_Style i_eClass, + E_Style i_eTree, + const char * i_sTreeLink, + E_Style i_eProj, + const ary::cpp::ProjectGroup * i_pProj, + E_Style i_eFile, + const ary::cpp::FileGroup * i_pFile ) +{ + udmstri sLinkOverview = PathPerRoot(*pEnv, C_sHFN_Overview); + Add_Item( eStd, sOverview, sLinkOverview.c_str(), "" ); + + if ( i_eNsp == eStd ) + { + udmstri sLinkNamespace = PathPerNamespace(*pEnv, "index.html"); + Add_Item( i_eNsp, sNamespace, sLinkNamespace.c_str(), "" ); + } + else + { + Add_Item( i_eNsp, sNamespace, "", "" ); + } + + if ( i_eClass == eStd ) + { + csv_assert( pEnv->CurClass() != 0 ); + + StreamLock sLinkClass(300); + sLinkClass() << PathPerNamespace(*pEnv, "c-") + << pEnv->CurClass()->LocalName() + << ".html"; + StreamLock sTipClass(300); + sTipClass() << "Class " + << pEnv->CurClass()->LocalName(); + Add_Item( i_eClass, sClass, sLinkClass().c_str(), sTipClass().c_str() ); + } + else + { + Add_Item( i_eClass, sClass, "", "" ); + } + +#if 0 // Will be implemented later + if ( i_eTree == eStd ) + { + csv_assert( i_sTreeLink != 0 ); + Add_Item( i_eTree, sTree, i_sTreeLink, "" ); + } + else + { + Add_Item( i_eTree, sTree, "", "" ); + } + + if ( i_eProj == eStd ) + { + csv_assert( i_pProj != 0 ); + udmstri sProjectLink = PathPerRoot(*pEnv, "prj/"); + sProjectLink = csv::StringSum( sProjectLink.c_str(), + i_pProj->Name().c_str(), + "/index.html", + NIL ); + udmstri sProjectTip = csv::StringSum( "Project ", + i_pProj->Name().c_str(), + NIL ); + Add_Item( i_eProj, sProject, sProjectLink, sProjectTip.c_str() ); + } + else + { + Add_Item( i_eProj, sProject, "", "" ); + } + if ( i_eProj == eStd ) + { + csv_assert( i_pProj != 0 ); + csv_assert( i_pFile != 0 ); + + udmstri sFileLink = PathPerRoot(*pEnv, "prj/"); + sFileLink = csv::StringSum( sFileLink.c_str(), + i_pProj->Name().c_str(), + "/f-", + i_pFile->FileName().c_str(), + ".html", + NIL ); + udmstri sFileTip = csv::StringSum( "File ", + i_pFile->FileName().c_str(), + NIL ); + Add_Item( i_eFile, sFile, sFileLink, sFileTip.c_str() ); + } + else + { + Add_Item( i_eFile, sFile, "", "" ); + } +#endif // Will be implemented later + + + Add_Item( eStd, sIndex, PathPerRoot(*pEnv, C_sPath_Index), "" ); + udmstri sLinkHelp = PathPerRoot(*pEnv, "help.html"); + Add_Item( eStd, sHelp, sLinkHelp.c_str(), "" ); +} + +void +MainRow::Create_ItemList_InDirTree_Prj( E_Style i_eProj, + const ary::cpp::ProjectGroup * i_pProj, + E_Style i_eFile, + const ary::cpp::FileGroup * i_pFile ) +{ + Add_Item( eStd, sOverview, "../../index.html", "" ); + Add_Item( eNo, sNamespace, "", "" ); + Add_Item( eNo, sClass, "", "" ); + Add_Item( eNo, sTree, "", "" ); + + udmstri sLinkProject = i_pProj != 0 + ? "index.html" + : ""; + Add_Item( i_eProj, sProject, sLinkProject.c_str(), "" ); + StreamLock sLinkFile(120); + if ( i_pFile != 0 ) + sLinkFile() << "f-" << i_pFile->FileName(); + + Add_Item( i_eFile, sFile, sLinkFile().c_str(), "" ); + + Add_Item( eStd, sIndex, "../../index-files/index-1.html", "" ); + Add_Item( eStd, sHelp, "../../help.html", "" ); +} + +void +MainRow::Add_Item( E_Style i_eStyle, + const udmstri & i_sText, + const char * i_sLink, + const char * i_sTip ) +{ + switch (i_eStyle) + { + case eStd: aItems.push_back( new MainRowItem(i_sText, i_sLink, i_sTip) ); + break; + case eNo: aItems.push_back( new UnavailableItem(i_sText) ); + break; + case eSelf: aItems.push_back( new SelectedItem(i_sText) ); + break; + default: + csv_assert(false); + } +} + + + diff --git a/autodoc/source/display/html/nav_main.hxx b/autodoc/source/display/html/nav_main.hxx new file mode 100644 index 000000000000..ab83de192499 --- /dev/null +++ b/autodoc/source/display/html/nav_main.hxx @@ -0,0 +1,182 @@ +/************************************************************************* + * + * $RCSfile: nav_main.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_NAV_MAIN_HXX +#define ADC_DISPLAY_HTML_NAV_MAIN_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + namespace cpp + { + class DisplayGate; + } + + class CodeEntity; +} +namespace csi +{ + namespace xml + { + class Element; + } +} + +class OuputPage_Environment; +class MainItem; + + +class MainRow : public ary::cpp::Display +{ + public: + MainRow( + const OuputPage_Environment & + i_rEnv ); + ~MainRow(); + + void SetupItems_Overview(); + void SetupItems_AllDefs(); + void SetupItems_Index(); + void SetupItems_Help(); + + void SetupItems_Ce( + const ary::CodeEntity & + i_rCe ); + void SetupItems_FunctionGroup(); /// For class member methods. + void SetupItems_FunctionGroup( /// For global functions. + const ary::cpp::FileGroup & + i_rFile ); + void SetupItems_DataGroup(); /// For class member data. + void SetupItems_DataGroup( /// For global data. + const ary::cpp::FileGroup & + i_rFile ); + + void SetupItems_Project(); + void SetupItems_File( + const ary::cpp::ProjectGroup & + i_rProj ); + void SetupItems_DefinitionsGroup( + const ary::cpp::ProjectGroup & + i_rProj, + const ary::cpp::FileGroup & + i_rFile ); + void Write2( + csi::xml::Element & o_rOut ) const; + private: + // Local + enum E_Style + { + eSelf, + eNo, + eStd + }; + + /** @precond + Only combinations of 1 eSelf and 2 eStd are allowed + as arguments, here. + */ + void Create_ItemList_Global( + E_Style i_eOverview, + E_Style i_eIndex, + E_Style i_eHelp ); + void Create_ItemList_InDirTree_Cpp( + E_Style i_eNsp, + E_Style i_eClass, + E_Style i_eTree, + const char * i_sTreeLink, + E_Style i_eProj, + const ary::cpp::ProjectGroup * + i_pProj, + E_Style i_eFile, + const ary::cpp::FileGroup * + i_pFile ); + void Create_ItemList_InDirTree_Prj( + E_Style i_eProj, + const ary::cpp::ProjectGroup * + i_pProj, + E_Style i_eFile, + const ary::cpp::FileGroup * + i_pFile ); + void Add_Item( + E_Style i_eStyle, + const udmstri & i_sText, + const char * i_sLink, + const char * i_sTip ); + // DATA + typedef std::vector< DYN MainItem* > ItemList; + + + ItemList aItems; + const OuputPage_Environment * + pEnv; +}; + + +#endif + diff --git a/autodoc/source/display/html/navibar.cxx b/autodoc/source/display/html/navibar.cxx new file mode 100644 index 000000000000..544bcbc84bed --- /dev/null +++ b/autodoc/source/display/html/navibar.cxx @@ -0,0 +1,383 @@ +/************************************************************************* + * + * $RCSfile: navibar.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "navibar.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include "nav_main.hxx" +#include "opageenv.hxx" + + +using namespace csi::xml; +using namespace csi::html; + + +namespace +{ + +//************************ SubRowItem ***************************// + +class SubRowItem +{ + public: + SubRowItem( + const char * i_sText, + const char * i_sLink, + bool i_bActive, + bool i_bFirstOfRow = false ); + ~SubRowItem(); + + void Write2( + Element & o_rOut ) const; + private: + udmstri sText; + udmstri sLink; + bool bIsActive; + bool bFirstOfRow; +}; + +SubRowItem::SubRowItem( const char * i_sText, + const char * i_sLink, + bool i_bActive, + bool i_bFirstOfRow ) + : sText(i_sText), + sLink(i_sLink), + bIsActive(i_bActive), + bFirstOfRow(i_bFirstOfRow) +{ + csv_assert( NOT csv::no_str(i_sLink) ); +} + +SubRowItem::~SubRowItem() +{ +} + +void +SubRowItem::Write2( Element & o_rOut ) const +{ + o_rOut << new Sbr; + if ( NOT bFirstOfRow ) + o_rOut << new XmlCode( "| " ); + else + o_rOut << new XmlCode( " " ); + + if ( bIsActive ) + { + o_rOut + >> *new Link( sLink.c_str() ) + >> *new AnElement( "font" ) + << new AnAttribute("size","-2") + >> *new Bold + << sText.c_str(); + } + else + { + o_rOut + >> *new AnElement( "font" ) + << new AnAttribute("size","-2") + << sText.c_str(); + } +} + + + +//************************ SubRow ***************************// + +class SubRow +{ + public: + SubRow( + const char * i_sTitle ); + ~SubRow(); + + void AddItem( + const char * i_sText, + const char * i_sLink, + bool i_bActive ); + void Write2( + Table & o_rOut ) const; + private: + typedef std::vector< DYN SubRowItem * > List_Items; + + List_Items aItemList; + udmstri sTitle; +}; + +SubRow::SubRow( const char * i_sTitle ) +// : // aItemList, + // sTitle +{ + StreamStr sUp(i_sTitle,0); + sUp.to_upper(); + sTitle = sUp.c_str(); +} + +SubRow::~SubRow() +{ +} + +inline void +SubRow::AddItem( const char * i_sText, + const char * i_sLink, + bool i_bActive ) +{ + aItemList.push_back( new SubRowItem(i_sText, i_sLink, i_bActive, aItemList.empty()) ); +} + +void +SubRow::Write2( Table & o_rOut ) const +{ + TableRow * pRow = new TableRow; + o_rOut << pRow; + + if (sTitle.length() > 0) + { + Element & rCell1 = pRow->AddCell(); + rCell1 + << new WidthAttr("20%") + >> *new AnElement( "font" ) + << new AnAttribute("size","-2") + << sTitle + << ":"; + } + + Element & rCell2 = pRow->AddCell(); + for ( List_Items::const_iterator it = aItemList.begin(); + it != aItemList.end(); + ++it ) + { + (*it)->Write2( rCell2 ); + } +} + + +} // anonymous namespace + + + +//************************* CheshireCat ***********************// + + +typedef std::vector< DYN SubRow * > List_SubRows; + +struct NavigationBar::CheshireCat +{ + MainRow aMainRow; + List_SubRows aSubRows; + const OuputPage_Environment * + pEnv; + + + CheshireCat( + const OuputPage_Environment & + i_rEnv ); + ~CheshireCat(); +}; + +NavigationBar:: +CheshireCat::CheshireCat( const OuputPage_Environment & i_rEnv ) + : aMainRow( i_rEnv ), + pEnv( & i_rEnv ) +{ +} + +NavigationBar:: +CheshireCat::~CheshireCat() +{ + csv::erase_container_of_heap_ptrs( aSubRows ); +} + + +//************************ NavigationBar *******************// + +NavigationBar::NavigationBar( const OuputPage_Environment & i_rEnv, + E_GlobalLocation i_eLocation ) + : pi( new CheshireCat(i_rEnv) ) +{ + switch (i_eLocation) + { + case LOC_Overview: pi->aMainRow.SetupItems_Overview(); break; + case LOC_AllDefs: pi->aMainRow.SetupItems_AllDefs(); break; + case LOC_Index: pi->aMainRow.SetupItems_Index(); break; + case LOC_Help: pi->aMainRow.SetupItems_Help(); break; + default: + csv_assert(false); + } +} + +NavigationBar::NavigationBar( const OuputPage_Environment & i_rEnv, + const ary::CodeEntity & i_rCe ) + : pi( new CheshireCat(i_rEnv) ) +{ + pi->aMainRow.SetupItems_Ce( i_rCe ); +} + +NavigationBar::NavigationBar( const OuputPage_Environment & i_rEnv, + E_CeGatheringType i_eCeGatheringType, + const ary::cpp::FileGroup * i_pFile ) + : pi( new CheshireCat(i_rEnv) ) +{ + if ( i_rEnv.CurClass() != 0 ) + { + switch (i_eCeGatheringType) + { + case CEGT_operations: pi->aMainRow.SetupItems_FunctionGroup(); break; + case CEGT_data: pi->aMainRow.SetupItems_DataGroup(); break; + default: + csv_assert(false); + } + } + else + { + csv_assert( i_pFile != 0 ); + switch (i_eCeGatheringType) + { + case CEGT_operations: pi->aMainRow.SetupItems_FunctionGroup(*i_pFile); break; + case CEGT_data: pi->aMainRow.SetupItems_DataGroup(*i_pFile); break; + default: + csv_assert(false); + } + } +} + +NavigationBar::NavigationBar( const OuputPage_Environment & i_rEnv, + const ary::cpp::ProjectGroup * i_pPrj, + const ary::cpp::FileGroup * i_pFile ) + : pi( new CheshireCat(i_rEnv) ) +{ + if ( i_pPrj == 0 ) + { + pi->aMainRow.SetupItems_Project(); + return; + } + if ( i_pFile == 0 ) + { + pi->aMainRow.SetupItems_File( *i_pPrj ); + return; + } + + pi->aMainRow.SetupItems_DefinitionsGroup( *i_pPrj, *i_pFile ); +} + +NavigationBar::~NavigationBar() +{ + csv::erase_container_of_heap_ptrs( pi->aSubRows ); +} + +void +NavigationBar::MakeSubRow( const char * i_sTitle ) +{ + pi->aSubRows.push_back( new SubRow(i_sTitle) ); +} + +void +NavigationBar::AddItem( const char * i_sName, + const char * i_sLink, + bool i_bValid ) +{ + csv_assert( pi->aSubRows.size() > 0 ); + StreamStr sName(i_sName, 0); + sName.to_upper(); + + StreamLock aSum(100); + pi->aSubRows.back()->AddItem( sName.c_str(), + aSum() << "#" << i_sLink << c_str, + i_bValid ); +} + +void +NavigationBar::Write( Element & o_rOut, + bool i_bWithSubRows ) const +{ + pi->aMainRow.Write2( o_rOut ); + + const_cast< NavigationBar* >(this)->pSubRowsTable = new Table; + o_rOut << pSubRowsTable; + *pSubRowsTable + << new AnAttribute( "cellpadding", "0" ) + << new AnAttribute( "cellspacing", "3" ); + + if (i_bWithSubRows) + { + o_rOut >> *new TableRow >> *new Paragraph << " "; + Write_SubRows(); + } +} + +void +NavigationBar::Write_SubRows() const +{ + for ( List_SubRows::const_iterator it = pi->aSubRows.begin(); + it != pi->aSubRows.end(); + ++it ) + { + (*it)->Write2( *pSubRowsTable ); + } +} + + + + + diff --git a/autodoc/source/display/html/navibar.hxx b/autodoc/source/display/html/navibar.hxx new file mode 100644 index 000000000000..67dbb1942924 --- /dev/null +++ b/autodoc/source/display/html/navibar.hxx @@ -0,0 +1,164 @@ +/************************************************************************* + * + * $RCSfile: navibar.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_NAVIBAR_HXX +#define ADC_DISPLAY_HTML_NAVIBAR_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> +#include "hdimpl.hxx" + // COMPONENTS + // PARAMETERS + +namespace ary +{ + class CodeEntity; +} + + +/** Creates a HTML navigation bar wth the following parts: + + A main bar with fixed items. + Zero to several subbars with user defined items, depending of + the contents of the page. + + The main bar contains those items: + + Overview | Namespace | Class | Tree | Project | File | Index | Help +*/ +class NavigationBar +{ + public: + enum E_GlobalLocation + { + LOC_Overview, + LOC_AllDefs, + LOC_Index, + LOC_Help + }; + enum E_CeGatheringType + { + CEGT_operations, + CEGT_data + }; + + /// Used for Overview, Index and Help. + NavigationBar( + const OuputPage_Environment & + i_rEnv, + E_GlobalLocation i_eLocation ); + /// Used for all Ces except operations and data. + NavigationBar( + const OuputPage_Environment & + i_rEnv, + const ary::CodeEntity & + i_rCe ); + /** Used for operations and data. + If functions or data ar non-members, i_pFile has to be != 0. + */ + NavigationBar( + const OuputPage_Environment & + i_rEnv, + E_CeGatheringType i_eCeGatheringType, + const ary::cpp::FileGroup * + i_pFile = 0 ); + /** Used for + Project: i_pProj == 0. + File: i_pProj != 0 and i_pFile == 0. + Defs: i_pProj != 0 and i_pFile != 0. + */ + NavigationBar( + const OuputPage_Environment & + i_rEnv, + const ary::cpp::ProjectGroup * + i_pPrj, + const ary::cpp::FileGroup * + i_pFile = 0 ); + ~NavigationBar(); + + void MakeSubRow( + const char * i_sTitle ); + void AddItem( /// Items are added to last made sub-row. + const char * i_sName, + const char * i_sLink, + bool i_bValid ); + /** This writes the main bar and the pSubRowTable to o_rOut. + The pSubRowsTable stays in memory and can be filled later, + when all SubRow items are known. + */ + void Write( + csi::xml::Element & o_rOut, + bool i_bWithSubRows = false ) const; + void Write_SubRows() const; + + private: + struct CheshireCat; + Dyn<CheshireCat> pi; + csi::html::Table * pSubRowsTable; +}; + + + +#endif + diff --git a/autodoc/source/display/html/opageenv.cxx b/autodoc/source/display/html/opageenv.cxx new file mode 100644 index 000000000000..a9510344a4a2 --- /dev/null +++ b/autodoc/source/display/html/opageenv.cxx @@ -0,0 +1,571 @@ +/************************************************************************* + * + * $RCSfile: opageenv.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "opageenv.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/ploc_dir.hxx> +#include <ary/ce.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/cg_file.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <udm/html/htmlitem.hxx> +#include "hdimpl.hxx" +#include "strconst.hxx" +#include <estack.hxx> + +const udmstri C_sProjectDir( "prj" ); +const udmstri C_sCppDir( "names" ); +const udmstri C_sIndexDir( "ix" ); + + +//************************ Implementation ********************// + +namespace +{ + +void CreateDirectory( const udmstri & i_sPath ); +void CreateDirectory( const csv::ploc::Path & i_rPath ); + +void +CreateDirectory( const udmstri & i_sPath ) +{ + csv::ploc::Directory aDirectory(i_sPath); + if (NOT aDirectory.Exists()) + aDirectory.PhysicalCreate(); +} + +void +CreateDirectory( const csv::ploc::Path & i_rPath ) +{ + csv::ploc::Directory aDirectory(i_rPath); + if (NOT aDirectory.Exists()) + aDirectory.PhysicalCreate(); +} + +//************************ CheshireCat ********************// + +struct InNamespaceTree +{ + enum E_Type + { + t_unknown, + t_namespace, + t_type, + t_operations, + t_data + }; + + EStack< const ary::cpp::Namespace * > + aNamespaces; /// never empty. + EStack< const ary::cpp::Class * > + aClasses; /// maybe empty. + const ary::CodeEntity * + pCe; /// CurFileCe, maybe 0 + E_Type eType; + + InNamespaceTree( + const ary::cpp::Namespace & + i_rNsp ); + ~InNamespaceTree(); + void GoDown( + const ary::cpp::Namespace & + i_rNsp ); + void GoDown( + const ary::cpp::Class & + i_rClass ); + void GoUp(); +}; + +InNamespaceTree::InNamespaceTree( const ary::cpp::Namespace & i_rNsp ) + : // aNamespaces, + // aClasses, + pCe(0), + eType(t_unknown) +{ + aNamespaces.push( &i_rNsp ); +} + +InNamespaceTree::~InNamespaceTree() +{ +} + +void +InNamespaceTree::GoDown( const ary::cpp::Namespace & i_rNsp ) +{ + aNamespaces.push(&i_rNsp); + aClasses.erase_all(); + pCe = 0; + eType = t_unknown; +} + +void +InNamespaceTree::GoDown( const ary::cpp::Class & i_rClass ) +{ + aClasses.push(&i_rClass); + pCe = 0; + eType = t_unknown; +} + +void +InNamespaceTree::GoUp() +{ + if ( NOT aClasses.empty() ) + aClasses.pop(); + else + aNamespaces.pop(); + pCe = 0; + eType = t_unknown; +} + +struct InProjectTree +{ + enum E_Type + { + t_project, + t_file, + t_defs + }; + + const ary::cpp::ProjectGroup * + pProject; /// Always != 0. + const ary::cpp::FileGroup * + pFile; /// Maybe 0. + E_Type eType; +}; + +struct InIndex +{ + char cLetter; + + InIndex() : cLetter('A') {} +}; + + +} // anonymous namespace + + + + + +struct OuputPage_Environment::CheshireCat +{ + csv::ploc::Path aOutputRoot; + csv::ploc::Path aMyPath; + csv::StreamStr aFileName; + + const ary::cpp::DisplayGate * + pGate; + const display::CorporateFrame * + pLayout; + intt nDepth; + + Dyn<InNamespaceTree> + pInNamespace; + Dyn<InProjectTree> pInProject; + Dyn<InIndex> pInIndex; + + CheshireCat( + const csv::ploc::Path & + io_rOutputDir, + const ary::cpp::DisplayGate & + i_rGate, + const display::CorporateFrame & + i_rLayout ); + ~CheshireCat(); + void AddQualifiedName2Path( + const ary::CodeEntity & + i_rCe, + bool i_bIncludeLocalName ); + + const Dyn<InNamespaceTree> & + NspEnv() const { return pInNamespace; } + Dyn<InNamespaceTree> & + NspEnv() { return pInNamespace; } + const ary::cpp::Namespace * + Namespace() const { return pInNamespace ? pInNamespace->aNamespaces.top() : 0; } + const ary::cpp::Class * + Class() const { return pInNamespace ? (pInNamespace->aClasses.empty() ? 0 : pInNamespace->aClasses.top()) : 0; } +}; + +OuputPage_Environment:: +CheshireCat::CheshireCat( const csv::ploc::Path & io_rOutputDir, + const ary::cpp::DisplayGate & i_rGate, + const display::CorporateFrame & i_rLayout ) + : aOutputRoot(io_rOutputDir), + aMyPath(io_rOutputDir), + aFileName(500), + pGate(&i_rGate), + pLayout(&i_rLayout), + nDepth(0) + // pInNamespace, + // pInProject, + // pInIndex +{ +} + +OuputPage_Environment:: +CheshireCat::~CheshireCat() +{ +} + +void +OuputPage_Environment:: +CheshireCat::AddQualifiedName2Path( const ary::CodeEntity & i_rCe, + bool i_bIncludeLocalName ) +{ + if ( i_rCe.Owner() == 0 ) + { + aMyPath.DirChain().PushBack( C_sCppDir ); + return; + } + + const ary::CodeEntity * pParent = pGate->Find_Ce( i_rCe.Owner() ); + csv_assert( pParent != 0 ); + AddQualifiedName2Path( *pParent, true ); + + if ( i_bIncludeLocalName ) + aMyPath.DirChain().PushBack( i_rCe.LocalName() ); +} + + + +//************************ OuputPage_Environment ********************// + +OuputPage_Environment::OuputPage_Environment( const csv::ploc::Path & io_rOutputDir, + const ary::cpp::DisplayGate & i_rGate, + const display::CorporateFrame & i_rLayout ) + : pi( new CheshireCat(io_rOutputDir, i_rGate, i_rLayout) ) +{ +} + +OuputPage_Environment::~OuputPage_Environment() +{ +} + +void +OuputPage_Environment::MoveDir_2Root() +{ + pi->NspEnv() = 0; + pi->pInProject = 0; + pi->pInIndex = 0; + pi->nDepth = 0; + while ( pi->aMyPath.DirChain().Size() > pi->aOutputRoot.DirChain().Size() ) + pi->aMyPath.DirChain().PopBack(); + pi->aMyPath.SetFile(udmstri::Null_()); +} + +void +OuputPage_Environment::MoveDir_Down2( const ary::cpp::Namespace & i_rNsp ) +{ + if ( pi->NspEnv() ) + { + csv_assert( pi->Namespace()->Id() == i_rNsp.Owner() ); + pi->NspEnv()->GoDown( i_rNsp ); + pi->aMyPath.DirChain().PushBack(i_rNsp.LocalName()); + } + else + { + csv_assert( i_rNsp.Owner() == 0 ); + + MoveDir_2Root(); + pi->NspEnv() = new InNamespaceTree( i_rNsp ); + pi->aMyPath.DirChain().PushBack( C_sCppDir ); + } + + pi->aMyPath.SetFile(udmstri::Null_()); + ++pi->nDepth; + + CreateDirectory( pi->aMyPath ); +} + +void +OuputPage_Environment::MoveDir_Down2( const ary::cpp::Class & i_rClass ) +{ + csv_assert( pi->NspEnv() ); + if ( i_rClass.Protection() == ary::cpp::PROTECT_global ) + { + csv_assert( pi->Namespace()->Id() == i_rClass.Owner() ); + } + else + { + csv_assert( pi->Class() != 0 ); + csv_assert( pi->Class()->Id() == i_rClass.Owner() ); + } + + pi->NspEnv()->GoDown(i_rClass); + pi->aMyPath.DirChain().PushBack(i_rClass.LocalName()); + pi->aMyPath.SetFile(udmstri::Null_()); + ++pi->nDepth; + + CreateDirectory( pi->aMyPath ); +} + +void +OuputPage_Environment::MoveDir_2Project( const ary::cpp::ProjectGroup & i_rProject ) +{ + // KORR_FUTURE +} + +void +OuputPage_Environment::MoveDir_2Index() +{ + MoveDir_2Root(); + pi->pInIndex = new InIndex; + pi->aMyPath.DirChain().PushBack( udmstri(C_sDIR_Index) ); + pi->aMyPath.SetFile(udmstri::Null_()); + pi->nDepth = 1; + + CreateDirectory( pi->aMyPath ); +} + +void +OuputPage_Environment::MoveDir_Up() +{ + if ( pi->nDepth == 1 ) + { + MoveDir_2Root(); + return; + } + else if ( pi->NspEnv() ) + { + pi->NspEnv()->GoUp(); + pi->aMyPath.DirChain().PopBack(); + pi->aMyPath.SetFile(udmstri::Null_()); + --pi->nDepth; + } + +/* // KORR_FUTURE + else if ( pi_>pInProject ) + { + + --pi->nDepth; + } +*/ +} + +void +OuputPage_Environment::SetFile_Overview() +{ + pi->aMyPath.SetFile( C_sHFN_Overview ); +} + +void +OuputPage_Environment::SetFile_AllDefs() +{ + // Provisorium + pi->aMyPath.SetFile("def-all.html"); +} + +void +OuputPage_Environment::SetFile_Index( char i_cLetter ) +{ + csv_assert( 'A' <= i_cLetter AND i_cLetter <= 'Z' OR i_cLetter == '_' ); + + static StreamStr sIndexFileName(40); + sIndexFileName.seekp(0); + sIndexFileName << "index-"; + if ( i_cLetter == '_' ) + { + sIndexFileName << "27"; + } + else + { + sIndexFileName << int(i_cLetter -'A' + 1); + } + sIndexFileName << ".html"; + + pi->aMyPath.SetFile( sIndexFileName.c_str() ); +} + +void +OuputPage_Environment::SetFile_Help() +{ + pi->aMyPath.SetFile( C_sHFN_Help ); +} + +void +OuputPage_Environment::SetFile_CurNamespace() +{ + csv_assert( pi->NspEnv() ); + pi->aMyPath.SetFile("index.html"); + pi->NspEnv()->pCe = pi->Namespace(); + pi->NspEnv()->eType = InNamespaceTree::t_namespace; +} + +void +OuputPage_Environment::SetFile_Class( const ary::cpp::Class & i_rClass ) +{ + csv_assert( pi->NspEnv() ); + pi->aMyPath.SetFile( ClassFileName(i_rClass.LocalName()) ); + pi->NspEnv()->pCe = &i_rClass; + pi->NspEnv()->eType = InNamespaceTree::t_type; +} + +void +OuputPage_Environment::SetFile_Enum( const ary::cpp::Enum & i_rEnum ) +{ + csv_assert( pi->NspEnv() ); + pi->aMyPath.SetFile( EnumFileName(i_rEnum.LocalName()) ); + pi->NspEnv()->pCe = &i_rEnum; + pi->NspEnv()->eType = InNamespaceTree::t_type; +} + +void +OuputPage_Environment::SetFile_Typedef( const ary::cpp::Typedef & i_rTypedef ) +{ + csv_assert( pi->NspEnv() ); + pi->aMyPath.SetFile( TypedefFileName(i_rTypedef.LocalName()) ); + pi->NspEnv()->pCe = &i_rTypedef; + pi->NspEnv()->eType = InNamespaceTree::t_type; +} + +void +OuputPage_Environment::SetFile_Operations( const ary::cpp::FileGroup * i_pFile ) +{ + csv_assert( pi->NspEnv() ); + if ( CurClass() != 0 ) + pi->aMyPath.SetFile( "o.html" ); + else + { + csv_assert( i_pFile != 0 ); + pi->aMyPath.SetFile( HtmlFileName("o-", i_pFile->FileName()) ); + } + pi->NspEnv()->pCe = 0; + pi->NspEnv()->eType = InNamespaceTree::t_operations; +} + +void +OuputPage_Environment::SetFile_Data( const ary::cpp::FileGroup * i_pFile ) +{ + csv_assert( pi->NspEnv() ); + if ( CurClass() != 0 ) + pi->aMyPath.SetFile( "d.html" ); + else + { + csv_assert( i_pFile != 0 ); + pi->aMyPath.SetFile( HtmlFileName("d-", i_pFile->FileName()) ); + } + pi->NspEnv()->pCe = 0; + pi->NspEnv()->eType = InNamespaceTree::t_data; +} + +void +OuputPage_Environment::SetFile_CurProject() +{ + // KORR_FUTURE +} + +void +OuputPage_Environment::SetFile_File( const ary::cpp::FileGroup & i_rFile ) +{ + // KORR_FUTURE +} + +void +OuputPage_Environment::SetFile_Defs( const ary::cpp::FileGroup & i_rFile ) +{ + // KORR_FUTURE +} + +const ary::cpp::Namespace * +OuputPage_Environment::CurNamespace() const +{ + return pi->Namespace(); +} + +const ary::cpp::Class * +OuputPage_Environment::CurClass() const +{ + return pi->Class(); +} + +const csv::ploc::Path & +OuputPage_Environment::CurPath() const +{ + return pi->aMyPath; +} + +const ary::cpp::DisplayGate & +OuputPage_Environment::Gate() const +{ + return *pi->pGate; +} + +const display::CorporateFrame & +OuputPage_Environment::Layout() const +{ + return *pi->pLayout; +} + +uintt +OuputPage_Environment::Depth() const +{ + return pi->nDepth; +} + + diff --git a/autodoc/source/display/html/opageenv.hxx b/autodoc/source/display/html/opageenv.hxx new file mode 100644 index 000000000000..d8374e67f9ae --- /dev/null +++ b/autodoc/source/display/html/opageenv.hxx @@ -0,0 +1,169 @@ +/************************************************************************* + * + * $RCSfile: opageenv.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_OPAGEENV_HXX +#define ADC_DISPLAY_HTML_OPAGEENV_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <slist> +#include <cosv/ploc.hxx> + // PARAMETERS + +namespace ary +{ + namespace cpp + { + class DisplayGate; + + class ProjectGroup; + class FileGroup; + + class Namespace; + class Class; + class Enum; + class Typedef; + } +} +namespace display +{ + class CorporateFrame; +} + +class OuputPage_Environment +{ + public: + // LIFECYCLE + OuputPage_Environment( + const csv::ploc::Path & + io_rOutputDir, + const ary::cpp::DisplayGate & + i_rGate, + const display::CorporateFrame & + i_rLayout ); + ~OuputPage_Environment(); + + // OPERATIONS + void MoveDir_2Root(); + void MoveDir_Down2( /// Only one level. + const ary::cpp::Namespace & + i_rNsp ); + void MoveDir_Down2( /// Only one level. + const ary::cpp::Class & + i_rClass ); + void MoveDir_2Project( + const ary::cpp::ProjectGroup & + i_rProject ); + void MoveDir_2Index(); + void MoveDir_Up(); + + void SetFile_Overview(); + void SetFile_AllDefs(); + void SetFile_Index( + char i_cLetter ); + void SetFile_Help(); + void SetFile_CurNamespace(); + void SetFile_Class( + const ary::cpp::Class & + i_rClass ); + void SetFile_Enum( + const ary::cpp::Enum & + i_rEnum ); + void SetFile_Typedef( + const ary::cpp::Typedef & + i_rEnum ); + void SetFile_Operations( + const ary::cpp::FileGroup * + i_pFile = 0 ); /// Only needed for global functions. + void SetFile_Data( + const ary::cpp::FileGroup * + i_pFile = 0 ); /// Only needed for global variables. + void SetFile_CurProject(); + void SetFile_File( + const ary::cpp::FileGroup & + i_rFile ); + void SetFile_Defs( + const ary::cpp::FileGroup & + i_rFile ); + // INQUIRY + const ary::cpp::Namespace * + CurNamespace() const; + const ary::cpp::Class * + CurClass() const; + const csv::ploc::Path & + CurPath() const; + const ary::cpp::DisplayGate & + Gate() const; + const display::CorporateFrame & + Layout() const; + uintt Depth() const; + + private: + struct CheshireCat; + Dyn<CheshireCat> pi; +}; + + +#endif + + diff --git a/autodoc/source/display/html/outfile.cxx b/autodoc/source/display/html/outfile.cxx new file mode 100644 index 000000000000..6c853443a77b --- /dev/null +++ b/autodoc/source/display/html/outfile.cxx @@ -0,0 +1,296 @@ +/************************************************************************* + * + * $RCSfile: outfile.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "outfile.hxx" + +// NOT FULLY DECLARED SERVICES +#include <cosv/file.hxx> +#include <udm/html/htmlitem.hxx> + + +using namespace csi; +using csi::xml::AnAttribute; + + + +#define CRLF "\n" + static const char s_StdStyle[] = +// "\ta { color: #444488; }" CRLF +/* + "\ta.syntax { font-weight:bold; color: #444488; }" CRLF + "\ta.memberlink { font-weight:bold; color: #444488; }" CRLF + "\ta.objchapter { font-size:16pt; font-weight:bold }" CRLF + "\ta.inverse { font-size:12pt; color: #ffffff; }" CRLF + "\ta.inversebig { font-size:20pt; color: #ffffff; }" CRLF + "\th2 { font-size:18pt; }" CRLF + "\th2.inverse { font-size:18pt; color: #ffffff; }" CRLF + "\th3 { font-size:15pt; }" CRLF + "\th3.inverse { font-size:15pt; color: #ffffff; }" CRLF + "\th4 { font-size:14pt; }" CRLF + "\th4.inverse { font-size:14pt; color: #ffffff; }" CRLF + "\tp { font-size:12pt; margin-top:2pt; margin-bottom:1pt; }" CRLF + "\tp.inverse { font-size:12pt; color: #ffffff; }" CRLF + "\tp.tagtitle { font-size:14pt; font-weight:bold; margin-top:7pt; margin-bottom:3pt; }" CRLF + "\tp.copyright {font-size: 10pt; font-style: italic; text-align: center}" CRLF + "\tpre.inverse { color: #ffffff; }" CRLF + "\tcode { color: #444488; }" CRLF +*/ + "\th1 { font-size:20pt; margin-top:3pt; margin-bottom:7pt; }" CRLF + "\th2 { font-family:\"Arial\"; font-size:16pt; margin-top:3pt; margin-bottom:5pt; }" CRLF + "\th3 { font-size:13pt; margin-top:2pt; margin-bottom:3pt; }" CRLF + "\th4 { font-size:10pt; font-weight:bold; margin-top:2pt; margin-bottom:1pt; }" CRLF + "\tdl { margin-top:1pt; margin-bottom:1pt; }" CRLF + "\tdl.member { margin-top:1pt; margin-bottom:1pt; background-color:#eeeeff; }" CRLF + "\tdt { font-size:10pt; font-weight:bold; margin-top:2pt; margin-bottom:1pt; }" CRLF + "\tdt.member { font-size:13pt; font-weight:bold; margin-top:2pt; margin-bottom:1pt; }" CRLF + "\tdt.simple { font-size:10pt; font-weight:normal; margin-top:2pt; margin-bottom:1pt; }" CRLF + "\tdd { font-size:10pt; margin-top:1pt; margin-bottom:1pt; }" CRLF + "\tdd.member { font-size:10pt; margin-top:1pt; margin-bottom:1pt; background-color:#ffffff; }" CRLF + "\tp { font-size:10pt; margin-top:3pt; margin-bottom:1pt; }" CRLF + "\tpre { font-family: Times, serif; font-size:10pt; margin-top:1pt; margin-bottom:1pt; }" CRLF + "\ttr { font-size:10pt; }" CRLF + "\ttd { font-size:10pt; }" CRLF + +// "\t.TableHeadingColor { background: #CCCCFF } /* Dark mauve */" CRLF +// "\t.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */" CRLF +// "\t.TableRowColor { background: #FFFFFF } /* White */" CRLF +// "\t.FrameTitleFont { font-size: normal; font-family: normal }" CRLF +// "\t.FrameHeadingFont { font-size: normal; font-family: normal }" CRLF +// "\t.FrameItemFont { font-size: normal; font-family: normal }" CRLF +// "\ttd.NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */" CRLF +// "\ttd.NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */" CRLF +// "\tfont.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}" CRLF +// "\tfont.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}" CRLF +// "\t.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}" CRLF +// "\t.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}" CRLF + ; + + +HtmlDocuFile::HtmlDocuFile() +// : // aBodyData +{ + aBodyData +// << new AnAttribute( "link", "#0000cc" ) +// << new AnAttribute( "vlink", "#9999cc" ) + << new AnAttribute( "bgcolor", "#ffffff" ); + + SetStyle(s_StdStyle); +} + +void +HtmlDocuFile::SetLocation( const csv::ploc::Path & i_rFilePath ) +{ + static StreamStr sPath_(1000); + sPath_.seekp(0); + i_rFilePath.Get( sPath_ ); + + sFilePath = sPath_.c_str(); +} + +void +HtmlDocuFile::SetTitle( const char * i_sTitle ) +{ + sTitle = i_sTitle; +} + +void +HtmlDocuFile::SetStyle( const char * i_sStyle ) +{ + sStyle = i_sStyle; +} + +void +HtmlDocuFile::SetBodyAttr( const char * i_sAttrName, + const char * i_sAttrValue ) +{ + aBodyData << new AnAttribute( i_sAttrName, i_sAttrValue ); +} + +void +HtmlDocuFile::SetCopyright( const char * i_sCopyright ) +{ + sCopyright = i_sCopyright; +} + +void +HtmlDocuFile::EmptyBody() +{ + aBodyData.SetContent(0); + aBodyData + >> *new html::Label( "_top_" ) + << " "; + +} + +bool +HtmlDocuFile::CreateFile() +{ + csv::File aFile(sFilePath, csv::CFM_CREATE); + if (NOT aFile.open()) + { + Cerr() << "Can't create file " << sFilePath << "." << Endl(); + return false; + } + + WriteHeader(aFile); + WriteBody(aFile); + + aFile.close(); + Cout() << '.' << Flush(); + return true; +} + + +void +HtmlDocuFile::WriteHeader( csv::File & io_aFile ) +{ + static const char s1[] = + "<html>\n<head>\n<title>"; + static const char s2[] = + "</title>\n<style>"; + static const char s3[] = + "</style>\n</head>\n"; + + io_aFile.write( s1 ); + io_aFile.write( sTitle ); + io_aFile.write( s2 ); + io_aFile.write( sStyle ); + io_aFile.write( s3 ); +} + +void +HtmlDocuFile::WriteBody( csv::File & io_aFile ) +{ + aBodyData + >> *new html::Link( "#_top_" ) + << new html::ClassAttr( "objchapter" ) + << "Top of Page"; + + if ( sCopyright.length() > 0 ) + { + aBodyData +#ifndef COMPATIBLE_NETSCAPE_47 + >> *new html::HorizontalLine + << new html::SizeAttr( "3" ); +#else + << new xml::XmlCode("<hr size=\"3\">"); +#endif + + aBodyData + >> *new html::Paragraph + << new html::ClassAttr( "copyright" ) + << new xml::AnAttribute( "align", "center" ) + << sCopyright ; + } + aBodyData.WriteOut(io_aFile); +} + + + + + + + +#if 0 + + +#define CRLF "\n" + static const char sStyle[] = + "\ta { color: #444488; }" CRLF + "\ta.syntax { font-weight:bold; color: #444488; }" CRLF + "\ta.memberlink { font-weight:bold; color: #444488; }" CRLF + "\ta.objchapter { font-size:16pt; font-weight:bold }" CRLF + "\ta.inverse { font-size:12pt; color: #ffffff; }" CRLF + "\ta.inversebig { font-size:20pt; color: #ffffff; }" CRLF + "\th2 { font-size:18pt; }" CRLF + "\th2.inverse { font-size:18pt; color: #ffffff; }" CRLF + "\th3 { font-size:15pt; }" CRLF + "\th3.inverse { font-size:15pt; color: #ffffff; }" CRLF + "\th4 { font-size:14pt; }" CRLF + "\th4.inverse { font-size:14pt; color: #ffffff; }" CRLF + "\tdt { margin-top:3pt; margin-bottom:1pt; }" CRLF + "\tdd { margin-top:1pt; margin-bottom:1pt; }" CRLF + "\tp { font-size:12pt; margin-top:2pt; margin-bottom:1pt; }" CRLF + "\tp.inverse { font-size:12pt; color: #ffffff; }" CRLF + "\tp.tagtitle { font-size:14pt; font-weight:bold; margin-top:7pt; margin-bottom:3pt; }" CRLF + "\tp.copyright {font-size: 10pt; font-style: italic; text-align: center}" CRLF + "\tpre.inverse { color: #ffffff; }" CRLF + "\tcode { color: #444488; }" CRLF + ".TableHeadingColor { background: #CCCCFF } /* Dark mauve */" CRLF + ".TableSubHeadingColor { background: #EEEEFF } /* Light mauve */" CRLF + ".TableRowColor { background: #FFFFFF } /* White */" CRLF + ".FrameTitleFont { font-size: normal; font-family: normal }" CRLF + ".FrameHeadingFont { font-size: normal; font-family: normal }" CRLF + ".FrameItemFont { font-size: normal; font-family: normal }" CRLF + ".NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */" CRLF + ".NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */" CRLF + ".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}" CRLF + ".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}" CRLF + ".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}" CRLF + ".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}" CRLF; + static const char sBodyAttrs[] = + "link=\"#444488\" vlink=\"#444488\" bgcolor=\"#ffffff\""; + + + +#endif // 0 + diff --git a/autodoc/source/display/html/outfile.hxx b/autodoc/source/display/html/outfile.hxx new file mode 100644 index 000000000000..b177726ebb02 --- /dev/null +++ b/autodoc/source/display/html/outfile.hxx @@ -0,0 +1,130 @@ +/************************************************************************* + * + * $RCSfile: outfile.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_OUTFILE_HXX +#define ADC_DISPLAY_HTML_OUTFILE_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <udm/html/htmlitem.hxx> + // PARAMETERS +#include <cosv/ploc.hxx> + + +namespace csv +{ +class File; +} + + + + +class HtmlDocuFile +{ + public: + // LIFECYCLE + HtmlDocuFile(); + + void SetLocation( + const csv::ploc::Path & + i_rFilePath ); + void SetTitle( + const char * i_sTitle ); + void SetStyle( + const char * i_sStyle ); + void SetBodyAttr( + const char * i_sAttrName, + const char * i_sAttrValue ); + void SetCopyright( + const char * i_sCopyright ); + void EmptyBody(); + + Html::Body & Body() { return aBodyData; } + bool CreateFile(); + +#if 0 + // INQUIRY + const char * FileName() const { return sFileName.GetStr(); } + +#endif // 0 + + private: + void WriteHeader( + csv::File & io_aFile ); + void WriteBody( + csv::File & io_aFile ); + + // DATA + udmstri sFilePath; + udmstri sTitle; + udmstri sLocation; + udmstri sStyle; + udmstri sCopyright; + + Html::Body aBodyData; +}; + + + +#endif + + diff --git a/autodoc/source/display/html/pagemake.cxx b/autodoc/source/display/html/pagemake.cxx new file mode 100644 index 000000000000..8c5e2f8fb149 --- /dev/null +++ b/autodoc/source/display/html/pagemake.cxx @@ -0,0 +1,619 @@ +/************************************************************************* + * + * $RCSfile: pagemake.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pagemake.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/cpp/cg_file.hxx> +#include <display/corframe.hxx> +#include "hd_chlst.hxx" +#include "hd_docu.hxx" +#include "hdimpl.hxx" +#include "html_kit.hxx" +#include "navibar.hxx" +#include "opageenv.hxx" +#include "outfile.hxx" +#include "pm_aldef.hxx" +#include "pm_class.hxx" +#include "pm_help.hxx" +#include "pm_index.hxx" +#include "pm_namsp.hxx" +#include "pm_start.hxx" +#include "strconst.hxx" + + +using namespace csi; +using csi::html::Link; +using csi::html::HorizontalLine; + + +const int C_nNrOfIndexLetters = 27; + + +template <class SPECIAL_MAKER> +inline void +Make_SpecialPage( DYN SPECIAL_MAKER * let_dpMaker ) +{ + Dyn< SPECIAL_MAKER > pMaker( let_dpMaker ); + pMaker->MakePage(); + pMaker = 0; +} + + +PageDisplay::PageDisplay( OuputPage_Environment & io_rEnv ) + : HtmlDisplay_Impl( io_rEnv ), + pMyFile( new HtmlDocuFile ) +{ +} + +PageDisplay::~PageDisplay() +{ + +} + +void +PageDisplay::Create_OverviewFile() +{ + Env().SetFile_Overview(); + File().SetLocation( Env().CurPath() ); + + SetupFileOnCurEnv( C_sHFTitle_Overview ); + Make_SpecialPage( new PageMaker_Overview(*this) ); + Create_File(); +} + +void +PageDisplay::Create_AllDefsFile() +{ + // This method is a provisorium, because later this will + // be spreaded over the files. + + Env().MoveDir_2Root(); + Env().SetFile_AllDefs(); + File().SetLocation( Env().CurPath() ); + + SetupFileOnCurEnv( "Defines and Macros" ); + Make_SpecialPage( new PageMaker_AllDefs(*this) ); + Create_File(); +} + +void +PageDisplay::Create_IndexFiles() +{ + Env().MoveDir_2Index(); + + for ( int i = 0; i < C_nNrOfIndexLetters; ++i ) + Create_IndexFile(i); +} + +void +PageDisplay::Create_HelpFile() +{ + Env().SetFile_Help(); + File().SetLocation( Env().CurPath() ); + + SetupFileOnCurEnv( C_sHFTitle_Help ); + Make_SpecialPage( new PageMaker_Help(*this) ); + Create_File(); +} + +void +PageDisplay::Create_NamespaceFile() +{ + csv_assert( Env().CurNamespace() != 0 ); + Env().SetFile_CurNamespace(); + File().SetLocation( Env().CurPath() ); + if ( Env().CurNamespace()->Owner() != 0 ) + { + StreamLock sNsp(100); + SetupFileOnCurEnv( sNsp() << C_sHFTypeTitle_Namespace + << " " + << Env().CurNamespace()->LocalName() + << c_str ); + } + else + { + SetupFileOnCurEnv( C_sHFTitle_GlobalNamespaceCpp ); + } + + Make_SpecialPage( new PageMaker_Namespace(*this) ); + + Create_File(); +} + +void +PageDisplay::Setup_OperationsFile_for( const ary::cpp::FileGroup & i_rFile ) +{ + csv_assert( Env().CurNamespace() != 0 ); + Env().SetFile_Operations(&i_rFile); + File().SetLocation( Env().CurPath() ); + + StreamLock sOpFile(100); + SetupFileOnCurEnv( sOpFile() << "Global Functions in Namespace " + << Env().CurNamespace()->LocalName() + << " in Sourcefile " + << i_rFile.FileName() + << c_str ); + NavigationBar + aNavi( Env(), + NavigationBar::CEGT_operations, + &i_rFile ); + aNavi.Write( CurOut() ); + CurOut() << new HorizontalLine; + + adcdisp::PageTitle_Std fTitle; + csi::xml::Element & rTitle = fTitle( CurOut() ); + if ( Env().CurNamespace()->Owner() != 0 ) + { + rTitle << "Global Functions in Namespace " + << Env().CurNamespace()->LocalName(); + } + else + { + rTitle << "Global Functions in Global Namespace C++"; + } + + rTitle << new html::LineBreak + << "in Sourcefile " + << i_rFile.FileName(); + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Setup_OperationsFile_for( const ary::cpp::Class & i_rClass ) +{ + csv_assert( Env().CurNamespace() != 0 ); + Env().SetFile_Operations(0); + File().SetLocation( Env().CurPath() ); + + StreamLock sOpFile(100); + SetupFileOnCurEnv( sOpFile() << "Methods of Class " + << i_rClass.LocalName() + << c_str ); + NavigationBar + aNavi( Env(), + NavigationBar::CEGT_operations, + 0 ); + aNavi.Write( CurOut() ); + CurOut() << new HorizontalLine; + + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), "Methods of Class", i_rClass.LocalName() ); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Setup_DataFile_for( const ary::cpp::FileGroup & i_rFile ) +{ + csv_assert( Env().CurNamespace() != 0 ); + Env().SetFile_Data(&i_rFile); + File().SetLocation( Env().CurPath() ); + + StreamLock sDataFile(100); + SetupFileOnCurEnv( sDataFile() << "Global Data in Namespace " + << Env().CurNamespace()->LocalName() + << " in Sourcefile " + << i_rFile.FileName() + << c_str ); + NavigationBar + aNavi( Env(), + NavigationBar::CEGT_data, + &i_rFile ); + aNavi.Write( CurOut() ); + CurOut() << new HorizontalLine; + + adcdisp::PageTitle_Std fTitle; + csi::xml::Element & rTitle = fTitle( CurOut() ); + if ( Env().CurNamespace()->Owner() != 0 ) + { + rTitle << "Global Data in Namespace " + << Env().CurNamespace()->LocalName(); + } + else + { + rTitle << "Global Data in Global Namespace C++"; + } + + rTitle + << new html::LineBreak + << "in Sourcefile " + << i_rFile.FileName();; + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Setup_DataFile_for( const ary::cpp::Class & i_rClass ) +{ + csv_assert( Env().CurNamespace() != 0 ); + Env().SetFile_Data(0); + File().SetLocation( Env().CurPath() ); + + StreamLock sDataFile(100); + SetupFileOnCurEnv( sDataFile() << "Data of Class " + << i_rClass.LocalName() + << c_str ); + + NavigationBar + aNavi( Env(), + NavigationBar::CEGT_data, + 0 ); + aNavi.Write( CurOut() ); + CurOut() << new HorizontalLine; + + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), "Data of Class", i_rClass.LocalName() ); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Create_File() +{ + Easy().Leave(); + File().CreateFile(); +} + +void +PageDisplay::Display_Class( const ary::cpp::Class & i_rData ) +{ + Env().SetFile_Class(i_rData); + File().SetLocation( Env().CurPath() ); + + const char * + sTypeTitle = i_rData.ClassKey() == ary::cpp::CK_class + ? C_sHFTypeTitle_Class + : i_rData.ClassKey() == ary::cpp::CK_struct + ? C_sHFTypeTitle_Struct + : C_sHFTypeTitle_Union; + StreamLock sClassFile(60); + SetupFileOnCurEnv( sClassFile() << sTypeTitle + << " " + << i_rData.LocalName() + << c_str ); + + Make_SpecialPage( new PageMaker_Class(*this, i_rData) ); + + Create_File(); +} + +void +PageDisplay::Display_Enum( const ary::cpp::Enum & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + Env().SetFile_Enum(i_rData); + File().SetLocation( Env().CurPath() ); + + StreamLock sEnumFile(100); + SetupFileOnCurEnv( sEnumFile() << C_sHFTypeTitle_Enum + << " " + << i_rData.LocalName() + << c_str ); + Write_NavBar_Enum(i_rData); + Write_TopArea_Enum(i_rData); + Write_DocuArea_Enum(i_rData); + Write_ChildList_Enum(i_rData); + + Create_File(); +} + +void +PageDisplay::Display_Typedef( const ary::cpp::Typedef & i_rData ) +{ + if ( Ce_IsInternal(i_rData) ) + return; + + Env().SetFile_Typedef(i_rData); + File().SetLocation( Env().CurPath() ); + + StreamLock sTypedefFile(100); + SetupFileOnCurEnv( sTypedefFile() << C_sHFTypeTitle_Typedef + << " " + << i_rData.LocalName() + << c_str ); + Write_NavBar_Typedef(i_rData); + Write_TopArea_Typedef(i_rData); + Write_DocuArea_Typedef(i_rData); + + + Create_File(); +} + +void +PageDisplay::Write_NameChainWithLinks( const ary::CodeEntity & i_rCe ) +{ + if ( Env().CurNamespace()->Id() != i_rCe.Id() ) + { + RecursiveWrite_NamespaceLink( Env().CurNamespace() ); + if ( Env().CurClass() != 0 ) + { + CurOut() << new html::Sbr; + RecursiveWrite_ClassLink( Env().CurClass(), 1 ); + } + } + else + { + RecursiveWrite_NamespaceLink( Env().CurNamespace()->Parent() ); + } +} + +const ary::DisplayGate * +PageDisplay::inq_Get_ReFinder() const +{ + return &Env().Gate(); +} + +void +PageDisplay::RecursiveWrite_NamespaceLink( const ary::cpp::Namespace * i_pNamespace ) +{ + if ( i_pNamespace == 0 ) + { + return; + } + else if ( i_pNamespace->Owner() == 0 ) + { // Global namespace: + StreamLock sNspDir(50); + CurOut() + >> *new Link( PathPerRoot(Env(), + sNspDir() << C_sDIR_NamespacesCpp + << "/" + << C_sHFN_Namespace + << c_str) ) + << new xml::AnAttribute( "alt", C_sHFTitle_GlobalNamespaceCpp ) + >> *new html::Font + << new html::SizeAttr("+1") + >> *new html::Bold + << "::"; + CurOut() + << " "; + return; + } + else + { + RecursiveWrite_NamespaceLink( i_pNamespace->Parent() ); + } + + uintt nLevelDistance = Env().Depth() - ( i_pNamespace->Depth() + 1 ); + csv_assert( nLevelDistance < 100 ); + CurOut() + >> *new Link( PathPerLevelsUp(nLevelDistance, C_sHFN_Namespace) ) + << new xml::AnAttribute( "alt", C_sHFTypeTitle_Namespace) + >> *new html::Font + << new html::SizeAttr("+1") + >> *new html::Bold + << i_pNamespace->LocalName(); + CurOut() + >> *new html::Font + << new html::SizeAttr("+1") + << " :: "; +} + +void +PageDisplay::RecursiveWrite_ClassLink( const ary::cpp::Class * i_pClass, + uintt i_nLevelDistance ) +{ + if ( i_pClass == 0 ) + return; + + if ( i_pClass->Protection() != ary::cpp::PROTECT_global ) + { + RecursiveWrite_ClassLink( + dynamic_cast< const ary::cpp::Class* >( + Env().Gate().Find_Ce(i_pClass->Owner())), + i_nLevelDistance + 1 ); + } + + CurOut() + >> *new Link( Path2Class(i_nLevelDistance, i_pClass->LocalName()) ) + << new xml::AnAttribute( "alt", "class") + >> *new html::Font + << new html::SizeAttr("0") + << new xml::AnAttribute( "color", "#008800") + << i_pClass->LocalName(); + CurOut() + >> *new html::Font + << new html::SizeAttr("0") + << " :: "; +} + +void +PageDisplay::SetupFileOnCurEnv( const char * i_sTitle ) +{ + File().SetLocation( Env().CurPath() ); + File().SetTitle( i_sTitle ); + File().SetCopyright( Env().Layout().CopyrightText() ); + File().EmptyBody(); + + // This sets CurOut() to the contents of <body></body> + // in File() : + Easy().Enter( File().Body() ); +} + +void +PageDisplay::Write_NavBar_Enum( const ary::cpp::Enum & i_rData ) +{ + NavigationBar aNavi( Env(), i_rData ); + aNavi.MakeSubRow("List of"); + aNavi.AddItem( C_sTitle_EnumValues, C_sLabel_EnumValues, true ); + aNavi.Write( CurOut(), true ); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Write_TopArea_Enum( const ary::cpp::Enum & i_rData ) +{ + Write_NameChainWithLinks( i_rData ); + + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), C_sHFTypeTitle_Enum, i_rData.LocalName() ); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Write_DocuArea_Enum( const ary::cpp::Enum & i_rData ) +{ + Docu_Display aDocuShow( Env() ); + + aDocuShow.Assign_Out(CurOut()); + i_rData.Info().StoreAt( aDocuShow ); + aDocuShow.Unassign_Out(); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Write_ChildList_Enum( const ary::cpp::Enum & i_rData ) +{ + bool bChildrenExist = false; + ChildList_Display::Area_Result + aResult( bChildrenExist, CurOut() ); + + ChildList_Display aDisplay(Env(), i_rData); + aDisplay.Run_Simple( aResult, + ary::cpp::Enum::SLOT_Values, + C_sLabel_EnumValues, + C_sTitle_EnumValues ); + + if (NOT bChildrenExist) + CurOut() >> *new html::Headline(4) << "This enum has no values."; + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Write_NavBar_Typedef( const ary::cpp::Typedef & i_rData ) +{ + NavigationBar aNavi( Env(), i_rData ); + aNavi.Write( CurOut(), true ); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Write_TopArea_Typedef( const ary::cpp::Typedef & i_rData ) +{ + Write_NameChainWithLinks( i_rData ); + + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), C_sHFTypeTitle_Typedef, i_rData.LocalName() ); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Write_DocuArea_Typedef( const ary::cpp::Typedef & i_rData ) +{ + adcdisp::ExplanationList aDef( CurOut() ); + aDef.AddEntry("Definition:"); + xml::Element & rDef = aDef.Def(); + + ary::Tid nDefiningType = i_rData.DescribingType(); + + const ary::CodeEntity * + pRelatedCe = Env().Gate().Search_RelatedCe(nDefiningType); + if ( pRelatedCe != 0 ) + { + const char * sTypeKey = Get_TypeKey(*pRelatedCe); + if ( NOT csv::no_str(sTypeKey) ) + rDef << sTypeKey << " "; + } + + dshelp::Get_LinkedTypeText( rDef, Env(), nDefiningType ); + + Docu_Display aDocuShow( Env() ); + + aDocuShow.Assign_Out(CurOut()); + i_rData.Info().StoreAt( aDocuShow ); + aDocuShow.Unassign_Out(); + + CurOut() << new HorizontalLine; +} + +void +PageDisplay::Create_IndexFile( int i_nLetter ) +{ + static char aLetters[C_nNrOfIndexLetters+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_"; + csv_assert( 0 <= i_nLetter AND i_nLetter < C_nNrOfIndexLetters ); + + char cCurLetter = aLetters[i_nLetter]; + Env().SetFile_Index( cCurLetter ); + + static char sIndexFileTitle[] = "Global Index X"; + const int nPositionOfLetterInTitle = 13; + sIndexFileTitle[nPositionOfLetterInTitle] = cCurLetter; + SetupFileOnCurEnv( sIndexFileTitle ); + + Make_SpecialPage( new PageMaker_Index(*this, cCurLetter ) ); + + Create_File(); +} + diff --git a/autodoc/source/display/html/pagemake.hxx b/autodoc/source/display/html/pagemake.hxx new file mode 100644 index 000000000000..a89dae7cb792 --- /dev/null +++ b/autodoc/source/display/html/pagemake.hxx @@ -0,0 +1,184 @@ +/************************************************************************* + * + * $RCSfile: pagemake.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PAGEMAKE_HXX +#define ADC_DISPLAY_HTML_PAGEMAKE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/cpp_disp.hxx> +#include "hdimpl.hxx" + // COMPONENTS + // PARAMETERS +#include <ary/ids.hxx> +#include <ary/cpp/c_namesp.hxx> + +namespace ary +{ + namespace cpp + { + class Namespace; + class Class; + class Enum; + class Typedef; + } +} + + +class OuputPage_Environment; +class HtmlDocuFile; + + +class PageDisplay : public ary::cpp::Display, + public HtmlDisplay_Impl +{ + public: + PageDisplay( + OuputPage_Environment & + io_rEnv ); + virtual ~PageDisplay(); + + void Create_OverviewFile(); + void Create_AllDefsFile(); + void Create_IndexFiles(); + void Create_HelpFile(); + + void Create_NamespaceFile(); + + void Setup_OperationsFile_for( + const ary::cpp::FileGroup & + i_rFile ); + void Setup_OperationsFile_for( + const ary::cpp::Class & + i_rClass ); + void Setup_DataFile_for( + const ary::cpp::FileGroup & + i_rFile ); + void Setup_DataFile_for( + const ary::cpp::Class & + i_rClass ); + /// Used with Setup_OperatonsFile_for(). + void Create_File(); + + // Interface ary::cpp::Display + virtual void Display_Class( + const ary::cpp::Class & + i_rData ); + virtual void Display_Enum( + const ary::cpp::Enum & + i_rData ); + virtual void Display_Typedef( + const ary::cpp::Typedef & + i_rData ); + + // Interface for Children of SpecializedPageMaker: + void Write_NameChainWithLinks( + const ary::CodeEntity & + i_rCe ); + private: + // Interface ary::cpp::Display: + virtual const ary::DisplayGate * + inq_Get_ReFinder() const; + // Locals + HtmlDocuFile & File() { return *pMyFile; } + void RecursiveWrite_NamespaceLink( + const ary::cpp::Namespace * + i_pNamespace ); + void RecursiveWrite_ClassLink( + const ary::cpp::Class * + i_pClass, + uintt i_nLevelDistance ); + void SetupFileOnCurEnv( + const char * i_sTitle ); + void Write_NavBar_Enum( + const ary::cpp::Enum & + i_rData ); + void Write_TopArea_Enum( + const ary::cpp::Enum & + i_rData ); + void Write_DocuArea_Enum( + const ary::cpp::Enum & + i_rData ); + void Write_ChildList_Enum( + const ary::cpp::Enum & + i_rData ); + void Write_NavBar_Typedef( + const ary::cpp::Typedef & + i_rData ); + void Write_TopArea_Typedef( + const ary::cpp::Typedef & + i_rData ); + void Write_DocuArea_Typedef( + const ary::cpp::Typedef & + i_rData ); + void Create_IndexFile( + int i_nLetter ); + + // DATA + Dyn<HtmlDocuFile> pMyFile; +}; + + + +#endif + diff --git a/autodoc/source/display/html/pm_aldef.cxx b/autodoc/source/display/html/pm_aldef.cxx new file mode 100644 index 000000000000..eed6f38cf6a9 --- /dev/null +++ b/autodoc/source/display/html/pm_aldef.cxx @@ -0,0 +1,275 @@ +/************************************************************************* + * + * $RCSfile: pm_aldef.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_aldef.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_define.hxx> +#include <ary/cpp/c_macro.hxx> +#include <ary/loc/l_rogate.hxx> +#include <ary/loc/loc_file.hxx> +#include "hd_docu.hxx" +#include "html_kit.hxx" +#include "navibar.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" +#include "strconst.hxx" + + +using namespace csi; +using csi::html::HorizontalLine; +using csi::html::Link; +using csi::html::Label; +using csi::html::AlignAttr; + + + +PageMaker_AllDefs::PageMaker_AllDefs( PageDisplay & io_rPage ) + : SpecializedPageMaker(io_rPage), + pDocuDisplay( new Docu_Display(io_rPage.Env()) ), + pNavi(0) +{ +} + +PageMaker_AllDefs::~PageMaker_AllDefs() +{ +} + +void +PageMaker_AllDefs::MakePage() +{ + pNavi = new NavigationBar( Env(), NavigationBar::LOC_AllDefs ); + Write_NavBar(); + + Write_TopArea(); + + Write_DefinesList(); + Write_MacrosList(); + + pNavi->Write_SubRows(); +} + +void +PageMaker_AllDefs::Write_NavBar() +{ + pNavi->MakeSubRow( "" ); + pNavi->AddItem( "Defines", "defines", true ); + pNavi->AddItem( "Macros", "macros", true ); + pNavi->Write( CurOut() ); + CurOut() << new HorizontalLine; +} + +void +PageMaker_AllDefs::Write_TopArea() +{ + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), "Defines and ", "Macros" ); + + CurOut() << new HorizontalLine; +} + +void +PageMaker_AllDefs::Write_DocuArea() +{ + // Not needed. +} + +void +PageMaker_AllDefs::Write_DefinesList() +{ + CurOut() + << new html::LineBreak + << new html::LineBreak + >> *new xml::AnElement("div") + << new html::StyleAttr("font-family:Arial; background-color:#ccccff;") + >> *new html::Label("defines") + >> *new html::Headline(3) + << "Defines"; + + List_Ids aAllDefines; + uintt nCount = Env().Gate().RoDefines().Get_AllDefines(aAllDefines); + + if (nCount > 0) + { + csv::call_for_each( aAllDefines, + this, + &PageMaker_AllDefs::Write_Define ); + } + else + { + CurOut() << "None."; + } + + CurOut() << new HorizontalLine; +} + +void +PageMaker_AllDefs::Write_MacrosList() + +{ + CurOut() + << new html::LineBreak + << new html::LineBreak + >> *new xml::AnElement("div") + << new html::StyleAttr("font-family:Arial; background-color:#ccccff;") + >> *new html::Label("macros") + >> *new html::Headline(3) + << "Macros"; + + List_Ids aAllMacros; + uintt nCount = Env().Gate().RoDefines().Get_AllMacros(aAllMacros); + + if (nCount > 0) + { + csv::call_for_each( aAllMacros, + this, + &PageMaker_AllDefs::Write_Macro ); + } + else + { + CurOut() << "None."; + } + + CurOut() << new HorizontalLine; +} + +void +PageMaker_AllDefs::Write_Define( const ary::Rid & i_nId ) +{ + const ary::cpp::Define * + pDef = Env().Gate().RoDefines().Find_Define(i_nId); + if (pDef == 0) + return; + + CurOut() << new html::HorizontalLine; + + adcdisp::ExplanationList aDocu( CurOut(), true ); + aDocu.AddEntry(); + + aDocu.Term() + >> *new html::Label( pDef->DefinedName() ) + << " "; + aDocu.Term() + << pDef->DefinedName(); + + Write_DefsDocu( aDocu.Def(), *pDef ); +} + +void +PageMaker_AllDefs::Write_Macro( const ary::Rid & i_nId ) +{ + const ary::cpp::Macro * + pDef = Env().Gate().RoDefines().Find_Macro(i_nId); + if (pDef == 0) + return; + + CurOut() << new html::HorizontalLine; + + adcdisp::ExplanationList aDocu( CurOut(), true ); + aDocu.AddEntry(); + + aDocu.Term() + >> *new html::Label( pDef->DefinedName() ) + << " "; + aDocu.Term() + << pDef->DefinedName() + << "("; + WriteOut_TokenList( aDocu.Term(), pDef->Params(), ", " ); + aDocu.Term() + << ")"; + + Write_DefsDocu( aDocu.Def(), *pDef ); +} + + +void +PageMaker_AllDefs::Write_DefsDocu( csi::xml::Element & o_rOut, + const ary::cpp::CppDefinition & i_rTextReplacement ) +{ + if ( i_rTextReplacement.DefinitionText().size() > 0 ) + { + EraseLeadingSpace( *const_cast< udmstri* >( + &(*i_rTextReplacement.DefinitionText().begin()) + ) ); + } + + adcdisp::ExplanationTable rList( o_rOut ); + + rList.AddEntry( "Defined As" ); + WriteOut_TokenList( rList.Def(), i_rTextReplacement.DefinitionText(), " " ); + + ary::loc::SourceCodeFile * + pFile = Env().Gate().RoLocations().Find_File( i_rTextReplacement.Location() ); + if (pFile != 0 ) + { + rList.AddEntry( "In File" ); + rList.Def() << pFile->Name(); + } + + ShowDocu_On( o_rOut, *pDocuDisplay, i_rTextReplacement ); +} + + diff --git a/autodoc/source/display/html/pm_aldef.hxx b/autodoc/source/display/html/pm_aldef.hxx new file mode 100644 index 000000000000..ed12467312ef --- /dev/null +++ b/autodoc/source/display/html/pm_aldef.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: pm_aldef.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PM_ALDEF_HXX +#define ADC_DISPLAY_HTML_PM_ALDEF_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "pm_base.hxx" + // COMPONENTS + // PARAMETERS +#include <ary/cpp/crog_def.hxx> + + +namespace ary +{ + namespace cpp + { + class CppDefinition; + } +} + +class Docu_Display; +class NavigationBar; + +class PageMaker_AllDefs : public SpecializedPageMaker +{ + public: + PageMaker_AllDefs( + PageDisplay & io_rPage ); + + virtual ~PageMaker_AllDefs(); + + virtual void MakePage(); + + private: + typedef ary::cpp::RoGate_Defines::List_DefIds List_Ids; + typedef List_Ids::const_iterator ids_iterator; + + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_DocuArea(); + virtual void Write_DefinesList(); + virtual void Write_MacrosList(); + void Write_Define( + const ary::Rid & i_nId ); + void Write_Macro( + const ary::Rid & i_nId ); + void Write_DefsDocu( + csi::xml::Element & o_rOut, + const ary::cpp::CppDefinition & + i_rTextReplacement ); + + // DATA + Dyn<Docu_Display> pDocuDisplay; + Dyn<NavigationBar> pNavi; +}; + + + +#endif + diff --git a/autodoc/source/display/html/pm_base.cxx b/autodoc/source/display/html/pm_base.cxx new file mode 100644 index 000000000000..f51a9768ab3a --- /dev/null +++ b/autodoc/source/display/html/pm_base.cxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: pm_base.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_base.hxx" + + +// NOT FULLY DEFINED SERVICES +#include "opageenv.hxx" +#include "pagemake.hxx" + + +//******************** SpecializedPageMaker *********************// + +SpecializedPageMaker::SpecializedPageMaker( PageDisplay & io_rPage ) + : pEnv( &io_rPage.Env() ), + pCurOut( &io_rPage.CurOut() ), + pPage( &io_rPage ) +{ +} + +void +SpecializedPageMaker::Write_NavBar() +{ + // Dummy +} + +void +SpecializedPageMaker::Write_TopArea() +{ + // Dummy +} + +void +SpecializedPageMaker::Write_DocuArea() +{ + // Dummy +} + +void +SpecializedPageMaker::Write_ChildList( ary::SlotAccessId , + const char * , + const char * ) +{ + // Dummy +} + +csi::xml::Element & +SpecializedPageMaker::CurOut() +{ + return Page().CurOut(); +} + diff --git a/autodoc/source/display/html/pm_base.hxx b/autodoc/source/display/html/pm_base.hxx new file mode 100644 index 000000000000..4583ae0af8e3 --- /dev/null +++ b/autodoc/source/display/html/pm_base.hxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * $RCSfile: pm_base.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_PM_BASE_HXX +#define ADC_DISPLAY_PM_BASE_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include "hdimpl.hxx" + + + +class OuputPage_Environment; +class csi::xml::Element; +class PageDisplay; + + +/** Interface for making a special kind of HTML-Page +*/ +class SpecializedPageMaker +{ + public: + virtual ~SpecializedPageMaker() {} + + virtual void MakePage() = 0; + + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_DocuArea(); + virtual void Write_ChildList( + ary::SlotAccessId i_nSlot, + const char * i_nListTitle, + const char * i_nLabel ); + + protected: + SpecializedPageMaker( + PageDisplay & io_rPage ); + + OuputPage_Environment & + Env() { return *pEnv; } + csi::xml::Element & CurOut(); + PageDisplay & Page() { return *pPage; } + + private: + OuputPage_Environment * + pEnv; + csi::xml::Element * pCurOut; + PageDisplay * pPage; +}; + + + +#endif + diff --git a/autodoc/source/display/html/pm_class.cxx b/autodoc/source/display/html/pm_class.cxx new file mode 100644 index 000000000000..dc0ebfbaa487 --- /dev/null +++ b/autodoc/source/display/html/pm_class.cxx @@ -0,0 +1,830 @@ +/************************************************************************* + * + * $RCSfile: pm_class.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_class.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/loc/l_rogate.hxx> +#include <ary/loc/loc_file.hxx> +#include "hd_chlst.hxx" +#include "hd_docu.hxx" +#include "hdimpl.hxx" +#include "html_kit.hxx" +#include "navibar.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" +#include "strconst.hxx" + +using namespace adcdisp; + +using namespace csi; +using csi::html::HorizontalLine; +using csi::html::LineBreak; +using csi::html::Link; +using csi::html::Table; +using csi::html::TableRow; +using csi::html::TableCell; + +const char * const C_sTitle_InnerClasses = "Classes"; +const char * const C_sTitle_InnerStructs = "Structs"; +const char * const C_sTitle_InnerUnions = "Unions"; +const char * const C_sTitle_Methods = "Methods"; +const char * const C_sTitle_StaticMethods = "Static Methods"; +const char * const C_sTitle_Data = "Data"; +const char * const C_sTitle_StaticData = "Static Data"; + +const char * const C_sLabel_StaticOperations = "static_ops"; +const char * const C_sLabel_StaticVariables = "static_vars"; + +const char * const C_sTitlePublic = "Public Members"; +const char * const C_sTitleProtected = "Protected Members"; +const char * const C_sTitlePrivate = "Private Members"; +const char * const C_sMprTitles[3] = { C_sTitlePublic, + C_sTitleProtected, + C_sTitlePrivate + }; +const char * const C_sSummaryTitlePublic = "Public Members"; +const char * const C_sSummaryTitleProtected = "Protected Members"; +const char * const C_sSummaryTitlePrivate = "Private Members"; +const char * + C_sMprSummaryTitles[3] = + { C_sSummaryTitlePublic, C_sSummaryTitleProtected, C_sSummaryTitlePrivate }; +const char * + C_sMprPrefixes[3] = + { "publ_", "prot_", "priv_" }; +const char * + C_sSummaryItems_Titles[PageMaker_Class::cl_MAX] = + { C_sTitle_InnerClasses, C_sTitle_InnerStructs, C_sTitle_InnerUnions, + C_sTitle_Enums, C_sTitle_Typedefs, + C_sTitle_Methods, C_sTitle_StaticMethods, C_sTitle_Data, C_sTitle_StaticData }; +const char * + C_sSummaryItems_Labels[PageMaker_Class::cl_MAX] = + { C_sLabel_Classes, C_sLabel_Structs, C_sLabel_Unions, + C_sLabel_Enums, C_sLabel_Typedefs, + C_sLabel_Operations, C_sLabel_StaticOperations, + C_sLabel_Variables, C_sLabel_StaticVariables }; + + +const ary::cpp::E_Protection + aProt[3] = { ary::cpp::PROTECT_public, + ary::cpp::PROTECT_protected, + ary::cpp::PROTECT_private }; + + +PageMaker_Class::PageMaker_Class( PageDisplay & io_rPage, + const ary::cpp::Class & i_rClass ) + : SpecializedPageMaker(io_rPage), + pMe( &i_rClass ), + pChildDisplay( new ChildList_Display(io_rPage.Env(), i_rClass) ), + pNavi(0) + // pProtectionArea, + // bChildLists_Exist +{ + int i_max = 3 * cl_MAX; + for (int i = 0; i < i_max; i++) + { + bChildLists_Exist[i] = false; + } // end for +} + +PageMaker_Class::~PageMaker_Class() +{ +} + +void +PageMaker_Class::MakePage() +{ + pNavi = new NavigationBar( Env(), Me() ); + + Write_NavBar(); + Write_TopArea(); + Write_DocuArea(); + Write_ChildLists(); + + pNavi->Write_SubRows(); + pNavi = 0; +} + +void +PageMaker_Class::Write_NavBar() +{ + NavigationBar aNavi( Env(), Me() ); + pNavi->Write( CurOut() ); + CurOut() << new HorizontalLine; +} + +void +PageMaker_Class::Write_TopArea() +{ + TemplateClause fTemplateClause; + PageTitle_Std fTitle; + + Page().Write_NameChainWithLinks( Me() ); + + fTemplateClause( CurOut(), Me().TemplateParameters() ); + fTitle( CurOut(), Get_ClassTypeKey(Me()), Me().LocalName() ); + + CurOut() << new HorizontalLine; + + Write_BaseHierarchy(); + Write_DerivedList(); + + CurOut() << new LineBreak; + + adcdisp::FlagTable + aFlags( CurOut(), 4 ); + aFlags.SetColumn( 0, "virtual", + Me().Virtuality() != ary::cpp::VIRTUAL_none ); + aFlags.SetColumn( 1, "abstract", + Me().Virtuality() == ary::cpp::VIRTUAL_abstract ); + aFlags.SetColumn( 2, "interface", + static_cast< const ary::info::CodeInfo& >(Me().Info()).IsInterface() + OR Me().Virtuality() == ary::cpp::VIRTUAL_abstract ); + aFlags.SetColumn( 3, "template", + Me().TemplateParameters().size() > 0 ); +} + +void +PageMaker_Class::Write_DocuArea() +{ + Docu_Display aDocuShow( Env() ); + + aDocuShow.Assign_Out(CurOut()); + Me().StoreAt( aDocuShow ); + aDocuShow.Unassign_Out(); + + ary::loc::SourceCodeFile * + pFile = Env().Gate().RoLocations().Find_File( Me().Location() ); + if (pFile != 0) + { + adcdisp::ExplanationList + aFileText( CurOut() ); + aFileText.AddEntry("File"); + aFileText.Def() + << pFile->Name(); + } + + CurOut() << new HorizontalLine; +} + +void +PageMaker_Class::Write_ChildLists() +{ + int i_max = 3 * cl_MAX; + for (int i = 0; i < i_max; i++) + { + bChildLists_Exist[i] = false; + } // end for + + csi::html::DefListDefinition & + rPublic = Setup_MemberSegment_Out( mp_public ); + csi::html::DefListDefinition & + rProtected = Setup_MemberSegment_Out( mp_protected ); + csi::html::DefListDefinition & + rPrivate = Setup_MemberSegment_Out( mp_private ); + + Write_ChildList_forClasses( rPublic, + rProtected, + rPrivate, + C_sLabel_Classes, + C_sTitle_InnerClasses, + ary::cpp::CK_class ); + Write_ChildList_forClasses( rPublic, + rProtected, + rPrivate, + C_sLabel_Structs, + C_sTitle_InnerStructs, + ary::cpp::CK_struct ); + Write_ChildList_forClasses( rPublic, + rProtected, + rPrivate, + C_sLabel_Unions, + C_sTitle_InnerUnions, + ary::cpp::CK_union ); + + Write_ChildList( ary::cpp::Class::SLOT_Enums, + cl_Enums, + C_sLabel_Enums, + C_sTitle_Enums, + rPublic, + rProtected, + rPrivate ); + Write_ChildList( ary::cpp::Class::SLOT_Typedefs, + cl_Typedefs, + C_sLabel_Typedefs, + C_sTitle_Typedefs, + rPublic, + rProtected, + rPrivate ); + + Write_ChildList( ary::cpp::Class::SLOT_Operations, + cl_Operations, + C_sLabel_Operations, + C_sTitle_Methods, + rPublic, + rProtected, + rPrivate ); + Write_ChildList( ary::cpp::Class::SLOT_StaticOperations, + cl_StaticOperations, + C_sLabel_StaticOperations, + C_sTitle_StaticMethods, + rPublic, + rProtected, + rPrivate ); + Write_ChildList( ary::cpp::Class::SLOT_Data, + cl_Data, + C_sLabel_Variables, + C_sTitle_Data, + rPublic, + rProtected, + rPrivate ); + Write_ChildList( ary::cpp::Class::SLOT_StaticData, + cl_StaticData, + C_sLabel_StaticVariables, + C_sTitle_StaticData, + rPublic, + rProtected, + rPrivate ); + + Create_NaviSubRow(mp_public); // Also puts out or deletes pPublic. + Create_NaviSubRow(mp_protected); // Also puts out or deletes pProtected. + Create_NaviSubRow(mp_private); // Also puts out or deletes pPrivate. +} + +void +PageMaker_Class::Write_ChildList( ary::SlotAccessId i_nSlot, + E_ChidList i_eChildListIndex, + const char * i_sLabel, + const char * i_sListTitle, + csi::xml::Element & o_rPublic, + csi::xml::Element & o_rProtected, + csi::xml::Element & o_rPrivate ) + +{ + bool bPublic_ChildrenExist = false; + bool bProtected_ChildrenExist = false; + bool bPrivate_ChildrenExist = false; + + ChildList_Display::Area_Result + aPublic_Result( bPublic_ChildrenExist, o_rPublic ); + ChildList_Display::Area_Result + aProtected_Result( bProtected_ChildrenExist, o_rProtected ); + ChildList_Display::Area_Result + aPrivate_Result( bPrivate_ChildrenExist, o_rPrivate ); + + udmstri sLabelPublic = ChildListLabel(i_sLabel, mp_public); + udmstri sLabelProtected = ChildListLabel(i_sLabel, mp_protected); + udmstri sLabelPrivate = ChildListLabel(i_sLabel, mp_private); + + pChildDisplay->Run_Members( aPublic_Result, + aProtected_Result, + aPrivate_Result, + i_nSlot, + sLabelPublic, + sLabelProtected, + sLabelPrivate, + i_sListTitle ); + + bChildLists_Exist[i_eChildListIndex] + = bPublic_ChildrenExist; + bChildLists_Exist[i_eChildListIndex + cl_MAX] + = bProtected_ChildrenExist; + bChildLists_Exist[i_eChildListIndex + 2*cl_MAX] + = bPrivate_ChildrenExist; + + if (bPublic_ChildrenExist) + o_rPublic << new HorizontalLine; + if (bProtected_ChildrenExist) + o_rProtected << new HorizontalLine; + if (bPrivate_ChildrenExist) + o_rPrivate << new HorizontalLine; +} + +void +PageMaker_Class::Write_ChildList_forClasses( csi::xml::Element & o_rPublic, + csi::xml::Element & o_rProtected, + csi::xml::Element & o_rPrivate, + const char * i_sLabel, + const char * i_sListTitle, + ary::cpp::E_ClassKey i_eFilter ) +{ + bool bPublic_ChildrenExist = false; + bool bProtected_ChildrenExist = false; + bool bPrivate_ChildrenExist = false; + + ChildList_Display::Area_Result + aPublic_Result( bPublic_ChildrenExist, o_rPublic ); + ChildList_Display::Area_Result + aProtected_Result( bProtected_ChildrenExist, o_rProtected ); + ChildList_Display::Area_Result + aPrivate_Result( bPrivate_ChildrenExist, o_rPrivate ); + + udmstri sLabelPublic = ChildListLabel(i_sLabel, mp_public); + udmstri sLabelProtected = ChildListLabel(i_sLabel, mp_protected); + udmstri sLabelPrivate = ChildListLabel(i_sLabel, mp_private); + + pChildDisplay->Run_MemberClasses( aPublic_Result, + aProtected_Result, + aPrivate_Result, + ary::cpp::Class::SLOT_NestedClasses, + sLabelPublic, + sLabelProtected, + sLabelPrivate, + i_sListTitle, + i_eFilter ); + + bChildLists_Exist[int(cl_NestedClasses)+int(i_eFilter)] + = bPublic_ChildrenExist; + bChildLists_Exist[int(cl_NestedClasses)+int(i_eFilter) + cl_MAX] + = bProtected_ChildrenExist; + bChildLists_Exist[int(cl_NestedClasses)+int(i_eFilter) + 2*cl_MAX] + = bPrivate_ChildrenExist; + + if (bPublic_ChildrenExist) + o_rPublic << new HorizontalLine; + if (bProtected_ChildrenExist) + o_rProtected << new HorizontalLine; + if (bPrivate_ChildrenExist) + o_rPrivate << new HorizontalLine; +} + +const char * +PageMaker_Class::ChildListLabel( const char * i_sLabel, E_MemberProtection i_eMpr ) +{ + static char sResult[100]; + strcpy( sResult, C_sMprPrefixes[i_eMpr] ); + strcat( sResult, i_sLabel ); + return sResult; +} + +csi::html::DefListDefinition & +PageMaker_Class::Setup_MemberSegment_Out( E_MemberProtection i_eMpr ) +{ + html::DefList * pDefList = new html::DefList; + pProtectionArea[i_eMpr] = pDefList; + + pDefList->AddTerm() + << new html::BgColorAttr("#CCCCFF") + >> *new html::Label( C_sMprPrefixes[i_eMpr] ) + >> *new html::Headline(3) + << C_sMprTitles[i_eMpr]; + return pDefList->AddDefinition(); +} + +void +PageMaker_Class::Create_NaviSubRow( E_MemberProtection i_eMpr ) +{ + int nIndexAdd = cl_MAX * i_eMpr; + + bool bEmpty = true; + for (int e = 0; e < cl_MAX; e++) + { + if ( bChildLists_Exist[e + nIndexAdd] ) + { + bEmpty = false; + break; + } + } // end for + if (bEmpty) + { + pProtectionArea[i_eMpr] = 0; + return; + } + else // + { + CurOut() << pProtectionArea[i_eMpr].Release(); + } // endif + + pNavi->MakeSubRow( C_sMprSummaryTitles[i_eMpr] ); + for (int i = 0; i < cl_MAX; i++) + { + pNavi->AddItem( C_sSummaryItems_Titles[i], + ChildListLabel( C_sSummaryItems_Labels[i], i_eMpr ), + bChildLists_Exist[i+nIndexAdd] ); + } // end for +} + +void +PageMaker_Class::Write_DerivedList() +{ + adcdisp::ExplanationList aDeriveds( CurOut() ); + aDeriveds.AddEntry( "Known Derived Classes" ); + + if ( Me().KnownDerivatives().size() == 0 ) + { + aDeriveds.Def() << "None."; + return; + } + + typedef ary::List_Rid RidList; + + for ( RidList::const_iterator it = Me().KnownDerivatives().begin(); + it != Me().KnownDerivatives().end(); + ++it ) + { + const ary::CodeEntity & + rCe = Env().Gate().Ref_Ce(*it); + + aDeriveds.Def() + >> *new html::Link( Link2Ce(Env(),rCe) ) + << rCe.LocalName(); + aDeriveds.Def() + << new html::LineBreak; + } // end for +} + + +// ============== Creating a classes base hierarchy ====================== // + + +namespace +{ + +class Node +{ + public: + Node( + const ary::cpp::Class & + i_rClass, + ary::Tid i_nClassType, + const ary::cpp::DisplayGate & + i_rGate, + intt i_nPositionOffset, + Node * io_pDerived = 0, + ary::cpp::E_Protection + i_eProtection = ary::cpp::PROTECT_global, + bool i_bVirtual = false ); + ~Node(); + + void FillPositionList( + std::vector< const Node* > & + o_rPositionList ) const; + void Write2( + csi::xml::Element & o_rOut, + const OuputPage_Environment & + i_rEnv ) const; + + intt BaseCount() const { return nCountBases; } + intt Position() const { return nPosition; } + int Xpos() const { return 3*Position(); } + int Ypos() const { return 2*Position(); } + const Node * Derived() const { return pDerived; } + + private: + typedef std::vector< DYN Node* > BaseList; + + void IncrBaseCount(); + + // DATA + BaseList aBases; + intt nCountBases; + Node * pDerived; + + udmstri sName; + const ary::cpp::Class * + pClass; + ary::Tid nClassType; + ary::cpp::E_Protection + eProtection; + bool bVirtual; + + intt nPosition; +}; + +void WriteNodeHierarchy( + csi::xml::Element & o_rOut, + const OuputPage_Environment & + i_rEnv, + const Node & i_rClass ); + +const ary::cpp::Class * + HereFind_Class( + const ary::cpp::DisplayGate & + i_rGate, + ary::Tid i_nReferingTypeId ); + +} // anonymous namespace + +void +PageMaker_Class::Write_BaseHierarchy() +{ + adcdisp::ExplanationList aBases( CurOut() ); + aBases.AddEntry( "Base Classes" ); + + if ( Me().BaseClasses().size() == 0 ) + { + aBases.Def() << "None."; + } + else + { + Dyn< Node > + pBaseGraph( new Node(Me(), 0, Env().Gate(), 0) ); + WriteNodeHierarchy( aBases.Def(), Env(), *pBaseGraph ); + } +} + + + +namespace +{ + +void +WriteNodeHierarchy( csi::xml::Element & o_rOut, + const OuputPage_Environment & i_rEnv, + const Node & i_rClass ) +{ + typedef const Node * NodePtr; + typedef std::vector<NodePtr> NodeList; + + NodeList aPositionList; + intt nSize = i_rClass.Position()+1; + aPositionList.reserve(nSize); + i_rClass.FillPositionList( aPositionList ); + + xml::Element & + rPre = o_rOut + >> *new xml::AnElement("pre") + << new html::StyleAttr("font-family:monospace;"); + + for ( int line = 0; line < nSize; ++line ) + { + char * sLine1 = new char[2 + line*5]; + char * sLine2 = new char[1 + line*5]; + *sLine1 = '\0'; + *sLine2 = '\0'; + + bool bBaseForThisLineReached = false; + for ( int col = 0; col < line; ++col ) + { + intt nDerivPos = aPositionList[col]->Derived()->Position(); + + if ( nDerivPos >= line ) + strcat(sLine1, " | "); + else + strcat(sLine1, " "); + + if ( nDerivPos > line ) + { + strcat(sLine2, " | "); + } + else if ( nDerivPos == line ) + { + if (bBaseForThisLineReached) + strcat(sLine2, "--+--"); + else + { + bBaseForThisLineReached = true; + strcat(sLine2, " +--"); + } + } + else // nDerivPos < line + { + if (bBaseForThisLineReached) + strcat(sLine2, "-----"); + else + strcat(sLine2, " "); + } + } // end for (col) + strcat(sLine1,"\n"); + rPre + << sLine1 + << sLine2; + delete [] sLine1; + delete [] sLine2; + + aPositionList[line]->Write2( rPre, i_rEnv ); + rPre << "\n"; + } // end for (line) +} + +const ary::cpp::Class * +HereFind_Class( const ary::cpp::DisplayGate & i_rGate, + ary::Tid i_nReferingTypeId ) +{ + const ary::CodeEntity * pCe = i_rGate.Search_RelatedCe( i_nReferingTypeId ); + + if ( pCe != 0 ) + { + if (pCe->RC() == ary::cpp::Class::RC_()) + { + return static_cast< const ary::cpp::Class* >(pCe); + } + else if (pCe->RC() == ary::cpp::Typedef::RC_()) + { + const ary::cpp::Typedef * + pTydef = static_cast< const ary::cpp::Typedef* >(pCe); + return HereFind_Class( i_rGate, pTydef->DescribingType() ); + } + } + + static const ary::cpp::Class aClassNull_( 0, + "Base class not found", + 0, + ary::cpp::PROTECT_global, + 0, + ary::cpp::CK_class ); + return &aClassNull_; +} + + +//********************* Node ***********************// + +Node::Node( const ary::cpp::Class & i_rClass, + ary::Tid i_nClassType, + const ary::cpp::DisplayGate & i_rGate, + intt i_nPositionOffset, + Node * io_pDerived, + ary::cpp::E_Protection i_eProtection, + bool i_bVirtual ) + : // aBases, + nCountBases(0), + pDerived(io_pDerived), + pClass(&i_rClass), + nClassType(i_nClassType), + eProtection(i_eProtection), + bVirtual(i_bVirtual), + nPosition(i_nPositionOffset) +{ + typedef ary::cpp::List_Bases BList; + + for ( BList::const_iterator it = i_rClass.BaseClasses().begin(); + it != i_rClass.BaseClasses().end(); + ++it ) + { + const ary::cpp::Class * + pBaseClass = HereFind_Class( i_rGate, (*it).nId ); + +#if 0 // only for debugging + if ( pBaseClass->Id() == 0 ) + { + Cerr() << "\nWarning: A baseclass not found of class " + << i_rClass.LocalName() + << Endl(); + } +#endif // 0 + + Dyn<Node> + pBase( new Node(*pBaseClass, + (*it).nId, + i_rGate, + nPosition, + this, + (*it).eProtection, + (*it).eVirtuality == ary::cpp::VIRTUAL_virtual) + ); + IncrBaseCount(); + nPosition += pBase->BaseCount() + 1; + aBases.push_back( pBase.Release() ); + } // end for +} + +Node::~Node() +{ +} + +void +Node::FillPositionList( std::vector< const Node* > & o_rPositionList ) const +{ + for ( BaseList::const_iterator it = aBases.begin(); + it != aBases.end(); + ++it ) + { + (*it)->FillPositionList(o_rPositionList); + } // end for + + if( o_rPositionList.size() != uintt(Position()) ) + { + csv_assert(false); + } + o_rPositionList.push_back(this); +} + +void +Node::Write2( csi::xml::Element & o_rOut, + const OuputPage_Environment & i_rEnv ) const +{ + if ( Derived() == 0 ) + { + o_rOut + >> *new html::Strong + << pClass->LocalName(); + return; + } + + csi::xml::Element * + pOut = & ( o_rOut >> *new xml::AnElement("span") ); + switch ( eProtection ) + { + case ary::cpp::PROTECT_public: + *pOut << new html::StyleAttr("color:#33ff33;"); + break; + case ary::cpp::PROTECT_protected: + *pOut << new html::StyleAttr("color:#cc9933;"); + break; + case ary::cpp::PROTECT_private: + *pOut << new html::StyleAttr("color:#ff6666;"); + break; + // default: do nothing. + } // end switch + + if ( bVirtual ) + pOut = & (*pOut >> *new html::Italic); + + csi::xml::Element & rOut = *pOut; + + Get_LinkedTypeText( rOut, i_rEnv, nClassType, false ); + + rOut << " ("; + if ( bVirtual ) + rOut << "virtual "; + switch ( eProtection ) + { + case ary::cpp::PROTECT_public: + rOut << "public)"; + break; + case ary::cpp::PROTECT_protected: + rOut << "protected)"; + break; + case ary::cpp::PROTECT_private: + rOut << "private)"; + break; + // default: do nothing. + } // end switch +} + +void +Node::IncrBaseCount() +{ + ++nCountBases; + if (pDerived != 0) + pDerived->IncrBaseCount(); +} + + +} // anonymous namespace + + diff --git a/autodoc/source/display/html/pm_class.hxx b/autodoc/source/display/html/pm_class.hxx new file mode 100644 index 000000000000..761087a46dab --- /dev/null +++ b/autodoc/source/display/html/pm_class.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * $RCSfile: pm_class.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PM_CLASS_HXX +#define ADC_DISPLAY_HTML_PM_CLASS_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "pm_base.hxx" + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + namespace cpp + { + class Class; + } +} + +class ChildList_Display; +class NavigationBar; + + +class PageMaker_Class : public SpecializedPageMaker +{ + public: + enum E_ChidList + { + cl_NestedClasses = 0, + cl_NestedStructs, + cl_NestedUnions, + cl_Enums, + cl_Typedefs, + cl_Operations, + cl_StaticOperations, + cl_Data, + cl_StaticData, + cl_MAX + }; + PageMaker_Class( + PageDisplay & io_rPage, + const ary::cpp::Class & + i_rClass ); + + virtual ~PageMaker_Class(); + + virtual void MakePage(); + + private: + enum E_MemberProtection { mp_public = 0, mp_protected, mp_private, mp_MAX }; + + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_DocuArea(); + virtual void Write_ChildList( + ary::SlotAccessId i_nSlot, + E_ChidList i_eChildListIndex, + const char * i_sLabel, + const char * i_sListTitle, + csi::xml::Element & o_rPublic, + csi::xml::Element & o_rProtected, + csi::xml::Element & o_rPrivate ); + void Write_ChildList_forClasses( + csi::xml::Element & o_rPublic, + csi::xml::Element & o_rProtected, + csi::xml::Element & o_rPrivate, + const char * i_sLabel, + const char * i_sListTitle, + ary::cpp::E_ClassKey + i_eFilter ); + void Write_ChildLists(); + static const char * ChildListLabel( + const char * i_sLabel, + E_MemberProtection i_eMpr ); + csi::html::DefListDefinition & + Setup_MemberSegment_Out( + E_MemberProtection i_eMpr ); + void Create_NaviSubRow( + E_MemberProtection i_eMpr ); + void Write_BaseHierarchy(); + void Write_DerivedList(); + + const ary::cpp::Class & + Me() const { return *pMe; } + // DATA + const ary::cpp::Class * + pMe; + Dyn<ChildList_Display> + pChildDisplay; + Dyn<NavigationBar> pNavi; + + Dyn<csi::xml::Element> + pProtectionArea[mp_MAX]; + + bool bChildLists_Exist[3*cl_MAX]; +}; + + + + + +#endif + diff --git a/autodoc/source/display/html/pm_help.cxx b/autodoc/source/display/html/pm_help.cxx new file mode 100644 index 000000000000..ed482cedbc4f --- /dev/null +++ b/autodoc/source/display/html/pm_help.cxx @@ -0,0 +1,270 @@ +/************************************************************************* + * + * $RCSfile: pm_help.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_help.hxx" + + +// NOT FULLY DEFINED SERVICES +#include "navibar.hxx" +#include "html_kit.hxx" + +using namespace csi; +using csi::html::Paragraph; +using csi::html::HorizontalLine; +using csi::html::Headline; +using csi::html::AlignAttr; +using csi::html::Bold; +using csi::html::Link; +using csi::html::Sbr; +using csi::html::LineBreak; +using csi::xml::Element; + + + +const udmstri C_sHelpText( +"<div style=\"font-size:10pt;\">\n" +"<h3 style=\"background-color: rgb(238,238,255); \">The Main Navigationbar</h3>\n" +"<p> On top of every page, there is a main navigationbar on a lightly coloured\n" +"background with the following items:<br>\n" +"</p>\n" +"<ul>\n" +" <li>Overview - the start page for this document,</li>\n" +" <li>Namespace - the lowest/deepest namespace of the language objects, described\n" +"on the current page,</li>\n" +" <li>Class - the class, struct or union, which owns the methods or data,\n" +"described on the current page,</li>\n" +" <li>Index - the global alphabetical index,</li>\n" +" <li>Help - this page.</li>\n" +"</ul>\n" +" Each item in this bar can be in three different states:<br>\n" +"<ul>\n" +" <li>Link - the item is valid and you can get there,</li>\n" +" <li>Simple - the item does not apply (if this page described a namespace,\n" +"there would be no owning class),</li>\n" +" <li>Reversed (white text on dark background) - this is the current page.</li>\n" +"</ul>\n" +"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Lower Navigationbars</h3>\n" +" Just below the main navigation bar, there may be zero to three lower navigationbars\n" +"on white background.<br>\n" +"<br>\n" +"Their items are dependent of the context, but they always link to paragraphs\n" +"on the same, current page.<br>\n" +"Available items appear as links. Unavailable items appear as simple text.<br>\n" +"\n" +"\n" +"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Namespace Descriptions</h3>\n" +"\n" +"<dl>\n" +"<dt class=\"simple\">Parent namespaces</dt>\n" +" </dl>\n" +" <dl>\n" +" <dd>In front of the namespace title, there is a linked list of the parent\n" +"namespaces. The global namespace is linked with the first \"::\",</dd>\n" +" <dd>the namespaces between the global and the current one are linked\n" +"by their names.<br>\n" +" </dd>\n" +" <dd> </dd>\n" +" </dl>\n" +"After the title, the documentation of the namespace follows (which is often\n" +"missing, because the namespace name may be self-explaining).<br>\n" +" <br>\n" +"Below are the lists of nested namspaces and of the classes, functions and\n" +"other program objects, that belong within this namespace.<br>\n" +"Each of this lists is accessible by the lower navigationbar on top of the\n" +"page.<br>\n" +"\n" +"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Class Descriptions</h3>\n" +"\n" +" <dl>\n" +" <dt class=\"simple\">Parent namespaces and classes</dt>\n" +" </dl>\n" +" <dl>\n" +" <dd>In front of the class title, there is a linked list of the\n" +"parent namespaces or classes. The global namespace is linked with the first\n" +"\"::\",</dd>\n" +" <dd>the namespaces between the global and the current one are\n" +"linked by their names. Parent classes are linked as well, but appear in <font color=\"#33cc00\">\n" +"green</font> color. </dd>\n" +" <dd>So you see on the first glance, that this is a parent class,\n" +"no namespace.<br>\n" +" </dd>\n" +" <dd><br>\n" +" </dd>\n" +" </dl>\n" +"After the title, the bases and derivations of the class follow. <br>\n" +"Base classes are displayed as a graph. The text around base classes can appear\n" +"in different styles and colours:<br>\n" +"<ul>\n" +" <li><font color=\"#33ff33\">Green</font> - public inherited,</li>\n" +" <li><font color=\"#ffcc00\">Orange</font> - protected inherited,</li>\n" +" <li><font color=\"#ff0000\">Red </font>- private inherited,</li>\n" +" <li><font color=\"#33ff33\"><i>italic </i></font>- a (public inherited) virtual base class.</li>\n" +" <li><b>Bold and black</b> without a link - the placeholder\n" +"for the currently described class.<br>\n" +" </li>\n" +"</ul>\n" +"There may be many derivations of a class, but only the known ones, which\n" +"are described within this document also, are listed.<br>\n" +"<br>\n" +"Below the derivations is a little table with some properties of the class:<br>\n" +"<ul>\n" +" <li>virtual - the class owns at least one virtual method,</li>\n" +" <li>abstract - the class owns at least one abstract method,</li>\n" +" <li>interface - the class may or may be not abstract,\n" +"but it is intended by its author to be used only as an interface and never\n" +"to be instantiated,</li>\n" +" <li>template - the class is a template class.<br>\n" +" </li>\n" +"</ul>\n" +"Next comes further documentation of the class itself.<br>\n" +"<br>\n" +"Lastly, there are listed all members of the class. Public members come first,\n" +"then protected, at last the private ones.<br>\n" +"All member lists are accessible by the lower navigationbars on top of the\n" +"page.<br>\n" +"\n" +"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Macros\n" +"and Defines</h3>\n" +"In C++ and C, there are also program constructs, which do not fit into the\n" +"name tree, because they are #define'd: macros and definitions.<br>\n" +"These may be documented, too. Those comments you find <a href=\"def-all.html\">\n" +"here</a>\n" +" or from the \"Overview\" start page.\n" +"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Links\n" +"to IDL-Documentation</h3>\n" +"Some types, which appear as links, may refer to classes, enums or other\n" +"entities, which are direct mappings of UNO-IDL entities.<br>\n" +"In those cases the link doesn't lead to the C++ class, enum or whatever,\n" +"but to the description of the IDL entity.\n" +"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">How to\n" +"Link From Extern Documents</h3>\n" +"If you wish to write an extern html document, which links to types within\n" +"this C++ reference, you can do so, if your links have the following format:<br>\n" +"<br>\n" +"<RootDirectory-of-this-Document>/names/<Namespace-A>/<Namespace-XY>/ParentClass-nn>/<TypePreFix>-<MyTypeName>.html<br>\n" +"<br>\n" +"<TypePreFix> can have the following values:<br>\n" +"<ul>\n" +"<li>c - class, struct or union</li>\n" +"<li>e - enum</li>\n" +"<li>t - typedef</li>\n" +"</ul>\n" +"If this document would be located in directory \"/doc/cpp/ref\", examples\n" +"would look like this:<br>\n" +"<br>\n" +"<a href=\"/doc/cpp/ref/names/osl/c-File.html\">class File</a><br>\n" +"<a href=\"/doc/cpp/ref/names/osl/FileBase/e-RC.html\">enum FileBase::RC</a><br>\n" +"<a href=\"/doc/cpp/ref/names/t-oslMutex.html\">typedef oslMutex</a><br>\n" +"<br>\n" +"Namespaces are described in the index.html file within their directory:<br>\n" +"<br>\n" +"<a href=\"/doc/cpp/ref/names/cppu/index.html\">namespace cppu</a><br>\n" +"</div>" ); + + + + +PageMaker_Help::PageMaker_Help( PageDisplay & io_rPage ) + : SpecializedPageMaker(io_rPage), + pNavi(0) +{ +} + +PageMaker_Help::~PageMaker_Help() +{ +} + +void +PageMaker_Help::MakePage() +{ + pNavi = new NavigationBar( Env(), NavigationBar::LOC_Help ); + Write_NavBar(); + + Write_TopArea(); + Write_DocuArea(); +} + +void +PageMaker_Help::Write_NavBar() +{ + pNavi->Write( CurOut() ); + CurOut() << new HorizontalLine; +} + +void +PageMaker_Help::Write_TopArea() +{ + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), "How to Use", "this Reference Document" ); + + CurOut() << new xml::XmlCode(C_sHelpText); +} + +void +PageMaker_Help::Write_DocuArea() +{ + CurOut() << new HorizontalLine; +} + + + diff --git a/autodoc/source/display/html/pm_help.hxx b/autodoc/source/display/html/pm_help.hxx new file mode 100644 index 000000000000..cbad004af716 --- /dev/null +++ b/autodoc/source/display/html/pm_help.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: pm_help.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PM_HELP_HXX +#define ADC_DISPLAY_HTML_PM_HELP_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "pm_base.hxx" + // COMPONENTS + // PARAMETERS + +class NavigationBar; + +class PageMaker_Help : public SpecializedPageMaker +{ + public: + PageMaker_Help( + PageDisplay & io_rPage ); + + virtual ~PageMaker_Help(); + + virtual void MakePage(); + + private: + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_DocuArea(); + + // DATA + Dyn<NavigationBar> pNavi; +}; + + + +#endif + diff --git a/autodoc/source/display/html/pm_index.cxx b/autodoc/source/display/html/pm_index.cxx new file mode 100644 index 000000000000..ce129b0d7c9f --- /dev/null +++ b/autodoc/source/display/html/pm_index.cxx @@ -0,0 +1,345 @@ +/************************************************************************* + * + * $RCSfile: pm_index.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_index.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_define.hxx> +#include <ary/cpp/c_enum.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/c_macro.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <ary/cpp/c_vari.hxx> +#include <ary/cpp/c_enuval.hxx> +#include "hd_chlst.hxx" +#include "hd_docu.hxx" +#include "html_kit.hxx" +#include "navibar.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" +#include "strconst.hxx" + + +using namespace csi; + + +namespace +{ + +inline const char * +F_CK_Text( ary::cpp::E_ClassKey i_eCK ) +{ + switch (i_eCK) + { + case ary::cpp::CK_class: return "class"; + case ary::cpp::CK_struct: return "struct"; + case ary::cpp::CK_union: return "union"; + } // end switch + return ""; +} + +template <class CE> +inline const char * +F_OwnerType( const CE & i_rData, const ary::cpp::DisplayGate & i_rGate ) +{ + if ( i_rData.Protection() == ary::cpp::PROTECT_global ) + return "namespace "; + + const ary::cpp::Class * + pClass = dynamic_cast< const ary::cpp::Class* >( + i_rGate.Find_Ce(i_rData.Owner()) ); + if (pClass != 0) + return F_CK_Text(pClass->ClassKey()); + return ""; +} + +} // anonymous namespace + +PageMaker_Index::PageMaker_Index( PageDisplay & io_rPage, + char i_c ) + : SpecializedPageMaker(io_rPage), + pNavi(0), + c(i_c), + pCurIndex(0) +{ +} + +PageMaker_Index::~PageMaker_Index() +{ +} + +void +PageMaker_Index::MakePage() +{ + pNavi = new NavigationBar( Env(), NavigationBar::LOC_Index ); + + Write_NavBar(); + Write_TopArea(); + Write_CompleteAlphabeticalList(); +} + +void +PageMaker_Index::Display_Namespace( const ary::cpp::Namespace & i_rData ) +{ + Write_CeIndexEntry( i_rData, "namespace", "namespace" ); +} + +void +PageMaker_Index::Display_Class( const ary::cpp::Class & i_rData ) +{ + Write_CeIndexEntry( i_rData, + F_CK_Text(i_rData.ClassKey()), + F_OwnerType(i_rData, Env().Gate()) ); +} + +void +PageMaker_Index::Display_Enum( const ary::cpp::Enum & i_rData ) +{ + Write_CeIndexEntry( i_rData, "enum", F_OwnerType(i_rData, Env().Gate()) ); +} + +void +PageMaker_Index::Display_Typedef( const ary::cpp::Typedef & i_rData ) +{ + Write_CeIndexEntry( i_rData, "typedef", F_OwnerType(i_rData, Env().Gate()) ); +} + +void +PageMaker_Index::Display_Function( const ary::cpp::Function & i_rData ) +{ + Write_CeIndexEntry( i_rData, "function", F_OwnerType(i_rData, Env().Gate()) ); +} + +void +PageMaker_Index::Display_Variable( const ary::cpp::Variable & i_rData ) +{ + Write_CeIndexEntry( i_rData, "variable", F_OwnerType(i_rData, Env().Gate()) ); +} + +void +PageMaker_Index::Display_EnumValue( const ary::cpp::EnumValue & i_rData ) +{ + Write_CeIndexEntry( i_rData, "enum value", "" ); +} + +void +PageMaker_Index::Display_Define( const ary::cpp::Define & i_rData ) +{ + udmstri sFileName; + + pCurIndex->AddEntry(); + pCurIndex->Term() + >> *new html::Link( Link2CppDefinition(Env(), i_rData) ) + >> *new html::Bold + << i_rData.DefinedName() + << " - define"; + + // KORR FUTURE +// pCurIndex->Term() +// << " - " +// << " define in file " +// << sFileName; + + pCurIndex->Def() << " "; +} + +void +PageMaker_Index::Display_Macro( const ary::cpp::Macro & i_rData ) +{ + udmstri sFileName; + + pCurIndex->AddEntry(); + pCurIndex->Term() + >> *new html::Link( Link2CppDefinition(Env(), i_rData) ) + >> *new html::Bold + << i_rData.DefinedName() + << " - macro"; + + // KORR FUTURE +// pCurIndex->Term() +// << " - " +// << " macro in file " +// << sFileName; + + pCurIndex->Def() << " "; +} + +void +PageMaker_Index::Write_NavBar() +{ + pNavi->Write( CurOut() ); + CurOut() << new html::HorizontalLine; +} + + +const udmstri C_sAlphabet( +"<a href=\"index-1.html\"><B>A</B></a> <a href=\"index-2.html\"><B>B</B></a> <a href=\"index-3.html\"><B>C</B></a> <a href=\"index-4.html\"><B>D</B></a> <a href=\"index-5.html\"><B>E</B></a> " +"<a href=\"index-6.html\"><B>F</B></a> <a href=\"index-7.html\"><B>G</B></a> <a href=\"index-8.html\"><B>H</B></a> <a href=\"index-9.html\"><B>I</B></a> <a href=\"index-10.html\"><B>J</B></a> " +"<a href=\"index-11.html\"><B>K</B></a> <a href=\"index-12.html\"><B>L</B></a> <a href=\"index-13.html\"><B>M</B></a> <a href=\"index-14.html\"><B>N</B></a> <a href=\"index-15.html\"><B>O</B></a> " +"<a href=\"index-16.html\"><B>P</B></a> <a href=\"index-17.html\"><B>Q</B></a> <a href=\"index-18.html\"><B>R</B></a> <a href=\"index-19.html\"><B>S</B></a> <a href=\"index-20.html\"><B>T</B></a> " +"<a href=\"index-21.html\"><B>U</B></a> <a href=\"index-22.html\"><B>V</B></a> <a href=\"index-23.html\"><B>W</B></a> <a href=\"index-24.html\"><B>X</B></a> <a href=\"index-25.html\"><B>Y</B></a> " +"<a href=\"index-26.html\"><B>Z</B></a> <a href=\"index-27.html\"><B>_</B></a>" ); + +void +PageMaker_Index::Write_TopArea() +{ + udmstri sLetter(&c, 1); + + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), "Global Index", sLetter ); + + CurOut() >>* new html::Paragraph + << new html::AlignAttr("center") + << new xml::XmlCode(C_sAlphabet); + + CurOut() << new html::HorizontalLine; +} + +void +PageMaker_Index::Write_CompleteAlphabeticalList() +{ + std::vector<ary::Rid> + aThisPagesItems; + const ary::cpp::DisplayGate & + rGate = Env().Gate(); + + static char sBegin[] = "X"; + static char sEnd[] = "Y"; + + switch ( c ) + { + case 'Z': sBegin[0] = 'Z'; + sEnd[0] = '_'; + break; + case '_': sBegin[0] = '_'; + sEnd[0] = '0'; + break; + default: sBegin[0] = c; + sEnd[0] = char(c + 1); + break; + } + + uintt nCount = rGate.Get_AlphabeticalList( aThisPagesItems, sBegin, sEnd ); + if (nCount > 0 ) + { + adcdisp::IndexList + aIndex(CurOut()); + pCurIndex = &aIndex; + + std::vector<ary::Rid>::const_iterator itEnd = aThisPagesItems.end(); + for ( std::vector<ary::Rid>::const_iterator it = aThisPagesItems.begin(); + it != itEnd; + ++it ) + { + const ary::RepositoryEntity * + pRe = rGate.Find_Re( *it ); + if ( pRe != 0 ) + pRe->StoreAt(*this); + } // end for + + pCurIndex = 0; + } // endif (nCount > 0) +} + +void +PageMaker_Index::Write_CeIndexEntry( const ary::CodeEntity & i_rCe, + const char * i_sType, + const char * i_sOwnerType ) +{ + static csv::StreamStr aQualification(500); + + const ary::CodeEntity & rOwner = Env().Gate().Ref_Ce(i_rCe.Owner()); + + + pCurIndex->AddEntry(); + pCurIndex->Term() + >> *new html::Link( Link2Ce(Env(), i_rCe) ) + >> *new html::Bold + << i_rCe.LocalName(); + pCurIndex->Term() + << " - " + << i_sType; + + if ( rOwner.Owner() != 0 ) + { + aQualification.seekp(0); + Env().Gate().Get_QualifiedName( aQualification, + rOwner.LocalName(), + rOwner.Owner() ); + + pCurIndex->Term() + << " in " + << i_sOwnerType + << " " + << aQualification.c_str(); + } + + pCurIndex->Def() << " "; +} + + + diff --git a/autodoc/source/display/html/pm_index.hxx b/autodoc/source/display/html/pm_index.hxx new file mode 100644 index 000000000000..ba3a4ec10af8 --- /dev/null +++ b/autodoc/source/display/html/pm_index.hxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * $RCSfile: pm_index.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PM_INDEX_HXX +#define ADC_DISPLAY_HTML_PM_INDEX_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "pm_base.hxx" +#include <ary/cpp/cpp_disp.hxx> + // COMPONENTS + // PARAMETERS + +namespace adcdisp +{ + class IndexList; +} + + +class ChildList_Display; +class NavigationBar; + +class PageMaker_Index : public SpecializedPageMaker, + private ary::cpp::Display +{ + public: + PageMaker_Index( + PageDisplay & io_rPage, + char i_c ); + + virtual ~PageMaker_Index(); + + virtual void MakePage(); + + // Interface ary::cpp::Display: + virtual void Display_Namespace( + const ary::cpp::Namespace & + i_rData ); + virtual void Display_Class( + const ary::cpp::Class & + i_rData ); + virtual void Display_Enum( + const ary::cpp::Enum & + i_rData ); + virtual void Display_Typedef( + const ary::cpp::Typedef & + i_rData ); + virtual void Display_Function( + const ary::cpp::Function & + i_rData ); + virtual void Display_Variable( + const ary::cpp::Variable & + i_rData ); + virtual void Display_EnumValue( + const ary::cpp::EnumValue & + i_rData ); + + virtual void Display_Define( + const ary::cpp::Define & + i_rData ); + virtual void Display_Macro( + const ary::cpp::Macro & + i_rData ); + + private: + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_CompleteAlphabeticalList(); + + void Write_CeIndexEntry( + const ary::CodeEntity & + i_rCe, + const char * i_sType, + const char * i_sOwnerType ); + + // DATA + Dyn<NavigationBar> pNavi; + char c; + adcdisp::IndexList * + pCurIndex; +}; + + + +#endif + diff --git a/autodoc/source/display/html/pm_namsp.cxx b/autodoc/source/display/html/pm_namsp.cxx new file mode 100644 index 000000000000..e9a66acec4a3 --- /dev/null +++ b/autodoc/source/display/html/pm_namsp.cxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * $RCSfile: pm_namsp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_namsp.hxx" + + +// NOT FULLY DEFINED SERVICES +#include "hd_chlst.hxx" +#include "hd_docu.hxx" +#include "html_kit.hxx" +#include "navibar.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" +#include "strconst.hxx" + + +using namespace csi; +using csi::html::HorizontalLine; +using csi::html::Link; +using csi::html::Table; +using csi::html::TableRow; +using csi::html::TableCell; + + + +PageMaker_Namespace::PageMaker_Namespace( PageDisplay & io_rPage ) + : SpecializedPageMaker(io_rPage), + pMe( io_rPage.Env().CurNamespace() ), + pChildDisplay( new ChildList_Display(io_rPage.Env()) ), + pNavi(0) +{ + csv_assert( pMe != 0 ); +} + +PageMaker_Namespace::~PageMaker_Namespace() +{ +} + +void +PageMaker_Namespace::MakePage() +{ + pNavi = new NavigationBar( Env(), Me() ); + + Write_NavBar(); + Write_TopArea(); + Write_DocuArea(); + + pNavi->MakeSubRow(""); + Write_ChildList( ary::cpp::Namespace::SLOT_SubNamespaces, C_sTitle_SubNamespaces, C_sLabel_SubNamespaces ); + + Write_ChildLists_forClasses( C_sTitle_Classes, + C_sLabel_Classes, + ary::cpp::CK_class ); + Write_ChildLists_forClasses( C_sTitle_Structs, + C_sLabel_Structs, + ary::cpp::CK_struct ); + Write_ChildLists_forClasses( C_sTitle_Unions, + C_sLabel_Unions, + ary::cpp::CK_union ); + + Write_ChildList( ary::cpp::Namespace::SLOT_Enums, C_sTitle_Enums, C_sLabel_Enums ); + Write_ChildList( ary::cpp::Namespace::SLOT_Typedefs, C_sTitle_Typedefs, C_sLabel_Typedefs ); + Write_ChildList( ary::cpp::Namespace::SLOT_Operations, C_sTitle_Operations, C_sLabel_Operations ); + Write_ChildList( ary::cpp::Namespace::SLOT_Constants, C_sTitle_Constants, C_sLabel_Constants ); + Write_ChildList( ary::cpp::Namespace::SLOT_Variables, C_sTitle_Variables, C_sLabel_Variables ); + + pNavi->Write_SubRows(); +} + +void +PageMaker_Namespace::Write_NavBar() +{ + pNavi->Write( CurOut() ); + CurOut() << new HorizontalLine; +} + +void +PageMaker_Namespace::Write_TopArea() +{ + Page().Write_NameChainWithLinks( Me() ); + + adcdisp::PageTitle_Std fTitle; + xml::Element & rH3 = fTitle( CurOut() ); + if ( Env().CurNamespace()->Owner() != 0 ) + { + rH3 << C_sHFTypeTitle_Namespace + << " " + << Env().CurNamespace()->LocalName(); + } + else + { + rH3 << C_sHFTitle_GlobalNamespaceCpp; + } + CurOut() << new HorizontalLine; +} + +void +PageMaker_Namespace::Write_DocuArea() +{ + Docu_Display aDocuShow( Env() ); + + aDocuShow.Assign_Out(CurOut()); + Me().Info().StoreAt( aDocuShow ); + aDocuShow.Unassign_Out(); + + CurOut() << new HorizontalLine; +} + +void +PageMaker_Namespace::Write_ChildList( ary::SlotAccessId i_nSlot, + const char * i_sListTitle, + const char * i_sLabel ) + +{ + bool bChildrenExist = false; + ChildList_Display::Area_Result + aResult( bChildrenExist, CurOut() ); + + pChildDisplay->Run_Simple( aResult, + i_nSlot, + i_sLabel, + i_sListTitle ); + + pNavi->AddItem(i_sListTitle, i_sLabel, bChildrenExist); + if (bChildrenExist) + CurOut() << new HorizontalLine; +} + +void +PageMaker_Namespace::Write_ChildLists_forClasses( const char * i_sListTitle, + const char * i_sLabel, + ary::cpp::E_ClassKey i_eFilter ) + +{ + bool bChildrenExist = false; + ChildList_Display::Area_Result + aResult( bChildrenExist, CurOut() ); + + pChildDisplay->Run_GlobalClasses( aResult, + ary::cpp::Namespace::SLOT_Classes, + i_sLabel, + i_sListTitle, + i_eFilter ); + + pNavi->AddItem(i_sListTitle, i_sLabel, bChildrenExist); + if ( bChildrenExist ) + CurOut() << new HorizontalLine; +} + + + diff --git a/autodoc/source/display/html/pm_namsp.hxx b/autodoc/source/display/html/pm_namsp.hxx new file mode 100644 index 000000000000..884e90b0d956 --- /dev/null +++ b/autodoc/source/display/html/pm_namsp.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: pm_namsp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PM_NAMSP_HXX +#define ADC_DISPLAY_HTML_PM_NAMSP_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "pm_base.hxx" + // COMPONENTS + // PARAMETERS + +class ChildList_Display; +class NavigationBar; + +class PageMaker_Namespace : public SpecializedPageMaker +{ + public: + PageMaker_Namespace( + PageDisplay & io_rPage ); + + virtual ~PageMaker_Namespace(); + + virtual void MakePage(); + + private: + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_DocuArea(); + virtual void Write_ChildList( + ary::SlotAccessId i_nSlot, + const char * i_nListTitle, + const char * i_nLabel ); + void Write_ChildLists_forClasses( + const char * i_sListTitle, + const char * i_sLabel, + ary::cpp::E_ClassKey i_eFilter ); + + const ary::cpp::Namespace & + Me() const { return *pMe; } + // DATA + const ary::cpp::Namespace * + pMe; + Dyn<ChildList_Display> + pChildDisplay; + Dyn<NavigationBar> pNavi; +}; + + + +#endif + diff --git a/autodoc/source/display/html/pm_start.cxx b/autodoc/source/display/html/pm_start.cxx new file mode 100644 index 000000000000..8ae6f337aafd --- /dev/null +++ b/autodoc/source/display/html/pm_start.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * $RCSfile: pm_start.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pm_start.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/ary.hxx> +#include "hd_chlst.hxx" +#include "hd_docu.hxx" +#include "navibar.hxx" +#include "html_kit.hxx" +#include "opageenv.hxx" +#include "pagemake.hxx" +#include "strconst.hxx" + + +using namespace csi; +using csi::html::Paragraph; +using csi::html::HorizontalLine; +using csi::html::AlignAttr; +using csi::html::Bold; +using csi::html::Link; +using csi::html::Sbr; +using csi::html::LineBreak; + + + +PageMaker_Overview::PageMaker_Overview( PageDisplay & io_rPage ) + : SpecializedPageMaker(io_rPage), + pNavi(0) +{ +} + +PageMaker_Overview::~PageMaker_Overview() +{ +} + +void +PageMaker_Overview::MakePage() +{ + pNavi = new NavigationBar( Env(), NavigationBar::LOC_Overview ); + Write_NavBar(); + + Write_TopArea(); + Write_DocuArea(); +} + +void +PageMaker_Overview::Write_NavBar() +{ + pNavi->Write( CurOut() ); + CurOut() << new HorizontalLine; +} + +void +PageMaker_Overview::Write_TopArea() +{ + adcdisp::PageTitle_Std fTitle; + fTitle( CurOut(), ary::Repository::The_().Name().c_str(), "" ); + + CurOut() + >> *new Paragraph + << new html::StyleAttr("font-size:14pt;") + << "This is a reference documentation for the C++ source code." + << new LineBreak + << new LineBreak + << "Points to start:"; + + html::SimpleList & rList = *new html::SimpleList; + CurOut() >> rList; + + html::ListItem & rNamedObjsItem = + rList.AddItem(); + + StreamLock sNspDir(50); + rNamedObjsItem + << new html::StyleAttr("font-size:14pt;") + >> *new Link( sNspDir() << C_sDIR_NamespacesCpp + << "/" + << C_sHFN_Namespace + << c_str ) + >> *new Bold + << "Named Objects"; + rNamedObjsItem << " (classes, functions, namespaces, etc.)" + << new html::LineBreak; + rList.AddItem() + << new html::StyleAttr("font-size:14pt;") + >> *new Link( "def-all.html" ) + >> *new Bold + << "Defines and Macros" + << new html::LineBreak; + StreamLock sIndexDir(50); + rList.AddItem() + << new html::StyleAttr("font-size:14pt;") + >> *new Link( sIndexDir() << C_sDIR_Index + << "/index-1.html" + << c_str ) + >> *new Bold + << "Global Index" + << new html::LineBreak; +} + +void +PageMaker_Overview::Write_DocuArea() +{ + CurOut() << new HorizontalLine; +} + + + diff --git a/autodoc/source/display/html/pm_start.hxx b/autodoc/source/display/html/pm_start.hxx new file mode 100644 index 000000000000..81563fc79f82 --- /dev/null +++ b/autodoc/source/display/html/pm_start.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: pm_start.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PM_START_HXX +#define ADC_DISPLAY_HTML_PM_START_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "pm_base.hxx" + // COMPONENTS + // PARAMETERS + +class NavigationBar; + +class PageMaker_Overview : public SpecializedPageMaker +{ + public: + PageMaker_Overview( + PageDisplay & io_rPage ); + + virtual ~PageMaker_Overview(); + + virtual void MakePage(); + + private: + virtual void Write_NavBar(); + virtual void Write_TopArea(); + virtual void Write_DocuArea(); + + // DATA + Dyn<NavigationBar> pNavi; +}; + + + +#endif + diff --git a/autodoc/source/display/html/protarea.cxx b/autodoc/source/display/html/protarea.cxx new file mode 100644 index 000000000000..310a8a059a40 --- /dev/null +++ b/autodoc/source/display/html/protarea.cxx @@ -0,0 +1,200 @@ +/************************************************************************* + * + * $RCSfile: protarea.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "protarea.hxx" + + +// NOT FULLY DEFINED SERVICES +#include "hdimpl.hxx" + + +inline UINT8 +ProtectionArea::Index( ary::cpp::E_ClassKey i_eClassKey ) const +{ + return i_eClassKey == ary::cpp::CK_class + ? 0 + : i_eClassKey == ary::cpp::CK_struct + ? 1 + : 2; +} + + + +ProtectionArea::ProtectionArea( const char * i_sLabel, + const char * i_sTitle ) + : sLabel(i_sLabel), + pSglTable( new S_Slot_Table(i_sTitle) ) +{ +} + +ProtectionArea::ProtectionArea( const char * i_sLabel, + const char * i_sTitle_class, + const char * i_sTitle_struct, + const char * i_sTitle_union ) + : sLabel(i_sLabel), + pSglTable(0) +{ + aClassesTables[ Index(ary::cpp::CK_class) ] + = new S_Slot_Table(i_sTitle_class); + aClassesTables[ Index(ary::cpp::CK_struct) ] + = new S_Slot_Table(i_sTitle_struct); + aClassesTables[ Index(ary::cpp::CK_union) ] + = new S_Slot_Table(i_sTitle_union); +} + +ProtectionArea::~ProtectionArea() +{ + +} + +csi::html::Table & +ProtectionArea::GetTable() +{ + csv_assert(pSglTable); + + return pSglTable->GetTable(); +} + +csi::html::Table & +ProtectionArea::GetTable( ary::cpp::E_ClassKey i_eClassKey ) +{ + csv_assert(aClassesTables[Index(i_eClassKey)]); + return aClassesTables[Index(i_eClassKey)]->GetTable(); +} + +DYN csi::html::Table * +ProtectionArea::ReleaseTable() +{ + csv_assert(pSglTable); + return pSglTable->ReleaseTable(); +} + +DYN csi::html::Table * +ProtectionArea::ReleaseTable( ary::cpp::E_ClassKey i_eClassKey ) +{ + csv_assert(aClassesTables[Index(i_eClassKey)]); + return aClassesTables[Index(i_eClassKey)]->ReleaseTable(); +} + +const char * +ProtectionArea::Label() const +{ + return sLabel; +} + + +bool +ProtectionArea::WasUsed_Area() const +{ + if ( pSglTable ) + { + return pSglTable->WasUsed(); + } + + typedef const Dyn<ProtectionArea::S_Slot_Table> cdyntab; + + // Workaround a maybe compiler bug in Solaris5-CC ? + // should normally work without the cast, + // because that is exactly the genuine type, given: + return static_cast< cdyntab& >(aClassesTables[0])->WasUsed() + OR static_cast< cdyntab& >(aClassesTables[1])->WasUsed() + OR static_cast< cdyntab& >(aClassesTables[2])->WasUsed(); +} + +bool +ProtectionArea::WasUsed_Table() const +{ + return pSglTable->WasUsed(); +} + +bool +ProtectionArea::WasUsed_Table( ary::cpp::E_ClassKey i_eClassKey ) const +{ + return aClassesTables[Index(i_eClassKey)]->WasUsed(); +} + + +//******************* S_Slot_Table **********************// + +ProtectionArea:: +S_Slot_Table::S_Slot_Table(const char * i_sTitle) + : sTableTitle(i_sTitle) +{ +} + +ProtectionArea:: +S_Slot_Table::~S_Slot_Table() +{ +} + +csi::html::Table & +ProtectionArea:: +S_Slot_Table::GetTable() +{ + return pTable + ? *pTable + : *( pTable = &Create_ChildListTable(sTableTitle) ); +} + + + diff --git a/autodoc/source/display/html/protarea.hxx b/autodoc/source/display/html/protarea.hxx new file mode 100644 index 000000000000..d1f624b31e26 --- /dev/null +++ b/autodoc/source/display/html/protarea.hxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * $RCSfile: protarea.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_PROTAREA_HXX +#define ADC_DISPLAY_HTML_PROTAREA_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/cpp/c_etypes.hxx> + +namespace csi +{ + namespace html + { + class Table; + } +} + + +class ProtectionArea +{ + public: + ProtectionArea( + const char * i_sLabel, + const char * i_sTitle ); + ProtectionArea( + const char * i_sLabel, + const char * i_sTitle_class, + const char * i_sTitle_struct, + const char * i_sTitle_union ); + ~ProtectionArea(); + + csi::html::Table & GetTable(); + csi::html::Table & GetTable( + ary::cpp::E_ClassKey + i_eClassKey ); + DYN csi::html::Table * ReleaseTable(); + DYN csi::html::Table * ReleaseTable( + ary::cpp::E_ClassKey + i_eClassKey ); + const char * Label() const; + + int Size() const { return pSglTable ? 1 : 3; } + + bool WasUsed_Area() const; + bool WasUsed_Table() const; + bool WasUsed_Table( + ary::cpp::E_ClassKey + i_eClassKey ) const; + private: + struct S_Slot_Table + { + const char * sTableTitle; + Dyn< csi::html::Table > + pTable; + + S_Slot_Table( + const char * i_sTitle ); + ~S_Slot_Table(); + csi::html::Table & GetTable(); + DYN csi::html::Table * + ReleaseTable() { return pTable.Release(); } + bool WasUsed() const { return pTable; } + }; + + UINT8 Index( + ary::cpp::E_ClassKey + i_eClassKey ) const; + // DATA + Dyn<S_Slot_Table> pSglTable; + Dyn<S_Slot_Table> aClassesTables[3]; + const char * sLabel; +}; + + + +#endif + diff --git a/autodoc/source/display/html/strconst.hxx b/autodoc/source/display/html/strconst.hxx new file mode 100644 index 000000000000..afc48f7e25ec --- /dev/null +++ b/autodoc/source/display/html/strconst.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: strconst.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_STRCONST_HXX +#define ADC_DISPLAY_HTML_STRCONST_HXX + + +const char * const C_sDIR_Projects = "prj"; +const char * const C_sDIR_NamespacesCpp = "names"; +const char * const C_sDIR_Index = "index-files"; // Convention recognised by Javadoc + +const char * const C_sPath_Index = "index-files/index-1.html"; // Convention recognised by Javadoc + +const char * const C_sHFN_Overview = "index.html"; +const char * const C_sHFN_Help = "help.html"; + +const char * const C_sHFN_Namespace = "index.html"; + +const char * const C_sTitle_SubNamespaces = "Nested Namespaces"; +const char * const C_sTitle_Classes = "Classes"; +const char * const C_sTitle_Structs = "Structs"; +const char * const C_sTitle_Unions = "Unions"; +const char * const C_sTitle_Enums = "Enums"; +const char * const C_sTitle_Typedefs = "Typedefs"; +const char * const C_sTitle_Operations = "Functions"; +const char * const C_sTitle_Constants = "Constants"; +const char * const C_sTitle_Variables = "Variables"; +const char * const C_sTitle_EnumValues = "Values"; + +const char * const C_sLabel_SubNamespaces = "subnsps"; +const char * const C_sLabel_Classes = "classes"; +const char * const C_sLabel_Structs = "structs"; +const char * const C_sLabel_Unions = "unions"; +const char * const C_sLabel_Enums = "enums"; +const char * const C_sLabel_Typedefs = "tydefs"; +const char * const C_sLabel_Operations = "ops"; +const char * const C_sLabel_Constants = "consts"; +const char * const C_sLabel_Variables = "vars"; +const char * const C_sLabel_EnumValues = "envals"; + +const char * const C_sHFTitle_Overview = "C++ Reference Documentation Overview"; +const char * const C_sHFTitle_Help = "How This Reference Document Is Organized"; + +const char * const C_sHFTitle_GlobalNamespaceCpp = "Global Namespace in C++"; +const char * const C_sHFTypeTitle_Namespace = "namespace"; +const char * const C_sHFTypeTitle_Class = "class"; +const char * const C_sHFTypeTitle_Struct = "struct"; +const char * const C_sHFTypeTitle_Union = "union"; +const char * const C_sHFTypeTitle_Enum = "enum"; +const char * const C_sHFTypeTitle_Typedef = "typedef"; + + +#endif + diff --git a/autodoc/source/display/inc/html/chd_udk2.hxx b/autodoc/source/display/inc/html/chd_udk2.hxx new file mode 100644 index 000000000000..ccc5d7f5497d --- /dev/null +++ b/autodoc/source/display/inc/html/chd_udk2.hxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * $RCSfile: chd_udk2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_HTML_CHD_UDK2_HXX +#define ADC_DISPLAY_HTML_CHD_UDK2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <autodoc/dsp_html_std.hxx> + // COMPONENTS +#include <cosv/ploc.hxx> + // PARAMETERS +#include <ary/idlists.hxx> + +namespace csv +{ + namespace ploc + { + class Path; + } +} + +namespace ary +{ + namespace cpp + { + class Namespace; + class ProjectGroup; + } + + class TopProject; + class CodeEntity; +} + +// class PageDisplay; +class OuputPage_Environment; + + + +class CppHtmlDisplay_Udk2 : public autodoc::HtmlDisplay_UdkStd +{ + public: + CppHtmlDisplay_Udk2(); + ~CppHtmlDisplay_Udk2(); + private: + // Interface CppHtmlDisplay_UdkStd: + virtual void do_Run( + const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & + i_rAryGate, + const display::CorporateFrame & + i_rLayout, + const StringVector * + i_pProjectList ); + + // Local + typedef std::vector< const ary::cpp::ProjectGroup * > ProjectList; + + + void SetRunData( + const char * i_sOutputDirectory, + const ary::cpp::DisplayGate & + i_rAryGate, + const display::CorporateFrame & + i_rLayout, + const StringVector * + i_pProjectList ); + + + void Create_Overview_File(); + void Create_Help_File(); + void Create_AllDefs_File(); + void CreateFiles_InSubTree_Projects(); + void CreateFiles_InSubTree_Namespaces(); + void CreateFiles_InSubTree_Index(); + + void RecursiveDisplay_Namespace( + const ary::cpp::Namespace & + i_rNsp ); + void DisplayFiles_InNamespace( + const ary::cpp::Namespace & + i_rNsp ); + bool CheckFilters( + const ary::CodeEntity & + i_rCe ) const + { // KORR_FUTURE Check, if project is included, and maybe other filters. + return true; } + const ary::cpp::DisplayGate & + Gate() const; + // DATA + Dyn<OuputPage_Environment> + pCurPageEnv; + ProjectList aProjectList; + bool bFilterByProjectList; +}; + + + +// IMPLEMENTATION + + +#endif + diff --git a/autodoc/source/display/kernel/displfct.cxx b/autodoc/source/display/kernel/displfct.cxx new file mode 100644 index 000000000000..a7fc7ddbd788 --- /dev/null +++ b/autodoc/source/display/kernel/displfct.cxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: displfct.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "displfct.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <html/chd_udk2.hxx> +#include <html/cfrstd.hxx> + + +DYN DisplayToolsFactory * DisplayToolsFactory::dpTheInstance_ = 0; + + +namespace autodoc +{ + +DisplayToolsFactory_Ifc & +DisplayToolsFactory_Ifc::GetIt_() +{ + if ( DisplayToolsFactory::dpTheInstance_ == 0 ) + DisplayToolsFactory::dpTheInstance_ = new DisplayToolsFactory; + return *DisplayToolsFactory::dpTheInstance_; +} + +} // namespace autodoc + + +DisplayToolsFactory::DisplayToolsFactory() +{ +} + +DisplayToolsFactory::~DisplayToolsFactory() +{ +} + +DYN autodoc::HtmlDisplay_UdkStd * +DisplayToolsFactory::Create_HtmlDisplay_UdkStd() const +{ + return new CppHtmlDisplay_Udk2; +} + +// DYN autodoc::TextDisplay_FunctionList_Ifc * +// DisplayToolsFactory::Create_TextDisplay_FunctionList() const +// { +// return new CppTextDisplay_FunctionList; +// } + +const display::CorporateFrame & +DisplayToolsFactory::Create_StdFrame() const +{ + static StdFrame aFrame; + return aFrame; +} + + diff --git a/autodoc/source/display/kernel/displfct.hxx b/autodoc/source/display/kernel/displfct.hxx new file mode 100644 index 000000000000..b35455df5831 --- /dev/null +++ b/autodoc/source/display/kernel/displfct.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: displfct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DISPLAY_DISPLFCT_HXX +#define ADC_DISPLAY_DISPLFCT_HXX + + +#include <autodoc/displaying.hxx> + + +/** Interface for parsing code of a programming language and + delivering the information into an Autodoc Repository. +**/ +class DisplayToolsFactory : public autodoc::DisplayToolsFactory_Ifc +{ + public: + DisplayToolsFactory(); + virtual ~DisplayToolsFactory(); + + virtual DYN autodoc::HtmlDisplay_UdkStd * + Create_HtmlDisplay_UdkStd() const; +// virtual DYN autodoc::TextDisplay_FunctionList_Ifc * +// Create_TextDisplay_FunctionList() const; + virtual const display::CorporateFrame & + Create_StdFrame() const; + private: + static DYN DisplayToolsFactory * + dpTheInstance_; + + friend class autodoc::DisplayToolsFactory_Ifc; +}; + + +#endif + diff --git a/autodoc/source/display/kernel/makefile.mk b/autodoc/source/display/kernel/makefile.mk new file mode 100644 index 000000000000..a994d7830486 --- /dev/null +++ b/autodoc/source/display/kernel/makefile.mk @@ -0,0 +1,90 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:25 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=display_kernel +TARGETTYPE=CUI + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/displfct.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/exes/adc_uni/adc_cl.cxx b/autodoc/source/exes/adc_uni/adc_cl.cxx new file mode 100644 index 000000000000..226dee45ed8a --- /dev/null +++ b/autodoc/source/exes/adc_uni/adc_cl.cxx @@ -0,0 +1,451 @@ +/************************************************************************* + * + * $RCSfile: adc_cl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <adc_cl.hxx> + + +// NOT FULLY DEFINED SERVICES +#include "adc_cmds.hxx" + + +namespace autodoc +{ + +CommandLine * CommandLine::pTheInstance_ = 0; + + +const char * const C_sUserGuide = + +"\n\n\n" +" Use of Autodoc\n" +" --------------\n" +"\n" +" Example for C++:\n" +"\n" +" -html <OutputDirectory> -name \"UDK 3.x anything\" -lg c++\n" +" -p <ProjName> <ProjectRootDirectory>\n" +" -t <SourceDir_relativeToProjectRoot>\n" +"\n" +" There may be several Projects specified by -p.\n" +"\n" +"\n" +" Example for IDL:\n" +"\n" +" -html <OutputDirectory> -name \"UDK 3.x anything\" -lg idl\n" +" -t <SourceDir1> <SourceDir2>\n" +"\n" +"\n" +" For both languages, instead of or in addition to -t may be\n" +" used -d (no subdirectories) or -f (just one file). There can\n" +" be multiple arguments after each of these options (-t -d -f).\n"; + + +#if 0 // FUTURE +"\n\n\n" +" Use of Autodoc\n" +" --------------\n" +"\n" +" Basics:\n" +"\n" +" Autodoc may perform different tasks.\n" +"\n" +" Possible tasks are\n" +" - parsing source code\n" +" - creating HTML-output.\n" +" On the command line each task starts with a specific\n" +" option:\n" +" '-parse' for parsing source code,\n" +" '-html' for creating HTML.\n" +" All command line options, related to one task, have to follow before\n" +" the starting option of the next task.\n" +"\n" +" Within the task '-parse', there may be defined different projects.\n" +" A project definition is started with '-p'.\n" +" All not project specific options within the task '-parse' have to\n" +" appear in front of the first '-p'.\n" +" There can be no project at all. Then all options, available for\n" +" projects, can be used like for one nameless default project, without using\n" +" '-p', but these options still have to appear behind all other\n" +" options of the task '-parse'.\n" +"\n" +"\n" +" Legend:\n" +"\n" +" <SomeText> Describes an argument.\n" +" 'SomeText' Within '...' is the literal value of an argument.\n" +" + There can be multiple arguments.\n" +" | Separator for alternative literal values of an argument.\n" +"\n" +"\n" +" Syntax:\n" +"\n" +" -parse\n" +" -name <RepositoryName>]\n" +" -lg 'c++'|'idl'\n" +" -extg <AdditonalExtensions>+\n" +" -docg 'usehtml'\n" +" -p <ProjectName> <ProjectRootDir>\n" +" -l 'c++'|'idl'\n" +" -ext <AdditonalExtensions>+\n" +" -doc 'usehtml'\n" +" -d <SourceDir_relative2ProjectRootDir_nosubdirs>+\n" +" -t <SourceTree_relative2ProjectRootDir>+\n" +" -f <SourceFile_relative2ProjectRootDir>+\n" +" -html <OutputDir>\n" +" -xlinks <Namespace> <ExternLinksRootDir>\n" +" -i <CommandFilePath>\n" +" -v <VerboseNr>\n" +"\n" +"\n" +" Detailed Options Description:\n" +"\n" +" Option Arguments\n" +" ----------------------------------------------------------\n" +"\n" +" -parse \n\n" +" Starts the task \"Parse source code\".\n" +" May be omitted, if it would be the first option on the\n" +" command line.\n" +"\n" +" -name <RepositoryName>\n\n" +" This name is used for naming the repository in\n" +" human readable output. In future it may be used also for\n" +" identifiing a repository in searches.\n" +"\n" +" -lg 'c++|'idl'\n\n" +" Identifies the programming language to be parsed.\n" +" 'c++': C++\n" +" Files with extensions '.h', '.hxx' are parsed.\n" +" 'idl': UNO-IDL\n" +" Files with extensions '.idl' are parsed.\n" +" Here the language is set globally for all projects.\n" +" A project can override this by using '-l'.\n" +"\n" +" -extg <.AdditionalExtension>+\n\n" +" Has to follow immediately behind '-lg'.\n" +" Specifies additional extensions, that will be recognised as\n" +" source code files of the previously specified programming\n" +" language. Each extension has to start with '.'.\n" +" It is possible to include extensionless files, too,\n" +" by the argument '.'\n" +" Here these extensions are set globally for all projects.\n" +" A project can override this by using '-l' and '-ext'.\n" +"\n" +" -docg 'html'|'nohtml'\n\n" +" Specifies the default for all comments in source code, so \n" +" that HTML-tags are interpreted as such or else treated as\n" +" regular text.\n" +" Without this option, the default is 'nohtml'.\n" +" Here the default is set globally for all projects.\n" +" A project can override this by using '-doc'.\n" +"\n" +" -p <ProjectName> <ProjectRootDirectory>\n\n" +" ProjectName is used in output as human readable identifier\n" +" for the project. ProjectRootDirectory is the path,\n" +" where the arguments of '-d', '-t' and '-f' are relative to.\n" +" This option can be omitted, then there is no project name\n" +" and all paths are relative to the current working directory.\n" +"\n" +" -l 'c++|'idl'\n\n" +" Overrides -lg and -extg for the current project, which is\n" +" specified by the last previous '-p'.\n" +" For details see at option '-lg'.\n" +"\n" +" -ext <.AdditionalExtension>+\n\n" +" Can be used only immediately behind '-l'.\n" +" Overrides -extg for the current project, which is\n" +" specified by the last previous '-p'.\n" +" For details see at option '-extg'.\n" +"\n" +" -doc 'html'|'nohtml'\n\n" +" Overrides -docg for the current project, which is\n" +" specified by the last previous '-p'.\n" +" For details see at option '-docg'.\n" +"\n" +" -d <SourceDir_relative2ProjectRootDir_nosubdirs>+\n\n" +" For the current project all files in the given\n" +" directories are parsed, which have valid extensions.\n" +" Subdirectories are NOT parsed.\n" +"\n" +" -t <SourceTree_relative2ProjectRootDir>+\n\n" +" For the current project all files in the given\n" +" directories AND its subdirectories are parsed, which\n" +" have valid extensions.\n" +"\n" +" -f <SourceFile_relative2ProjectRootDir>+\n\n" +" For the current project and language the given files\n" +" are parsed. It doesn't matter, if their extensions match\n" +" the valid extensions.\n" +"\n" +" -html <OutputRootDir>\n\n" +" Starts the task \"Create HTML output\".\n" +"\n" +" -xlinks <Namespace> <ExternLinksRootDir>\n\n" +" This option allows, to create links to external\n" +" HTML-documents.\n" +" For all source code objects (like classes or functions)\n" +" which belong in the given namespace, the given root\n" +" directory is used as a base for links to them.\n" +" Presently, this works only for C++-mappings of IDL-items.\n" +" The given namespace has to be absolute.\n" +"\n" +" -i <CommandFilePath>\n\n" +" This option is replaced by the contents of the given\n" +" file. The file has to be ASCII and each option\n" +" has to start in the first column of a new line.\n" +" So each valid line starts with a '-'.\n" +" Empty lines are allowed.\n" +" Comment lines have to start with '#'\n" +"\n" +" -v <VerboseNumber>\n\n" +" Show details during parsing:\n" +" 2 shows each parsed letter,\n" +" 4 shows stored objects.\n" +" 1 shows recognised tokens.\n" +" These bit-values can be combined.\n" +" This option suppresses errors, because of\n" +" missing output options (no '-html').\n"; +#endif // 0, FUTURE + + +CommandLine::CommandLine() + : nDebugStyle(0), + // pCmd_Parse, + // pCmd_Load, + // pCmd_CreateHtml, + // pCmd_CreateXml, + // pCmd_Save, + pCurProject(0), + bInitOk(false) +{ + csv_assert(pTheInstance_ == 0); + pTheInstance_ = this; +} + +CommandLine::~CommandLine() +{ + pTheInstance_ = 0; +} + +void +CommandLine::SetUpdate( const char * i_sRepositoryDir ) +{ + if ( pCmd_Load ) + { + if ( strcmp(pCmd_Load->ReposyDir(), i_sRepositoryDir) != 0 ) + { + StreamLock slMsg(200); + throw command::X_CommandLine( + slMsg() << "Different repository directories with options " + << command::C_opt_Load + << " and " + << command::C_opt_Update + << "." + << c_str ); + } + } + else + { + pCmd_Load = new command::Load(i_sRepositoryDir); + } +} + +void +CommandLine::SetCurProject( command::S_ProjectData & io_rProject ) +{ + pCurProject = &io_rProject; +} + +command::S_ProjectData & +CommandLine::CurProject() +{ + if (pCurProject == 0) + { + if ( NOT pCmd_Parse ) + { + pCmd_Parse = new command::Parse(*this); + } + pCurProject = &pCmd_Parse->CreateDefaultProject(); + } + + return *pCurProject; +} + +const CommandLine & +CommandLine::Get_() +{ + csv_assert(pTheInstance_ != 0); + return *pTheInstance_; +} + +void +CommandLine::do_Init( int argc, + char * argv[] ) +{ + bInitOk = false; + + try + { + + char * * itEnd = &argv[0] + argc; + for ( char * * it = &argv[1]; it != itEnd; ) + { + if ( strcmp(*it, command::C_opt_Verbose) == 0 ) + { + ++it; + if ( NOT(it != itEnd && **it >= '0' && **it <= '9') ) + { + StreamLock slMsg(200); + throw command::X_CommandLine( + slMsg() << "Missing number after " + << command::C_opt_Verbose + << "." + << c_str ); + } + + nDebugStyle = int(**it - '0'); + ++it; + } + else if ( strcmp(*it, command::C_opt_Load) == 0 ) + { + pCmd_Load = new command::Load; + it = pCmd_Load->Init(it, itEnd); + } + else if ( strcmp(*it, command::C_opt_CreateHtml) == 0 ) + { + pCmd_CreateHtml = new command::CreateHtml; + it = pCmd_CreateHtml->Init(it, itEnd); + } + else if ( strcmp(*it, command::C_opt_CreateXml) == 0 ) + { + pCmd_CreateXml = new command::CreateXml; + it = pCmd_CreateXml->Init(it, itEnd); + } + else if ( strcmp(*it, command::C_opt_Save) == 0 ) + { + pCmd_Save = new command::Save; + it = pCmd_Save->Init(it, itEnd); + } + else + { + pCmd_Parse = new command::Parse(*this); + char * * result = pCmd_Parse->Init(it, itEnd); + if (result == it) + { + StreamLock slMsg(200); + throw command::X_CommandLine( + slMsg() << "Unknown comand line option: '" + << *it + << "' ." + << c_str ); + } + else + it = result; + } + } // end for + + bInitOk = true; + + } // end try + catch ( command::X_CommandLine & xxx ) + { + xxx.Report( Cerr() ); + } + catch ( ... ) + { + Cerr() << "Unknown error during command line parsing." << Endl(); + } + +} + +void +CommandLine::do_PrintUse() const +{ + Cout() << C_sUserGuide << Endl(); +} + +bool +CommandLine::inq_CheckParameters() const +{ + if ( NOT pCmd_Parse AND NOT pCmd_Load) + return false; + if ( pCmd_Parse ) + { + if ( pCmd_Parse->GlobalLanguageInfo() == 0 ) + { + Cerr() << "Missing language option (" + << command::C_opt_LangAll + << ") in command line" + << Endl(); + return false; + } + } + if ( NOT pCmd_Save AND NOT pCmd_CreateHtml AND NOT pCmd_CreateXml + AND nDebugStyle == 0 ) + return false; + return bInitOk; +} + + +} // namespace autodoc + diff --git a/autodoc/source/exes/adc_uni/adc_cmds.cxx b/autodoc/source/exes/adc_uni/adc_cmds.cxx new file mode 100644 index 000000000000..785396783d15 --- /dev/null +++ b/autodoc/source/exes/adc_uni/adc_cmds.cxx @@ -0,0 +1,578 @@ +/************************************************************************* + * + * $RCSfile: adc_cmds.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "adc_cmds.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <cosv/ploc.hxx> +#include "adc_cl.hxx" + + + +namespace autodoc +{ +namespace command +{ + +Parse::InitMap Parse::aOptions_; + + + +inline bool +is( char * * pArgsIterator, const char * pOption ) +{ + return strcmp(*pArgsIterator, pOption) == 0; +} + +#define CHECK( cond, text ) \ + if ( NOT ( cond ) ) \ + throw X_CommandLine( text ) +#define CHECKOPT( cond, miss, opt ) \ + if ( NOT ( cond ) ) \ + { \ + StreamLock slMsg(100); \ + throw X_CommandLine( slMsg() << "Missing " << miss <<" after " << opt << "." << c_str ); \ + } + + +//************************** Parsing ***********************// + + +S_ProjectData::S_ProjectData( const char * i_sName, + const char * i_sRootDir ) + : sName(i_sName), + aRootDirectory(i_sRootDir,true), + // pLanguage, + bHtmlIsDefaultForDocs(false) + // aFiles +{ +} + +S_ProjectData::~S_ProjectData() +{ +} + +Parse::Parse( CommandLine & io_rCommandLine ) + : // sRepositoryName, + // sRepositoryDirectoryForUpdate + // pGlobal_Language + bGlobal_HtmlIsDefaultForDocs(false), + // aProjects, + pCommandLine(&io_rCommandLine) +{ +} + +Parse::~Parse() +{ + csv::erase_container_of_heap_ptrs(aProjects); +} + +S_ProjectData & +Parse::CreateDefaultProject() +{ + if ( aProjects.size() > 0 ) + throw new X_CommandLine("Unexpected default project in command line."); + + S_ProjectData * ret = new S_ProjectData("", "."); + aProjects.push_back(ret); + return *ret; +} + +char * * +Parse::do_Init( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + for ( char * * it = i_nCurArgsBegin; + it != i_nEndOfAllArgs; + ) + { + F_Init fi = FindFI(*it); + if (fi != 0) + it = (this->*fi)(it, i_nEndOfAllArgs); + } + + return it; +} + + +const Parse::InitMap & +Parse::Options() +{ + if ( aOptions_.size() > 0 ) + return aOptions_; + + aOptions_[udmstri(C_opt_Parse)] = &Parse::FI_Start_ParseOptions; + aOptions_[udmstri(C_opt_Name)] = &Parse::FI_SetName; + aOptions_[udmstri(C_opt_Update)] = &Parse::FI_SetUpdate; + aOptions_[udmstri(C_opt_LangAll)] = &Parse::FI_SetLanguage4All; + aOptions_[udmstri(C_opt_ExtensionsAll)] = &Parse::FI_SetExtensions4All; + aOptions_[udmstri(C_opt_DocAll)] = &Parse::FI_SetDocAttrs4All; + + aOptions_[udmstri(C_opt_Project)] = &Parse::FI_Start_ProjectOptions; + aOptions_[udmstri(C_opt_Lang)] = &Parse::FI_SetLanguage; + aOptions_[udmstri(C_opt_Extensions)] = &Parse::FI_SetExtensions; + aOptions_[udmstri(C_opt_Doc)] = &Parse::FI_SetDocAttrs; + aOptions_[udmstri(C_opt_SourceDir)] = &Parse::FI_SetSourceDirs; + aOptions_[udmstri(C_opt_SourceTree)] = &Parse::FI_SetSourceTrees; + aOptions_[udmstri(C_opt_SourceFile)] = &Parse::FI_SetSourceFiles; + + return aOptions_; +} + +Parse::F_Init +Parse::FindFI( const char * i_pArg ) const +{ + InitMap::const_iterator itFound = Options().find( udmstri(i_pArg) ); + if ( itFound == Options().end() ) + return 0; + + return (*itFound).second; +} + +char * * +Parse::FI_Start_ParseOptions( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + return i_nCurArgsBegin + 1; +} + +char * * +Parse::FI_SetName( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( **ret != '-' && ret != i_nEndOfAllArgs, + "name", C_opt_Name ); + + sRepositoryName = *ret; + return ++ret; +} + +char * * +Parse::FI_SetUpdate( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( **ret != '-' && ret != i_nEndOfAllArgs, + "directory", C_opt_Update ); + + sRepositoryDirectoryForUpdate = *ret; + pCommandLine->SetUpdate(*ret); + return ++ret; +} + +char * * +Parse::FI_SetLanguage4All( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + + if ( is(ret, C_arg_Cplusplus) ) + { + pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::cpp); + pGlobal_Language->aExtensions.push_back(udmstri("*.hxx")); + pGlobal_Language->aExtensions.push_back(udmstri("*.h")); + } + else if (is(ret, C_arg_Idl) ) + { + pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::idl); + pGlobal_Language->aExtensions.push_back(udmstri("*.idl")); + } + else if (is(ret, C_arg_Corba) ) + { + pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::corba); + pGlobal_Language->aExtensions.push_back(udmstri("*.idl")); + } + else if (is(ret, C_arg_Java) ) + { + pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::java); + pGlobal_Language->aExtensions.push_back(udmstri("*.java")); + } + else + { + StreamLock slMsg(100); + throw X_CommandLine( + slMsg() << "Missing language after " << C_opt_LangAll << "." << c_str ); + } + + return ++ret; +} + +char * * +Parse::FI_SetExtensions4All( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret == '.', + "extension(s)", C_opt_ExtensionsAll ); + StreamLock slCheck(150); + slCheck() << C_opt_ExtensionsAll + << " used without previous " + << C_opt_LangAll; + + CHECK( pGlobal_Language != 0, + slCheck().c_str() ); + + do { + pGlobal_Language->aExtensions.push_back(udmstri(*ret)); + ++ret; + } while ( ret != i_nEndOfAllArgs && **ret == '.' ); + + return ret; +} + +char * * +Parse::FI_SetDocAttrs4All( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "attribute", C_opt_DocAll ); + + if ( is(ret, C_arg_Usehtml) ) + { + bGlobal_HtmlIsDefaultForDocs = true; + ++ret; + } + else + { + throw X_CommandLine( + StreamLock(100)() << "Unknown attribute after " + << C_opt_DocAll + << "." + << c_str ); + } + + return ret; +} + +char * * +Parse::FI_Start_ProjectOptions( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + if ( aProjects.size() == 1 ) + { + if ( aProjects[0]->sName.length() == 0 ) + throw X_CommandLine( "Both, named projects and a default project, cannot be used together." ); + } + + S_ProjectData * pProject = 0; + + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "name", C_opt_Project ); + ++ret; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "root directory", C_opt_Project ); + ++ret; + + pProject = new S_ProjectData( i_nCurArgsBegin[1], i_nCurArgsBegin[2] ); + pCommandLine->SetCurProject(*pProject); + aProjects.push_back(pProject); + + return ret; +} + +char * * +Parse::FI_SetLanguage( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + + if ( is(ret, C_arg_Cplusplus) ) + pCommandLine->CurProject().pLanguage + = new S_LanguageInfo(S_LanguageInfo::cpp); + else if (is(ret, C_arg_Idl) ) + pCommandLine->CurProject().pLanguage + = new S_LanguageInfo(S_LanguageInfo::idl); + else if (is(ret, C_arg_Corba) ) + pCommandLine->CurProject().pLanguage + = new S_LanguageInfo(S_LanguageInfo::corba); + else if (is(ret, C_arg_Java) ) + pCommandLine->CurProject().pLanguage + = new S_LanguageInfo(S_LanguageInfo::java); + else + throw X_CommandLine( + StreamLock(100)() << "Missing language after " + << C_opt_Lang + << "." + << c_str ); + + return ++ret; +} + +char * * +Parse::FI_SetExtensions( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + + CHECKOPT( ret != i_nEndOfAllArgs && **ret == '.', + "extension(s)", C_opt_Extensions ); + CHECK( pCommandLine->CurProject().pLanguage != 0, + StreamLock(100)() << C_opt_Extensions + << " used without previous " + << C_opt_Lang + << c_str ); + + do { + pCommandLine->CurProject().pLanguage + ->aExtensions.push_back(udmstri(*ret)); + ++ret; + } while ( ret != i_nEndOfAllArgs && **ret == '.' ); + + return ret; +} + +char * * +Parse::FI_SetDocAttrs( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "attribute", C_opt_Doc ); + + if ( is(ret, C_arg_Usehtml) ) + { + pCommandLine->CurProject().bHtmlIsDefaultForDocs = true; + ++ret; + } + else + { + throw X_CommandLine( + StreamLock(100)() << "Unknown attribute after " + << C_opt_Doc + << "." + << c_str ); + } + + return ret; +} + +char * * +Parse::FI_SetSourceDirs( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "directory", C_opt_SourceDir ); + do { + pCommandLine->CurProject().aFiles. + aDirectories.push_back( udmstri(*ret) ); + ++ret; + } while (ret != i_nEndOfAllArgs && **ret != '-'); + + return ret; +} + +char * * +Parse::FI_SetSourceTrees( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "directory", C_opt_SourceTree ); + do { + pCommandLine->CurProject().aFiles. + aTrees.push_back( udmstri(*ret) ); + ++ret; + } while (ret != i_nEndOfAllArgs && **ret != '-'); + + return ret; +} + +char * * +Parse::FI_SetSourceFiles( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "file", C_opt_SourceFile ); // KORR_FUTURE + // What about files, which start with '-'? + do { + pCommandLine->CurProject().aFiles. + aFiles.push_back( udmstri(*ret) ); + ++ret; + } while (ret != i_nEndOfAllArgs && **ret != '-'); // KORR_FUTURE + // What about files, which start with '-'? + return ret; +} + +//************************** Load ***********************// + +Load::Load( const char * i_sRepositoryDirectory ) + : sRepositoryDirectory(i_sRepositoryDirectory) +{ +} + +Load::~Load() +{ +} + +char * * +Load::do_Init( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs AND **ret != '-', + "directory", C_opt_Load ); + + sRepositoryDirectory = *ret; + return ++ret; +} + + + +//************************** CreateHTML ***********************// + +CreateHtml::CreateHtml() +// : // sOutputRootDirectory, + // aExtLinks +{ +} + +CreateHtml::~CreateHtml() +{ +} + +char * * +CreateHtml::do_Init( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "output directory", C_opt_CreateHtml ); + sOutputRootDirectory = *ret; + + if ( is(++ret, C_opt_ExternLinks) ) + { + CHECKOPT( ret+1 != i_nEndOfAllArgs && **(ret+1) != '-', + "namespace", C_opt_ExternLinks ); + CHECKOPT( ret+2 != i_nEndOfAllArgs && **(ret+2) != '-', + "linked root directory", C_opt_ExternLinks ); + do { + aExtLinks.push_back( S_ExternLinkage(*(ret+1), *(ret+2)) ); + ret += 3; + } while ( is(ret, C_opt_ExternLinks) ); + } + + return ret; +} + + +//************************** Out XML ***********************// + +CreateXml::CreateXml() +// : // sOutputRootDirectory +{ +} + +CreateXml::~CreateXml() +{ +} + +char * * +CreateXml::do_Init( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + "output directory", C_opt_CreateXml ); + + sOutputRootDirectory = *ret; + return ++ret; +} + + +//************************** Save ***********************// + +Save::Save() +// : // sRepositoryDirectory, +{ +} + +Save::~Save() +{ +} + +char * * +Save::do_Init( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) +{ + char * * ret = i_nCurArgsBegin + 1; + CHECKOPT( ret != i_nEndOfAllArgs AND **ret != '-', + "directory", C_opt_Save ); + + sRepositoryDirectory = *ret; + return ++ret; +} + + +} // namespace command +} // namespace autodoc + + + diff --git a/autodoc/source/exes/adc_uni/adc_cmds.hxx b/autodoc/source/exes/adc_uni/adc_cmds.hxx new file mode 100644 index 000000000000..210602ffeffd --- /dev/null +++ b/autodoc/source/exes/adc_uni/adc_cmds.hxx @@ -0,0 +1,433 @@ +/************************************************************************* + * + * $RCSfile: adc_cmds.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_ADC_CMDS_HXX +#define ADC_ADC_CMDS_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <cosv/comdline.hxx> + // COMPONENTS +#include <cosv/ploc.hxx> + // PARAMETERS + +namespace ary +{ + class Repository; +} + +namespace autodoc +{ + class CommandLine; + +namespace command +{ + + +class Command +{ + public: + virtual ~Command() {} + + /** @return The first not parsed argument. + If an error occured, 0 is returned. + */ + char * * Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + private: + virtual char * * do_Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) = 0; +}; + +inline char * * +Command::Init( char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ) + { return do_Init(i_nCurArgsBegin, i_nEndOfAllArgs); } + + +struct S_ProjectData; +struct S_LanguageInfo; +struct S_ExternLinkage; + +class Parse : public Command +{ + public: + typedef std::vector< DYN S_ProjectData * > ProjectList; + typedef ProjectList::const_iterator ProjectIterator; + + Parse( + CommandLine & io_rCommandLine ); + ~Parse(); + + // INQUIRY + const udmstri & ReposyName() const; + const S_LanguageInfo * + GlobalLanguageInfo() const; + bool GlobalIsHtmlDefaultForDocs() const; + ProjectIterator ProjectsBegin() const; + ProjectIterator ProjectsEnd() const; + + + // ACCESS + S_ProjectData & CreateDefaultProject(); + + private: + // Interface Command: + virtual char * * do_Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + + typedef char * * (Parse::*F_Init)(char * *, char * *); + typedef std::map< udmstri , F_Init > InitMap; + + static const InitMap & + Options(); + F_Init FindFI( + const char * i_pArg ) const; + + char * * FI_Start_ParseOptions( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetName( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetUpdate( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetLanguage4All( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetExtensions4All( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetDocAttrs4All( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + + char * * FI_Start_ProjectOptions( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetLanguage( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetExtensions( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetDocAttrs( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetSourceDirs( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetSourceTrees( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + char * * FI_SetSourceFiles( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + + // DATA + udmstri sRepositoryName; + udmstri sRepositoryDirectoryForUpdate; + + Dyn<S_LanguageInfo> pGlobal_Language; + bool bGlobal_HtmlIsDefaultForDocs; + + ProjectList aProjects; + + CommandLine * pCommandLine; + static InitMap aOptions_; +}; + +inline const udmstri & +Parse::ReposyName() const + { return sRepositoryName; } +inline const S_LanguageInfo * +Parse::GlobalLanguageInfo() const + { return pGlobal_Language ? pGlobal_Language.Ptr() : 0; } +inline bool +Parse::GlobalIsHtmlDefaultForDocs() const + { return bGlobal_HtmlIsDefaultForDocs; } +inline Parse::ProjectIterator +Parse::ProjectsBegin() const + { return aProjects.begin(); } +inline Parse::ProjectIterator +Parse::ProjectsEnd() const + { return aProjects.end(); } + +class Load : public Command +{ + public: + Load( + const char * i_sRepositoryDirectory = "" ); + ~Load(); + + const udmstri & ReposyDir() const; + + private: + // Interface Command: + virtual char * * do_Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + // DATA + udmstri sRepositoryDirectory; +}; + +inline const udmstri & +Load::ReposyDir() const + { return sRepositoryDirectory; } + +struct S_ExternLinkage +{ + S_ExternLinkage( + const char * i_sNamespace, + const char * i_sLinkedRootDirectory ) + : sNamespace(i_sNamespace), + sLinkedRootDirectory(i_sLinkedRootDirectory) + { } + + udmstri sNamespace; + udmstri sLinkedRootDirectory; + +}; + +class CreateHtml : public Command +{ + public: + CreateHtml(); + ~CreateHtml(); + + const udmstri & OutputDir() const; + + private: + // Interface Command: + virtual char * * do_Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + // DATA + udmstri sOutputRootDirectory; + + std::vector< S_ExternLinkage > + aExtLinks; +}; + +inline const udmstri & +CreateHtml::OutputDir() const + { return sOutputRootDirectory; } + + +class CreateXml : public Command +{ + public: + CreateXml(); + ~CreateXml(); + + const udmstri & OutputDir() const; + + private: + // Interface Command: + virtual char * * do_Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + // DATA + udmstri sOutputRootDirectory; +}; + +inline const udmstri & +CreateXml::OutputDir() const + { return sOutputRootDirectory; } + + + +class Save : public Command +{ + public: + Save(); + ~Save(); + + const udmstri & ReposyDir() const; + + private: + // Interface Command: + virtual char * * do_Init( + char * * i_nCurArgsBegin, + char * * i_nEndOfAllArgs ); + // DATA + udmstri sRepositoryDirectory; +}; + +inline const udmstri & +Save::ReposyDir() const + { return sRepositoryDirectory; } + + +class X_CommandLine +{ + public: + X_CommandLine( + const char * i_sExplanation ) + : sExplanation(i_sExplanation) {} + + void Report( + ostream & o_rOut ) + { o_rOut << "Error in command line: " + << sExplanation << Endl(); } + + private: + udmstri sExplanation; +}; + +struct S_LanguageInfo +{ + enum E_ProgrammingLanguage + { + none, + cpp, + idl, + corba, + java + }; + S_LanguageInfo( + E_ProgrammingLanguage + i_eLang ); + StringVector + aExtensions; // An empty string is possible and means exactly that: files without extension. + E_ProgrammingLanguage + eLanguage; +}; + +inline +S_LanguageInfo::S_LanguageInfo( E_ProgrammingLanguage i_eLang ) +{ + eLanguage = i_eLang; +} + +struct S_Sources +{ + StringVector aDirectories; + StringVector aTrees; + StringVector aFiles; +}; + +struct S_ProjectData +{ + S_ProjectData( + const char * i_sName, + const char * i_sRootDir ); + ~S_ProjectData(); + + udmstri sName; + csv::ploc::Path aRootDirectory; + + Dyn<S_LanguageInfo> pLanguage; + bool bHtmlIsDefaultForDocs; + + S_Sources aFiles; +}; + + + + +const char * const C_opt_Verbose = "-v"; + +const char * const C_opt_Parse = "-parse"; +const char * const C_opt_Name = "-name"; +const char * const C_opt_Update = "-update"; +const char * const C_opt_LangAll = "-lg"; +const char * const C_opt_ExtensionsAll = "-extg"; +const char * const C_opt_DocAll = "-docg"; + +const char * const C_arg_Usehtml = "usehtml"; +const char * const C_arg_Cplusplus = "c++"; +const char * const C_arg_Idl = "idl"; +const char * const C_arg_Corba = "corba"; +const char * const C_arg_Java = "java"; + +const char * const C_opt_Project = "-p"; +const char * const C_opt_Lang = "-l"; +const char * const C_opt_Extensions = "-ext"; +const char * const C_opt_Doc = "-doc"; +const char * const C_opt_SourceDir = "-d"; +const char * const C_opt_SourceTree = "-t"; +const char * const C_opt_SourceFile = "-f"; + +const char * const C_opt_Load = "-load"; + +const char * const C_opt_CreateHtml = "-html"; +const char * const C_opt_ExternLinks = "-xlinks"; + +const char * const C_opt_CreateXml = "-xml"; +const char * const C_opt_Save = "-save"; + +// IMPLEMENTATION + + + +} // namespace command +} // namespace autodoc + + +#endif + diff --git a/autodoc/source/exes/adc_uni/cmd_run.cxx b/autodoc/source/exes/adc_uni/cmd_run.cxx new file mode 100644 index 000000000000..af55940f2679 --- /dev/null +++ b/autodoc/source/exes/adc_uni/cmd_run.cxx @@ -0,0 +1,492 @@ +/************************************************************************* + * + * $RCSfile: cmd_run.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "cmd_run.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/x.hxx> +#include <ary/ary.hxx> +#include <ary/ary.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary_i/ce2.hxx> +#include <ary_i/uidl/cenamesp.hxx> +#include <ary_i/uidl/gate.hxx> +#include <autodoc/displaying.hxx> +#include <autodoc/dsp_html_std.hxx> +#include <autodoc/filecoli.hxx> +#include <autodoc/parsing.hxx> +#include <autodoc/prs_code.hxx> +#include <autodoc/prs_docu.hxx> +#include <display/uidldisp.hxx> +#include <parser/unoidl.hxx> +#include "adc_cl.hxx" +#include "adc_cmds.hxx" + + +ary::uidl::Gate * G_pGate = 0; + +ary::uidl::Gate & +GetAryGate() +{ + csv_assert(G_pGate != 0); + return *G_pGate; +} + + +namespace +{ + +void Recursive_PutOutNamespace( + csi::uidl::Display & o_rDisplay, + const ary::uidl::CeNamespace & + i_rNamespace, + const ary::uidl::Gate & i_rGate ); + +} // anonymous namespace + + +namespace autodoc +{ + + +inline const ParseToolsFactory_Ifc & +CommandRunner::ParseToolsFactory() + { return ParseToolsFactory_Ifc::GetIt_(); } + + +inline const command::S_LanguageInfo & +CommandRunner::Get_ProjectLanguage( const command::Parse & i_rCommand, + const command::S_ProjectData & i_rProject ) +{ + if ( i_rProject.pLanguage ) + return *i_rProject.pLanguage; + return *i_rCommand.GlobalLanguageInfo(); +} + +inline bool +CommandRunner::HasParsedCpp() const + { return pCppParser; } +inline bool +CommandRunner::HasParsedIdl() const + { return pIdlParser; } + + + + + +CommandRunner::CommandRunner() + : pCommandLine(0), + pReposy(0), + nResultCode(0) +{ +} + +CommandRunner::~CommandRunner() +{ + ary::Repository::Destroy_(); +} + +int +CommandRunner::Run( const CommandLine & i_rCL ) +{ + ary::Repository::Destroy_(); + pReposy = 0; + nResultCode = 0; + pCommandLine = &i_rCL; + + if ( nResultCode == 0 AND pCommandLine->Cmd_Load() ) + Load(); + + if ( nResultCode == 0 AND pCommandLine->Cmd_Parse() ) + Parse(); + + if ( nResultCode == 0 AND pCommandLine->Cmd_Save() ) + Save(); + + if ( nResultCode == 0 AND pCommandLine->Cmd_CreateHtml() ) + CreateHtml(); + + if ( nResultCode == 0 AND pCommandLine->Cmd_CreateXml() ) + CreateXml(); + + return nResultCode; +} + +void +CommandRunner::Parse() +{ + try + { + + csv_assert( pCommandLine->Cmd_Parse() != 0 ); + const command::Parse & + rCmd = *pCommandLine->Cmd_Parse(); + + Cout() << "Parsing the repository " + << rCmd.ReposyName() + << " ..." + << Endl(); + + if ( pReposy == 0 ) + pReposy = & ary::Repository::Create_( rCmd.ReposyName(), 0 ); + + Dyn< FileCollector_Ifc > pFiles; + pFiles = ParseToolsFactory().Create_FileCollector(6000); + + command::Parse::ProjectIterator itEnd = rCmd.ProjectsEnd(); + for ( command::Parse::ProjectIterator it = rCmd.ProjectsBegin(); + it != itEnd; + ++it ) + { + + uintt nCount = GatherFiles( *pFiles, rCmd, *(*it) ); + Cout() << nCount + << " files found to parse in project " + << (*it)->sName + << "." + << Endl(); + + + switch ( Get_ProjectLanguage(rCmd, *(*it)).eLanguage ) + { + case command::S_LanguageInfo::cpp: + { + Get_CppParser().Run( (*it)->sName, + (*it)->aRootDirectory, + *pFiles ); +// pReposy->RwGate_Cpp().Connect_AllTypes_2_TheirRelated_CodeEntites(); + } break; + case command::S_LanguageInfo::idl: + { + Get_IdlParser().Run(*pFiles); + } break; + default: + Cerr() << "Project in yet unimplemented language skipped." + << Endl(); + } + } + + pReposy->RwGate_Cpp().Connect_AllTypes_2_TheirRelated_CodeEntites(); + + } // end try + catch (csv::Exception & xx) + { + xx.GetInfo(Cerr()); + Cerr() << " program will exit." << Endl(); + nResultCode = 1; + } + catch (...) + { + Cerr() << "Unknown exception - program will exit." << Endl(); + nResultCode = 1; + } +} + +void +CommandRunner::Load() +{ + Cout() << "This would load the repository from the directory " + << pCommandLine->Cmd_Load()->ReposyDir() + << "." + << Endl(); +} + + +void +CommandRunner::Save() +{ + Cout() << "This would save the repository into the directory " + << pCommandLine->Cmd_Save()->ReposyDir() + << "." + << Endl(); +} + + +void +CommandRunner::CreateHtml() +{ + Cout() << "Creating HTML-output into the directory " + << pCommandLine->Cmd_CreateHtml()->OutputDir() + << "." + << Endl(); + + if ( HasParsedCpp() ) + CreateHtml_NewStyle(); + if ( HasParsedIdl() ) + CreateHtml_OldIdlStyle(); +} + + + +void +CommandRunner::CreateXml() +{ + Cout() << "This would create the XML-output into the directory " + << pCommandLine->Cmd_CreateXml()->OutputDir() + << "." + << Endl(); +} + +CodeParser_Ifc & +CommandRunner::Get_CppParser() +{ + if ( NOT pCppParser ) + Create_CppParser(); + return *pCppParser; +} + +IdlParser & +CommandRunner::Get_IdlParser() +{ + if ( NOT pIdlParser ) + Create_IdlParser(); + return *pIdlParser; +} + +void +CommandRunner::Create_CppParser() +{ + pCppParser = ParseToolsFactory().Create_Parser_Cplusplus(); + pCppDocuInterpreter = ParseToolsFactory().Create_DocuParser_AutodocStyle(); + + pCppParser->Setup( *pReposy, + *pCppDocuInterpreter ); +} + +void +CommandRunner::Create_IdlParser() +{ + pIdlParser = new IdlParser(*pReposy); +} + +uintt +CommandRunner::GatherFiles( FileCollector_Ifc & o_rFiles, + const command::Parse & i_rCommand, + const command::S_ProjectData & i_rProject ) +{ + uintt ret = 0; + o_rFiles.EraseAll(); + + typedef StringVector StrVector; + typedef StrVector::const_iterator StrIterator; + const command::S_Sources & + rSources = i_rProject.aFiles; + const StrVector & + rExtensions = Get_ProjectLanguage(i_rCommand,i_rProject).aExtensions; + + StrIterator it; + StrIterator itDirsEnd = rSources.aDirectories.end(); + StrIterator itTreesEnd = i_rProject.aFiles.aTrees.end(); + StrIterator itFilesEnd = i_rProject.aFiles.aFiles.end(); + StrIterator itExt; + StrIterator itExtEnd = rExtensions.end(); + + csv::StreamStr aDir(500); + i_rProject.aRootDirectory.Get( aDir ); + + uintt nProjectDir_AddPosition = + (strcmp(aDir.c_str(),".\\") == 0) + ? 0 + : uintt( aDir.tellp() ); + + for ( it = rSources.aDirectories.begin(); + it != itDirsEnd; + ++it ) + { + aDir.seekp( nProjectDir_AddPosition ); + aDir << *it; + + for ( itExt = rExtensions.begin(); + itExt != itExtEnd; + ++itExt ) + { + ret += o_rFiles.AddFilesFrom( aDir.c_str(), + *itExt, + FileCollector_Ifc::flat ); + } // end for itExt + } // end for it + for ( it = rSources.aTrees.begin(); + it != itTreesEnd; + ++it ) + { + aDir.seekp( nProjectDir_AddPosition ); + aDir << *it; + + for ( itExt = rExtensions.begin(); + itExt != itExtEnd; + ++itExt ) + { + ret += o_rFiles.AddFilesFrom( aDir.c_str(), + *itExt, + FileCollector_Ifc::recursive ); + } // end for itExt + } // end for it + for ( it = rSources.aFiles.begin(); + it != itFilesEnd; + ++it ) + { + aDir.seekp( nProjectDir_AddPosition ); + aDir << *it; + + o_rFiles.AddFile( aDir.c_str() ); + } // end for it + ret += rSources.aFiles.size(); + + return ret; +} + +void +CommandRunner::CreateHtml_NewStyle() +{ + const ary::cpp::DisplayGate & + rGate = pReposy->DisplayGate_Cpp(); + + Dyn< autodoc::HtmlDisplay_UdkStd > pHtmlDisplay; + pHtmlDisplay = DisplayToolsFactory_Ifc::GetIt_(). + Create_HtmlDisplay_UdkStd(); + + pHtmlDisplay->Run( pCommandLine->Cmd_CreateHtml()->OutputDir(), + rGate, + DisplayToolsFactory_Ifc::GetIt_().Create_StdFrame() ); +} + +void +CommandRunner::CreateHtml_OldIdlStyle() +{ + ary::uidl::Gate & + rAryGate = pReposy->RwGate_Idl(); + G_pGate = &rAryGate; + ary::uidl::CeNamespace & + rGlobalNamespace = rAryGate.GlobalNamespace(); + + Dyn<csi::uidl::Display> pDisplay; + pDisplay = csi::uidl::Create_HtmlDisplay_( + pCommandLine->Cmd_CreateHtml()->OutputDir(), + DisplayToolsFactory_Ifc::GetIt_() + .Create_StdFrame() ); + + Recursive_PutOutNamespace( *pDisplay, + rGlobalNamespace, + rAryGate ); + pDisplay->WriteGlobalIndices(); +} + + +} // namespace autodoc + +namespace +{ + +typedef std::vector< ary::uidl::CeNamespace * > LocalSNList; + +inline void +DisplayCe( csi::uidl::Display & o_rDisplay, + ary::Cei i_nID, + const ary::uidl::Gate & i_rGate ) +{ + ary::CodeEntity2 * pEntity = i_rGate.FindCe(i_nID); + if (pEntity != 0) + pEntity->DisplayAt(o_rDisplay); +} + +void +Recursive_PutOutNamespace( csi::uidl::Display & o_rDisplay, + const ary::uidl::CeNamespace & i_rNamespace, + const ary::uidl::Gate & i_rGate ) +{ + static StreamStr sPath(512); + sPath.seekp(0); + i_rNamespace.GetFullName( sPath, "\\"); + o_rDisplay.InitModule( i_rNamespace.Name(), + sPath.c_str(), + i_rNamespace.Depth() ); + + DisplayCe(o_rDisplay, i_rNamespace.Id(), i_rGate); + + const ary::uidl::CeNamespace::NameMap & rMap = i_rNamespace.LocalNames(); + + for ( ary::uidl::CeNamespace::NameMap::const_iterator iter = rMap.begin(); + iter != rMap.end(); + ++iter ) + { + if ( uintt((*iter).second.second) > uintt(ary::uidl::CeNamespace::nok_predeclaration) ) + DisplayCe(o_rDisplay, (*iter).second.first, i_rGate); + } // for + + LocalSNList aSubNamespaces; + i_rNamespace.GetSubNamespaces(aSubNamespaces); + + for ( LocalSNList::iterator iter2 = aSubNamespaces.begin(); + iter2 != aSubNamespaces.end(); + ++iter2 ) + { + csv_assert(*iter2 != 0); + Recursive_PutOutNamespace(o_rDisplay, *(*iter2), i_rGate); + } // for +} + +} // anonymous namespace + + + diff --git a/autodoc/source/exes/adc_uni/cmd_run.hxx b/autodoc/source/exes/adc_uni/cmd_run.hxx new file mode 100644 index 000000000000..2f1655b6f58b --- /dev/null +++ b/autodoc/source/exes/adc_uni/cmd_run.hxx @@ -0,0 +1,164 @@ +/************************************************************************* + * + * $RCSfile: cmd_run.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CMD_RUN_HXX +#define ADC_CMD_RUN_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <cosv/comdline.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ + class Repository; +} + +namespace csi +{ + namespace uidl + { + class Uidl_Parser; + } +} + +namespace autodoc +{ + namespace command + { + class Parse; + struct S_ProjectData; + struct S_LanguageInfo; + } + + class CommandLine; + class FileCollector_Ifc; + class ParseToolsFactory_Ifc; + class CodeParser_Ifc; + class DocumentationParser_Ifc; + typedef csi::uidl::Uidl_Parser IdlParser; + + +class CommandRunner +{ + public: + CommandRunner(); + ~CommandRunner(); + + + int Run( + const CommandLine & i_rCL ); + private: + // Locals + void Parse(); + void Load(); + void Save(); + void CreateHtml(); + void CreateXml(); + + CodeParser_Ifc & Get_CppParser(); + IdlParser & Get_IdlParser(); + void Create_CppParser(); + void Create_IdlParser(); + + inline const ParseToolsFactory_Ifc & + ParseToolsFactory(); + inline const command::S_LanguageInfo & + Get_ProjectLanguage( + const command::Parse & + i_rCommand, + const command::S_ProjectData & + i_rProject ); + uintt GatherFiles( + FileCollector_Ifc & o_rFiles, + const command::Parse & + i_rCommand, + const command::S_ProjectData & + i_rProject ); + void CreateHtml_NewStyle(); + void CreateHtml_OldIdlStyle(); + + bool HasParsedCpp() const; + bool HasParsedIdl() const; + + // DATA + const CommandLine * pCommandLine; + ary::Repository * pReposy; + int nResultCode; + + Dyn<CodeParser_Ifc> pCppParser; + Dyn<DocumentationParser_Ifc> + pCppDocuInterpreter; + Dyn<IdlParser> pIdlParser; +}; + + + +// IMPLEMENTATION + + +} // namespace autodoc + +#endif + diff --git a/autodoc/source/exes/adc_uni/main.cxx b/autodoc/source/exes/adc_uni/main.cxx new file mode 100644 index 000000000000..f9480ebea688 --- /dev/null +++ b/autodoc/source/exes/adc_uni/main.cxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: main.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> + + +// NOT FULLY DECLARED SERVICES + +#include <adc_cl.hxx> +#include "cmd_run.hxx" + + + + +int +#ifdef WNT + _cdecl +#endif +main( int argc, + char * argv[] ) +{ + autodoc::CommandLine aCL; + autodoc::CommandRunner aRunner; + + aCL.Init(argc, argv); + if (NOT aCL.CheckParameters() ) + return 1; + + int ret = aRunner.Run(aCL); + + return ret; +} + + + diff --git a/autodoc/source/exes/adc_uni/makefile.mk b/autodoc/source/exes/adc_uni/makefile.mk new file mode 100644 index 000000000000..e3c314071b6a --- /dev/null +++ b/autodoc/source/exes/adc_uni/makefile.mk @@ -0,0 +1,146 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=autodoc +TARGETTYPE=CUI + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + +.INCLUDE : static.mk + + + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/adc_cl.obj \ + $(OBJ)$/adc_cmds.obj \ + $(OBJ)$/cmd_run.obj + + +# --- Targets ------------------------------------------------------ + +LIB1TARGET=$(LB)$/atdoc.lib +LIB1FILES= \ + $(LB)$/$(TARGET).lib $(LB)$/autodoc_tools.lib \ + $(LB)$/ary_kernel.lib $(LB)$/ary_cpp.lib $(LB)$/ary_info.lib \ + $(LB)$/ary_loc.lib $(LB)$/ary_store.lib \ + $(LB)$/parser_kernel.lib $(LB)$/parser_tokens.lib $(LB)$/parser_semantic.lib \ + $(LB)$/parser_cpp.lib $(LB)$/parser_adoc.lib \ + $(LB)$/csi_html.lib \ + $(LB)$/display_kernel.lib $(LB)$/display_html.lib \ + $(LB)$/ary2_kernel.lib $(LB)$/ary2_uidl.lib \ + $(LB)$/csi2_uidl.lib $(LB)$/csi2_dsapi.lib $(LB)$/csi2_html.lib \ + $(LB)$/parser2_tokens.lib \ + $(LB)$/parser2_s2_luidl.lib $(LB)$/parser2_s2_dsapi.lib \ + $(LB)$/display2_dsapi.lib \ + $(LB)$/comphelp.lib + +# $(LB)$/display_funclist.lib + + + +APP1TARGET= $(TARGET) +APP1STACK= 1000000 +APP1OBJS= $(OBJ)$/main.obj + +.IF "$(GUI)"=="WNT" +APP1STDLIBS= $(LIBSTLPORT) msvcirt.lib cosv.lib udm.lib +.ELSE +APP1STDLIBS= $(L)$/acosv.a $(L)$/audm.a +.ENDIF + +APP1LIBS=$(LB)$/atdoc.lib + +DEPOBJFILES += $(APP1OBJS) + +APP1DEPN= $(L)$/cosv.lib \ + $(LB)$/$(TARGET).lib $(LB)$/autodoc_tools.lib \ + $(LB)$/ary_kernel.lib $(LB)$/ary_cpp.lib $(LB)$/ary_info.lib \ + $(LB)$/ary_loc.lib $(LB)$/ary_store.lib \ + $(LB)$/parser_kernel.lib $(LB)$/parser_tokens.lib $(LB)$/parser_semantic.lib \ + $(LB)$/parser_cpp.lib $(LB)$/parser_adoc.lib \ + $(LB)$/csi_html.lib \ + $(LB)$/display_kernel.lib $(LB)$/display_html.lib \ + $(LB)$/ary2_kernel.lib $(LB)$/ary2_uidl.lib \ + $(LB)$/csi2_uidl.lib $(LB)$/csi2_dsapi.lib $(LB)$/csi2_html.lib \ + $(LB)$/parser2_tokens.lib \ + $(LB)$/parser2_s2_luidl.lib $(LB)$/parser2_s2_dsapi.lib \ + $(LB)$/display2_dsapi.lib \ + $(LB)$/comphelp.lib + +# $(LB)$/display_funclist.lib + + +.INCLUDE : target.mk + + diff --git a/autodoc/source/inc/adc_cl.hxx b/autodoc/source/inc/adc_cl.hxx new file mode 100644 index 000000000000..bf187acf3842 --- /dev/null +++ b/autodoc/source/inc/adc_cl.hxx @@ -0,0 +1,192 @@ +/************************************************************************* + * + * $RCSfile: adc_cl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_ADC_CL_HXX +#define ADC_ADC_CL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <cosv/comdline.hxx> + // COMPONENTS + // PARAMETERS + +namespace autodoc +{ + namespace command + { + class Parse; + class Load; + class CreateHtml; + class CreateXml; + class Save; + + struct S_ProjectData; + } + + +class CommandLine : public csv::CommandLine_Ifc +{ + public: + CommandLine(); + ~CommandLine(); + + bool DebugStyle_ShowText() const; + bool DebugStyle_ShowStoredObjects() const; + bool DebugStyle_ShowTokens() const; + + // ACCESS + void SetUpdate( + const char * i_sRepositoryDir ); + void SetCurProject( + command::S_ProjectData & + io_rProject ); + command::S_ProjectData & + CurProject(); + + static const CommandLine & + Get_(); + + const Dyn<command::Parse> & + Cmd_Parse() const; + const Dyn<command::Load> & + Cmd_Load() const; + const Dyn<command::CreateHtml> & + Cmd_CreateHtml() const; + const Dyn<command::CreateXml> & + Cmd_CreateXml() const; + const Dyn<command::Save> & + Cmd_Save() const; + + private: + // Interface cosv::CommandLine_Ifc: + virtual void do_Init( + int argc, + char * argv[] ); + virtual void do_PrintUse() const; + virtual bool inq_CheckParameters() const; + + // Locals + + // DATA + uintt nDebugStyle; + Dyn<command::Parse> pCmd_Parse; + Dyn<command::Load> pCmd_Load; + Dyn<command::CreateHtml> + pCmd_CreateHtml; + Dyn<command::CreateXml> + pCmd_CreateXml; + Dyn<command::Save> pCmd_Save; + + command::S_ProjectData * + pCurProject; + bool bInitOk; + static CommandLine * + pTheInstance_; +}; + + + +// IMPLEMENTATION +inline bool +CommandLine::DebugStyle_ShowText() const + { return (nDebugStyle & 2) != 0; } +inline bool +CommandLine::DebugStyle_ShowStoredObjects() const + { return (nDebugStyle & 4) != 0; } +inline bool +CommandLine::DebugStyle_ShowTokens() const + { return (nDebugStyle & 1) != 0; } + +inline const Dyn<command::Parse> & +CommandLine::Cmd_Parse() const + { return pCmd_Parse; } +inline const Dyn<command::Load> & +CommandLine::Cmd_Load() const + { return pCmd_Load; } +inline const Dyn<command::CreateHtml> & +CommandLine::Cmd_CreateHtml() const + { return pCmd_CreateHtml; } +inline const Dyn<command::CreateXml> & +CommandLine::Cmd_CreateXml() const + { return pCmd_CreateXml; } +inline const Dyn<command::Save> & +CommandLine::Cmd_Save() const + { return pCmd_Save; } + + + + +} // namespace autodoc + +inline bool +DEBUG_ShowText() + { return autodoc::CommandLine::Get_().DebugStyle_ShowText(); } +inline bool +DEBUG_ShowStoring() + { return autodoc::CommandLine::Get_().DebugStyle_ShowStoredObjects(); } +inline bool +DEBUG_ShowTokens() + { return autodoc::CommandLine::Get_().DebugStyle_ShowTokens(); } + +#endif + diff --git a/autodoc/source/inc/estack.hxx b/autodoc/source/inc/estack.hxx new file mode 100644 index 000000000000..446d0353d091 --- /dev/null +++ b/autodoc/source/inc/estack.hxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * $RCSfile: estack.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_ESTACK_HXX +#define ARY_ESTACK_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <slist> + // COMPONENTS + // PARAMETERS + + + +template <class ELEM> +class EStack : private std::slist<ELEM> +{ + private: + typedef std::slist<ELEM> base; + const base & Base() const { return *this; } + base & Base() { return *this; } + + public: + typedef ELEM value_type; + typedef std::slist<ELEM>::size_type size_type; + + // LIFECYCLE + EStack() {} + EStack( + const EStack & i_rStack ) + : base( (const base &)(i_rStack) ) {} + ~EStack() {} + // OPERATORS + EStack & operator=( + const EStack & i_rStack ) + { base::operator=( i_rStack.Base() ); + return *this; } + bool operator==( + const EStack<ELEM> & + i_r2 ) const + { return std::operator==( Base(), i_rStack.Base() ); } + bool operator<( + const EStack<ELEM> & + i_r2 ) const + { return std::operator<( Base(), i_rStack.Base() ); } + // OPERATIONS + void push( + const value_type & i_rElem ) + { base::push_front(i_rElem); } + void pop() { base::pop_front(); } + void erase_all() { while (NOT empty()) pop(); } + + // INQUIRY + const value_type & top() const { return base::front(); } + size_type size() const { return base::size(); } + bool empty() const { return base::empty(); } + + // ACCESS + value_type & top() { return base::front(); } +}; + + + +// IMPLEMENTATION + + +#endif + diff --git a/autodoc/source/inc/luxenum.hxx b/autodoc/source/inc/luxenum.hxx new file mode 100644 index 000000000000..657d0e8dd43f --- /dev/null +++ b/autodoc/source/inc/luxenum.hxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * $RCSfile: luxenum.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef UDM_LUXENUM_HXX +#define UDM_LUXENUM_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <map> +#include <algorithm> + + +namespace udm +{ + +typedef std::map< intt, udmstri > EnumValueMap; + + +template <class DIFF> +class Enum // : public Template_Base +{ + public: + // TYPES + typedef Enum< DIFF > self; + + // LIFECYCLE + Enum( + DIFF i_nValue, + const char * i_sText ) + : nValue(i_nValue) { Values_()[nValue] = i_sText; + // Sequence_().insert( + // std::lower_bound( Sequence_().begin(), Sequence_().end(), i_nValue ), + // i_nValue ); + } + Enum( + DIFF i_nValue ) + : nValue(i_nValue) { ; } + Enum( + intt i_nValue = 0 ) + : nValue(i_nValue) { if ( NOT CheckIntt(i_nValue) ) { csv_assert(false); } } + Enum( + const self & i_rEnum ) + : nValue(i_rEnum.nValue) {;} + + self & operator=( + DIFF i_nValue ) + { nValue = i_nValue; return *this; } + self & operator=( + intt i_nValue ) + { if ( CheckIntt(i_nValue) ) nValue = DIFF(i_nValue); + else csv_assert(false); return *this; } + self & operator=( + const self & i_rEnum ) + { nValue = i_rEnum.nValue; return *this; } + operator DIFF() const { return DIFF(nValue); } + +// self & operator++() { if ( uintt(nValue) < Sequence_().size() - 1) nValue = Sequence_()[nValue+1]; return *this; } +// self & operator--() { if ( uintt(nValue) > 0) nValue = Sequence_()[nValue-1]; } + + + DIFF operator()() const { return nValue; } + const udmstri & Text() const { return Values_()[nValue]; } +// virtual const Agent & +// GetSpecialAgent() const; + + private: + static EnumValueMap & + Values_(); +// static std::vector< DIFF > & +// Sequence_(); + bool CheckIntt( + intt i_nNumber ) + { return Values_().find(nValue) != Values_().end(); } + + // DATA + intt nValue; +}; + + +// IMPLEMENTATION + +/* +// Dummy - has t be overwritten by specialisation, if used: +template <class DIFF> +const Agent & +Enum<DIFF>::GetSpecialAgent() const +{ + csv_assert(false); + return *(const udm::Agent*)0; +} +*/ + +} // namespace udm + + +#endif + diff --git a/autodoc/source/inc/manip.hxx b/autodoc/source/inc/manip.hxx new file mode 100644 index 000000000000..ef81dec4aa33 --- /dev/null +++ b/autodoc/source/inc/manip.hxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * $RCSfile: manip.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_MANIP_HXX +#define ARY_MANIP_HXX + +template <class XY > +class Manipulator +{ + public: + ~Manipulator() {} + + void operator()( + XY & io_r ) const + { op_fcall(io_r); } + private: + virtual void op_fcall( + XY & io_r ) const = 0; +}; + +template <class XY > +class Const_Manipulator +{ + public: + ~Const_Manipulator() {} + + void operator()( + const XY & io_r ) const + { op_fcall(io_r); } + private: + virtual void op_fcall( + const XY & io_r ) const = 0; +}; + + +#endif + diff --git a/autodoc/source/inc/precomp.h b/autodoc/source/inc/precomp.h new file mode 100644 index 000000000000..c299f68b8182 --- /dev/null +++ b/autodoc/source/inc/precomp.h @@ -0,0 +1,130 @@ +/************************************************************************* + * + * $RCSfile: precomp.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef __ADC_PRECOMP_H_06071998__ +#define __ADC_PRECOMP_H_06071998__ + + +// For en/disabling csv_assertions: +#ifndef DEBUG +#define CSV_NO_ASSERTIONS +#endif + +#ifdef NP_LOCALBUILD +#pragma warning( disable : 4786 ) +#endif + +#include <cosv/csv_precomp.h> + +#include <vector> +#include <map> +#include <set> + + + +// Shortcuts to access csv::-types: +using csv::String; +using csv::StringVector; +using csv::StreamStr; +using csv::ios; +using csv::ostream; +using csv::c_str; +typedef csv::StreamStrLock StreamLock; + + + +// As long, as appearances of udmstri are not changed yet: +typedef String udmstri; + + +/** @attention + Has to be changed to returning csv::Cout(),if + 1) iostreams are not used ( #ifdef CSV_NO_IOSTREAM ) + 2) used for an GUI-application. +*/ +inline ostream & +Cout() { return std::cout; } + +/** @attention + Has to be changed to returning csv::Cerr(),if + 1) iostreams are not used ( #ifdef CSV_NO_IOSTREAM ) + 2) used for an GUI-application. +*/ +inline ostream & +Cerr() { return std::cerr; } + + +inline csv::F_FLUSHING_FUNC +Endl() { return csv::Endl; } +inline csv::F_FLUSHING_FUNC +Flush() { return csv::Flush; } + + +// Backwardscompatibility: +template <class DELI> +inline void Delete_dyn( DELI * & pObj ) + { delete pObj; pObj = 0; } + + + + +#endif + + diff --git a/autodoc/source/inc/tools/filecoll.hxx b/autodoc/source/inc/tools/filecoll.hxx new file mode 100644 index 000000000000..a25a059252e0 --- /dev/null +++ b/autodoc/source/inc/tools/filecoll.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * $RCSfile: filecoll.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_FILECOLL_HXX +#define ADC_FILECOLL_HXX + +// USED SERVICES + // BASE CLASSES +#include <autodoc/filecoli.hxx> + // COMPONENTS + // PARAMETERS + + + +class FileCollector : public autodoc::FileCollector_Ifc +{ + public: + // LIFECYCLE + FileCollector( + uintt i_nRoughNrOfFiles = 0 ); + + // OPERATIONS + virtual uintt AddFilesFrom( + const char * i_sRootDir, + const char * i_sFilter, + E_SearchMode i_eSearchMode ); + virtual uintt AddFile( + const char * i_sFilePath ); + virtual void EraseAll(); + + // INQUIRY + virtual const_iterator + Begin() const; + virtual const_iterator + End() const; + virtual uintt Size() const; + + private: + typedef StringVector FilePathList; + typedef StringVector FileNameList; + typedef StringVector DirNameList; + + void GetSubDirectories( + DirNameList & o_rList, + const char * i_sParentDir ); + void GetFiles( + FileNameList & o_rList, + const char * i_sParentDir, + const char * i_sFilter ); + + FilePathList aFoundFiles; +}; + + +#endif + diff --git a/autodoc/source/inc/tools/tkpchars.hxx b/autodoc/source/inc/tools/tkpchars.hxx new file mode 100644 index 000000000000..29caa3135a08 --- /dev/null +++ b/autodoc/source/inc/tools/tkpchars.hxx @@ -0,0 +1,210 @@ +/************************************************************************* + * + * $RCSfile: tkpchars.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TKPCHARS_HXX +#define ADC_TKPCHARS_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETRS +#include <adc_cl.hxx> +#include <stack> + + + +/** @descr + + dpSource: + + 1||||||||||||||||||||||a||||||||||||b|||c||||||||||||||||||||... + + + 1 := first character of Sourcecode. + a := nLastTokenStart, there starts the last cut token. + b := nLastCut, there is a '\0'-char which marks the end of + the last cut token. The original character at b is stored + in cCharAtLastCut and will replace the '\0'-char, when the + next token is cut. + c := The current cursor position. + + + @needs cosv.lib + + @use This class can be used by any parser to get the chars of a + text one by one and separate them to tokens. +**/ + +class CharacterSource +{ + public: + // LIFECYCLE + CharacterSource(); + ~CharacterSource(); + + // OPERATIONS + /** Loads the complete contents of in_rSource into the classes private memory. + If in_rSource is a file, it has to be open of course. + After loading the text, the CurChar() is set on the begin of the text. + **/ + void LoadText( + csv::bstream & io_rSource); + /** Loads the complete contents of in_rSource into the classes private memory. + If in_rSource is a file, it has to be open of course. + After loading the text, the CurChar() is set on the begin of the text. + **/ + void LoadText( + const char * i_sSourceText ); + + void InsertTextAtCurPos( + const char * i_sText2Insert ); + + /// @return CurChar() after moving forward one char. + const char & MoveOn(); + /** @return + The token which starts at the char which was CurChar(), when + CutToken() was called the last time - or at the beginning of the text. + The token ends by the CurChar() being replaced by a '\0'. + + Value is valid until the next call of CutToken() or ~CharacterSource(). + **/ + const char * CutToken(); + + // INQUIRY + const char & CurChar() const; + /// @return The result of the last CutToken(). Or NULL, if there was none yet. + const char * CurToken() const; + + // INQUIRY + /// @return true, if + bool IsFinished() const; + + private: + struct S_SourceState + { + DYN char * dpSource; + intt nSourceSize; + + intt nCurPos; + intt nLastCut; + intt nLastTokenStart; + char cCharAtLastCut; + + S_SourceState( + DYN char * dpSource, + intt nSourceSize, + intt nCurPos, + intt nLastCut, + intt nLastTokenStart, + char cCharAtLastCut ); + }; + + void BeginSource(); + intt CurPos() const; + const char & MoveOn_OverStack(); + + // DATA + std::stack< S_SourceState > + aSourcesStack; + + DYN char * dpSource; + intt nSourceSize; + + intt nCurPos; + intt nLastCut; + intt nLastTokenStart; + char cCharAtLastCut; +}; + + +inline const char & +CharacterSource::MoveOn() + { +if (DEBUG_ShowText()) +{ + Cerr() << char(dpSource[nCurPos+1]) << Flush(); +} + if ( nCurPos < nSourceSize-1 ) + return dpSource[++nCurPos]; + else if ( aSourcesStack.size() > 0 ) + return MoveOn_OverStack(); + else + return dpSource[nCurPos = nSourceSize]; + } +inline const char & +CharacterSource::CurChar() const + { return nCurPos != nLastCut ? dpSource[nCurPos] : cCharAtLastCut; } +inline const char * +CharacterSource::CurToken() const + { return &dpSource[nLastTokenStart]; } +inline bool +CharacterSource::IsFinished() const + { return nCurPos >= nSourceSize; } +inline intt +CharacterSource::CurPos() const + { return nCurPos; } + + + + +#endif + + diff --git a/autodoc/source/mkinc/fullcpp.mk b/autodoc/source/mkinc/fullcpp.mk new file mode 100644 index 000000000000..0ea8822173a4 --- /dev/null +++ b/autodoc/source/mkinc/fullcpp.mk @@ -0,0 +1,88 @@ +#************************************************************************* +# +# $RCSfile: fullcpp.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + + + +# --- Settings ----------------------------------------------------- +# Has to be included AFTER settings.mk ! + + + +.IF "$(GUI)"=="WNT" + +# RTTI +CFLAGS+= /GR + +.IF "$(NP_LOCALBUILD)"!="" + +# Precompiled Headers +PCH_NAME= autodoc +.IF "$(DEBUG)"=="" +CFLAGS+= -YX"precomp.h" /Fp$(PRJ)$/$(INPATH)$/misc$/$(PCH_NAME).pch +.ELSE +CFLAGS+= -YX"precomp.h" /Fp$(PRJ)$/$(INPATH)$/misc$/$(PCH_NAME).pcd -DNP_LOCALBUILD +.ENDIF + +.ENDIF + +.ENDIF + diff --git a/autodoc/source/parser/adoc/a_rdocu.cxx b/autodoc/source/parser/adoc/a_rdocu.cxx new file mode 100644 index 000000000000..13965b1172fe --- /dev/null +++ b/autodoc/source/parser/adoc/a_rdocu.cxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: a_rdocu.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/a_rdocu.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <adoc/docu_pe.hxx> +#include <adoc/adoc_tok.hxx> +#include <ary/docu.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::Documentation * 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..cb27c7b3c2ab --- /dev/null +++ b/autodoc/source/parser/adoc/adoc_tok.cxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * $RCSfile: adoc_tok.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/adoc_tok.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <adoc/atokdeal.hxx> + + +namespace adoc { + +void +Token::DealOut( ::TokenDealer & o_rDealer ) +{ + dynamic_cast< adoc::TokenDealer& >(o_rDealer).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..c6fbf996ee0b --- /dev/null +++ b/autodoc/source/parser/adoc/cx_a_std.cxx @@ -0,0 +1,547 @@ +/************************************************************************* + * + * $RCSfile: cx_a_std.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#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 * text) { return new Tok_at_std(ary::info::atid_ATT); } +DYN TextToken * TCF_atstd_author(const char * text) { return new Tok_at_std(ary::info::atid_author); } +DYN TextToken * TCF_atstd_change(const char * text) { return new Tok_at_std(ary::info::atid_change); } +DYN TextToken * TCF_atstd_collab(const char * text) { return new Tok_at_std(ary::info::atid_collab); } +DYN TextToken * TCF_atstd_contact(const char * text) { return new Tok_at_std(ary::info::atid_contact); } +DYN TextToken * TCF_atstd_copyright(const char * text) { return new Tok_at_std(ary::info::atid_copyright); } +DYN TextToken * TCF_atstd_descr(const char * text) { return new Tok_at_std(ary::info::atid_descr); } +DYN TextToken * TCF_atstd_docdate(const char * text) { return new Tok_at_std(ary::info::atid_docdate); } +DYN TextToken * TCF_atstd_derive(const char * text) { return new Tok_at_std(ary::info::atid_derive); } +DYN TextToken * TCF_atstd_instance(const char * text) { return new Tok_at_std(ary::info::atid_instance); } +DYN TextToken * TCF_atstd_life(const char * text) { return new Tok_at_std(ary::info::atid_life); } +DYN TextToken * TCF_atstd_multi(const char * text) { return new Tok_at_std(ary::info::atid_multi); } +DYN TextToken * TCF_atstd_onerror(const char * text) { return new Tok_at_std(ary::info::atid_onerror); } +DYN TextToken * TCF_atstd_persist(const char * text) { return new Tok_at_std(ary::info::atid_persist); } +DYN TextToken * TCF_atstd_postcond(const char * text) { return new Tok_at_std(ary::info::atid_postcond); } +DYN TextToken * TCF_atstd_precond(const char * text) { return new Tok_at_std(ary::info::atid_precond); } +DYN TextToken * TCF_atstd_responsibility(const char * text) { return new Tok_at_std(ary::info::atid_resp); } +DYN TextToken * TCF_atstd_return(const char * text) { return new Tok_at_std(ary::info::atid_return); } +DYN TextToken * TCF_atstd_short(const char * text) { return new Tok_at_std(ary::info::atid_short); } +DYN TextToken * TCF_atstd_todo(const char * text) { return new Tok_at_std(ary::info::atid_todo); } +DYN TextToken * TCF_atstd_version(const char * text) { 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_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 * i_sMultiLineEndToken ) +{ + 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: + { + udmstri sChar( &io_rText.CurChar(), 1 ); + throw X_Parser(X_Parser::x_InvalidChar, sChar, udmstri::Null_(), 0); + } break; + 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: + { + udmstri sChar( &io_rText.CurChar(), 1 ); + throw X_Parser(X_Parser::x_InvalidChar, sChar, udmstri::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( "@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 = 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..7ae11ff4c179 --- /dev/null +++ b/autodoc/source/parser/adoc/cx_a_sub.cxx @@ -0,0 +1,354 @@ +/************************************************************************* + * + * $RCSfile: cx_a_sub.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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, "", udmstri::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; +} + + + +/* +bool +Cx_Base::PassNewToken() +{ + if (pNewToken) + { + rReceiver.Receive(*pNewToken.Release()); + return true; + } + return false; +} + +TkpContext & +Cx_Base::FollowUpContext() +{ + csv_assert(pFollowUpContext != 0); + return *pFollowUpContext; +} + + +void +Cx_EoHtml::ReadCharChain( CharacterSource & io_rText ) +{ + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + io_rText.MoveOn(); + SetToken(new Tok_HtmlTag(io_rText.CutToken(),bToken_IsStartOfParagraph)); +} + +void +Cx_EoXmlConst::ReadCharChain( CharacterSource & io_rText ) +{ + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlConst(eTokenId)); +} + +void +Cx_EoXmlLink_BeginTag::ReadCharChain( CharacterSource & io_rText ) +{ + udmstri sScope; + + switch ( jumpTo(io_rText,'"','>') ) + { + case '"': + io_rText.MoveOn(); + io_rText.CutToken(); + if ( NULCH == jumpTo(io_rText,'"') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + sScope = io_rText.CutToken(); + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + break; + case '>': + break; + default: + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + } + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlLink_BeginTag(eTokenId,sScope)); +} + +void +Cx_EoXmlLink_EndTag::ReadCharChain( CharacterSource & io_rText ) +{ + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlLink_EndTag(eTokenId)); +} + +void +Cx_EoXmlFormat_BeginTag::ReadCharChain( CharacterSource & io_rText ) +{ + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlFormat_BeginTag(eTokenId)); +} + +void +Cx_EoXmlFormat_EndTag::ReadCharChain( CharacterSource & io_rText ) +{ + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlFormat_EndTag(eTokenId)); +} + +void +Cx_CheckStar::ReadCharChain( CharacterSource & io_rText ) +{ + bEndTokenFound = false; + if (bIsEnd) + { + char cNext = jumpOver(io_rText,'*'); + if ( NULCH == cNext ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + if (cNext == '/') + { + io_rText.MoveOn(); + SetToken(new Tok_DocuEnd); + bEndTokenFound = true; + } + else + { + SetToken( new Tok_Word(io_rText.CutToken()) ); + } + } + else + { + jumpToWhite(io_rText); + SetToken( new Tok_Word(io_rText.CutToken()) ); + } +} + +TkpContext & +Cx_CheckStar::FollowUpContext() +{ + if (bEndTokenFound) + return *pEnd_FollowUpContext; + else + return Cx_Base::FollowUpContext(); +} +*/ + +} // 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..67ca8448857d --- /dev/null +++ b/autodoc/source/parser/adoc/docu_pe.cxx @@ -0,0 +1,430 @@ +/************************************************************************* + * + * $RCSfile: docu_pe.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <adoc/docu_pe.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/info/codeinfo.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; + 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 & i_rTok ) +{ + InstallAtTag( + CurDocu().CheckIn_BaseTag() ); +} + +void +Adoc_PE::Hdl_at_exception( const Tok_at_exception & i_rTok ) +{ + InstallAtTag( + CurDocu().CheckIn_ExceptionTag() ); +} + +void +Adoc_PE::Hdl_at_impl( const Tok_at_impl & i_rTok ) +{ + InstallAtTag( + CurDocu().Create_ImplementsTag() ); +} + +void +Adoc_PE::Hdl_at_key( const Tok_at_key & i_rTok ) +{ + InstallAtTag( + CurDocu().Create_KeywordTag() ); +} + +void +Adoc_PE::Hdl_at_param( const Tok_at_param & i_rTok ) +{ + InstallAtTag( + CurDocu().CheckIn_ParameterTag() ); +} + +void +Adoc_PE::Hdl_at_see( const Tok_at_see & i_rTok ) +{ + InstallAtTag( + CurDocu().CheckIn_SeeTag() ); +} + +void +Adoc_PE::Hdl_at_template( const Tok_at_template & i_rTok ) +{ + InstallAtTag( + CurDocu().CheckIn_TemplateTag() ); +} + +void +Adoc_PE::Hdl_at_interface( const Tok_at_interface & i_rTok ) +{ + CurDocu().Set_Interface(); +} + +void +Adoc_PE::Hdl_at_internal( const Tok_at_internal & i_rTok ) +{ + CurDocu().Set_Internal(); +} + +void +Adoc_PE::Hdl_at_obsolete( const Tok_at_obsolete & i_rTok ) +{ + CurDocu().Set_Obsolete(); +} + +void +Adoc_PE::Hdl_at_module( const Tok_at_module & i_rTok ) +{ + // KORR + +// pCurAtTag = CurDocu().Assign2_ModuleTag(); +// nCurSpecialMeaningTokens = pCurAtTag->NrOfSpecialMeaningTokens(); +} + +void +Adoc_PE::Hdl_at_file( const Tok_at_file & i_rTok ) +{ + // KORR + +// pCurAtTag = CurDocu().Assign2_FileTag(); +// nCurSpecialMeaningTokens = pCurAtTag->NrOfSpecialMeaningTokens(); +} + +void +Adoc_PE::Hdl_at_gloss( const Tok_at_gloss & i_rTok ) +{ + // KORR + +// Create_GlossaryEntry(); +} + +void +Adoc_PE::Hdl_at_global( const Tok_at_global & i_rTok ) +{ + // KORR +// Create_GlobalTextComponent(); +} + +void +Adoc_PE::Hdl_at_include( const Tok_at_include & i_rTok ) +{ + // KORR +} + +void +Adoc_PE::Hdl_at_label( const Tok_at_label & i_rTok ) +{ + InstallAtTag( + CurDocu().Create_LabelTag() ); +} + +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 & i_rTok ) +{ + bIsComplete = true; +} + +DYN ary::Documentation * +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::info::CodeInfo & +Adoc_PE::CurDocu() +{ + if (NOT pCurDocu) + pCurDocu = new ary::info::CodeInfo; + 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..63c659db5b63 --- /dev/null +++ b/autodoc/source/parser/adoc/makefile.mk @@ -0,0 +1,97 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +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..d419c6a91f8d --- /dev/null +++ b/autodoc/source/parser/adoc/prs_adoc.cxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: prs_adoc.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..c3f25e3c246c --- /dev/null +++ b/autodoc/source/parser/adoc/tk_attag.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: tk_attag.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <adoc/tk_attag.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <adoc/tokintpr.hxx> + +INSTANCIATE_ENUM(adoc::E_AtTagId); + + +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 + return "Ein 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, "") + +} // 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..c81d9e18cd8d --- /dev/null +++ b/autodoc/source/parser/adoc/tk_docw.cxx @@ -0,0 +1,162 @@ +/************************************************************************* + * + * $RCSfile: tk_docw.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..5a4b5490b48c --- /dev/null +++ b/autodoc/source/parser/cpp/all_toks.cxx @@ -0,0 +1,187 @@ +/************************************************************************* + * + * $RCSfile: all_toks.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <all_toks.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <cpp/ctokdeal.hxx> +#include "tokintpr.hxx" + + + +namespace cpp { + + +void +Token::DealOut( ::TokenDealer & o_rDealer ) +{ + dynamic_cast< cpp::TokenDealer& >(o_rDealer).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_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 ) +{ + dynamic_cast< cpp::TokenDealer& >(o_rDealer).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..75454a37dd07 --- /dev/null +++ b/autodoc/source/parser/cpp/all_toks.hxx @@ -0,0 +1,344 @@ +/************************************************************************* + * + * $RCSfile: all_toks.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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: + udmstri 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: + udmstri 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); + +#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: \ + udmstri sText; \ +}; \ +const INT16 Tid_##name = tid + +DECL_TOKEN_CLASS_WITHTEXT(DefineName,43); +DECL_TOKEN_CLASS_WITHTEXT(MacroName,44); +DECL_TOKEN_CLASS_WITHTEXT(MacroParameter,45); +DECL_TOKEN_CLASS_WITHTEXT(PreProDefinition,46); + + + +/** char short int long float double wchar_t size_t +*/ +DECL_TOKEN_CLASS_WITHTEXT(BuiltInType, 47); +/** signed unsigned +*/ +DECL_TOKEN_CLASS_WITHTEXT(TypeSpecializer, 48); +DECL_TOKEN_CLASS_WITHTEXT(Constant, 49); + + + +#if 0 +/** char short int long float double wchar_t size_t +*/ +class Tok_BuiltInType : public cpp::Token +{ + public: + Tok_BuiltInType( + const char * i_sText ) : sText(i_sText) {} + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual INT16 TypeId() const; + virtual const char * + Text() const; + private: + udmstri sText; +}; +const INT16 Tid_BuiltInType = 47; + +/** signed unsigned +*/ +class Tok_TypeSpecializer : public cpp::Token +{ + public: + Tok_TypeSpecializer( + const char * i_sText ) : sText(i_sText) {} + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual INT16 TypeId() const; + virtual const char * + Text() const; + private: + udmstri sText; +}; +const INT16 Tid_TypeSpecializer = 48; + + +class Tok_Constant : public cpp::Token +{ + public: + Tok_Constant( + const char * i_sText ) : sText(i_sText) {} + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual INT16 TypeId() const; + virtual const char * + Text() const; + private: + udmstri sText; +}; +const INT16 Tid_Constant = 49; + +#endif // 0 + + +/** 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: + udmstri sMacroName; +}; + + + + +#if 0 // These tokens will not be created, but just ignored. +/// auto typename __cdecl __stdcall __fastcall +class Tok_Ignore : public cpp::Token +{ + public: + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; +}; +#endif // 0 + + + + + + +#if 0 // These tokens will not be created, but just ignored. +/// /* // /** /// # +class Tok_ContextChanger : public cpp::Token +{ + public: + enum E_Id { id_ml_comment, id_sl_comment, id_ml_docu, id_sl_docu, id_preprocessor }; + typedef udm::Enum<E_Id> Ec_Id; + + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; + Ec_Id Id() const { return eId; } + + private: + Ec_Id eId; +}; +#endif // 0 + + +#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..92acaaa78a90 --- /dev/null +++ b/autodoc/source/parser/cpp/c_dealer.cxx @@ -0,0 +1,196 @@ +/************************************************************************* + * + * $RCSfile: c_dealer.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "c_dealer.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/crwg_grp.hxx> +#include <ary/cpp/cg_proj.hxx> +#include <ary/loc/l_rwgate.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 cpp + { + class ProjectGroup; + } + + namespace loc + { + class LocationRoot; + } + + class Documentation; +} + + + + +namespace cpp +{ + +Distributor::Distributor( ary::cpp::RwGate & 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::StartNewProject( const udmstri & i_sProjectName, + const csv::ploc::Path & i_rProjectRootDirectory ) +{ + ary::loc::LocationRoot & rRoot + = pGate->Locations().CheckIn_Root( i_rProjectRootDirectory ); + ary::cpp::ProjectGroup & rProject + = pGate->Groups().CheckIn_ProjectGroup( i_sProjectName, rRoot.Id() ); + pFileEventHandler->SetCurProject(rProject); +} + +void +Distributor::StartNewFile( const udmstri & i_sFileName, + const csv::ploc::DirectoryChain & i_rFileSubPath ) +{ + ary::loc::SourceCodeFile & rFile + = pGate->Locations().CheckIn_File( + i_sFileName, + i_rFileSubPath, + pFileEventHandler->CurProject().RootDir() ); + ary::cpp::FileGroup & rCurFile + = pGate->Groups().CheckIn_FileGroup( + rFile.Id(), + pFileEventHandler->CurProject().Id_Group(), + i_sFileName ); + pFileEventHandler->SetCurFile(rCurFile, i_sFileName); + + 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); +} + + + + + + +} // 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..58a7262450c7 --- /dev/null +++ b/autodoc/source/parser/cpp/c_dealer.hxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: c_dealer.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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< udmstri, DefineDescription* > MacroMap; + + // LIFECYCLE + Distributor( + ary::cpp::RwGate & io_rGate ); + ~Distributor(); + // OPERATIONS + void AssignPartners( + CharacterSource & io_rSourceText, + const MacroMap & i_rValidMacros ); + void StartNewProject( + const udmstri & i_sProjectName, + const csv::ploc::Path & + i_rProjectRootDirectory ); + void StartNewFile( + const udmstri & i_sFileName, + const csv::ploc::DirectoryChain & + i_rFileSubPath ); + 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 ); + private: + // DATA + PreProcessor aCppPreProcessor; + CodeExplorer aCodeExplorer; + adoc::DocuExplorer aDocuExplorer; + ary::cpp::RwGate * pGate; + FileScope_EventHandler * + pFileEventHandler; + DocuDealer * pDocuDistributor; +}; + + + +// IMPLEMENTATION + + + +} // 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..79af6eddb6fc --- /dev/null +++ b/autodoc/source/parser/cpp/c_rcode.cxx @@ -0,0 +1,204 @@ +/************************************************************************* + * + * $RCSfile: c_rcode.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "c_rcode.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/c_namesp.hxx> +// #include <ary/cpp/c_groups.hxx> +#include <ary/loc/l_rwgate.hxx> +#include "cpp_pe.hxx" +#include <adc_cl.hxx> +#include <x_parse.hxx> +#include "pe_file.hxx" + + + +const uintt C_nNO_TRY = uintt(-1); + + +namespace cpp { + + +CodeExplorer::CodeExplorer( ary::cpp::RwGate & 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) +} + +ary::Cid +CodeExplorer::CurFile() const +{ + // KORR + return 0; +} + +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..b5559be6337f --- /dev/null +++ b/autodoc/source/parser/cpp/c_rcode.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * $RCSfile: c_rcode.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_C_RCODE_HXX +#define ADC_CPP_C_RCODE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <tokens/tokproct.hxx> + // COMPONENTS +#include <cosv/ploc.hxx> +#include "cxt2ary.hxx" + // PARAMETERS +#include <ary/ids.hxx> + + + +namespace ary +{ + namespace cpp + { + class RwGate; + } + + class Documentation; +} + +namespace cpp +{ + + class PE_File; + class Token; + class Cpp_PE; + +class CodeExplorer : private TokenProcessing_Types + +{ + public: + CodeExplorer( + ary::cpp::RwGate & io_rAryGate ); + ~CodeExplorer(); + + void StartNewFile(); + void Process_Token( + DYN cpp::Token & let_drToken ); + ary::Cid CurFile() const; + + // 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::RwGate * 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..6fd305c5a8ed --- /dev/null +++ b/autodoc/source/parser/cpp/cpp_pe.cxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: cpp_pe.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "cpp_pe.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/info/codeinfo.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 * i_sText ) +{ +// GlobalHandlingOfSyntaxError(i_sText, Env().CurFileName(), Env().LineCount()); + + 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..5c15a088afc6 --- /dev/null +++ b/autodoc/source/parser/cpp/cpp_pe.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: cpp_pe.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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/ids.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..e54fbca64db1 --- /dev/null +++ b/autodoc/source/parser/cpp/cpp_tok.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: cpp_tok.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..a01e14013690 --- /dev/null +++ b/autodoc/source/parser/cpp/cx_base.cxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * $RCSfile: cx_base.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..3bf0fa31747d --- /dev/null +++ b/autodoc/source/parser/cpp/cx_base.hxx @@ -0,0 +1,130 @@ +/************************************************************************* + * + * $RCSfile: cx_base.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..bad7d8d0917d --- /dev/null +++ b/autodoc/source/parser/cpp/cx_c_pp.cxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * $RCSfile: cx_c_pp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 ) +{ + int o_rCount_BackslashedLineBreaks = 0; + + 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 ); + + 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() ); + } +} + + +#if 0 // Version Autodoc before 2.0 +void +Context_Preprocessor::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(); + + if (io_rText.CurChar() != NULCH) + jumpOverEol(io_rText); + io_rText.CutToken(); + Dealer().Deal_Eol(); + SetNewToken(0); +} +#endif + +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 ) +{ + jumpOverWhite( io_rText ); + // KORR_FUTURE Handling line breaks within macro parameters: + char cSeparator = jumpTo( io_rText, ',', ')' ); + csv_assert( cSeparator != 0 ); + + static char cBuf[100]; + strcpy( cBuf, io_rText.CutToken() ); + for ( uintt 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..d27fdc80b644 --- /dev/null +++ b/autodoc/source/parser/cpp/cx_c_pp.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: cx_c_pp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..586021b0b27a --- /dev/null +++ b/autodoc/source/parser/cpp/cx_c_std.cxx @@ -0,0 +1,564 @@ +/************************************************************************* + * + * $RCSfile: cx_c_std.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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; } + + // 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: + { + udmstri sCurChar( &io_rText.CurChar(), 1 ); + throw X_Parser( X_Parser::x_InvalidChar, sCurChar, udmstri::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); + + // 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("typename", 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..799bfa73cbd7 --- /dev/null +++ b/autodoc/source/parser/cpp/cx_c_std.hxx @@ -0,0 +1,126 @@ +/************************************************************************* + * + * $RCSfile: cx_c_std.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..99fc8953b213 --- /dev/null +++ b/autodoc/source/parser/cpp/cx_c_sub.cxx @@ -0,0 +1,198 @@ +/************************************************************************* + * + * $RCSfile: cx_c_sub.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "cx_c_sub.hxx" + + + +// NOT FULLY DECLARED SERVICES +#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 + // 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, "", udmstri::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, "", udmstri::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 = 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) +{ + char cNext = 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..32705f98517d --- /dev/null +++ b/autodoc/source/parser/cpp/cx_c_sub.hxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * $RCSfile: cx_c_sub.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..35835ab62e80 --- /dev/null +++ b/autodoc/source/parser/cpp/cxt2ary.cxx @@ -0,0 +1,405 @@ +/************************************************************************* + * + * $RCSfile: cxt2ary.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "cxt2ary.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/re.hxx> +#include <ary/docu.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_rwgate.hxx> +#include <ary/cpp/c_tydef.hxx> +#include <ary/cpp/c_vari.hxx> +#include <ary/info/docstore.hxx> +#include "icprivow.hxx" + +// Implementationheader, 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::RwGate & io_rAryGate ) + : pGate(&io_rAryGate), + // aTokenResult, + pFileScopeInfo( new S_FileScopeInfo ), + pOwnerStack( new S_OwnerStack ), + pDocuDistributor( new S_DocuDistributor ), + pRecoveryGuard( new S_RecoveryGuard ) +{ + OpenNamespace( pGate->GlobalNamespace() ); +} + +ContextForAry::~ContextForAry() +{ +} + +ary::cpp::ProjectGroup & +ContextForAry::inq_CurProjectGroup() const +{ + csv_assert(pFileScopeInfo->pCurProject != 0); + + return *pFileScopeInfo->pCurProject; +} + +ary::cpp::FileGroup & +ContextForAry::inq_CurFileGroup() 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 i_bOnlyForOneDeclaration ) +{ + pOwnerStack->OpenExternC(); + // KORR + // 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_Event_Class_FinishedBase( const udmstri & i_sBaseName ) +{ + // 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::CppDefinition & 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 udmstri & i_sParameterName ) +{ + // 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::Documentation & let_drInfo ) +{ + let_drInfo.Store2(*pDocuDistributor); +} + +void +ContextForAry::do_StartWaitingFor_Recovery() +{ + pRecoveryGuard->StartWaitingFor_Recovery(); +} + +ary::cpp::RwGate & +ContextForAry::inq_AryGate() const +{ + return * const_cast< ary::cpp::RwGate* >(pGate); +} + +const ary::cpp::InputContext & +ContextForAry::inq_Context() const +{ + return *this; +} + +udmstri +ContextForAry::inq_CurFileName() const +{ + return pFileScopeInfo->sCurFileName; +} + +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_SetCurProject( ary::cpp::ProjectGroup & io_rCurProject ) +{ + pFileScopeInfo->pCurProject = &io_rCurProject; +} + +void +ContextForAry::do_SetCurFile( ary::cpp::FileGroup & io_rCurFile, + const udmstri & i_sFileName ) +{ + pFileScopeInfo->pCurFile = &io_rCurFile; + pFileScopeInfo->sCurFileName = i_sFileName; + 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(); +} + +ary::cpp::ProjectGroup & +ContextForAry::inq_CurProject() const +{ + csv_assert( pFileScopeInfo->pCurProject != 0 ); + + return *pFileScopeInfo->pCurProject; +} + + +} // namespace cpp + + diff --git a/autodoc/source/parser/cpp/cxt2ary.hxx b/autodoc/source/parser/cpp/cxt2ary.hxx new file mode 100644 index 000000000000..30e85b2eef76 --- /dev/null +++ b/autodoc/source/parser/cpp/cxt2ary.hxx @@ -0,0 +1,231 @@ +/************************************************************************* + * + * $RCSfile: cxt2ary.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 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::RwGate. + + 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::RwGate & 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::cpp::ProjectGroup & + inq_CurProjectGroup() const; + virtual ary::cpp::FileGroup & + inq_CurFileGroup() 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_Event_Class_FinishedBase( + const udmstri & 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::CppDefinition & + io_rDefinition ); + virtual void do_Event_EnterFunction_ParameterList(); + virtual void do_Event_Function_FinishedParameter( + const udmstri & 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::Documentation & + let_drInfo ); + virtual void do_StartWaitingFor_Recovery(); + virtual ary::cpp::RwGate & + inq_AryGate() const; + virtual const ary::cpp::InputContext & + inq_Context() const; + virtual udmstri 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_SetCurProject( + ary::cpp::ProjectGroup & + io_rCurProject ); + virtual void do_SetCurFile( + ary::cpp::FileGroup & + io_rCurFile, + const udmstri & i_sFileName ); + virtual void do_Event_IncrLineCount(); + virtual void do_Event_SwBracketOpen(); + virtual void do_Event_SwBracketClose(); + virtual void do_Event_Semicolon(); + virtual ary::cpp::ProjectGroup & + inq_CurProject() const; + + // Local types + struct S_FileScopeInfo; + struct S_OwnerStack; + struct S_DocuDistributor; + struct S_RecoveryGuard; + + // DATA + ary::cpp::RwGate * 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..a7c4e032fefc --- /dev/null +++ b/autodoc/source/parser/cpp/defdescr.cxx @@ -0,0 +1,247 @@ +/************************************************************************* + * + * $RCSfile: defdescr.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "defdescr.hxx" + + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/prpr.hxx> + + +#if 0 // should be obsolete +bool CheckForOperator( + bool & o_bStringify, + bool & o_bConcatenate, + const udmstri & i_sTextItem ); +void Do_bConcatenate( + csv::StreamStr & o_rText, + bool & io_bConcatenate ); +inline void Do_bStringify_begin( + csv::StreamStr & o_rText, + bool i_bStringify ); +inline void Do_bStringify_end( + csv::StreamStr & o_rText, + bool & io_bStringify ); +inline bool HandleOperatorsBeforeTextItem( /// @return true, if text item is done here + csv::StreamStr & o_rText, + bool & io_bStringify, + bool & io_bConcatenate, + const udmstri & i_sTextItem ); + +inline void +Do_bStringify_begin( csv::StreamStr & o_rText, + bool i_bStringify ) +{ + if ( i_bStringify ) + { + o_rText << "\""; + } +} + +inline void +Do_bStringify_end( csv::StreamStr & o_rText, + bool & io_bStringify ) +{ + if ( io_bStringify ) + { + o_rText << "\""; + io_bStringify = false; + } +} + + +inline bool +HandleOperatorsBeforeTextItem( csv::StreamStr & o_rText, + bool & io_bStringify, + bool & io_bConcatenate, + const udmstri & 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; +} +#endif // 0, obsolete + + + +namespace cpp +{ + + + + +DefineDescription::DefineDescription( const udmstri & i_sName, + const str_vector & i_rDefinition ) + : sName(i_sName), + // aParams, + aDefinition(i_rDefinition), + eDefineType(type_define) +{ +} + +DefineDescription::DefineDescription( const udmstri & 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 + + + + + diff --git a/autodoc/source/parser/cpp/defdescr.hxx b/autodoc/source/parser/cpp/defdescr.hxx new file mode 100644 index 000000000000..b5606c3fb974 --- /dev/null +++ b/autodoc/source/parser/cpp/defdescr.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * $RCSfile: defdescr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_DEFDESCR_HXX +#define ADC_CPP_DEFDESCR_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +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 udmstri & i_sName, + const str_vector & i_rDefinition ); + DefineDescription( /// Used for: #define MACRO(...) abc + const udmstri & 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 + udmstri 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..e8455c53a837 --- /dev/null +++ b/autodoc/source/parser/cpp/fevnthdl.hxx @@ -0,0 +1,168 @@ +/************************************************************************* + * + * $RCSfile: fevnthdl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_FEVNTHDL_HXX +#define ADC_CPP_FEVNTHDL_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + namespace cpp + { + class ProjectGroup; + class FileGroup; + } + namespace loc + { + class LocationRoot; + } +} + + + + +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 SetCurProject( + ary::cpp::ProjectGroup & + io_rCurProject ); + void SetCurFile( + ary::cpp::FileGroup & + io_rCurFile, + const udmstri & i_sFileName ); + void Event_IncrLineCount(); + void Event_SwBracketOpen(); + void Event_SwBracketClose(); + void Event_Semicolon(); + + // INQUIRY + ary::cpp::ProjectGroup & + CurProject() const; + private: + virtual void do_SetCurProject( + ary::cpp::ProjectGroup & + io_rCurProject ) = 0; + virtual void do_SetCurFile( + ary::cpp::FileGroup & + io_rCurFile, + const udmstri & i_sFileName ) = 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; + + virtual ary::cpp::ProjectGroup & + inq_CurProject() const = 0; +}; + + +// IMPLEMENTATION + +inline void +FileScope_EventHandler::SetCurProject( ary::cpp::ProjectGroup & io_rCurProject ) + { do_SetCurProject(io_rCurProject); } +inline void +FileScope_EventHandler::SetCurFile( ary::cpp::FileGroup & io_rCurFile, + const udmstri & i_sFileName ) + { do_SetCurFile(io_rCurFile,i_sFileName); } +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(); } +inline ary::cpp::ProjectGroup & +FileScope_EventHandler::CurProject() const + { return inq_CurProject(); } + + + +} // 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..7b0afff3e7d6 --- /dev/null +++ b/autodoc/source/parser/cpp/icprivow.cxx @@ -0,0 +1,220 @@ +/************************************************************************* + * + * $RCSfile: icprivow.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#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; +} + +void +Owner_Namespace::do_Add_Class( const udmstri & i_sLocalName, + Cid i_nId ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalClass(i_sLocalName, i_nId); +} + +void +Owner_Namespace::do_Add_Enum( const udmstri & i_sLocalName, + Cid i_nId ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalEnum(i_sLocalName, i_nId); +} + +void +Owner_Namespace::do_Add_Typedef( const udmstri & i_sLocalName, + Cid i_nId ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalTypedef(i_sLocalName, i_nId); +} + +void +Owner_Namespace::do_Add_Operation( const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStatic ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalOperation(i_sLocalName, i_nSignature, i_nId); +} + +void +Owner_Namespace::do_Add_Variable( const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + bool i_bIsStatic ) +{ + 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_Id() const +{ + csv_assert(pScope != 0); + return pScope->Id(); +} + + +//****************** Owner_Class ********************// + +Owner_Class::Owner_Class() + : pScope(0) +{ +} + +void +Owner_Class::SetAnotherClass( ary::cpp::Class & io_rScope ) +{ + pScope = &io_rScope; +} + +void +Owner_Class::do_Add_Class( const udmstri & i_sLocalName, + Cid i_nId ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalClass(i_sLocalName, i_nId); +} + +void +Owner_Class::do_Add_Enum( const udmstri & i_sLocalName, + Cid i_nId ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalEnum(i_sLocalName, i_nId); +} + +void +Owner_Class::do_Add_Typedef( const udmstri & i_sLocalName, + Cid i_nId ) +{ + csv_assert(pScope != 0); + pScope->Add_LocalTypedef(i_sLocalName, i_nId); +} + +void +Owner_Class::do_Add_Operation( const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStatic ) +{ + csv_assert(pScope != 0); + if (i_bIsStatic) + pScope->Add_LocalStaticOperation(i_sLocalName, i_nSignature, i_nId); + else + pScope->Add_LocalOperation(i_sLocalName, i_nSignature, i_nId); +} + +void +Owner_Class::do_Add_Variable( const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + 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_Id() const +{ + csv_assert(pScope != 0); + return pScope->Id(); +} + + + + + +} // namespace cpp diff --git a/autodoc/source/parser/cpp/icprivow.hxx b/autodoc/source/parser/cpp/icprivow.hxx new file mode 100644 index 000000000000..98136d1acb0a --- /dev/null +++ b/autodoc/source/parser/cpp/icprivow.hxx @@ -0,0 +1,154 @@ +/************************************************************************* + * + * $RCSfile: icprivow.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CPP_ICPRIVOW_HXX +#define ARY_CPP_ICPRIVOW_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/cpp/inpcontx.hxx> + // COMPONENTS + // PARAMETERS + +namespace cpp +{ + + + +using ary::Cid; +using ary::OSid; + +class Owner_Namespace : public ary::cpp::InputContext::Owner +{ + public: + Owner_Namespace(); + void SetAnotherNamespace( + ary::cpp::Namespace & + io_rScope ); + + private: + virtual void do_Add_Class( + const udmstri & i_sLocalName, + Cid i_nId ); + virtual void do_Add_Enum( + const udmstri & i_sLocalName, + Cid i_nId ); + virtual void do_Add_Typedef( + const udmstri & i_sLocalName, + Cid i_nId ); + virtual void do_Add_Operation( + const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStatic ); + virtual void do_Add_Variable( + const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + bool i_bIsStatic ); + virtual Cid inq_Id() const; + + // DATA + ary::cpp::Namespace * + pScope; +}; + +class Owner_Class : public ary::cpp::InputContext::Owner +{ + public: + Owner_Class(); + void SetAnotherClass( + ary::cpp::Class & io_rScope ); + private: + virtual void do_Add_Class( + const udmstri & i_sLocalName, + Cid i_nId ); + virtual void do_Add_Enum( + const udmstri & i_sLocalName, + Cid i_nId ); + virtual void do_Add_Typedef( + const udmstri & i_sLocalName, + Cid i_nId ); + virtual void do_Add_Operation( + const udmstri & i_sLocalName, + OSid i_nSignature, + Cid i_nId, + bool i_bIsStatic ); + virtual void do_Add_Variable( + const udmstri & i_sLocalName, + Cid i_nId, + bool i_bIsConst, + bool i_bIsStatic ); + virtual Cid inq_Id() 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..76d6ae4018a8 --- /dev/null +++ b/autodoc/source/parser/cpp/makefile.mk @@ -0,0 +1,123 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +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 \ + $(OBJ)$/tokintpr.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..f82bc2e6ac08 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_base.cxx @@ -0,0 +1,256 @@ +/************************************************************************* + * + * $RCSfile: pe_base.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "pe_base.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/ca_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[] = { On_startOfNext_Identifier, + On_startOfNext_public, + On_startOfNext_protected, + On_startOfNext_private, + On_startOfNext_virtual, + On_startOfNext_DoubleColon }; + static INT16 stateT_startOfNext[] = { Tid_Identifier, + Tid_public, + Tid_protected, + Tid_private, + Tid_virtual, + Tid_DoubleColon }; + static F_Tok stateF_inName[] = { On_inName_Identifier, + On_inName_virtual, + On_inName_SwBracket_Left, + On_inName_DoubleColon, + 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().RoGate() ); + + 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 * i_sText) +{ + pSpuBaseName->Push(not_done); +} + +void +PE_Base::On_startOfNext_DoubleColon(const char *) +{ + pSpuBaseName->Push(not_done); +} + +void +PE_Base::On_inName_Identifier(const char * i_sText) +{ + 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..093c78995f30 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_base.hxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * $RCSfile: pe_base.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#ifndef ADC_CPP_PE_BASE_HXX +#define ADC_CPP_PE_BASE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cpp_pe.hxx" + // COMPONENTS +#include <semantic/callf.hxx> +#include <semantic/sub_peu.hxx> + // PARAMETERS +#include <ary/cpp/c_etypes.hxx> +// #include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_idlist.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..7f9b13722b4e --- /dev/null +++ b/autodoc/source/parser/cpp/pe_class.cxx @@ -0,0 +1,511 @@ +/************************************************************************* + * + * $RCSfile: pe_class.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "pe_class.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_namesp.hxx> +#include <all_toks.hxx> +#include "pe_base.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); + + 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); +} + + +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[] = { On_start_class, + On_start_struct, + On_start_union }; + static INT16 stateT_start[] = { Tid_class, + Tid_struct, + Tid_union }; + + static F_Tok stateF_expectName[] = { On_expectName_Identifier, + On_expectName_SwBracket_Left, + On_expectName_Colon + }; + static INT16 stateT_expectName[] = { Tid_Identifier, + Tid_SwBracket_Left, + Tid_Colon + }; + + static F_Tok stateF_gotName[] = { On_gotName_SwBracket_Left, + On_gotName_Semicolon, + On_gotName_Colon }; + static INT16 stateT_gotName[] = { Tid_SwBracket_Left, + Tid_Semicolon, + Tid_Colon }; + + static F_Tok stateF_bodyStd[] = { On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + On_bodyStd_ClassKey, + On_bodyStd_ClassKey, + On_bodyStd_ClassKey, + + On_bodyStd_enum, + On_bodyStd_typedef, + On_bodyStd_public, + On_bodyStd_protected, + On_bodyStd_private, + + On_bodyStd_template, + On_bodyStd_VarFunc, + On_bodyStd_friend, + On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + + On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + + On_bodyStd_using, + On_bodyStd_SwBracket_Right, + On_bodyStd_VarFunc, + On_bodyStd_VarFunc, + 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_BuiltInType, + Tid_TypeSpecializer }; + + static F_Tok stateF_inProtection[] = { On_inProtection_Colon }; + static INT16 stateT_inProtection[] = { Tid_Colon }; + + static F_Tok stateF_afterDecl[] = { 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 error: ';' 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().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, 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_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..e52d1669d07d --- /dev/null +++ b/autodoc/source/parser/cpp/pe_class.hxx @@ -0,0 +1,283 @@ +/************************************************************************* + * + * $RCSfile: pe_class.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_PE_CLASS_HXX +#define ADC_CPP_PE_CLASS_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cpp_pe.hxx" + // COMPONENTS +#include <semantic/callf.hxx> +#include <semantic/sub_peu.hxx> +#include <ary/cpp/c_etypes.hxx> +#include <ary/cpp/c_idlist.hxx> + // PARAMETERS +#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_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 udmstri & Result_LocalName() const; + const udmstri & 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 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 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_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<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; + + + udmstri 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 udmstri & +PE_Class::Result_LocalName() const +{ + return sLocalName; +} + +inline const udmstri & +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..58ae56e55b5a --- /dev/null +++ b/autodoc/source/parser/cpp/pe_defs.cxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * $RCSfile: pe_defs.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "pe_defs.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/c_define.hxx> +#include <ary/cpp/c_macro.hxx> +#include <ary/cpp/crwg_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[] = { On_expectName_DefineName, + On_expectName_MacroName + }; + static INT16 stateT_expectName[] = { Tid_DefineName, + Tid_MacroName + }; + + static F_Tok stateF_gotDefineName[] = { On_gotDefineName_PreProDefinition }; + static INT16 stateT_gotDefineName[] = { Tid_PreProDefinition }; + + static F_Tok stateF_expectMacroParameters[] = + { On_expectMacroParameters_MacroParameter, + 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) + { + ary::cpp::Define & + rNew = Env().AryGate().Defines().Store_Define( + Env().Context(), sName, aDefinition ); + Env().Event_Store_CppDefinition(rNew); + } + else + { + ary::cpp::Macro & + rNew = Env().AryGate().Defines().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( udmstri(i_sText) ); +} + +void +PE_Defines::On_expectMacroParameters_MacroParameter( const char * i_sText ) +{ + SetTokenResult(done, stay); + aParameters.push_back( udmstri(i_sText) ); +} + +void +PE_Defines::On_expectMacroParameters_PreProDefinition( const char * i_sText ) +{ + SetTokenResult(done, pop_success); + + aDefinition.push_back( udmstri(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..2b612c65a630 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_defs.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: pe_defs.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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; + + udmstri sName; + StringVector aParameters; + StringVector aDefinition; + bool bIsMacro; +}; + + + +// IMPLEMENTATION + +} //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..ae3024a34fce --- /dev/null +++ b/autodoc/source/parser/cpp/pe_enum.cxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * $RCSfile: pe_enum.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "pe_enum.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/c_enum.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[] = { On_expectName_Identifier, + On_expectName_SwBracket_Left + }; + static INT16 stateT_expectName[] = { Tid_Identifier, + Tid_SwBracket_Left + }; + + static F_Tok stateF_gotName[] = { On_gotName_SwBracket_Left }; + static INT16 stateT_gotName[] = { Tid_SwBracket_Left }; + + static F_Tok stateF_bodyStd[] = { On_bodyStd_Identifier, + On_bodyStd_SwBracket_Right }; + static INT16 stateT_bodyStd[] = { Tid_Identifier, + Tid_SwBracket_Right }; + + static F_Tok stateF_afterBlock[] = { 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().Store_Enum( Env().Context(), sLocalName ); +} + +void +PE_Enum::On_expectName_SwBracket_Left( const char * ) +{ + SetTokenResult(done, stay); + pStati->SetCur(bodyStd); + + sLocalName = ""; + pCurObject = & Env().AryGate().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 * i_sText ) +{ + 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..4a81a52d4f32 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_enum.hxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * $RCSfile: pe_enum.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 udmstri & Result_LocalName() const; + const udmstri & 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; + + udmstri 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 udmstri & +PE_Enum::Result_LocalName() const +{ + return sLocalName; +} + +inline const udmstri & +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..4b4184465ded --- /dev/null +++ b/autodoc/source/parser/cpp/pe_enval.cxx @@ -0,0 +1,202 @@ +/************************************************************************* + * + * $RCSfile: pe_enval.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pe_enval.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_rwgate.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[] = { On_start_Identifier }; + static INT16 stateT_start[] = { Tid_Identifier }; + + static F_Tok stateF_afterName[] = { On_afterName_SwBracket_Right, + On_afterName_Comma, + On_afterName_Assign }; + static INT16 stateT_afterName[] = { Tid_SwBracket_Right, + Tid_Comma, + Tid_Assign }; + + static F_Tok stateF_expectFinish[] = { On_expectFinish_SwBracket_Right, + 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().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..0e62ea59b628 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_enval.hxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * $RCSfile: pe_enval.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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; + + udmstri sName; + udmstri sInitExpression; +}; + + + +// IMPLEMENTATION + + +} // 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..1aab3b3ad901 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_expr.cxx @@ -0,0 +1,238 @@ +/************************************************************************* + * + * $RCSfile: pe_expr.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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[] = { On_std_SwBracket_Left, + On_std_SwBracket_Right, + On_std_ArrayBracket_Left, + On_std_ArrayBracket_Right, + On_std_Bracket_Left, + On_std_Bracket_Right, + On_std_Semicolon, + 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..0e3eef83f680 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_expr.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * $RCSfile: pe_expr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#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..2af9547fc24b --- /dev/null +++ b/autodoc/source/parser/cpp/pe_file.cxx @@ -0,0 +1,348 @@ +/************************************************************************* + * + * $RCSfile: pe_file.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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(); +} + +ary::cpp::RwGate & +PE_File::AryGate() const +{ + return const_cast< PE_File& >(*this).Env().AryGate(); +} + +void +PE_File::Setup_StatusFunctions() +{ + typedef CallFunction<PE_File>::F_Tok F_Tok; + static F_Tok stateF_std[] = { On_std_VarFunc, + On_std_ClassKey, + On_std_ClassKey, + On_std_ClassKey, + On_std_enum, + On_std_typedef, + On_std_template, + On_std_VarFunc, + On_std_VarFunc, + On_std_extern, + On_std_VarFunc, + On_std_VarFunc, + On_std_VarFunc, + On_std_namespace, + On_std_using, + On_std_SwBracketRight, + On_std_VarFunc, + On_std_DefineName, + On_std_MacroName, + On_std_VarFunc, + 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_DefineName, + Tid_MacroName, + Tid_BuiltInType, + Tid_TypeSpecializer }; + + static F_Tok stateF_in_extern[] = { On_in_extern_Constant }; + static INT16 stateT_in_extern[] = { Tid_Constant }; + + static F_Tok stateF_in_externC[] = { 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 error: ';' as a toplevel declaration is deprecated." + << Endl(); + SetTokenResult(done,stay); + return; + } + + StdHandlingOfSyntaxError(i_sText); +} + +void +PE_File::SpReturn_VarFunc() +{ + if (bWithinSingleExternC) + { + Env().CloseBlock(); + bWithinSingleExternC = false; + } +} + +void +PE_File::SpReturn_Template() +{ + Env().OpenTemplate( pSpuTemplate->Child().Result_Parameters() ); +} + +void +PE_File::On_std_namespace(const char * i_sText) +{ + pSpuNamespace->Push(done); +} + +void +PE_File::On_std_ClassKey(const char * i_sText) +{ + pSpuVarFunc->Push(not_done); // This is correct, + // classes are parsed via PE_Type. +} + +void +PE_File::On_std_typedef(const char * i_sText) +{ + pSpuTypedef->Push(not_done); +} + +void +PE_File::On_std_enum(const char * i_sText) +{ + pSpuVarFunc->Push(not_done); // This is correct, + // enums are parsed via PE_Type. +} + +void +PE_File::On_std_VarFunc(const char * i_sText) +{ + pSpuVarFunc->Push(not_done); +} + +void +PE_File::On_std_template(const char * i_sText) +{ + pSpuTemplate->Push(done); +} + +void +PE_File::On_std_extern(const char * i_sText) +{ + SetTokenResult(done, stay); + pStati->SetCur(in_extern); +} + +void +PE_File::On_std_using(const char * i_sText) +{ + pSpuUsing->Push(done); +} + +void +PE_File::On_std_SwBracketRight(const char * i_sText) +{ + SetTokenResult(done,stay); + Env().CloseBlock(); +} + +void +PE_File::On_std_DefineName(const char * i_sText) +{ + pSpuDefs->Push(not_done); +} + +void +PE_File::On_std_MacroName(const char * i_sText) +{ + pSpuDefs->Push(not_done); +} + +void +PE_File::On_in_extern_Constant(const char * i_sText) +{ + SetTokenResult(done,stay); + pStati->SetCur(in_externC); + + Env().OpenExternC(); +} + +void +PE_File::On_in_extern_Ignore(const char * i_sText) +{ + SetTokenResult(not_done, stay); + pStati->SetCur(std); +} + +void +PE_File::On_in_externC_SwBracket_Left(const char * i_sText) +{ + SetTokenResult(done, stay); + pStati->SetCur(std); +} + +void +PE_File::On_in_externC_NoBlock(const char * i_sText) +{ + 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..550d4224ea50 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_file.hxx @@ -0,0 +1,246 @@ +/************************************************************************* + * + * $RCSfile: pe_file.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_PE_FILE_HXX +#define ADC_CPP_PE_FILE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cpp_pe.hxx" + // COMPONENTS +#include <ary/ids.hxx> +#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(); + + ary::cpp::RwGate & AryGate() const; + + 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 & 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..0e320f1e30e3 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_funct.cxx @@ -0,0 +1,636 @@ +/************************************************************************* + * + * $RCSfile: pe_funct.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pe_funct.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/inpcontx.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/c_disply.hxx> +#include <ary/cpp/c_funct.hxx> +#include <ary/cpp/ca_type.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 udmstri & i_sName, + ary::Tid 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 udmstri & 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 udmstri & 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::Tid 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::Cid +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[] = + { On_afterOperator_Std_Operator, + On_afterOperator_Std_LeftBracket, + On_afterOperator_Std_LeftBracket, + On_afterOperator_Std_Operator, + On_afterOperator_Std_Operator, + On_afterOperator_Std_Operator, + On_afterOperator_Std_Operator, + On_afterOperator_Std_Operator, + 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[] = + { On_afterStdOperatorLeftBracket_RightBracket, + On_afterStdOperatorLeftBracket_RightBracket }; + static INT16 stateT_afterStdOperatorLeftBracket[] = + { Tid_ArrayBracket_Right, + Tid_Bracket_Right }; + + static F_Tok stateF_afterCastOperator[] = + { On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + On_afterOperator_Cast_Type, + 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_BuiltInType, + Tid_TypeSpecializer }; + + static F_Tok stateF_afterName[] = { On_afterName_Bracket_Left }; + static INT16 stateT_afterName[] = { Tid_Bracket_Left }; + + static F_Tok stateF_expectParameterSeparator[] = + { On_expectParameterSeparator_BracketRight, + On_expectParameterSeparator_Comma }; + static INT16 stateT_expectParameterSeparator[] = + { Tid_Bracket_Right, + Tid_Comma }; + + static F_Tok stateF_afterParameters[] = { On_afterParameters_const, + On_afterParameters_volatile, + On_afterParameters_throw, + On_afterParameters_SwBracket_Left, + On_afterParameters_Semicolon, + On_afterParameters_Comma, + On_afterParameters_Colon, + 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[] = { On_afterThrow_Bracket_Left }; + static INT16 stateT_afterThrow[] = { Tid_Bracket_Left }; + + static F_Tok stateF_expectExceptionSeparator[] = + { On_expectExceptionSeparator_BracketRight, + On_expectExceptionSeparator_Comma }; + static INT16 stateT_expectExceptionSeparator[] = + { Tid_Bracket_Right, + Tid_Comma }; + + static F_Tok stateF_afterExceptions[] = { On_afterExceptions_SwBracket_Left, + On_afterExceptions_Semicolon, + On_afterExceptions_Comma, + On_afterExceptions_Colon, + On_afterExceptions_Assign }; + static INT16 stateT_afterExceptions[] = { Tid_SwBracket_Left, + Tid_Semicolon, + Tid_Comma, + Tid_Colon, + Tid_Assign }; + + static F_Tok stateF_expectZero[] = { On_expectZero_Constant }; + static INT16 stateT_expectZero[] = { Tid_Constant }; + + static F_Tok stateF_inImplementation[] = + { On_inImplementation_SwBracket_Left, + 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() +{ + udmstri sName( aName.c_str() ); + ary::cpp::Function & rFunction = + Env().AryGate().Store_Operation( + Env().Context(), + sName, + nReturnType, + aParameters, + eVirtuality, + eConVol, + aFlags, + bThrow, + aExceptions ); + + Dyn< StringVector > + pTplParams ( Env().Get_CurTemplateParameters() ); + if ( pTplParams ) + { + for ( StringVector::const_iterator it = pTplParams->begin(); + it != pTplParams->end(); + ++it ) + { + rFunction.Add_TemplateParameterType( *it, 0 ); + } // end for + } + + Env().Event_Store_Function(rFunction); + + 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::Tid nParamType = pSpuParameter->Child().Result_FrontType(); + if ( nParamType != 0 ) // 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::Tid nException = pSpuException->Child().Result_Type().Id(); + if ( nException != 0 AND pSpuException->Child().Result_KindOf() == PE_Type::is_type ) + { + aExceptions.push_back( nException ); + } +} + +void +PE_Function::SpReturn_CastOperatorType() +{ + pStati->SetCur(afterName); + + Env().AryGate().RoGate().Get_TypeText( + aName, pSpuCastOperatorType->Child().Result_Type().Id() ); + aName; +} + +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; +} + +void +PE_Function::On_afterOperator_Cast_Type(const char * i_sText) +{ + pSpuCastOperatorType->Push(not_done); +} + +void +PE_Function::On_afterName_Bracket_Left(const char * i_sText) +{ + pSpuParameter->Push(done); +} + +void +PE_Function::On_expectParameterSeparator_BracketRight(const char * i_sText) +{ + SetTokenResult(done,stay); + pStati->SetCur(afterParameters); +} + +void +PE_Function::On_expectParameterSeparator_Comma(const char * i_sText) +{ + pSpuParameter->Push(done); +} + +void +PE_Function::On_afterParameters_const(const char * i_sText) +{ + 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 * i_sText) +{ + 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 * i_sText) +{ + SetTokenResult(done,stay); + pStati->SetCur(afterThrow); + bThrow = true; +} + +void +PE_Function::On_afterParameters_SwBracket_Left(const char * i_sText) +{ + EnterImplementation(1); +} + +void +PE_Function::On_afterParameters_Semicolon(const char * i_sText) +{ + PerformFinishingPunctuation(); +} + +void +PE_Function::On_afterParameters_Comma(const char * i_sText) +{ + PerformFinishingPunctuation(); +} + +void +PE_Function::On_afterParameters_Colon(const char * i_sText) +{ + EnterImplementation(0); +} + +void +PE_Function::On_afterParameters_Assign(const char * i_sText) +{ + SetTokenResult(done,stay); + pStati->SetCur(expectZero); +} + +void +PE_Function::On_afterThrow_Bracket_Left(const char * i_sText) +{ + pSpuException->Push(done); +} + +void +PE_Function::On_expectExceptionSeparator_BracketRight(const char * i_sText) +{ + SetTokenResult(done,stay); + pStati->SetCur(afterExceptions); +} + +void +PE_Function::On_expectExceptionSeparator_Comma(const char * i_sText) +{ + pSpuException->Push(done); +} + +void +PE_Function::On_afterExceptions_SwBracket_Left(const char * i_sText) +{ + EnterImplementation(1); +} + +void +PE_Function::On_afterExceptions_Semicolon(const char * i_sText) +{ + PerformFinishingPunctuation(); +} + +void +PE_Function::On_afterExceptions_Comma(const char * i_sText) +{ + PerformFinishingPunctuation(); +} + +void +PE_Function::On_afterExceptions_Colon(const char * i_sText) +{ + EnterImplementation(0); +} + +void +PE_Function::On_afterExceptions_Assign(const char * i_sText) +{ + 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 * i_sText) +{ + SetTokenResult(done,stay); + nBracketCounterInImplementation++; +} + +void +PE_Function::On_inImplementation_SwBracket_Right(const char * i_sText) +{ + nBracketCounterInImplementation--; + if (nBracketCounterInImplementation == 0) + { + SetTokenResult(done,pop_success); + } + else + { + SetTokenResult(done,stay); + } +} + +void +PE_Function::On_inImplementation_Default(const char * i_sText) +{ + 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..3eb65df81408 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_funct.hxx @@ -0,0 +1,315 @@ +/************************************************************************* + * + * $RCSfile: pe_funct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#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_etypes.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 udmstri & i_sName, + ary::Tid i_nReturnType, + bool i_bVirtual, + ary::cpp::FunctionFlags + i_aFlags ); + void Init_Ctor( + const udmstri & i_sName, + ary::cpp::FunctionFlags + i_aFlags ); + void Init_Dtor( + const udmstri & 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::Tid i_nReturnType, + bool i_bVirtual, + ary::cpp::FunctionFlags + i_aFlags ); + + ary::Cid 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::Tid> 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::Cid 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::Tid 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..6ff31c55f736 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_ignor.cxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * $RCSfile: pe_ignor.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..e7150ad12274 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_ignor.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: pe_ignor.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#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..27beb26d3a2b --- /dev/null +++ b/autodoc/source/parser/cpp/pe_namsp.cxx @@ -0,0 +1,173 @@ +/************************************************************************* + * + * $RCSfile: pe_namsp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_rwgate.hxx> +#include <semantic/callf.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[] = { On_start_Identifier }; + static INT16 stateT_start[] = { Tid_Identifier }; + static F_Tok stateF_gotName[] = { On_gotName_SwBracket_Left, + On_gotName_Assign }; + static INT16 stateT_gotName[] = { Tid_SwBracket_Left, + Tid_Assign }; + static F_Tok stateF_expectSemicolon[] = { 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().CheckIn_Namespace( Env().Context(), sLocalName ); + Env().OpenNamespace(rNew); + } +} + +void +PE_Namespace::Hdl_SyntaxError( const char *) +{ + csv_assert(false); +} + +void +PE_Namespace::On_start_Identifier(const char * i_sText) +{ + SetTokenResult(done, stay); + pStati->SetCur(gotName); + + sLocalName = i_sText; +} + +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 + 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..32415fe467c6 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_namsp.hxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * $RCSfile: pe_namsp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_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; + + udmstri sLocalName; + bool bPush; +}; + + + +// IMPLEMENTATION + + +} // 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..0fdc17fbcbfb --- /dev/null +++ b/autodoc/source/parser/cpp/pe_param.cxx @@ -0,0 +1,313 @@ +/************************************************************************* + * + * $RCSfile: pe_param.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pe_param.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_rwgate.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[] = { On_start_Type, + On_start_Type, + On_start_Type, + On_start_Type, + On_start_Type, + On_start_Type, + On_start_Type, + On_start_Bracket_Right, + On_start_Type, + On_start_Ellipse, + On_start_Type, + 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_BuiltInType, + Tid_TypeSpecializer }; + static F_Tok stateF_expectName[] = { On_expectName_Identifier, + On_expectName_ArrayBracket_Left, + On_expectName_Bracket_Right, + On_expectName_Comma, + On_afterName_Assign }; + static INT16 stateT_expectName[] = { Tid_Identifier, + Tid_ArrayBracket_Left, + Tid_Bracket_Right, + Tid_Comma, + Tid_Assign }; + static F_Tok stateF_afterName[] = { On_afterName_ArrayBracket_Left, + On_afterName_Bracket_Right, + On_afterName_Comma, + On_afterName_Assign }; + static INT16 stateT_afterName[] = { Tid_ArrayBracket_Left, + Tid_Bracket_Right, + Tid_Comma, + Tid_Assign }; + static F_Tok stateF_finished[] = { On_finished_Comma, + 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 * i_sText) +{ + pSpuType->Push(not_done); +} + +void +PE_Parameter::On_start_Bracket_Right(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Parameter::On_start_Ellipse(const char * i_sText) +{ + SetTokenResult(done, pop_success); + + aResultParamInfo.nType = Env().AryGate().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_expectName_Assign(const char * i_sText) +{ + On_afterName_Assign(i_sText); +} + +void +PE_Parameter::On_afterName_ArrayBracket_Left(const char * i_sText) +{ + pSpuVariable->Push(not_done); +} + +void +PE_Parameter::On_afterName_Bracket_Right(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Parameter::On_afterName_Comma(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Parameter::On_afterName_Assign(const char * i_sText) +{ + pSpuVariable->Push(not_done); +} + +void +PE_Parameter::On_finished_Bracket_Right(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Parameter::On_finished_Comma(const char * i_sText) +{ + 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..570b2eb72de1 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_param.hxx @@ -0,0 +1,174 @@ +/************************************************************************* + * + * $RCSfile: pe_param.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#ifndef ADC_CPP_PE_PARAM_HXX +#define ADC_CPP_PE_PARAM_HXX + + +// USED SERVICES + // BASE CLASSES +#include "cpp_pe.hxx" + // COMPONENTS +#include <semantic/callf.hxx> +#include <semantic/sub_peu.hxx> + // PARAMETERS +#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; + + PE_Parameter( + Cpp_PE * i_pParent ); + ~PE_Parameter(); + + virtual void Call_Handler( + const cpp::Token & i_rTok ); + + ary::Tid 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_expectName_Assign(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::Tid +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..33c40c50132a --- /dev/null +++ b/autodoc/source/parser/cpp/pe_tpltp.cxx @@ -0,0 +1,203 @@ +/************************************************************************* + * + * $RCSfile: pe_tpltp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "pe_tpltp.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <cosv/template/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[] = { On_start_Less }; + static INT16 stateT_start[] = { Tid_Less }; + + // KORR_FUTURE : add "typename". + static F_Tok stateF_expect_qualifier[]= { On_expect_qualifier_class }; + static INT16 stateT_expect_qualifier[]= { Tid_class }; + + static F_Tok stateF_expect_name[] = { On_expect_name_Identifier }; + static INT16 stateT_expect_name[] = { Tid_Identifier }; + + static F_Tok stateF_expect_separator[]= { On_expect_separator_Comma, + 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_class( const char *) +{ + SetTokenResult(done, stay); + pStati->SetCur(expect_name); +} + +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); + + if ( NOT bCurIsConstant ) + { + udmstri sText( StreamLock(50)() << "typename " << i_sText << c_str ); + aResult_Parameters.push_back(sText); + } + else // + { + udmstri sText( StreamLock(50)() << "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..8759cc2a35b7 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_tpltp.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * $RCSfile: pe_tpltp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_class(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..e51473204471 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_tydef.cxx @@ -0,0 +1,176 @@ +/************************************************************************* + * + * $RCSfile: pe_tydef.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include "pe_tydef.hxx" + + +// NOT FULLY DECLARED SERVICES +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/ca_type.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[] = { On_start_typedef }; + static INT16 stateT_start[] = { Tid_typedef }; + + static F_Tok stateF_expectName[] = { On_expectName_Identifier }; + static INT16 stateT_expectName[] = { Tid_Identifier }; + + static F_Tok stateF_afterName[] = { 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().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..065eb1d0f2ac --- /dev/null +++ b/autodoc/source/parser/cpp/pe_tydef.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: pe_tydef.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_PE_TYDEF_HXX +#define ADC_CPP_PE_TYDEF_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cpp_pe.hxx" + // COMPONENTS +#include <semantic/callf.hxx> +#include <semantic/sub_peu.hxx> + // PARAMETERS + + +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; + + udmstri sName; + ary::Tid nType; +}; + + + +// IMPLEMENTATION + + +} // 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..dfc4f10698db --- /dev/null +++ b/autodoc/source/parser/cpp/pe_type.cxx @@ -0,0 +1,521 @@ +/************************************************************************* + * + * $RCSfile: pe_type.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pe_type.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/cpp/inpcontx.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/c_class.hxx> +#include "pe_class.hxx" +#include "pe_enum.hxx" +#include <x_parse.hxx> + + +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[] = { On_start_Identifier, + On_start_class, + On_start_class, + On_start_class, + On_start_enum, + On_start_const, + On_start_volatile, + On_start_Bracket_Right, + On_start_DoubleColon, + On_start_BuiltInType, + 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_BuiltInType, + Tid_TypeSpecializer }; + + static F_Tok stateF_expect_namesegment[] = { On_expect_namesegment_Identifier, + On_expect_namesegment_Identifier }; + static INT16 stateT_expect_namesegment[] = { Tid_Identifier, + Tid_BuiltInType }; + + static F_Tok stateF_after_namesegment[] = { On_after_namesegment_const, + On_after_namesegment_volatile, + On_after_namesegment_Bracket_Left, + On_after_namesegment_DoubleColon, + On_after_namesegment_Less, + On_after_namesegment_Asterix, + 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[] = + { On_afterclass_expect_semicolon_Semicolon }; + static INT16 stateT_afterclass_expect_semicolon[] = + { Tid_Semicolon }; + + static F_Tok stateF_within_template[] = { On_within_template_Comma, + On_within_template_Greater, + On_within_template_Constant }; + static INT16 stateT_within_template[] = { Tid_Comma, + Tid_Greater, + Tid_Constant }; + + static F_Tok stateF_within_indirection[] = { On_within_indirection_const, + On_within_indirection_volatile, + On_within_indirection_Asterix, + 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); + + pType = new ary::cpp::UsedType; + 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().CheckIn_UsedType( Env().Context(), * pType.Release() ); + else + pResult_Type = new ary::cpp::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, "", udmstri::Null_(), 0); + + pCurTemplate_ParameterList->AddParam_Type( + pSpuType_TemplateParameter->Child().Result_Type().Id() ); +} + +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_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..9d922a537140 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_type.hxx @@ -0,0 +1,218 @@ +/************************************************************************* + * + * $RCSfile: pe_type.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#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_etypes.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_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; + udmstri sOwningClassName; + udmstri 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..a0200abfeaf6 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_vafu.cxx @@ -0,0 +1,669 @@ +/************************************************************************* + * + * $RCSfile: pe_vafu.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pe_vafu.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include <ary/cpp/c_rwgate.hxx> +#include <ary/cpp/inpcontx.hxx> +#include <ary/cpp/c_class.hxx> +#include <ary/cpp/c_vari.hxx> +#include <ary/cpp/c_vfflag.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[] = { On_start_Identifier, + On_start_operator, + On_start_TypeKey, + On_start_TypeKey, + On_start_TypeKey, + On_start_TypeKey, + On_start_virtual, + On_start_Tilde, + On_start_const, + On_start_volatile, + On_start_extern, + On_start_static, + On_start_mutable, + On_start_register, + On_start_inline, + On_start_explicit, + On_start_Bracket_Right, + On_start_Identifier, + On_start_Identifier, + 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_BuiltInType, + Tid_TypeSpecializer }; + + static F_Tok stateF_expectCtor[] = { On_expectCtor_Bracket_Left }; + static INT16 stateT_expectCtor[] = { Tid_Bracket_Left }; + + static F_Tok stateF_afterClassDecl[] = { On_afterClassDecl_Semicolon }; + static INT16 stateT_afterClassDecl[] = { Tid_Semicolon }; + + static F_Tok stateF_expectName[] = { On_expectName_Identifier, + On_expectName_operator, + On_expectName_Bracket_Left }; + static INT16 stateT_expectName[] = { Tid_Identifier, + Tid_operator, + Tid_Bracket_Left }; + + static F_Tok stateF_afterName[] = { On_afterName_ArrayBracket_Left, + On_afterName_Bracket_Left, + On_afterName_DoubleColon, + On_afterName_Semicolon, + On_afterName_Comma, + On_afterName_Assign, + 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[] = + { On_afterName_inErraneousTemplate_Less, + On_afterName_inErraneousTemplate_Greater }; + static INT16 stateT_afterName_inErraneousTemplate[] = + { Tid_Less, + Tid_Greater }; + + static F_Tok stateF_finished[] = { On_finished_Semicolon, + On_finished_Comma }; + static INT16 stateT_finished[] = { Tid_Semicolon, + Tid_Comma }; + + static F_Tok stateF_finishedIncludingFunctionImplementation[] = + { 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 != 0 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; + } +} + +void +PE_VarFunc::SpReturn_Variable() +{ + typedef ary::cpp::VariableFlags VarFlags; + + if ( NOT bExtern ) + { + VarFlags aFlags( UINT16(0) + | ( 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().Store_Variable( Env().Context(), + sName, + nResultFrontType, + aFlags, + pSpuVariable->Child().Result_SizeExpression(), + pSpuVariable->Child().Result_InitExpression() ); + Env().Event_Store_Variable(rCurParsedVariable); + aResultIds.push_back( rCurParsedVariable.Id() ); + 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 * i_sText) +{ + pSpuType->Push(not_done); +} + +void +PE_VarFunc::On_start_operator(const char * i_sText) +{ + pSpuFunctionCastOperator->Push(done); +} + +void +PE_VarFunc::On_start_TypeKey(const char * i_sText) +{ + pSpuType->Push(not_done); +} + +void +PE_VarFunc::On_start_virtual(const char * i_sText) +{ + SetTokenResult(done, stay); + bVirtual = true; +} + +void +PE_VarFunc::On_start_Tilde(const char * i_sText) +{ + SetTokenResult(done, stay); + pStati->SetCur(expectName); + + bInDestructor = true; +} + +void +PE_VarFunc::On_start_const(const char * i_sText) +{ + pSpuType->Push(not_done); +} + +void +PE_VarFunc::On_start_volatile(const char * i_sText) +{ + pSpuType->Push(not_done); +} + +void +PE_VarFunc::On_start_extern(const char * i_sText) +{ + SetTokenResult(done, stay); + bExtern = true; +} + +void +PE_VarFunc::On_start_static(const char * i_sText) +{ + SetTokenResult(done, stay); + bStatic = true; +} + +void +PE_VarFunc::On_start_mutable(const char * i_sText) +{ + SetTokenResult(done, stay); + bMutable = true; +} + +void +PE_VarFunc::On_start_register(const char * i_sText) +{ + SetTokenResult(done, stay); + bRegister = true; +} + +void +PE_VarFunc::On_start_inline(const char * i_sText) +{ + SetTokenResult(done, stay); + + bInline = true; +} + +void +PE_VarFunc::On_start_explicit(const char * i_sText) +{ + SetTokenResult(done, stay); + bExplicit = true; +} + +void +PE_VarFunc::On_start_Bracket_Right(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_VarFunc::On_expectCtor_Bracket_Left(const char * i_sText) +{ + pSpuFunctionCtor->Push(not_done); +} + +void +PE_VarFunc::On_afterClassDecl_Semicolon(const char * i_sText) +{ + 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 * i_sText) +{ + pSpuFunctionNormalOperator->Push(done); +} + +void +PE_VarFunc::On_expectName_Bracket_Left(const char * i_sText) +{ + // Function pointer declaration + pSpuIgnore->Push(not_done); + // TODO +} + + +void +PE_VarFunc::On_afterName_ArrayBracket_Left(const char * i_sText) +{ + pSpuVariable->Push(not_done); +} + +void +PE_VarFunc::On_afterName_Bracket_Left(const char * i_sText) +{ + if ( NOT bInDestructor) + pSpuFunctionStd->Push(not_done); + else + pSpuFunctionDtor->Push(not_done); +} + +void +PE_VarFunc::On_afterName_DoubleColon(const char * i_sText) +{ + pSpuIgnore->Push(done); // This seems to be only an implementation. +} + +void +PE_VarFunc::On_afterName_Semicolon(const char * i_sText) +{ + pSpuVariable->Push(not_done); +} + +void +PE_VarFunc::On_afterName_Comma(const char * i_sText) +{ + 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(0) + | ( 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..490c36574262 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_vafu.hxx @@ -0,0 +1,322 @@ +/************************************************************************* + * + * $RCSfile: pe_vafu.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#ifndef ADC_CPP_PE_VAFU_HXX +#define ADC_CPP_PE_VAFU_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cpp_pe.hxx" + // COMPONENTS +#include <semantic/callf.hxx> +#include <semantic/sub_peu.hxx> +#include <ary/cpp/c_etypes.hxx> +#include <ary/cpp/c_vfflag.hxx> + // PARAMETERS + + +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::Cid> & + Result_Ids() const; + ary::Tid 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_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::Cid> + aResultIds; + ary::Tid nResultFrontType; + E_ResultType eResultType; + + // Pre-Results + udmstri sName; + + bool bVirtual; + bool bStatic; + bool bExtern; + bool bExternC; + bool bMutable; + bool bInline; + bool bRegister; + bool bExplicit; +}; + + + +// IMPLEMENTATION + +inline const std::vector<ary::Tid> & +PE_VarFunc::Result_Ids() const + { return aResultIds; } +inline ary::Tid +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..f26685795f18 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_vari.cxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * $RCSfile: pe_vari.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "pe_vari.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/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[] = { On_afterName_ArrayBracket_Left, + On_afterName_Semicolon, + On_afterName_Comma, + On_afterName_Assign }; + static INT16 stateT_afterName[] = { Tid_ArrayBracket_Left, + Tid_Semicolon, + Tid_Comma, + Tid_Assign }; + static F_Tok stateF_afterSize[] = { On_afterSize_ArrayBracket_Right }; + static INT16 stateT_afterSize[] = { Tid_ArrayBracket_Right }; + static F_Tok stateF_expectFinish[] = { On_expectFinish_Bracket_Right, + On_expectFinish_Semicolon, + 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 * i_sText) +{ + pSpuArraySizeExpression->Push(done); +} + +void +PE_Variable::On_afterName_Semicolon(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Variable::On_afterName_Comma(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Variable::On_afterName_Assign(const char * i_sText) +{ + pSpuInitExpression->Push(done); +} + +void +PE_Variable::On_afterSize_ArrayBracket_Right(const char * i_sText) +{ + SetTokenResult(done, stay); + pStati->SetCur(afterName); +} + +void +PE_Variable::On_expectFinish_Semicolon(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Variable::On_expectFinish_Comma(const char * i_sText) +{ + SetTokenResult(not_done, pop_success); +} + +void +PE_Variable::On_expectFinish_Bracket_Right(const char * i_sText) +{ + 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..24c57573f682 --- /dev/null +++ b/autodoc/source/parser/cpp/pe_vari.hxx @@ -0,0 +1,164 @@ +/************************************************************************* + * + * $RCSfile: pe_vari.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_etypes.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 udmstri & Result_SizeExpression() const; + const udmstri & 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; + + udmstri sResultSizeExpression; + udmstri sResultInitExpression; +}; + + + +// IMPLEMENTATION + + +inline UINT16 +PE_Variable::Result_Pattern() const + { return ( sResultSizeExpression.length() > 0 ? 1 : 0 ) + + ( sResultInitExpression.length() > 0 ? 2 : 0 ); } +inline const udmstri & +PE_Variable::Result_SizeExpression() const + { return sResultSizeExpression; } +inline const udmstri & +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..6559645d4d30 --- /dev/null +++ b/autodoc/source/parser/cpp/pev.hxx @@ -0,0 +1,333 @@ +/************************************************************************* + * + * $RCSfile: pev.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_PEV_HXX +#define ADC_CPP_PEV_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <tokens/tokproct.hxx> + // COMPONENTS + // PARAMETERS +#include <ary/cpp/c_etypes.hxx> + +namespace ary +{ + namespace cpp + { + class RwGate; + class InputContext; + + class Namespace; + class Class; + class Enum; + class Typedef; + class Function; + class Variable; + class EnumValue; + + class CppDefinition; + } + + 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(); + + // Special events + void Event_Class_FinishedBase( + const udmstri & 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::CppDefinition & + io_rDefinition ); + + void Event_EnterFunction_ParameterList(); + void Event_Function_FinishedParameter( + const udmstri & 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::RwGate & AryGate() const; + const ary::cpp::InputContext & + Context() const; + udmstri 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_Event_Class_FinishedBase( + const udmstri & 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::CppDefinition & + io_rDefinition ) = 0; + virtual void do_Event_EnterFunction_ParameterList() = 0; + virtual void do_Event_Function_FinishedParameter( + const udmstri & 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::RwGate & + inq_AryGate() const = 0; + virtual const ary::cpp::InputContext & + inq_Context() const = 0; + virtual udmstri 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::Event_Class_FinishedBase( const udmstri & 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::CppDefinition & 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 udmstri & 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::RwGate & +PeEnvironment::AryGate() const + { return inq_AryGate(); } +inline const ary::cpp::InputContext & +PeEnvironment::Context() const + { return inq_Context(); } +inline udmstri +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..4e9f9661ee8c --- /dev/null +++ b/autodoc/source/parser/cpp/preproc.cxx @@ -0,0 +1,267 @@ +/************************************************************************* + * + * $RCSfile: preproc.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "preproc.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/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 + { + aCurParamText; + if ( NOT csv::no_str(aCurParamText.c_str()) ) + { + aCurMacroParams.push_back( udmstri(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( udmstri(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 ) +{ + udmstri 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()); + udmstri 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..0466b3c562fc --- /dev/null +++ b/autodoc/source/parser/cpp/preproc.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * $RCSfile: preproc.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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< udmstri, 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..690dc1fa91da --- /dev/null +++ b/autodoc/source/parser/cpp/prs_cpp.cxx @@ -0,0 +1,281 @@ +/************************************************************************* + * + * $RCSfile: prs_cpp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <cpp/prs_cpp.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <cosv/file.hxx> +#include <ary/ary.hxx> +#include <ary/cpp/c_rwgate.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 udmstri & 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< udmstri, DefineDescription* > Data; + + Udk_MacroMap(); + ~Udk_MacroMap(); + + const Data & GetData() const { return aData; } + + private: + Data aData; +}; + +struct S_RunningData +{ + CharacterSource aFileContent; + ary::cpp::RwGate & 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 udmstri & i_sProjectName, + csv::ploc::Path & i_rProjectRootDirectory, + const autodoc::FileCollector_Ifc & i_rFiles ) +{ + pRunningData->aDealer.StartNewProject( i_sProjectName, i_rProjectRootDirectory ); + uintt nProjectSubPathLength = i_rProjectRootDirectory.DirChain().Size(); + + for ( autodoc::FileCollector_Ifc::const_iterator iter = i_rFiles.Begin(); + iter != i_rFiles.End(); + ++iter ) + { + csv::ploc::Path aFilePath(*iter); + aFilePath.DirChain().PopFront(nProjectSubPathLength); + + try + { + if ( NOT Local_LoadFile(pRunningData->aFileContent, *iter) ) + continue; + for ( pRunningData->aTkp.StartNewFile(aFilePath.File(), aFilePath.DirChain()); + 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.RwGate_Cpp() ), + // aMacros, + aDealer(o_rRepository.RwGate_Cpp()), + aTkp( * i_rDocumentationInterpreter.Create_DocuContext() ) +{ + aDealer.AssignPartners( aFileContent, + aMacros.GetData() ); + aTkp.AssignPartners( aFileContent, aDealer ); +} + + +Udk_MacroMap::Udk_MacroMap() +{ + udmstri sSAL_CALL("SAL_CALL"); + udmstri sSAL_CALL_ELLIPSE("SAL_CALL_ELLIPSE"); + udmstri sSAL_NO_VTABLE("SAL_NO_VTABLE"); + udmstri sREGISTRY_CALLTYPE("REGISTRY_CALLTYPE"); + udmstri sSAL_THROW("SAL_THROW"); + udmstri sSAL_THROW_EXTERN_C("SAL_THROW_EXTERN_C"); + + udmstri s__DEF_COMPIMPLHELPER_A("__DEF_COMPIMPLHELPER_A"); + udmstri s__DEF_COMPIMPLHELPER_B("__DEF_COMPIMPLHELPER_B"); + udmstri s__DEF_COMPIMPLHELPER("__DEF_COMPIMPLHELPER"); + + udmstri s__DEF_IMPLHELPER_PRE("__DEF_IMPLHELPER_PRE"); + udmstri s__IFC_WRITEOFFSET("__IFC_WRITEOFFSET"); + udmstri s__DEF_IMPLHELPER_POST("__DEF_IMPLHELPER_POST"); + + + StringVector aEmpty; + + StringVector aParamsSAL_THROW; + aParamsSAL_THROW.push_back( udmstri("exc") ); + StringVector aDefSAL_THROW; + aDefSAL_THROW.push_back( udmstri("throw") ); + aDefSAL_THROW.push_back( udmstri("exc") ); + + StringVector aCompImplHelperParams; + aCompImplHelperParams.push_back(udmstri("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); + +} + +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 udmstri & 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..7fcf0f29ff93 --- /dev/null +++ b/autodoc/source/parser/cpp/sdocdist.hxx @@ -0,0 +1,205 @@ +/************************************************************************* + * + * $RCSfile: sdocdist.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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::RepositoryEntity & + io_rRe ); + void Event_LineBreak(); + + private: + // Interface ary::info::DocuStore + virtual void do_Store2CurProject( + DYN Documentation & let_drDocu ); + virtual void do_Store2CurFile( + DYN Documentation & let_drDocu ); + virtual void do_Store2CurNamespace( + DYN Documentation & let_drDocu ); + + virtual void do_Store2ConnectedDeclaration( + DYN Documentation & let_drDocu ); + + virtual void do_Store2Glossary( + DYN Documentation & let_drDocu, + const udmstri & i_sExplainedTerm ); + virtual void do_Store2GlobalTexts( + DYN Documentation & let_drDocu, + ary::info::GlobalTextId + i_nId ); + // DATA + ary::RepositoryEntity * + pCurRe; + Dyn<Documentation> 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::RepositoryEntity & io_rRe ) +{ + pCurRe = &io_rRe; + if ( pLastStoredDocu ) + pCurRe->Add_Documentation( *pLastStoredDocu.Release() ); +} + +inline void +ContextForAry:: +S_DocuDistributor::Event_LineBreak() +{ + pCurRe = 0; +} + +void +ContextForAry:: +S_DocuDistributor::do_Store2CurProject( DYN Documentation & let_drDocu ) +{ + // KORR_FUTURE + delete &let_drDocu; +} + +void +ContextForAry:: +S_DocuDistributor::do_Store2CurFile( DYN Documentation & let_drDocu ) +{ + // KORR_FUTURE + delete &let_drDocu; +} + +void +ContextForAry:: +S_DocuDistributor::do_Store2CurNamespace( DYN Documentation & let_drDocu ) +{ + // KORR_FUTURE + delete &let_drDocu; +} + +void +ContextForAry:: +S_DocuDistributor::do_Store2ConnectedDeclaration( DYN Documentation & let_drDocu ) +{ + if ( pCurRe != 0 ) + pCurRe->Add_Documentation(let_drDocu); + else + pLastStoredDocu = &let_drDocu; +} + +void +ContextForAry:: +S_DocuDistributor::do_Store2Glossary( DYN Documentation & let_drDocu, + const udmstri & // i_sExplainedTerm + ) +{ + // KORR_FUTURE + delete &let_drDocu; +} + +void +ContextForAry:: +S_DocuDistributor::do_Store2GlobalTexts( DYN Documentation & 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..5b2ca10792d0 --- /dev/null +++ b/autodoc/source/parser/cpp/sfscope.hxx @@ -0,0 +1,107 @@ +/************************************************************************* + * + * $RCSfile: sfscope.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_SFSCOPE_HXX +#define ADC_CPP_SFSCOPE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cxt2ary.hxx" + // COMPONENTS + // PARAMETERS + +namespace cpp +{ + +/** Implementation struct for cpp::ContextForAry. +*/ +struct ContextForAry::S_FileScopeInfo +{ + udmstri sCurFileName; + ary::cpp::ProjectGroup * + pCurProject; + ary::cpp::FileGroup * + pCurFile; + uintt nLineCount; + Dyn<StringVector> pCurTemplateParameters; + + S_FileScopeInfo(); +}; + + +inline +ContextForAry:: +S_FileScopeInfo::S_FileScopeInfo() + : // sCurFileName, + pCurProject(0), + pCurFile(0), + nLineCount(0) + // pCurTemplateParameters +{ +} + +} // 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..9e27ee8da5e1 --- /dev/null +++ b/autodoc/source/parser/cpp/sownstck.hxx @@ -0,0 +1,348 @@ +/************************************************************************* + * + * $RCSfile: sownstck.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_SOWNSTCK_HXX +#define ADC_CPP_SOWNSTCK_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "cxt2ary.hxx" + // COMPONENTS +#include <ary/cpp/c_etypes.hxx> +#include <estack.hxx> + // PARAMETERS +#include <ary/cpp/c_namesp.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() != 0 ) + 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 ); + csv_assert( pCurEnum == 0 ); + aStack_Namespaces.pop(); + csv_assert( aStack_Namespaces.size() > 0 ); + } + SetOwner_2CurNamespace(); +} + +void +ContextForAry:: +S_OwnerStack::CloseClass() +{ + csv_assert( aStack_Classes.size() > 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..14755c810fda --- /dev/null +++ b/autodoc/source/parser/cpp/srecover.hxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * $RCSfile: srecover.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..309d185ff57e --- /dev/null +++ b/autodoc/source/parser/cpp/tkp_cpp.cxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * $RCSfile: tkp_cpp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 udmstri & i_sFileName, + const csv::ploc::DirectoryChain & i_rFileSubPath ) +{ + csv_assert(pDealer != 0); + pDealer->StartNewFile(i_sFileName, i_rFileSubPath); + + 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..6e417cbcefe6 --- /dev/null +++ b/autodoc/source/parser/cpp/tkp_cpp.hxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * $RCSfile: tkp_cpp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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< udmstri, 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 udmstri & i_sFileName, + const csv::ploc::DirectoryChain & + i_rFileSubPath ); + 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..5b3e7c956bac --- /dev/null +++ b/autodoc/source/parser/cpp/tokintpr.hxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * $RCSfile: tokintpr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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(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..616fa9e72612 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/a_rdocu.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * $RCSfile: a_rdocu.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..12e58c58c734 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/adoc_tok.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * $RCSfile: adoc_tok.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..dd9d2ac740d1 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/atokdeal.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * $RCSfile: atokdeal.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 : public virtual ::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..4f7b6ac973cc --- /dev/null +++ b/autodoc/source/parser/inc/adoc/cx_a_std.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * $RCSfile: cx_a_std.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 * pFollowUpContext; + TkpContext * pParentContext; + 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..96344a5d3682 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/cx_a_sub.hxx @@ -0,0 +1,180 @@ +/************************************************************************* + * + * $RCSfile: cx_a_sub.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..470a5116cb5e --- /dev/null +++ b/autodoc/source/parser/inc/adoc/docu_pe.hxx @@ -0,0 +1,226 @@ +/************************************************************************* + * + * $RCSfile: docu_pe.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DOCU_PE_HXX +#define ADC_DOCU_PE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <adoc/tokintpr.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ + class Documentation; + + namespace info + { + class CodeInfo; + 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_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::Documentation * + ReleaseJustParsedDocu(); + + bool IsComplete() const; + + private: + void InstallAtTag( + DYN ary::info::AtTag * + let_dpTag, + bool i_bImplicit = false ); /// True for implicit @short and @descr. + ary::info::CodeInfo & + 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::info::CodeInfo> + 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..ce11dbaf71c5 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/prs_adoc.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * $RCSfile: prs_adoc.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..68d19ebfd331 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/tk_attag.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: tk_attag.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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); + + +#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..c577872c12b9 --- /dev/null +++ b/autodoc/source/parser/inc/adoc/tk_docw.hxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * $RCSfile: tk_docw.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 + udmstri 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..f7ef085432ce --- /dev/null +++ b/autodoc/source/parser/inc/adoc/tokintpr.hxx @@ -0,0 +1,149 @@ +/************************************************************************* + * + * $RCSfile: tokintpr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_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_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..594a66721e10 --- /dev/null +++ b/autodoc/source/parser/inc/cpp/ctokdeal.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: ctokdeal.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 : public virtual ::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..aab0aa91aa1a --- /dev/null +++ b/autodoc/source/parser/inc/cpp/prs_cpp.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * $RCSfile: prs_cpp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 udmstri & i_sProjectName, + csv::ploc::Path & i_rProjectRootDirectory, + 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..b01428a6d02a --- /dev/null +++ b/autodoc/source/parser/inc/doc_deal.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * $RCSfile: doc_deal.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DOC_DEAL_HXX +#define ADC_DOC_DEAL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <tokens/tokproct.hxx> + // COMPONENTS + // PARAMETERS +#include <ary/cpp/c_etypes.hxx> + +namespace ary +{ + class Documentation; +} + + + +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::Documentation & + let_drInfo ); + private: + virtual void do_TakeDocu( + DYN ary::Documentation & + let_drInfo ) = 0; +}; + + + +// IMPLEMENTATION + +inline void +DocuDealer::TakeDocu( DYN ary::Documentation & 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..b8a8a86678c2 --- /dev/null +++ b/autodoc/source/parser/inc/semantic/callf.hxx @@ -0,0 +1,328 @@ +/************************************************************************* + * + * $RCSfile: callf.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CPP_CALLF_HXX +#define ADC_CPP_CALLF_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <cosv/template/inc_stl.hxx> + // COMPONENTS + // PARAMETERS + + + + + +/** 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 CallFunction<PE>::F_Tok F_Tok; + + PeStatus( + PE & i_rMyPE, + uintt i_nSize, + F_Tok * i_pFuncArray, + INT16 * i_pTokTypeArray, + F_Tok i_pDefault ); + ~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 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; 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..e1696fd70d4d --- /dev/null +++ b/autodoc/source/parser/inc/semantic/parseenv.hxx @@ -0,0 +1,149 @@ +/************************************************************************* + * + * $RCSfile: parseenv.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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; + void GlobalHandlingOfSyntaxError( + const char * i_sTokenText, + const char * i_sFileName, + uintt i_nLineCount ); + + 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..20dde677de6c --- /dev/null +++ b/autodoc/source/parser/inc/semantic/sub_pe.hxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * $RCSfile: sub_pe.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..8dff8ae5f997 --- /dev/null +++ b/autodoc/source/parser/inc/semantic/sub_peu.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * $RCSfile: sub_peu.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..329fa5e76319 --- /dev/null +++ b/autodoc/source/parser/inc/tokens/parseinc.hxx @@ -0,0 +1,237 @@ +/************************************************************************* + * + * $RCSfile: parseinc.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..72a857c8c1d2 --- /dev/null +++ b/autodoc/source/parser/inc/tokens/stmstarr.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: stmstarr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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(); + void SetBranches( + intt in_nStartBranchIx, + StmStatus::Branch * in_aBranchValues, + intt in_nNrofValues ); + 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..9e01626d4d7b --- /dev/null +++ b/autodoc/source/parser/inc/tokens/stmstate.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: stmstate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..e7aef86b4e6f --- /dev/null +++ b/autodoc/source/parser/inc/tokens/stmstfin.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * $RCSfile: stmstfin.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..2786046351f4 --- /dev/null +++ b/autodoc/source/parser/inc/tokens/tkp.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: tkp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..0a04bdeadcca --- /dev/null +++ b/autodoc/source/parser/inc/tokens/tkpcontx.hxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * $RCSfile: tkpcontx.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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; + + /// 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..c2dbb00b24ee --- /dev/null +++ b/autodoc/source/parser/inc/tokens/tkpstama.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * $RCSfile: tkpstama.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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(); + + + // FOR TESTS ONLY: + void PrintOut(); + + // 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..81f9df33bdc7 --- /dev/null +++ b/autodoc/source/parser/inc/tokens/tokdeal.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * $RCSfile: tokdeal.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TOKDEAL_HXX +#define ADC_TOKDEAL_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +class TokenDealer + +{ + public: + virtual ~TokenDealer() {} + + virtual void Deal_Eol() = 0; + virtual void Deal_Eof() = 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..b054f84b7239 --- /dev/null +++ b/autodoc/source/parser/inc/tokens/token.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * $RCSfile: token.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..118d4fe508f1 --- /dev/null +++ b/autodoc/source/parser/inc/tokens/tokproct.hxx @@ -0,0 +1,117 @@ +/************************************************************************* + * + * $RCSfile: tokproct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_parse.hxx b/autodoc/source/parser/inc/x_parse.hxx new file mode 100644 index 000000000000..afbd72f1a323 --- /dev/null +++ b/autodoc/source/parser/inc/x_parse.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * $RCSfile: x_parse.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_X_PARSE_HXX +#define ADC_X_PARSE_HXX + +// USED SERVICES + // BASE CLASSES +#include <autodoc/x_parsing.hxx> + // COMPONENTS + // PARAMETERS + + +class X_Parser : public autodoc::X_Parser_Ifc +{ + public: + // LIFECYCLE + X_Parser( + E_Event i_eEvent, + const char * i_sObject, + const udmstri & i_sCausingFile_FullPath, + uintt i_nCausingLineNr ); + ~X_Parser(); + // INQUIRY + virtual E_Event GetEvent() const; + virtual void GetInfo( + ostream & o_rOutputMedium ) const; + + private: + E_Event eEvent; + udmstri sObject; + udmstri 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..3350ef003b92 --- /dev/null +++ b/autodoc/source/parser/kernel/makefile.mk @@ -0,0 +1,92 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +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_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..b541fe76e14d --- /dev/null +++ b/autodoc/source/parser/kernel/parsefct.cxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: parsefct.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..0b9eda3e58fc --- /dev/null +++ b/autodoc/source/parser/kernel/parsefct.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * $RCSfile: parsefct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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_parse.cxx b/autodoc/source/parser/kernel/x_parse.cxx new file mode 100644 index 000000000000..100f98cd65cd --- /dev/null +++ b/autodoc/source/parser/kernel/x_parse.cxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: x_parse.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <x_parse.hxx> + +// NOT FULLY DECLARED SERVICES + + + +X_Parser::X_Parser( E_Event i_eEvent, + const char * i_sObject, + const udmstri & 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( 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 error."; + break; + case x_Any: + default: + o_rOutputMedium << "Unspecified parsing exception."; + } // end switch + o_rOutputMedium << Endl(); +} + + +ostream & +operator<<( 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..f3f7be8a9fdf --- /dev/null +++ b/autodoc/source/parser/semantic/makefile.mk @@ -0,0 +1,93 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +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..6627ca57d713 --- /dev/null +++ b/autodoc/source/parser/semantic/parseenv.cxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * $RCSfile: parseenv.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <semantic/parseenv.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary/info/codeinfo.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) +{ +} + +void +ParseEnvironment::GlobalHandlingOfSyntaxError( const char * i_sTokenText, + const char * i_sFileName, + uintt i_nLineCount ) +{ + throw X_Parser( X_Parser::x_UnexpectedToken, + i_sTokenText, + i_sFileName, + i_nLineCount ); +} + + + diff --git a/autodoc/source/parser/tokens/makefile.mk b/autodoc/source/parser/tokens/makefile.mk new file mode 100644 index 000000000000..730c74b435cc --- /dev/null +++ b/autodoc/source/parser/tokens/makefile.mk @@ -0,0 +1,97 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +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..e00e49dca17e --- /dev/null +++ b/autodoc/source/parser/tokens/stmstarr.cxx @@ -0,0 +1,148 @@ +/************************************************************************* + * + * $RCSfile: stmstarr.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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; +} + +void +StmArrayStatus::SetBranches( intt in_nStartBranchIx, + StmStatus::Branch * in_aBranchValues, + intt in_nNrofValues ) +{ + precond(in_nStartBranchIx >= 0); + precond(in_aBranchValues != 0); + precond( in_nNrofValues > 0 + AND in_nStartBranchIx + in_nNrofValues <= nNrOfBranches ); + + memcpy(&dpBranches[in_nStartBranchIx],in_aBranchValues,in_nNrofValues); +} + + + +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, "", udmstri::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..9b1523c7e636 --- /dev/null +++ b/autodoc/source/parser/tokens/stmstate.cxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * $RCSfile: stmstate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..2dbff7817708 --- /dev/null +++ b/autodoc/source/parser/tokens/stmstfin.cxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * $RCSfile: stmstfin.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..b2991c12e8f9 --- /dev/null +++ b/autodoc/source/parser/tokens/tkp.cxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * $RCSfile: tkp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..e74c384dc812 --- /dev/null +++ b/autodoc/source/parser/tokens/tkpcontx.cxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: tkpcontx.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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..901e8370506a --- /dev/null +++ b/autodoc/source/parser/tokens/tkpstama.cxx @@ -0,0 +1,239 @@ +/************************************************************************* + * + * $RCSfile: tkpstama.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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) +{ + precond(in_nStatusSize > 0); + precond(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(); + 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); +} + +void +StateMachine::PrintOut() +{ + const anzahl = nNrofStati; + for (int i = 0; i < anzahl; i++) + { + Cout() << i << ':'; + StmArrayStatus * pArrSt = pStati[i]->AsArray(); + if (pArrSt != 0) + { + Cout() << Endl(); + for (int b = 0; b < 128; b++) + { + Cout().width(4); + Cout() << pArrSt->NextBy(b); + if (b%16 == 15) + Cout() << Endl(); + } + } + else if (pStati[i]->AsBounds() != 0) + { + Cout() << "Bounds "; + } + else + Cout() << "Error! "; + Cout() << (pStati[i]->IsADefault() ? "DEF" : "---") + << Endl(); + } // for +} + diff --git a/autodoc/source/parser/tokens/tokdeal.cxx b/autodoc/source/parser/tokens/tokdeal.cxx new file mode 100644 index 000000000000..36474e9d28a2 --- /dev/null +++ b/autodoc/source/parser/tokens/tokdeal.cxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * $RCSfile: tokdeal.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#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 ""; +} + + + diff --git a/autodoc/source/parser_i/idl/cx_idlco.cxx b/autodoc/source/parser_i/idl/cx_idlco.cxx new file mode 100644 index 000000000000..4216275ffb2e --- /dev/null +++ b/autodoc/source/parser_i/idl/cx_idlco.cxx @@ -0,0 +1,548 @@ +/************************************************************************* + * + * $RCSfile: cx_idlco.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/cx_idlco.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/cx_sub.hxx> +#include <s2_dsapi/cx_dsapi.hxx> +#include <tools/tkpchars.hxx> +#include <tokens/tkpstam2.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tokrecv.hxx> +#include <x_parse2.hxx> + + +namespace csi +{ +namespace uidl +{ + + +const intt C_nCppInitialNrOfStati = 400; +const intt C_nStatusSize = 128; + + + +const uintt nF_fin_Error = 1; +const uintt nF_fin_Ignore = 2; +const uintt nF_fin_Identifier = 3; +const uintt nF_fin_Keyword = 4; +const uintt nF_fin_Punctuation = 5; +const uintt nF_fin_EOL = 6; +const uintt nF_fin_EOF = 7; + +const uintt nF_goto_MLDocu = 10; +const uintt nF_goto_SLDocu = 11; +const uintt nF_goto_MLComment = 12; +const uintt nF_goto_SLComment = 13; +const uintt nF_goto_Praeprocessor = 14; +const uintt nF_goto_Assignment = 15; + + + +const UINT16 nTok_bty_any = 100 + TokBuiltInType::bty_any; +const UINT16 nTok_bty_boolean = 100 + TokBuiltInType::bty_boolean; +const UINT16 nTok_bty_byte = 100 + TokBuiltInType::bty_byte; +const UINT16 nTok_bty_char = 100 + TokBuiltInType::bty_char; +const UINT16 nTok_bty_double = 100 + TokBuiltInType::bty_double; +const UINT16 nTok_bty_hyper = 100 + TokBuiltInType::bty_hyper; +const UINT16 nTok_bty_long = 100 + TokBuiltInType::bty_long; +const UINT16 nTok_bty_short = 100 + TokBuiltInType::bty_short; +const UINT16 nTok_bty_string = 100 + TokBuiltInType::bty_string; +const UINT16 nTok_bty_void = 100 + TokBuiltInType::bty_void; + +const UINT16 nTok_tmod_unsigned = 200 + TokTypeModifier::tmod_unsigned; +const UINT16 nTok_tmod_sequence = 200 + TokTypeModifier::tmod_sequence; + +const UINT16 nTok_ph_in = 250 + TokParameterHandling::ph_in; +const UINT16 nTok_ph_out = 250 + TokParameterHandling::ph_out; +const UINT16 nTok_ph_inout = 250 + TokParameterHandling::ph_inout; + +const UINT16 nTok_mt_attribute = 300 + TokMetaType::mt_attribute; +const UINT16 nTok_mt_constants = 300 + TokMetaType::mt_constants; +const UINT16 nTok_mt_enum = 300 + TokMetaType::mt_enum; +const UINT16 nTok_mt_exception = 300 + TokMetaType::mt_exception; +const UINT16 nTok_mt_ident = 300 + TokMetaType::mt_ident; +const UINT16 nTok_mt_interface = 300 + TokMetaType::mt_interface; +const UINT16 nTok_mt_module = 300 + TokMetaType::mt_module; +const UINT16 nTok_mt_property = 300 + TokMetaType::mt_property; +const UINT16 nTok_mt_service = 300 + TokMetaType::mt_service; +const UINT16 nTok_mt_struct = 300 + TokMetaType::mt_struct; +const UINT16 nTok_mt_typedef = 300 + TokMetaType::mt_typedef; +const UINT16 nTok_mt_uik = 300 + TokMetaType::mt_uik; + +const UINT16 nTok_ste_const = 400 + TokStereotype::ste_const; +const UINT16 nTok_ste_oneway = 400 + TokStereotype::ste_oneway; +const UINT16 nTok_ste_optional = 400 + TokStereotype::ste_optional; +const UINT16 nTok_ste_readonly = 400 + TokStereotype::ste_readonly; +const UINT16 nTok_ste_virtual = 400 + TokStereotype::ste_virtual; + +const UINT16 nTok_raises = 501; +const UINT16 nTok_needs = 502; +const UINT16 nTok_observes = 503; + +const UINT16 nTok_assignment = 550; + +const UINT16 nTok_ignore = 600; +const UINT16 nTok_none_MLCommentBegin = 601; +const UINT16 nTok_none_SLCommentBegin = 602; +const UINT16 nTok_none_MLDocuBegin = 603; +const UINT16 nTok_none_SLDocuBegin = 604; +const UINT16 nTok_none_PraeprocessorBegin = 605; + + +const UINT16 nTok_punct_BracketOpen = 700 + TokPunctuation::BracketOpen; +const UINT16 nTok_punct_BracketClose = 700 + TokPunctuation::BracketClose; +const UINT16 nTok_punct_ArrayBracketOpen = 700 + TokPunctuation::ArrayBracketOpen; +const UINT16 nTok_punct_ArrayBracketClose = 700 + TokPunctuation::ArrayBracketClose; +const UINT16 nTok_punct_CurledBracketOpen = 700 + TokPunctuation::CurledBracketOpen; +const UINT16 nTok_punct_CurledBracketClose = 700 + TokPunctuation::CurledBracketClose; +const UINT16 nTok_punct_Semicolon = 700 + TokPunctuation::Semicolon; +const UINT16 nTok_punct_Colon = 700 + TokPunctuation::Colon; +const UINT16 nTok_punct_DoubleColon = 700 + TokPunctuation::DoubleColon; +const UINT16 nTok_punct_Comma = 700 + TokPunctuation::Comma; +const UINT16 nTok_punct_Minus = 700 + TokPunctuation::Minus; +const UINT16 nTok_punct_Fullstop = 700 + TokPunctuation::Fullstop; + +const UINT16 nTok_EOL = 801; +const UINT16 nTok_EOF = 802; + + + +Context_UidlCode::Context_UidlCode( Token_Receiver & o_rReceiver, + DYN TkpDocuContext & let_drContext_Docu ) + : aStateMachine(C_nStatusSize,C_nCppInitialNrOfStati), + pReceiver(&o_rReceiver), + pDocuContext(&let_drContext_Docu), + dpContext_MLComment(new Context_MLComment(o_rReceiver,*this)), + dpContext_SLComment(new Context_SLComment(o_rReceiver,*this)), + dpContext_Preprocessor(new Context_Praeprocessor(o_rReceiver,*this)), + dpContext_Assignment(new Context_Assignment(o_rReceiver,*this)), + pNewToken(0), + pFollowUpContext(0) +{ + pDocuContext->SetParentContext(*this,"*/"); + SetupStateMachine(); +} + +Context_UidlCode::~Context_UidlCode() +{ +} + +void +Context_UidlCode::ReadCharChain( CharacterSource & io_rText ) +{ + pNewToken = 0; + + UINT16 nTokenId = 0; + StmBoundsStatu2 & rBound = aStateMachine.GetCharChain(nTokenId, 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(), nTokenId, io_rText); +} + +bool +Context_UidlCode::PassNewToken() +{ + if (pNewToken) + { + pReceiver->Receive(*pNewToken.Release()); + return true; + } + return false; +} + +TkpContext & +Context_UidlCode::FollowUpContext() +{ + csv_assert(pFollowUpContext != 0); + return *pFollowUpContext; +} + +void +Context_UidlCode::PerformStatusFunction( uintt i_nStatusSignal, + UINT16 i_nTokenId, + CharacterSource & io_rText ) +{ + switch (i_nStatusSignal) + { + case nF_fin_Error: + // KORR + throw X_AutodocParser(X_AutodocParser::x_InvalidChar); + break; + case nF_fin_Ignore: + pNewToken = 0; + io_rText.CutToken(); + break; + case nF_fin_Identifier: + pNewToken = new TokIdentifier(io_rText.CutToken()); + break; + case nF_fin_Keyword: + io_rText.CutToken(); + switch ( i_nTokenId / 50 ) + { + case 2: + pNewToken = new TokBuiltInType(i_nTokenId - 100); + break; + case 4: + pNewToken = new TokTypeModifier(i_nTokenId - 200); + break; + case 5: + pNewToken = new TokParameterHandling(i_nTokenId - 250); + break; + case 6: + pNewToken = new TokMetaType(i_nTokenId - 300); + break; + case 8: + pNewToken = new TokStereotype(i_nTokenId - 400); + break; + case 10: + switch (i_nTokenId-500) + { + case 1: + pNewToken = new TokRaises; + break; + case 2: + pNewToken = new TokNeeds; + break; + case 3: + pNewToken = new TokObserves; + break; + default: + csv_assert(false); + } + break; + default: + csv_assert(false); + } // end switch ( i_nTokenId / 50 ) + break; + case nF_fin_Punctuation: + io_rText.CutToken(); + if (i_nTokenId == nTok_punct_DoubleColon) + pNewToken = new TokNameSeparator; + else + pNewToken = new TokPunctuation(i_nTokenId - 700); + break; + case nF_fin_EOL: + io_rText.CutToken(); + pNewToken = new Tok_EOL; + break; + case nF_fin_EOF: + pNewToken = new Tok_EOF; + break; + case nF_goto_MLDocu: + while ( io_rText.CurChar() == '*') + io_rText.MoveOn(); + io_rText.CutToken(); + pDocuContext->SetMode_IsMultiLine(true); + break; + case nF_goto_SLDocu: + io_rText.CutToken(); + pDocuContext->SetMode_IsMultiLine(false); + break; + case nF_goto_MLComment: + break; + case nF_goto_SLComment: + break; + case nF_goto_Praeprocessor: + break; + case nF_goto_Assignment: + break; + default: + csv_assert(false); + } // end switch (i_nStatusSignal) +} + +void +Context_UidlCode::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 finErr = 3; + const INT16 finIgn = 4; + const INT16 finBez = 5; + const INT16 finKeyw = 6; + const INT16 finPunct = 7; + const INT16 finEOL = 8; + const INT16 finEOF = 9; + + // Kontextwechsel-Stati: + const INT16 gotoMld = 10; + const INT16 gotoSld = 11; + const INT16 gotoMlc = 12; + const INT16 gotoSlc = 13; + const INT16 gotoPrp = 14; + const INT16 gotoAsg = 15; + + // Konstanten zur Benutzung in der Tabelle: + const INT16 err = finErr; + const INT16 fbz = finBez; + const INT16 fig = finIgn; + const INT16 fof = finEOF; + const INT16 fkw = finKeyw; + const INT16 fpc = finPunct; + + /// Die '0'en werden spaeter durch AddToken() ersetzt. + + 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,err,wht, 0,err,err,err,err, 0, 0,err,err, 0, 0, 0,err, + bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,err,err,err,err,err,err, // 48 ... + err,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,err, 0,err,bez, // 80 ... + err,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,err, 0,err,err, // 112 ... + }; + + 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,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, // 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 // 112 ... + }; + + 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 // 112 ... + }; + + 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 ... + }; + + const INT16 A_nKeywordDefStatus[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 // 112 ... + }; + + DYN StmArrayStatu2 * dpStatusTop + = new StmArrayStatu2( C_nStatusSize, A_nTopStatus, 0, true); + DYN StmArrayStatu2 * dpStatusWhite + = new StmArrayStatu2( C_nStatusSize, A_nWhitespaceStatus, 0, true); + DYN StmArrayStatu2 * dpStatusBez + = new StmArrayStatu2( C_nStatusSize, A_nBezeichnerStatus, 0, true); + + DYN StmBoundsStatu2 * dpBst_finErr + = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_Error, true ); + DYN StmBoundsStatu2 * dpBst_finIgn + = new StmBoundsStatu2( *this, *this, nF_fin_Ignore, true ); + DYN StmBoundsStatu2 * dpBst_finBez + = new StmBoundsStatu2( *this, *this, nF_fin_Identifier, true ); + DYN StmBoundsStatu2 * dpBst_finKeyw + = new StmBoundsStatu2( *this, *this, nF_fin_Keyword, false ); + DYN StmBoundsStatu2 * dpBst_finPunct + = new StmBoundsStatu2( *this, *this, nF_fin_Punctuation, false ); + DYN StmBoundsStatu2 * dpBst_finEOL + = new StmBoundsStatu2( *this, *this, nF_fin_EOL, false ); + DYN StmBoundsStatu2 * dpBst_finEOF + = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_EOF, false ); + + DYN StmBoundsStatu2 * dpBst_gotoMld + = new StmBoundsStatu2( *this, *pDocuContext, nF_goto_MLDocu, false ); + DYN StmBoundsStatu2 * dpBst_gotoSld + = new StmBoundsStatu2( *this, *pDocuContext, nF_goto_SLDocu, false ); + DYN StmBoundsStatu2 * dpBst_gotoMlc + = new StmBoundsStatu2( *this, *dpContext_MLComment, nF_goto_MLComment, false ); + DYN StmBoundsStatu2 * dpBst_gotoSlc + = new StmBoundsStatu2( *this, *dpContext_SLComment, nF_goto_SLComment, false ); + DYN StmBoundsStatu2 * dpBst_gotoPrp + = new StmBoundsStatu2( *this, *dpContext_Preprocessor, nF_goto_Praeprocessor, false ); + DYN StmBoundsStatu2 * dpBst_gotoAsg + = new StmBoundsStatu2( *this, *dpContext_Assignment, nF_goto_Assignment, false ); + + // dpMain aufbauen: + aStateMachine.AddStatus(dpStatusTop); + + aStateMachine.AddStatus(dpStatusWhite); + aStateMachine.AddStatus(dpStatusBez); + + aStateMachine.AddStatus(dpBst_finErr); + aStateMachine.AddStatus(dpBst_finIgn); + aStateMachine.AddStatus(dpBst_finBez); + aStateMachine.AddStatus(dpBst_finKeyw); + aStateMachine.AddStatus(dpBst_finPunct); + aStateMachine.AddStatus(dpBst_finEOL); + aStateMachine.AddStatus(dpBst_finEOF); + + aStateMachine.AddStatus(dpBst_gotoMld); + aStateMachine.AddStatus(dpBst_gotoSld); + aStateMachine.AddStatus(dpBst_gotoMlc); + aStateMachine.AddStatus(dpBst_gotoSlc); + aStateMachine.AddStatus(dpBst_gotoPrp); + aStateMachine.AddStatus(dpBst_gotoAsg); + + aStateMachine.AddToken("any", nTok_bty_any, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("attribute", nTok_mt_attribute, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("boolean", nTok_bty_boolean, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("byte", nTok_bty_byte, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("char", nTok_bty_char, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("const", nTok_ste_const, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("constants", nTok_mt_constants, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("double", nTok_bty_double, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("enum", nTok_mt_enum, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("exception", nTok_mt_exception, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("hyper", nTok_bty_hyper, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("ident", nTok_mt_ident, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("in", nTok_ph_in, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("inout", nTok_ph_inout, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("interface", nTok_mt_interface, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("long", nTok_bty_long, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("module", nTok_mt_module, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("needs", nTok_needs, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("observes", nTok_observes, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("oneway", nTok_ste_oneway, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("optional", nTok_ste_optional, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("out", nTok_ph_out, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("property", nTok_mt_property, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("raises", nTok_raises, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("readonly", nTok_ste_readonly, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("sequence", nTok_tmod_sequence, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("service", nTok_mt_service, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("short", nTok_bty_short, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("string", nTok_bty_string, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("struct", nTok_mt_struct, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("typedef", nTok_mt_typedef, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("uik", nTok_mt_uik, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("unsigned", nTok_tmod_unsigned, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("virtual", nTok_ste_virtual, A_nKeywordDefStatus, finKeyw); + aStateMachine.AddToken("void", nTok_bty_void, A_nKeywordDefStatus, finKeyw); + + aStateMachine.AddToken("=", nTok_assignment, A_nPunctDefStatus, gotoAsg); + + aStateMachine.AddToken("(", nTok_punct_BracketOpen, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken(")", nTok_punct_BracketClose,A_nPunctDefStatus, finPunct); + aStateMachine.AddToken("[", nTok_punct_ArrayBracketOpen, + A_nPunctDefStatus, finIgn); + aStateMachine.AddToken("]", nTok_punct_ArrayBracketClose, + A_nPunctDefStatus, finIgn); + aStateMachine.AddToken("{", nTok_punct_CurledBracketOpen, + A_nPunctDefStatus, finPunct); + aStateMachine.AddToken("}", nTok_punct_CurledBracketClose, + A_nPunctDefStatus, finPunct); + aStateMachine.AddToken("<", 0, A_nPunctDefStatus, finIgn); + aStateMachine.AddToken(">", 0, A_nPunctDefStatus, finIgn); + aStateMachine.AddToken(";", nTok_punct_Semicolon, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken(":", nTok_punct_Colon, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken("::", nTok_punct_DoubleColon, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken(",", nTok_punct_Comma, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken("-", nTok_punct_Minus, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken(".", nTok_punct_Fullstop, A_nPunctDefStatus, finPunct); + aStateMachine.AddToken("/**", nTok_none_MLDocuBegin, A_nPunctDefStatus, gotoMld); + aStateMachine.AddToken("///", nTok_none_SLDocuBegin, A_nPunctDefStatus, gotoSld); + aStateMachine.AddToken("/*", nTok_none_MLCommentBegin, + A_nPunctDefStatus, gotoMlc); + aStateMachine.AddToken("//", nTok_none_SLCommentBegin, + A_nPunctDefStatus, gotoSlc); + aStateMachine.AddToken("/**/", nTok_ignore, A_nPunctDefStatus, finIgn); + aStateMachine.AddToken("#", nTok_none_PraeprocessorBegin, + A_nPunctDefStatus, gotoPrp); + aStateMachine.AddToken("\r\n", nTok_EOL, A_nPunctDefStatus, finEOL); + aStateMachine.AddToken("\r", nTok_EOL, A_nPunctDefStatus, finEOL); + aStateMachine.AddToken("\n", nTok_EOL, A_nPunctDefStatus, finEOL); + aStateMachine.AddToken("\n\r", nTok_EOL, A_nPunctDefStatus, finEOL); +}; + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/cx_sub.cxx b/autodoc/source/parser_i/idl/cx_sub.cxx new file mode 100644 index 000000000000..65d2b717f271 --- /dev/null +++ b/autodoc/source/parser_i/idl/cx_sub.cxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * $RCSfile: cx_sub.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/cx_sub.hxx> + + + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/tokrecv.hxx> +#include <../../parser/inc/tokens/parseinc.hxx> +#include <x_parse2.hxx> +#include <s2_luidl/tk_const.hxx> + + + +namespace csi +{ +namespace uidl +{ + +bool +Cx_Base::PassNewToken() +{ + if (pNewToken) + { + rReceiver.Receive(*pNewToken.Release()); + return true; + } + return false; +} + +TkpContext & +Cx_Base::FollowUpContext() +{ + csv_assert(pFollowUpContext != 0); + return *pFollowUpContext; +} + +void +Context_MLComment::ReadCharChain( CharacterSource & io_rText ) +{ + char cNext = NULCH; + + do { + if ( jumpTo(io_rText,'*') == NULCH ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + + cNext = jumpOver(io_rText,'*'); + if (cNext == NULCH) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + } while (cNext != '/'); + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(0); +} + +void +Context_SLComment::ReadCharChain( CharacterSource & io_rText ) +{ + jumpToEol(io_rText); + if (io_rText.CurChar() != NULCH) + jumpOverEol(io_rText); + io_rText.CutToken(); + SetToken(0); +} + +void +Context_Praeprocessor::ReadCharChain( CharacterSource & io_rText ) +{ + jumpToEol(io_rText); + if (io_rText.CurChar() != NULCH) + jumpOverEol(io_rText); + io_rText.CutToken(); + SetToken(0); +} + +void +Context_Assignment::ReadCharChain( CharacterSource & io_rText ) +{ + char cNext = NULCH; + do { + if ( (cNext = jumpTo(io_rText,';',',','"','}')) == NULCH ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + if (cNext == '"') + { + cNext = io_rText.MoveOn(); + while (cNext != '"') + { + if ( (cNext = jumpTo(io_rText,'"','\\')) == NULCH ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + if (cNext == '\\') + io_rText.MoveOn(); + } + cNext = io_rText.MoveOn(); + } // endif (cNext == '"') + } while (cNext != ';' AND cNext != ',' AND cNext != '}'); + + if (cNext == ',' OR cNext == ';') + io_rText.MoveOn(); + SetToken(new TokAssignment(io_rText.CutToken())); +} + + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/distrib.cxx b/autodoc/source/parser_i/idl/distrib.cxx new file mode 100644 index 000000000000..dc859458783c --- /dev/null +++ b/autodoc/source/parser_i/idl/distrib.cxx @@ -0,0 +1,271 @@ +/************************************************************************* + * + * $RCSfile: distrib.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/distrib.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/tkp_uidl.hxx> +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_dsapi/docu_pe2.hxx> +#include <adc_cl.hxx> +#include <x_parse2.hxx> + + + +const uintt C_nNO_TRY = uintt(-1); + + +namespace csi +{ +namespace uidl +{ + +TokenDistributor::TokenDistributor( ary::Repository & io_rRepository ) + : pTokenSource(0), + aProcessingData( io_rRepository, aDocumentation ) + // aDocumentation +{ +} + +TokenDistributor::~TokenDistributor() +{ +} + +void +TokenDistributor::TradeToken() +{ + bool bGoon = true; + while (bGoon AND NOT aProcessingData.NextTokenExists()) + { + bGoon = pTokenSource->GetNextToken(); + } + if (bGoon) + aProcessingData.ProcessCurToken(); +} + +TokenDistributor::ProcessingData::ProcessingData( ary::Repository & io_rRepository, + Documentation & i_rDocuProcessor ) + : // aEnvironments + // aTokenQueue + // itCurToken + // aCurResult; + nTryCount(0), + bFinished(false), + rRepository(io_rRepository), + pDocuProcessor(&i_rDocuProcessor) +{ + itCurToken = aTokenQueue.end(); +} + +TokenDistributor::ProcessingData::~ProcessingData() +{ +} + +void +TokenDistributor::ProcessingData::SetTopParseEnvironment( UnoIDL_PE & io_pTopParseEnvironment ) +{ + csv::erase_container(aEnvironments); + aEnvironments.push_back( EnvironmentInfo( &io_pTopParseEnvironment, 0 ) ); + io_pTopParseEnvironment.EstablishContacts(0,rRepository,aCurResult); +} + +void +TokenDistributor::ProcessingData::Receive( DYN csi::uidl::Token & let_drToken ) +{ + aTokenQueue.push_back( &let_drToken ); + itCurToken = aTokenQueue.end()-1; +} + +void +TokenDistributor::ProcessingData::ProcessCurToken() +{ + +if (DEBUG_ShowTokens()) +{ + Cout() << (*itCurToken)->Text() << Endl(); +} + + aCurResult.reset(); + CurEnvironment().ProcessToken( CurToken() ); + AcknowledgeResult(); +} + + +UnoIDL_PE & +TokenDistributor::ProcessingData::CurEnvironment() const +{ + csv_assert(aEnvironments.size() > 0); + csv_assert(aEnvironments.back().first != 0); + + return *aEnvironments.back().first; +} + +bool +TokenDistributor::ProcessingData::NextTokenExists() const +{ + return itCurToken != aTokenQueue.end(); +} + +void +TokenDistributor::ProcessingData::AcknowledgeResult() +{ + if (aCurResult.eDone == done) + ++itCurToken; + + switch ( aCurResult.eStackAction ) + { + case stay: + if (aCurResult.eDone != done) + { + csv_assert(false); + } + break; + case push_sure: + CurEnv().Leave(push_sure); + aEnvironments.push_back( EnvironmentInfo(&PushEnv(), C_nNO_TRY) ); + PushEnv().Enter(push_sure); + PushEnv().SetDocu(pDocuProcessor->ReleaseLastParsedDocu()); + break; + case push_try: + Cout() << "TestInfo: Environment tried." << Endl(); + CurEnv().Leave(push_try); + aEnvironments.push_back( EnvironmentInfo(&PushEnv(), CurTokenPosition()) ); + nTryCount++; + PushEnv().Enter(push_try); + break; + case pop_success: + CurEnv().Leave(pop_success); + if ( CurEnv_TriedTokenPosition() > 0 ) + DecrementTryCount(); + aEnvironments.pop_back(); + CurEnv().Enter(pop_success); + break; + case pop_failure: + { + CurEnv().Leave(pop_failure); + if (aCurResult.eDone == done) + { + csv_assert(false); + } + + if ( CurEnv_TriedTokenPosition() == C_nNO_TRY ) + throw X_AutodocParser( X_AutodocParser::x_UnexpectedToken, (*itCurToken)->Text() ); + + itCurToken = aTokenQueue.begin() + CurEnv_TriedTokenPosition(); + DecrementTryCount(); + aEnvironments.pop_back(); + CurEnv().Enter(pop_failure); + } break; + default: + csv_assert(false); + } // end switch(aCurResult.eStackAction) +} + +void +TokenDistributor::ProcessingData::DecrementTryCount() +{ + nTryCount--; + if (nTryCount == 0) + { + aTokenQueue.erase(aTokenQueue.begin(), itCurToken); + itCurToken = aTokenQueue.begin(); + } +} + +TokenDistributor:: +Documentation::Documentation() + : pDocuParseEnv(new csi::dsapi::SapiDocu_PE), + pMostRecentDocu(0), + bIsPassedFirstDocu(false) +{ +} + +TokenDistributor:: +Documentation::~Documentation() +{ +} + +void +TokenDistributor:: +Documentation::Receive( DYN csi::dsapi::Token & let_drToken ) +{ + csv_assert(pDocuParseEnv); + + pDocuParseEnv->ProcessToken(let_drToken); + if ( pDocuParseEnv->IsComplete() ) + { + pMostRecentDocu = pDocuParseEnv->ReleaseJustParsedDocu(); + if (NOT bIsPassedFirstDocu) + { + pMostRecentDocu = 0; // Deletes the most recent docu. + bIsPassedFirstDocu = true; + } + } +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/makefile.mk b/autodoc/source/parser_i/idl/makefile.mk new file mode 100644 index 000000000000..20dcb4539d26 --- /dev/null +++ b/autodoc/source/parser_i/idl/makefile.mk @@ -0,0 +1,117 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=parser2_s2_luidl + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/cx_idlco.obj \ + $(OBJ)$/cx_sub.obj \ + $(OBJ)$/distrib.obj \ + $(OBJ)$/parsenv2.obj \ + $(OBJ)$/pe_attri.obj \ + $(OBJ)$/pe_const.obj \ + $(OBJ)$/pe_enum2.obj \ + $(OBJ)$/pe_evalu.obj \ + $(OBJ)$/pe_excp.obj \ + $(OBJ)$/pe_file2.obj \ + $(OBJ)$/pe_func2.obj \ + $(OBJ)$/pe_iface.obj \ + $(OBJ)$/pe_selem.obj \ + $(OBJ)$/pe_servi.obj \ + $(OBJ)$/pe_struc.obj \ + $(OBJ)$/pe_tydf2.obj \ + $(OBJ)$/pe_type2.obj \ + $(OBJ)$/pe_vari2.obj \ + $(OBJ)$/pestate.obj \ + $(OBJ)$/semnode.obj \ + $(OBJ)$/tk_const.obj \ + $(OBJ)$/tk_ident.obj \ + $(OBJ)$/tk_keyw.obj \ + $(OBJ)$/tk_punct.obj \ + $(OBJ)$/tkp_uidl.obj \ + $(OBJ)$/unoidl.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/parser_i/idl/parsenv2.cxx b/autodoc/source/parser_i/idl/parsenv2.cxx new file mode 100644 index 000000000000..646bc8cc3b68 --- /dev/null +++ b/autodoc/source/parser_i/idl/parsenv2.cxx @@ -0,0 +1,195 @@ +/************************************************************************* + * + * $RCSfile: parsenv2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/uidl_tok.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/uidl/gate.hxx> +#include <ary_i/codeinf2.hxx> + + + + +namespace csi +{ +namespace uidl +{ + + +UnoIDL_PE::~UnoIDL_PE() +{ +} + +void +UnoIDL_PE::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + aMyNode.EstablishContacts(io_pParentPE, io_rRepository, o_rResult); +} + +void +UnoIDL_PE::Enter( E_EnvStackAction i_eWayOfEntering ) +{ + switch (i_eWayOfEntering) + { + case push_sure: + InitData(); + break; + case push_try: + csv_assert(false); + break; + case pop_success: + ReceiveData(); + break; + case pop_failure: + csv_assert(false); + break; + default: + csv_assert(false); + } // end switch +} + +void +UnoIDL_PE::Leave( E_EnvStackAction i_eWayOfLeaving ) +{ + switch (i_eWayOfLeaving) + { + case push_sure: + break; + case push_try: + csv_assert(false); + break; + case pop_success: + TransferData(); + break; + case pop_failure: + csv_assert(false); + break; + default: + csv_assert(false); + } // end switch +} + +void +UnoIDL_PE::SetOptional() +{ + if (NOT pDocu) + { + Cout() << "OPTIONAL without documentation found (no dysfunction, just info)." << Endl(); + pDocu = new ary::info::CodeInformation; + } + + pDocu->SetOptional(); +} + +void +UnoIDL_PE::PassDocuAt( ary::Cei i_nCeId ) +{ + if (pDocu) + { + ary::CodeEntity2 * pCe = Gate().FindCe(i_nCeId); + csv_assert(pCe != 0); + pCe->SetDocu(*pDocu.Release()); + } +} + +void +UnoIDL_PE::InitData() +{ + // Needs not anything to do. +} + +void +UnoIDL_PE::ReceiveData() +{ + // Needs not anything to do. +} + +ary::uidl::CeNamespace & +UnoIDL_PE::CurNamespace() const +{ + if ( Parent() != 0 ) + return Parent()->CurNamespace(); + else + { + csv_assert(false); + return *(ary::uidl::CeNamespace*)0; + } +} + +ary::Cei +UnoIDL_PE::MatchingNamespace( const QuName & i_rQualification ) +{ + if (i_rQualification.IsQualified()) + return Gate().CheckInModule(i_rQualification).Id(); + else + return CurNamespace().Id(); +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_attri.cxx b/autodoc/source/parser_i/idl/pe_attri.cxx new file mode 100644 index 000000000000..f7b056ea5bf7 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_attri.cxx @@ -0,0 +1,246 @@ +/************************************************************************* + * + * $RCSfile: pe_attri.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_attri.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_vari2.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <csi/l_uidl/attrib.hxx> + + + +namespace csi +{ +namespace uidl +{ + + + +PE_Attribute::PE_Attribute( RAttribute & o_rResult, + const RInterface & i_rCurInterface ) + : eState(e_none), + pData(0), + pResult(&o_rResult), + pCurInterface(&i_rCurInterface), + pPE_Variable(0), + aCurParsedType(0), + sCurParsedName(""), + bIsOptional(false), + bIsReadonly(false) +{ + pPE_Variable = new PE_Variable(aCurParsedType, sCurParsedName); +} + +void +PE_Attribute::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Variable->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Attribute::~PE_Attribute() +{ +} + +void +PE_Attribute::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Attribute::Process_Stereotype( const TokStereotype & i_rToken ) +{ + if (i_rToken.Id() == TokStereotype::ste_readonly) + { + pData->Data().bReadonly = true; + SetResult(done, stay); + return; + } + else if (i_rToken.Id() == TokStereotype::ste_optional) + { + bIsOptional = true; + SetResult(done, stay); + return; + } + + SetResult(not_done, pop_failure); + eState = e_none; +} + +void +PE_Attribute::Process_MetaType( const TokMetaType & i_rToken ) +{ + if (eState == e_start) + { + if ( i_rToken.Id() == TokMetaType::mt_attribute OR + i_rToken.Id() == TokMetaType::mt_property ) + { + SetResult(done, stay); + eState = expect_variable; + return; + } + } + + SetResult(not_done, pop_failure); + eState = e_none; +} + +void +PE_Attribute::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + switch (eState) + { + case e_start: + SetResult(done, stay); + break; + case expect_variable: + if (i_rToken.Id() == TokPunctuation::Semicolon) + { + SetResult(done, pop_success); + eState = e_none; + } + else if (i_rToken.Id() == TokPunctuation::Comma) + SetResult(done, stay); + else + SetResult(not_done, pop_failure); + break; + default: + csv_assert(false); + } +} + +void +PE_Attribute::Process_Default() +{ + if (eState == expect_variable) + { + SetResult(not_done, push_sure, pPE_Variable.Ptr()); + eState = in_variable; + } + else + SetResult(not_done, pop_failure); +} + +void +PE_Attribute::InitData() +{ + eState = e_start; + + pData = new Attribute; + *pResult = 0; + aCurParsedType = 0; + sCurParsedName = ""; + + // bIsOptional may be preset by the PE_Service-parent with PresetOptional() + // - therefore it must not be set here! +} + +void +PE_Attribute::TransferData() +{ + if (bIsOptional) + { + SetOptional(); + bIsOptional = false; + } + if (bIsReadonly) + { + pData->Data().bReadonly = true; + bIsReadonly = false; + } + + *pResult = Gate().Store_Attribute( pCurInterface->Id(), *pData ); + PassDocuAt(pResult->Id()); + + pData = 0; + + eState = e_none; +} + +void +PE_Attribute::ReceiveData() +{ + pData->Data().pType = aCurParsedType; + pData->Data().sName = sCurParsedName; + eState = expect_variable; +} + + +UnoIDL_PE & +PE_Attribute::MyPE() +{ + return *this; +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_const.cxx b/autodoc/source/parser_i/idl/pe_const.cxx new file mode 100644 index 000000000000..8c7d0ee6ce33 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_const.cxx @@ -0,0 +1,312 @@ +/************************************************************************* + * + * $RCSfile: pe_const.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_const.hxx> + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/pe_evalu.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <csi/l_uidl/constant.hxx> +#include <ary_i/uidl/gate.hxx> + + +namespace csi +{ +namespace uidl +{ + + +#ifdef DF +#undef DF +#endif +#define DF PE_Constant::On_Default + +PE_Constant::F_TOK +PE_Constant::aDispatcher[PE_Constant::e_STATES_MAX][PE_Constant::tt_MAX] = + { { DF, DF, DF }, // e_none + { DF, On_expect_name_Identifier, + DF }, // expect_name + { DF, DF, On_expect_curl_bracket_open_Punctuation }, // expect_curl_bracket_open + { On_expect_const_Stereotype, + DF, On_expect_const_Punctuation }, // expect_const + { DF, On_expect_value_Identifier, + DF }, // expect_value + { DF, DF, On_expect_finish_Punctuation } // expect_finish + }; + + + +inline void +PE_Constant::CallHandler( const char * i_sTokenText, + E_TokenType i_eTokenType ) + { (this->*aDispatcher[eState][i_eTokenType])(i_sTokenText); } + + + + +PE_Constant::PE_Constant() + : eState(e_none), + pData(0), + pPE_Type(0), + pType(0), + pPE_Value(0) + // sName + // sAssignment +{ + pPE_Type = new PE_Type(pType); + pPE_Value = new PE_Value(sName, sAssignment,true); +} + +void +PE_Constant::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Value->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Constant::~PE_Constant() +{ +} + +void +PE_Constant::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Constant::Process_Identifier( const TokIdentifier & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_identifier); +} + +void +PE_Constant::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_punctuation); +} + +void +PE_Constant::Process_Stereotype( const TokStereotype & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_stereotype); +} + +void +PE_Constant::On_expect_name_Identifier(const char * i_sText) +{ + sName = i_sText; + + SetResult(done,stay); + eState = expect_curl_bracket_open; +} + +void +PE_Constant::On_expect_curl_bracket_open_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == '{') + { + pData = new ConstantsGroup; + pData->sName = sName; + nDataId = Gate().Store_ConstantsGroup(CurNamespace().Id(),*pData).Id(); + PassDocuAt(nDataId); + + SetResult(done,stay); + eState = expect_const; + } + else + { + On_Default(i_sText); + } +} + +void +PE_Constant::On_expect_const_Stereotype(const char * i_sText) +{ + SetResult( done, push_sure, pPE_Type.Ptr() ); +} + +void +PE_Constant::On_expect_const_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == '}') + { + SetResult(done,stay); + eState = expect_finish; + } + else + { + On_Default(i_sText); + } +} + +void +PE_Constant::On_expect_value_Identifier(const char * i_sText) +{ + SetResult( not_done, push_sure, pPE_Value.Ptr() ); +} + +void +PE_Constant::On_expect_finish_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == ';') + { + SetResult(done,pop_success); + eState = e_none; + } + else + { + On_Default(i_sText); + } +} + +void +PE_Constant::On_Default(const char * ) +{ + SetResult(not_done,pop_failure); + eState = e_none; +} + +void +PE_Constant::EmptySingleConstData() +{ + pType = 0; + sName = ""; + sAssignment = ""; +} + +void +PE_Constant::CreateSingleConstant() +{ + Constant * dpConst = new Constant; + + dpConst->Data().sName = sName; + dpConst->Data().sValue = sAssignment; + dpConst->Data().pType = pType; + + ary::Cei nId = Gate().Store_Constant( nDataId, *dpConst ).Id(); + pPE_Type->PassDocuAt(nId); + + pData->aConstants.push_back(nId); +} + +void +PE_Constant::InitData() +{ + eState = expect_name; + + pData = 0; + nDataId = 0; + + EmptySingleConstData(); +} + +void +PE_Constant::ReceiveData() +{ + switch (eState) + { + case expect_const: + eState = expect_value; + break; + case expect_value: + { + if (sName.length() == 0 OR sAssignment.length() == 0 OR NOT pType) + { + Cerr() << "Constant without value found." << Endl(); + eState = expect_const; + break; + } + + CreateSingleConstant(); + EmptySingleConstData(); + eState = expect_const; + } break; + default: + SetResult(not_done, pop_failure); + eState = e_none; + } // end switch +} + +void +PE_Constant::TransferData() +{ + csv_assert(pData != 0); + eState = e_none; +} + +UnoIDL_PE & +PE_Constant::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_enum2.cxx b/autodoc/source/parser_i/idl/pe_enum2.cxx new file mode 100644 index 000000000000..8711cd2663cc --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_enum2.cxx @@ -0,0 +1,289 @@ +/************************************************************************* + * + * $RCSfile: pe_enum2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_enum2.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_evalu.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <csi/l_uidl/enum.hxx> +#include <csi/l_uidl/enumvalu.hxx> +#include <ary_i/uidl/gate.hxx> + + +namespace csi +{ +namespace uidl +{ + + +#ifdef DF +#undef DF +#endif +#define DF PE_Enum::On_Default + +PE_Enum::F_TOK +PE_Enum::aDispatcher[PE_Enum::e_STATES_MAX][PE_Enum::tt_MAX] = + { { DF, DF }, // e_none + { On_expect_name_Identifier, + DF }, // expect_name + { DF, On_expect_curl_bracket_open_Punctuation }, // expect_curl_bracket_open + { On_expect_value_Identifier, + On_expect_value_Punctuation }, // expect_value + { DF, On_expect_finish_Punctuation } // expect_finish + }; + + + +inline void +PE_Enum::CallHandler( const char * i_sTokenText, + E_TokenType i_eTokenType ) + { (this->*aDispatcher[eState][i_eTokenType])(i_sTokenText); } + + + + +PE_Enum::PE_Enum() + : eState(e_none), + pData(0), + pPE_Value(0) + // sName + // sAssignment +{ + pPE_Value = new PE_Value(sName, sAssignment, false); +} + +void +PE_Enum::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Value->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Enum::~PE_Enum() +{ +} + +void +PE_Enum::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Enum::Process_Identifier( const TokIdentifier & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_identifier); +} + +void +PE_Enum::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_punctuation); +} + +void +PE_Enum::On_expect_name_Identifier(const char * i_sText) +{ + sName = i_sText; + + SetResult(done,stay); + eState = expect_curl_bracket_open; +} + +void +PE_Enum::On_expect_curl_bracket_open_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == '{') + { + pData = new Enum; + pData->Data().sName = sName; + nDataId = Gate().Store_Enum(CurNamespace().Id(),*pData).Id(); + PassDocuAt(nDataId); + + SetResult(done,stay); + eState = expect_value; + } + else + { + On_Default(i_sText); + } +} + +void +PE_Enum::On_expect_value_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == '}' ) + { + SetResult(done,stay); + eState = expect_finish; + } + else + { + On_Default(i_sText); + } +} + +void +PE_Enum::On_expect_value_Identifier(const char * i_sText) +{ + SetResult( not_done, push_sure, pPE_Value.Ptr() ); +} + +void +PE_Enum::On_expect_finish_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == ';') + { + SetResult(done,pop_success); + eState = e_none; + } + else + { + On_Default(i_sText); + } +} + +void +PE_Enum::On_Default(const char * ) +{ + SetResult(not_done,pop_failure); + eState = e_none; +} + +void +PE_Enum::EmptySingleValueData() +{ + sName = ""; + sAssignment = ""; +} + +void +PE_Enum::CreateSingleValue() +{ + DYN EnumValue * dpValue = new EnumValue; + + dpValue->Data().sName = sName; + dpValue->Data().sValue = sAssignment; + + ary::Cei nId = Gate().Store_EnumValue( nDataId, *dpValue ).Id(); + pPE_Value->PassDocuAt(nId); + + pData->Data().aValues.push_back(nId); +} + +void +PE_Enum::InitData() +{ + eState = expect_name; + + pData = 0; + nDataId = 0; + + EmptySingleValueData(); +} + +void +PE_Enum::ReceiveData() +{ + switch (eState) + { + case expect_value: + { + if (sName.length() == 0) + { + On_Default(""); + break; + } + + CreateSingleValue(); + EmptySingleValueData(); + } break; + default: + SetResult(not_done, pop_failure); + eState = e_none; + } // end switch +} + +void +PE_Enum::TransferData() +{ + csv_assert(pData != 0); + eState = e_none; +} + +UnoIDL_PE & +PE_Enum::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_evalu.cxx b/autodoc/source/parser_i/idl/pe_evalu.cxx new file mode 100644 index 000000000000..0f6922a2e821 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_evalu.cxx @@ -0,0 +1,213 @@ +/************************************************************************* + * + * $RCSfile: pe_evalu.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_evalu.hxx> + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tk_const.hxx> + + +namespace csi +{ +namespace uidl +{ + + +#ifdef DF +#undef DF +#endif +#define DF PE_Value::On_Default + +PE_Value::F_TOK +PE_Value::aDispatcher[PE_Value::e_STATES_MAX][PE_Value::tt_MAX] = + { { DF, DF, DF }, // e_none + { On_expect_name_Identifier, + DF, DF }, // expect_name + { DF, On_got_name_Punctuation, + On_got_name_Assignment } // got_name + }; + + + +inline void +PE_Value::CallHandler( const char * i_sTokenText, + E_TokenType i_eTokenType ) + { (this->*aDispatcher[eState][i_eTokenType])(i_sTokenText); } + + + + + +PE_Value::PE_Value( udmstri & o_rName, + udmstri & o_rAssignment, + bool i_bIsConst ) + : eState(e_none), + pName(&o_rName), + pAssignment(&o_rAssignment), + bIsConst(i_bIsConst) +{ +} + +void +PE_Value::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); +} + +PE_Value::~PE_Value() +{ +} + +void +PE_Value::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Value::Process_Identifier( const TokIdentifier & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_identifier); +} + +void +PE_Value::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_punctuation); +} + +void +PE_Value::Process_Assignment( const TokAssignment & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_assignment); +} + +void +PE_Value::On_expect_name_Identifier(const char * i_sText) +{ + *pName = i_sText; + SetResult(done,stay); + eState = got_name; +} + +void +PE_Value::On_got_name_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == ',' AND NOT IsConst() + OR i_sText[0] == ';' AND IsConst() ) + { + SetResult(done,pop_success); + eState = e_none; + } + else if (i_sText[0] == '}' AND NOT IsConst()) + { + SetResult(not_done,pop_success); + eState = e_none; + } + else + On_Default(i_sText); +} + +void +PE_Value::On_got_name_Assignment(const char * i_sText) +{ + *pAssignment = i_sText; + SetResult(done,pop_success); + eState = e_none; +} + +void +PE_Value::On_Default(const char * ) +{ + SetResult(not_done,pop_failure); +} + +void +PE_Value::InitData() +{ + eState = expect_name; + + *pName = ""; + *pAssignment = ""; +} + +void +PE_Value::TransferData() +{ + csv_assert(pName->length() > 0); + eState = e_none; +} + +UnoIDL_PE & +PE_Value::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_excp.cxx b/autodoc/source/parser_i/idl/pe_excp.cxx new file mode 100644 index 000000000000..2c174dae68c8 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_excp.cxx @@ -0,0 +1,336 @@ +/************************************************************************* + * + * $RCSfile: pe_excp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_excp.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/pe_selem.hxx> +#include <csi/l_uidl/except.hxx> +#include <csi/l_uidl/struelem.hxx> +#include <ary_i/uidl/gate.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +PE_Exception::PE_Exception() + // : aWork, + // pStati +{ + pStati = new S_Stati(*this); +} + +void +PE_Exception::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + Work().pPE_Element->EstablishContacts(this,io_rRepository,o_rResult); + Work().pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Exception::~PE_Exception() +{ +} + +void +PE_Exception::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*Stati().pCurStatus); +} + + +void +PE_Exception::InitData() +{ + Work().InitData(); + Stati().pCurStatus = &Stati().aWaitForName; +} + +void +PE_Exception::TransferData() +{ + if (NOT Work().bIsPreDeclaration) + { + csv_assert(Work().pData != 0); + csv_assert(Work().pCurStruct); + } + Stati().pCurStatus = &Stati().aNone; +} + +void +PE_Exception::ReceiveData() +{ + Stati().pCurStatus->On_SubPE_Left(); +} + +PE_Exception::S_Work::S_Work() + : // pData + bIsPreDeclaration(false), + pCurStruct(0), + pPE_Element(0), + aCurParsed_ElementRef(0), + pPE_Type(0) + // aCurParsed_Base + +{ + pPE_Element = new PE_StructElement(aCurParsed_ElementRef,pCurStruct); + pPE_Type = new PE_Type(aCurParsed_Base); +} + +void +PE_Exception::S_Work::InitData() +{ + pData = new Exception; + bIsPreDeclaration = false; + pCurStruct = 0; +} + +void +PE_Exception::S_Work::Prepare_PE_QualifiedName() +{ + aCurParsed_ElementRef = 0; +} + +void +PE_Exception::S_Work::Prepare_PE_Element() +{ + aCurParsed_Base = 0; +} + +void +PE_Exception::S_Work::Data_Set_Name( const char * i_sName ) +{ + pData->Data().sName = i_sName; +} + +void +PE_Exception::S_Work::Data_Add_CurParsed_ElementRef() +{ + pData->Data().aElements.push_back(aCurParsed_ElementRef); +} + + +PE_Exception::S_Stati::S_Stati(PE_Exception & io_rStruct) + : aNone(io_rStruct), + aWaitForName(io_rStruct), + aGotName(io_rStruct), + aWaitForBase(io_rStruct), + aGotBase(io_rStruct), + aWaitForElement(io_rStruct), + aWaitForFinish(io_rStruct), + pCurStatus(0) +{ + pCurStatus = &aNone; +} + + +//*********************** Stati ***************************// + + +UnoIDL_PE & +PE_Exception::PE_StructState::MyPE() +{ + return rStruct; +} + + +void +PE_Exception::State_WaitForName::Process_Identifier( const TokIdentifier & i_rToken ) +{ + Work().Data_Set_Name(i_rToken.Text()); + MoveState( Stati().aGotName ); + SetResult(done,stay); +} + +void +PE_Exception::State_GotName::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if ( i_rToken.Id() != TokPunctuation::Semicolon ) + { + Work().pCurStruct = + PE().Gate().Store_Exception( + PE().CurNamespace().Id(), + *Work().pData ); + PE().PassDocuAt(Work().pCurStruct.Id()); + + + switch (i_rToken.Id()) + { + case TokPunctuation::Colon: + MoveState( Stati().aWaitForBase ); + SetResult(done,push_sure,Work().pPE_Type.Ptr()); + Work().Prepare_PE_QualifiedName(); + break; + case TokPunctuation::CurledBracketOpen: + MoveState( Stati().aWaitForElement ); + SetResult(done,stay); + break; + default: + SetResult(not_done,pop_failure); + } // end switch + } + else + { + Delete_dyn(Work().pData); + SetResult(done,pop_success); + } +} + +void +PE_Exception::State_WaitForBase::On_SubPE_Left() +{ + Work().pData->Data().pBaseException = Work().aCurParsed_Base; + MoveState(Stati().aGotBase); +} + +void +PE_Exception::State_GotBase::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if ( i_rToken.Id() == TokPunctuation::CurledBracketOpen ) + { + MoveState( Stati().aWaitForElement ); + SetResult(done,stay); + } + else + { + SetResult(not_done,pop_failure); + } +} + +void +PE_Exception::State_WaitForElement::Process_Identifier( const TokIdentifier & ) +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr() ); + Work().Prepare_PE_Element(); +} + +void +PE_Exception::State_WaitForElement::Process_NameSeparator() +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr()); + Work().Prepare_PE_Element(); +} + +void +PE_Exception::State_WaitForElement::Process_BuiltInType( const TokBuiltInType & ) +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr()); + Work().Prepare_PE_Element(); +} + +void +PE_Exception::State_WaitForElement::Process_TypeModifier(const TokTypeModifier & ) +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr()); + Work().Prepare_PE_Element(); +} + +void +PE_Exception::State_WaitForElement::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if ( i_rToken.Id() == TokPunctuation::CurledBracketClose ) + { + MoveState( Stati().aWaitForFinish ); + SetResult( done, stay ); + } + else + { + SetResult( not_done, pop_failure ); + } +} + +void +PE_Exception::State_WaitForElement::On_SubPE_Left() +{ + Work().Data_Add_CurParsed_ElementRef(); +} + +void +PE_Exception::State_WaitForFinish::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if (i_rToken.Id() == TokPunctuation::Semicolon) + { + MoveState( Stati().aNone ); + SetResult( done, pop_success ); + } + else + { + SetResult( not_done, pop_failure ); + } +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_file2.cxx b/autodoc/source/parser_i/idl/pe_file2.cxx new file mode 100644 index 000000000000..88212205063b --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_file2.cxx @@ -0,0 +1,320 @@ +/************************************************************************* + * + * $RCSfile: pe_file2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_file2.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/distrib.hxx> +#include <s2_luidl/pe_servi.hxx> +#include <s2_luidl/pe_iface.hxx> +#include <s2_luidl/pe_struc.hxx> +#include <s2_luidl/pe_excp.hxx> +#include <s2_luidl/pe_const.hxx> +#include <s2_luidl/pe_enum2.hxx> +#include <s2_luidl/pe_tydf2.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <ary_i/uidl/gate.hxx> +#include <ary_i/uidl/cenamesp.hxx> + + + + +namespace csi +{ +namespace uidl +{ + + +PE_File::PE_File( TokenDistributor & i_rTokenAdmin ) + : pTokenAdmin(&i_rTokenAdmin), + pPE_Service(new PE_Service), + pPE_Interface(new PE_Interface), + pPE_Struct(new PE_Struct), + pPE_Exception(new PE_Exception), + pPE_Constant(new PE_Constant), + pPE_Enum(new PE_Enum), + pPE_Typedef(new PE_Typedef), + pCurNamespace(0), + eState(e_none), + nBracketCount_inDefMode(0) +{ +} + +void +PE_File::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Service->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Interface->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Struct->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Exception->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Constant->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Enum->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Typedef->EstablishContacts(this,io_rRepository,o_rResult); + + pCurNamespace = &Gate().GlobalNamespace(); +} + +PE_File::~PE_File() +{ +} + +void +PE_File::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_File::Process_Identifier( const TokIdentifier & i_rToken ) +{ + switch (eState) + { + case wait_for_module: + { + csv_assert(pCurNamespace != 0); + + ary::Cei nNspId = Gate().CheckInModule(pCurNamespace->Id(), i_rToken.Text()).Id(); + pCurNamespace = Gate().FindNamespace(nNspId); + + // Get docu out of normal: + SetDocu(pTokenAdmin->ReleaseLastParsedDocu()); + PassDocuAt(nNspId); + + csv_assert(pCurNamespace != 0); + + SetResult(done, stay); + eState = wait_for_module_bracket; + } break; + case on_default: + SetResult(done, stay); + break; + default: + csv_assert(false); + } +} + +void +PE_File::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + switch (eState) + { + case e_std: + if (i_rToken.Id() == TokPunctuation::CurledBracketClose) + { + csv_assert(pCurNamespace != 0); + + pCurNamespace = pCurNamespace->Parent(); + + SetResult(done, stay); + eState = wait_for_module_semicolon; + } + else + { + csv_assert(false); + } + break; + case wait_for_module_bracket: + if (i_rToken.Id() == TokPunctuation::CurledBracketOpen) + { + SetResult(done, stay); + eState = e_std; + } + else + { + csv_assert(false); + } + break; + case wait_for_module_semicolon: + if (i_rToken.Id() == TokPunctuation::Semicolon) + { + SetResult(done, stay); + eState = e_std; + } + else + { + csv_assert(false); + } + break; + case on_default: + if (i_rToken.Id() == TokPunctuation::CurledBracketClose) + { + nBracketCount_inDefMode--; + } + else if (i_rToken.Id() == TokPunctuation::CurledBracketOpen) + { + nBracketCount_inDefMode++; + } + else if (i_rToken.Id() == TokPunctuation::Semicolon) + { + if (nBracketCount_inDefMode <= 0) + { + eState = e_std; + } + } + SetResult(done, stay); + break; + default: + csv_assert(false); + } +} + +void +PE_File::Process_MetaType( const TokMetaType & i_rToken ) +{ + switch (i_rToken.Id()) + { + case TokMetaType::mt_service: + eState = in_sub_pe; + SetResult( not_done, push_sure, pPE_Service.Ptr()); + break; + case TokMetaType::mt_uik: + Cerr() << "Syntax error: [uik ....] is obsolete now." << Endl(); + SetResult( not_done, pop_failure); + break; + case TokMetaType::mt_interface: + eState = in_sub_pe; + SetResult( not_done, push_sure, pPE_Interface.Ptr()); + break; + case TokMetaType::mt_module: + eState = wait_for_module; + SetResult( done, stay ); + break; + case TokMetaType::mt_struct: + eState = in_sub_pe; + SetResult( done, push_sure, pPE_Struct.Ptr()); + break; + case TokMetaType::mt_exception: + eState = in_sub_pe; + SetResult( done, push_sure, pPE_Exception.Ptr()); + break; + case TokMetaType::mt_constants: + eState = in_sub_pe; + SetResult( done, push_sure, pPE_Constant.Ptr()); + break; + case TokMetaType::mt_enum: + eState = in_sub_pe; + SetResult( done, push_sure, pPE_Enum.Ptr()); + break; + case TokMetaType::mt_typedef: + eState = in_sub_pe; + SetResult( done, push_sure, pPE_Typedef.Ptr()); + break; + + default: + Process_Default(); + } // end switch +} + +void +PE_File::Process_Default() +{ + if (eState != on_default) + { + eState = on_default; + nBracketCount_inDefMode = 0; + } + SetResult(done, stay); +} + +ary::uidl::CeNamespace & +PE_File::CurNamespace() const +{ + csv_assert(pCurNamespace); + return *pCurNamespace; +} + +void +PE_File::InitData() +{ + eState = e_std; +} + +void +PE_File::TransferData() +{ + eState = e_none; +} + +void +PE_File::ReceiveData() +{ + eState = e_std; +} + + +UnoIDL_PE & +PE_File::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + + diff --git a/autodoc/source/parser_i/idl/pe_func2.cxx b/autodoc/source/parser_i/idl/pe_func2.cxx new file mode 100644 index 000000000000..b13905642d1b --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_func2.cxx @@ -0,0 +1,403 @@ +/************************************************************************* + * + * $RCSfile: pe_func2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_func2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/pe_vari2.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <csi/l_uidl/function.hxx> + + +namespace csi +{ +namespace uidl +{ + + +PE_Function::PE_Function( RFunction & o_rResult, + const RInterface & i_rCurInterface ) + : eState(e_none), + pData(0), + pResult(&o_rResult), + pCurInterface(&i_rCurInterface), + pPE_Type(0), + aCurParsedType(0), + // sName, + pPE_Variable(0), + eCurParsedParam_Direction(param_in), + aCurParsedParam_Type(0) + // sCurParsedParam_Name +{ + pPE_Type = new PE_Type(aCurParsedType); + pPE_Variable = new PE_Variable(aCurParsedParam_Type, sCurParsedParam_Name); +} + + +void +PE_Function::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Variable->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Function::~PE_Function() +{ +} + +void +PE_Function::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Function::Process_Stereotype( const TokStereotype & i_rToken ) +{ + if (eState == e_start) + { + switch (i_rToken.Id()) + { + case TokStereotype::ste_const: + pData->Data().bConst = true; + SetResult(done, stay); + break; + case TokStereotype::ste_oneway: + pData->Data().bOneway = true; + SetResult(done, stay); + break; + default: + OnDefault(); + } // end switch + } + else + OnDefault(); +} + +void +PE_Function::Process_Identifier( const TokIdentifier & i_rToken ) +{ + switch (eState) + { + case e_start: + GoIntoReturnType(); + break; + case expect_name: + pData->Data().sName = i_rToken.Text(); + SetResult(done,stay); + eState = expect_params_list; + break; + case expect_parameter_variable: + GoIntoParameterVariable(); + break; + case expect_exception: + GoIntoException(); + break; + default: + OnDefault(); + } +} + +void +PE_Function::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + switch (eState) + { + case e_start: + SetResult(done,stay); + break; + case expect_params_list: + if (i_rToken.Id() != TokPunctuation::BracketOpen) + { + OnDefault(); + return; + } + SetResult(done,stay); + eState = expect_parameter; + break; + case expect_parameter: + if (i_rToken.Id() == TokPunctuation::BracketClose) + { + SetResult(done,stay); + eState = params_finished; + } + else + { + OnDefault(); + return; + } + break; + case expect_parameter_separator: + if (i_rToken.Id() == TokPunctuation::Comma) + { + SetResult(done,stay); + eState = expect_parameter; + } + else if (i_rToken.Id() == TokPunctuation::BracketClose) + { + SetResult(done,stay); + eState = params_finished; + } + else + { + OnDefault(); + return; + } + break; + case params_finished: + case exceptions_finished: + if (i_rToken.Id() != TokPunctuation::Semicolon) + { + OnDefault(); + return; + } + SetResult(done,pop_success); + eState = e_none; + break; + case expect_exceptions_list: + if (i_rToken.Id() != TokPunctuation::BracketOpen) + { + OnDefault(); + return; + } + SetResult(done,stay); + eState = expect_exception; + break; + case expect_exception_separator: + if (i_rToken.Id() == TokPunctuation::Comma) + { + SetResult(done,stay); + eState = expect_exception; + } + else if (i_rToken.Id() == TokPunctuation::BracketClose) + { + SetResult(done,stay); + eState = exceptions_finished; + } + else + { + OnDefault(); + return; + } + break; + default: + OnDefault(); + } +} + +void +PE_Function::Process_ParameterHandling( const TokParameterHandling & i_rToken ) +{ + if (eState != expect_parameter) + { + OnDefault(); + return; + } + + switch (i_rToken.Id()) + { + case TokParameterHandling::ph_in: + eCurParsedParam_Direction = param_in; + break; + case TokParameterHandling::ph_out: + eCurParsedParam_Direction = param_out; + break; + case TokParameterHandling::ph_inout: + eCurParsedParam_Direction = param_inout; + break; + default: + csv_assert(false); + } + SetResult(done,stay); + eState = expect_parameter_variable; +} + +void +PE_Function::Process_Raises() +{ + if (eState != params_finished) + { + OnDefault(); + return; + } + SetResult(done,stay); + eState = expect_exceptions_list; +} + +void +PE_Function::Process_Default() +{ + switch (eState) + { + case e_start: + GoIntoReturnType(); + break; + case expect_parameter_variable: + GoIntoParameterVariable(); + break; + case expect_exception: + GoIntoException(); + break; + default: + OnDefault(); + } // end switch +} + +void +PE_Function::GoIntoReturnType() +{ + SetResult(not_done, push_sure, pPE_Type.Ptr()); + eState = in_return_type; +} + +void +PE_Function::GoIntoParameterVariable() +{ + SetResult(not_done, push_sure, pPE_Variable.Ptr()); + eState = in_parameter_variable; +} + +void +PE_Function::GoIntoException() +{ + SetResult(not_done, push_sure, pPE_Type.Ptr()); + eState = in_exception; +} + +void +PE_Function::OnDefault() +{ + csv_assert(1==2); +} + +void +PE_Function::InitData() +{ + eState = e_start; + pData = new Function; + *pResult = 0; + aCurParsedType = 0; + eCurParsedParam_Direction = param_in; + aCurParsedParam_Type = 0; + sCurParsedParam_Name = ""; +} + +void +PE_Function::ReceiveData() +{ + switch (eState) + { + case in_return_type: + pData->Data().pReturnType = aCurParsedType; + aCurParsedType = 0; + eState = expect_name; + break; + case in_parameter_variable: + pData->Data().aParameters.push_back( + Parameter( aCurParsedParam_Type, + sCurParsedParam_Name, + eCurParsedParam_Direction ) ); + sCurParsedParam_Name = ""; + aCurParsedParam_Type = 0; + eCurParsedParam_Direction = param_in; + eState = expect_parameter_separator; + break; + case in_exception: + pData->Data().aRaisedExceptions.push_back(aCurParsedType); + eState = expect_exception_separator; + break; + default: + csv_assert(false); + } +} + +void +PE_Function::TransferData() +{ + *pResult = Gate().Store_Function( pCurInterface->Id(), *pData ); + PassDocuAt(pResult->Id()); + + pData = 0; + + eState = e_none; +} + +UnoIDL_PE & +PE_Function::MyPE() +{ + return *this; +} + + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_iface.cxx b/autodoc/source/parser_i/idl/pe_iface.cxx new file mode 100644 index 000000000000..97541b070845 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_iface.cxx @@ -0,0 +1,468 @@ +/************************************************************************* + * + * $RCSfile: pe_iface.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_iface.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/ce2.hxx> +#include <ary_i/codeinf2.hxx> +#include <csi/l_uidl/intrface.hxx> +#include <s2_luidl/pe_func2.hxx> +#include <s2_luidl/pe_attri.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <adc_cl.hxx> + + + +namespace csi +{ +namespace uidl +{ + +#ifdef DF +#undef DF +#endif +#define DF PE_Interface::On_Default + +PE_Interface::F_TOK +PE_Interface::aDispatcher[PE_Interface::e_STATES_MAX][PE_Interface::tt_MAX] = + { { DF, DF, DF, DF, DF }, // e_none + { On_need_uik_MetaType, + DF, DF, DF, DF }, // need_uik + { DF, On_uik_Identifier, + On_uik_Punctuation, + DF, DF }, // uik + { On_need_ident_MetaType, + DF, DF, DF, DF }, // need_ident + { DF, On_ident_Identifier, + On_ident_Punctuation, + DF, DF }, // ident + { On_need_interface_MetaType, + DF, DF, DF, DF }, // need_interface + { DF, On_need_name_Identifer, + DF, DF, DF }, // need_name + { DF, DF, On_wait_for_base_Punctuation, + DF, DF }, // wait_for_base + { DF, DF, DF, DF, DF }, // in_base + { DF, DF, On_need_curlbr_open_Punctuation, + DF, DF }, // need_curlbr_open + { On_std_GotoAttribute, + On_std_GotoFunction, + On_std_Punctuation, + On_std_GotoFunction, + On_std_Stereotype }, // e_std + { DF, DF, DF, DF, DF }, // in_function + { DF, DF, DF, DF, DF }, // in_attribute + { DF, DF, On_need_finish_Punctuation, + DF, DF } // need_finish + }; + + + +inline void +PE_Interface::CallHandler( const char * i_sTokenText, + E_TokenType i_eTokenType ) + { (this->*aDispatcher[eState][i_eTokenType])(i_sTokenText); } + + + +PE_Interface::PE_Interface() + : eState(e_none), + pData(0), + bIsPreDeclaration(false), + pPE_Function(0), + pCurInterface(0), + aCurParsed_Function(0), + pPE_Attribute(0), + aCurParsed_Attribute(0), + pPE_Type(0), + aCurParsed_Base(0), + // cUik, + nUikCharCounter(0) +{ + pPE_Function = new PE_Function(aCurParsed_Function, pCurInterface); + pPE_Attribute = new PE_Attribute(aCurParsed_Attribute, pCurInterface); + pPE_Type = new PE_Type(aCurParsed_Base); + + memset( cUik, 0, 37 ); +} + +void +PE_Interface::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Function->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Attribute->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Interface::~PE_Interface() +{ +} + +void +PE_Interface::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + + +void +PE_Interface::Process_MetaType( const TokMetaType & i_rToken ) +{ + CallHandler( i_rToken.Text(), tt_metatype ); +} + +void +PE_Interface::Process_Identifier( const TokIdentifier & i_rToken ) +{ + CallHandler( i_rToken.Text(), tt_identifier ); +} + +void +PE_Interface::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + CallHandler( i_rToken.Text(), tt_punctuation ); +} + +void +PE_Interface::Process_NameSeparator() +{ + CallHandler( "", tt_startoftype ); +} + +void +PE_Interface::Process_BuiltInType( const TokBuiltInType & i_rToken ) +{ + CallHandler( i_rToken.Text(), tt_startoftype ); +} + +void +PE_Interface::Process_TypeModifier( const TokTypeModifier & i_rToken ) +{ + CallHandler( i_rToken.Text(), tt_startoftype ); +} + +void +PE_Interface::Process_Stereotype( const TokStereotype & i_rToken ) +{ + CallHandler( i_rToken.Text(), tt_stereotype ); +} + +void +PE_Interface::Process_Default() +{ + // KORR ? + if (DEBUG_ShowTokens()) + Cerr() << "PE_Interface: Strange token parsed." << Endl(); + SetResult(done, stay); +} + + +void +PE_Interface::On_need_uik_MetaType(const char * i_sText) +{ + SetResult(done, stay); + eState = uik; +} + +void +PE_Interface::On_uik_Identifier(const char * i_sText) +{ + unsigned sLen = strlen(i_sText); + csv_assert( (sLen == 4 OR sLen == 8) AND nUikCharCounter < 36 ); + if (nUikCharCounter > 0) + cUik[nUikCharCounter++] = '-'; + strncpy( cUik + nUikCharCounter, i_sText, sLen ); + nUikCharCounter += sLen; + + SetResult(done, stay); +} + +void +PE_Interface::On_uik_Punctuation(const char * i_sText) +{ + SetResult(done, stay); + if (strcmp(",",i_sText) == 0) + { + csv_assert(nUikCharCounter == 36); + pData->Data().sUik = cUik; + eState = need_ident; + } +} + +void +PE_Interface::On_need_ident_MetaType(const char * i_sText) +{ + SetResult(done, stay); + eState = ident; +} + +void +PE_Interface::On_ident_Identifier(const char * i_sText) +{ + SetResult(done, stay); +} + +void +PE_Interface::On_ident_Punctuation(const char * i_sText) +{ + SetResult(done, stay); + if (strcmp(")",i_sText) == 0) + { + eState = need_interface; + } +} + +void +PE_Interface::On_need_interface_MetaType(const char * i_sText) +{ + SetResult(done, stay); + eState = need_name; +} + +void +PE_Interface::On_need_name_Identifer(const char * i_sText) +{ + SetResult(done, stay); + pData->Data().sName = i_sText; + eState = wait_for_base; +} + +void +PE_Interface::On_wait_for_base_Punctuation(const char * i_sText) +{ + if (i_sText[0] != ';') + { + pCurInterface = Gate().Store_Interface(CurNamespace().Id(), *pData); + PassDocuAt(pCurInterface.Id()); + + switch (i_sText[0]) + { + case ':': + SetResult(done, push_sure, pPE_Type.Ptr()); + eState = in_base; + break; + case '{': + SetResult(done,stay); + eState = e_std; + break; + default: + SetResult(not_done, pop_failure); + eState = e_none; + } // end switch + } + else + { + bIsPreDeclaration = true; + SetResult(done, pop_success); + eState = e_none; + } +} + +void +PE_Interface::On_need_curlbr_open_Punctuation(const char * i_sText) +{ + if (i_sText[0] == '{') + { + SetResult(done, stay); + eState = e_std; + } + else + csv_assert(false); +} + +void +PE_Interface::On_std_Punctuation(const char * i_sText) +{ + switch (i_sText[0]) + { + case '}': + SetResult(done,stay); + eState = need_finish; + break; + default: + SetResult(not_done, pop_failure); + eState = e_none; + } // end switch +} + +void +PE_Interface::On_std_Stereotype(const char * i_sText) +{ + if (strcmp(i_sText,"readonly") == 0) + { + On_std_GotoAttribute(i_sText); + } + else + { + On_std_GotoFunction(i_sText); + } +} + +void +PE_Interface::On_std_GotoFunction(const char * i_sText) +{ + SetResult(not_done, push_sure, pPE_Function.Ptr()); + eState = in_function; +} + +void +PE_Interface::On_std_GotoAttribute(const char * i_sText) +{ + SetResult(not_done, push_sure, pPE_Attribute.Ptr()); + eState = in_attribute; +} + +void +PE_Interface::On_need_finish_Punctuation(const char * i_sText) +{ + switch (i_sText[0]) + { + case ';': + SetResult(done, pop_success); + eState = e_none; + break; + default: + SetResult(not_done, pop_failure); + eState = e_none; + } // end switch +} + +void +PE_Interface::On_Default(const char * i_sText) +{ + SetResult(not_done, pop_failure); +} + +void +PE_Interface::InitData() +{ + eState = need_interface; + + pData = new Interface; + bIsPreDeclaration = false; + pCurInterface = 0; + aCurParsed_Function = 0; + aCurParsed_Attribute = 0; + aCurParsed_Base = 0; + memset( cUik, 0, 33 ); + nUikCharCounter = 0; +} + +void +PE_Interface::TransferData() +{ + if (NOT bIsPreDeclaration) + { + csv_assert(pData != 0); + csv_assert(pCurInterface); + } + else + Delete_dyn(pData); + + eState = e_none; +} + +void +PE_Interface::ReceiveData() +{ + switch (eState) + { + case in_base: + pData->Data().pBase = aCurParsed_Base; + aCurParsed_Base = 0; + eState = need_curlbr_open; + break; + case in_function: + pData->Data().aFunctions.push_back(aCurParsed_Function); + aCurParsed_Function = 0; + eState = e_std; + break; + case in_attribute: + pData->Data().aAttributes.push_back(aCurParsed_Attribute); + aCurParsed_Attribute = 0; + eState = e_std; + break; + default: + csv_assert(false); + } +} + + +UnoIDL_PE & +PE_Interface::MyPE() +{ + return *this; +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_selem.cxx b/autodoc/source/parser_i/idl/pe_selem.cxx new file mode 100644 index 000000000000..c7e813f31645 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_selem.cxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * $RCSfile: pe_selem.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_selem.hxx> + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <csi/l_uidl/struelem.hxx> + + +namespace csi +{ +namespace uidl +{ + + +PE_StructElement::PE_StructElement( RStructElement & o_rResult, + const RStruct & i_rCurStruct ) + : eState(e_none), + pResult(&o_rResult), + pCurStruct(&i_rCurStruct), + pPE_Type(0), + pType(0) + // sName +{ + pPE_Type = new PE_Type(pType); +} + +void +PE_StructElement::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_StructElement::~PE_StructElement() +{ +} + +void +PE_StructElement::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + + +void +PE_StructElement::Process_Default() +{ + if (eState == expect_type) + { + SetResult( not_done, push_sure, pPE_Type.Ptr() ); + eState = expect_name; + } + else + csv_assert(false); +} + +void +PE_StructElement::Process_Identifier( const TokIdentifier & i_rToken ) +{ + if (eState == expect_type) + { + SetResult( not_done, push_sure, pPE_Type.Ptr() ); + eState = expect_name; + } + else if (eState == expect_name) + { + sName = i_rToken.Text(); + SetResult( done, stay ); + eState = expect_finish; + } + else + csv_assert(false); +} + +void +PE_StructElement::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if (eState == expect_finish) + { + SetResult( done, pop_success ); + } + else + csv_assert(false); +} + +void +PE_StructElement::InitData() +{ + eState = expect_type; + + pType = 0; + sName = ""; +} + +void +PE_StructElement::TransferData() +{ + DYN StructElement * pNew = new StructElement; + pNew->Data().pType = pType; + pNew->Data().sName = sName; + + csv_assert(pResult != 0 AND pCurStruct != 0); + *pResult = Gate().Store_StructElement( pCurStruct->Id(), *pNew ); + PassDocuAt(pResult->Id()); + + eState = e_none; +} + +UnoIDL_PE & +PE_StructElement::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_servi.cxx b/autodoc/source/parser_i/idl/pe_servi.cxx new file mode 100644 index 000000000000..d1c3b4ee13d2 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_servi.cxx @@ -0,0 +1,373 @@ +/************************************************************************* + * + * $RCSfile: pe_servi.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_servi.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_attri.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <csi/l_uidl/service.hxx> +#include <ary_i/ce2.hxx> + + + +namespace csi +{ +namespace uidl +{ + + + +PE_Service::PE_Service() + : eState(e_none), + pData(0), + bIsPreDeclaration(false), + pCurService(0), + pPE_Property(0), + aCurParsed_Property(0), + pPE_Type(0), + aCurParsed_Type(0), + bOptionalMember(false) +{ + pPE_Property = new PE_Attribute(aCurParsed_Property, pCurService); + pPE_Type = new PE_Type(aCurParsed_Type); +} + +void +PE_Service::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Property->EstablishContacts(this,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Service::~PE_Service() +{ +} + +void +PE_Service::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + + +void +PE_Service::Process_MetaType( const TokMetaType & i_rToken ) +{ + switch ( i_rToken.Id() ) + { + case TokMetaType::mt_service: + if (eState == need_name) + SetResult(done, stay ); + else if (eState == e_std) + { + SetResult(done, push_sure, pPE_Type.Ptr()); + eState = in_service_type; + } + else + On_Default(); + break; + case TokMetaType::mt_interface: + if (eState == e_std) + { + SetResult(done, push_sure, pPE_Type.Ptr()); + eState = in_ifc_type; + } + else + On_Default(); + break; + case TokMetaType::mt_property: + if (eState == e_std) + { + StartProperty(); + } + else + On_Default(); + break; + } // end switch +} + +void +PE_Service::Process_Identifier( const TokIdentifier & i_rToken ) +{ + if (eState == need_name) + { + pData->Data().sName = i_rToken.Text(); + SetResult(done, stay); + eState = need_curlbr_open; + } + else + On_Default(); +} + +void +PE_Service::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + switch (i_rToken.Id()) + { + case TokPunctuation::CurledBracketOpen: + if (eState == need_curlbr_open) + { + pCurService = Gate().Store_Service(CurNamespace().Id(), *pData); + PassDocuAt(pCurService.Id()); + + SetResult(done, stay); + eState = e_std; + } + else + On_Default(); + break; + case TokPunctuation::CurledBracketClose: + if (eState == e_std) + { + SetResult(done, stay); + eState = need_finish; + } + else + On_Default(); + break; + case TokPunctuation::Comma: + if (eState == expect_ifc_separator) + { + SetResult(done, push_sure, pPE_Type.Ptr()); + eState = in_ifc_type; + } + else if (eState == expect_service_separator) + { + SetResult(done, push_sure, pPE_Type.Ptr()); + eState = in_service_type; + } + else if (eState == e_std) + { + SetResult(done, stay); + } + else + On_Default(); + break; + case TokPunctuation::Semicolon: + switch (eState) + { + case need_curlbr_open: + Delete_dyn(pData); + bIsPreDeclaration = true; + SetResult(done, pop_success); + eState = e_none; + break; + case expect_ifc_separator: + case expect_service_separator: + SetResult(done, stay); + eState = e_std; + break; + case need_finish: + SetResult(done, pop_success); + eState = e_none; + break; + case at_ignore: + SetResult(done, stay); + eState = e_std; + break; + default: + On_Default(); + } // end switch + break; + default: + On_Default(); + } // end switch +} + +void +PE_Service::Process_Stereotype( const TokStereotype & i_rToken ) +{ + if ( eState == e_std AND i_rToken.Id() == TokStereotype::ste_readonly ) + { + StartProperty(); + } + else if (i_rToken.Id() == TokStereotype::ste_optional) + { + bOptionalMember = true; + SetResult(done, stay); + } + else + On_Default(); +} + +void +PE_Service::Process_Needs() +{ + SetResult(done,stay); + eState = at_ignore; +} + +void +PE_Service::Process_Observes() +{ + SetResult(done,stay); + eState = at_ignore; +} + +void +PE_Service::Process_Default() +{ + On_Default(); +} + + +void +PE_Service::On_Default() +{ + if (eState == at_ignore) + SetResult(done, stay); + else + SetResult(not_done, pop_failure); +} + +void +PE_Service::InitData() +{ + eState = need_name; + pData = new Service; + bIsPreDeclaration = false; + pCurService = 0; + aCurParsed_Property = 0; + aCurParsed_Type = 0; + bOptionalMember = false; +} + +void +PE_Service::TransferData() +{ + if (NOT bIsPreDeclaration) + { + csv_assert(pData != 0); + csv_assert(pCurService); + } + + eState = e_none; +} + +void +PE_Service::ReceiveData() +{ + switch (eState) + { + case in_property: + pData->Data().aProperties.push_back(aCurParsed_Property.Id()); + aCurParsed_Property = 0; + eState = e_std; + break; + case in_ifc_type: + if (bOptionalMember) + { + pPE_Type->SetOptional(); + bOptionalMember = false; + } + pData->Data().aServedInterfaces.push_back( + CommentedLink(aCurParsed_Type.Id(),pPE_Type->ReleaseDocu()) ); + aCurParsed_Type = 0; + eState = expect_ifc_separator; + break; + case in_service_type: + if (bOptionalMember) + pPE_Type->SetOptional(); + pData->Data().aIncludedServices.push_back( + CommentedLink(aCurParsed_Type.Id(),pPE_Type->ReleaseDocu()) ); + aCurParsed_Type = 0; + eState = expect_service_separator; + break; + default: + csv_assert(false); + } +} + + +UnoIDL_PE & +PE_Service::MyPE() +{ + return *this; +} + +void +PE_Service::StartProperty() +{ + SetResult(not_done, push_sure, pPE_Property.Ptr()); + eState = in_property; + + if (bOptionalMember) + { + pPE_Property->PresetOptional(); + bOptionalMember = false; + } +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_struc.cxx b/autodoc/source/parser_i/idl/pe_struc.cxx new file mode 100644 index 000000000000..24e5d0f6c438 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_struc.cxx @@ -0,0 +1,336 @@ +/************************************************************************* + * + * $RCSfile: pe_struc.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_struc.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tk_keyw.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/pe_selem.hxx> +#include <csi/l_uidl/struct.hxx> +#include <csi/l_uidl/struelem.hxx> +#include <ary_i/uidl/gate.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +PE_Struct::PE_Struct() + // : aWork, + // pStati +{ + pStati = new S_Stati(*this); +} + +void +PE_Struct::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + Work().pPE_Element->EstablishContacts(this,io_rRepository,o_rResult); + Work().pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Struct::~PE_Struct() +{ +} + +void +PE_Struct::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*Stati().pCurStatus); +} + + +void +PE_Struct::InitData() +{ + Work().InitData(); + Stati().pCurStatus = &Stati().aWaitForName; +} + +void +PE_Struct::TransferData() +{ + if (NOT Work().bIsPreDeclaration) + { + csv_assert(Work().pData != 0); + csv_assert(Work().pCurStruct); + } + Stati().pCurStatus = &Stati().aNone; +} + +void +PE_Struct::ReceiveData() +{ + Stati().pCurStatus->On_SubPE_Left(); +} + +PE_Struct::S_Work::S_Work() + : // pData + bIsPreDeclaration(false), + pCurStruct(0), + pPE_Element(0), + aCurParsed_ElementRef(0), + pPE_Type(0) + // aCurParsed_Base + +{ + pPE_Element = new PE_StructElement(aCurParsed_ElementRef,pCurStruct); + pPE_Type = new PE_Type(aCurParsed_Base); +} + +void +PE_Struct::S_Work::InitData() +{ + pData = new Struct; + bIsPreDeclaration = false; + pCurStruct = 0; +} + +void +PE_Struct::S_Work::Prepare_PE_QualifiedName() +{ + aCurParsed_ElementRef = 0; +} + +void +PE_Struct::S_Work::Prepare_PE_Element() +{ + aCurParsed_Base = 0; +} + +void +PE_Struct::S_Work::Data_Set_Name( const char * i_sName ) +{ + pData->Data().sName = i_sName; +} + +void +PE_Struct::S_Work::Data_Add_CurParsed_ElementRef() +{ + pData->Data().aElements.push_back(aCurParsed_ElementRef); +} + + +PE_Struct::S_Stati::S_Stati(PE_Struct & io_rStruct) + : aNone(io_rStruct), + aWaitForName(io_rStruct), + aGotName(io_rStruct), + aWaitForBase(io_rStruct), + aGotBase(io_rStruct), + aWaitForElement(io_rStruct), + aWaitForFinish(io_rStruct), + pCurStatus(0) +{ + pCurStatus = &aNone; +} + + +//*********************** Stati ***************************// + + +UnoIDL_PE & +PE_Struct::PE_StructState::MyPE() +{ + return rStruct; +} + + +void +PE_Struct::State_WaitForName::Process_Identifier( const TokIdentifier & i_rToken ) +{ + Work().Data_Set_Name(i_rToken.Text()); + MoveState( Stati().aGotName ); + SetResult(done,stay); +} + +void +PE_Struct::State_GotName::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if ( i_rToken.Id() != TokPunctuation::Semicolon ) + { + Work().pCurStruct = + PE().Gate().Store_Struct( + PE().CurNamespace().Id(), + *Work().pData ); + PE().PassDocuAt(Work().pCurStruct.Id()); + + + switch (i_rToken.Id()) + { + case TokPunctuation::Colon: + MoveState( Stati().aWaitForBase ); + SetResult(done,push_sure,Work().pPE_Type.Ptr()); + Work().Prepare_PE_QualifiedName(); + break; + case TokPunctuation::CurledBracketOpen: + MoveState( Stati().aWaitForElement ); + SetResult(done,stay); + break; + default: + SetResult(not_done,pop_failure); + } // end switch + } + else + { + Delete_dyn(Work().pData); + SetResult(done,pop_success); + } +} + +void +PE_Struct::State_WaitForBase::On_SubPE_Left() +{ + Work().pData->Data().pBase = Work().aCurParsed_Base; + MoveState(Stati().aGotBase); +} + +void +PE_Struct::State_GotBase::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if ( i_rToken.Id() == TokPunctuation::CurledBracketOpen ) + { + MoveState( Stati().aWaitForElement ); + SetResult(done,stay); + } + else + { + SetResult(not_done,pop_failure); + } +} + +void +PE_Struct::State_WaitForElement::Process_Identifier( const TokIdentifier & ) +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr() ); + Work().Prepare_PE_Element(); +} + +void +PE_Struct::State_WaitForElement::Process_NameSeparator() +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr()); + Work().Prepare_PE_Element(); +} + +void +PE_Struct::State_WaitForElement::Process_BuiltInType( const TokBuiltInType & ) +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr()); + Work().Prepare_PE_Element(); +} + +void +PE_Struct::State_WaitForElement::Process_TypeModifier(const TokTypeModifier & ) +{ + SetResult( not_done, push_sure, Work().pPE_Element.Ptr()); + Work().Prepare_PE_Element(); +} + +void +PE_Struct::State_WaitForElement::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if ( i_rToken.Id() == TokPunctuation::CurledBracketClose ) + { + MoveState( Stati().aWaitForFinish ); + SetResult( done, stay ); + } + else + { + SetResult( not_done, pop_failure ); + } +} + +void +PE_Struct::State_WaitForElement::On_SubPE_Left() +{ + Work().Data_Add_CurParsed_ElementRef(); +} + +void +PE_Struct::State_WaitForFinish::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if (i_rToken.Id() == TokPunctuation::Semicolon) + { + MoveState( Stati().aNone ); + SetResult( done, pop_success ); + } + else + { + SetResult( not_done, pop_failure ); + } +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_tydf2.cxx b/autodoc/source/parser_i/idl/pe_tydf2.cxx new file mode 100644 index 000000000000..99b1ef7a0e28 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_tydf2.cxx @@ -0,0 +1,219 @@ +/************************************************************************* + * + * $RCSfile: pe_tydf2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/pe_tydf2.hxx> + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <csi/l_uidl/typedef.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <ary_i/uidl/gate.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <s2_luidl/tk_const.hxx> + + +namespace csi +{ +namespace uidl +{ + + +#ifdef DF +#undef DF +#endif +#define DF PE_Typedef::On_Default + +PE_Typedef::F_TOK +PE_Typedef::aDispatcher[PE_Typedef::e_STATES_MAX][PE_Typedef::tt_MAX] = + { { DF, DF, DF }, // e_none + { On_expect_description_Any, + On_expect_description_Any, + DF }, // expect_description + { DF, On_expect_name_Identifier, + DF }, // expect_name + { DF, DF, On_got_name_Punctuation } // got_name + }; + + + +inline void +PE_Typedef::CallHandler( const char * i_sTokenText, + E_TokenType i_eTokenType ) + { (this->*aDispatcher[eState][i_eTokenType])(i_sTokenText); } + + + + + +PE_Typedef::PE_Typedef() + : eState(e_none), + pPE_Type(0), + pType(0) + // sName +{ + pPE_Type = new PE_Type(pType); +} + +void +PE_Typedef::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Typedef::~PE_Typedef() +{ +} + +void +PE_Typedef::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Typedef::Process_Identifier( const TokIdentifier & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_identifier); +} + +void +PE_Typedef::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + CallHandler(i_rToken.Text(), tt_punctuation); +} + +void +PE_Typedef::Process_Default() +{ + CallHandler("", tt_any); +} + +void +PE_Typedef::On_expect_description_Any(const char * i_sText) +{ + SetResult(not_done,push_sure, pPE_Type.Ptr()); +} + +void +PE_Typedef::On_expect_name_Identifier(const char * i_sText) +{ + sName = i_sText; + SetResult(done,stay); + eState = got_name; +} + +void +PE_Typedef::On_got_name_Punctuation(const char * i_sText) +{ + if ( i_sText[0] == ';' ) + { + SetResult(done,pop_success); + eState = e_none; + } + else + On_Default(i_sText); +} + +void +PE_Typedef::On_Default(const char * ) +{ + SetResult(not_done,pop_failure); +} + +void +PE_Typedef::InitData() +{ + eState = expect_description; + pType = 0; + sName = ""; +} + +void +PE_Typedef::ReceiveData() +{ + eState = expect_name; +} + +void +PE_Typedef::TransferData() +{ + Typedef * pData = new Typedef; + pData->Data().sName = sName; + pData->Data().pDefiningType = pType; + ary::Cei nId = Gate().Store_Typedef( CurNamespace().Id(), *pData ).Id(); + PassDocuAt(nId); + eState = e_none; +} + +UnoIDL_PE & +PE_Typedef::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pe_type2.cxx b/autodoc/source/parser_i/idl/pe_type2.cxx new file mode 100644 index 000000000000..2eee28b2aa07 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_type2.cxx @@ -0,0 +1,256 @@ +/************************************************************************* + * + * $RCSfile: pe_type2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_type2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/uidl_tok.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_keyw.hxx> +// #include <ary/uidl/cestorg.hxx> +#include <ary_i/uidl/gate.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +PE_Type::PE_Type( csi::prl::RefType & o_rResult ) + : pResult(&o_rResult), + nIsSequenceCounter(0), + bIsUnsigned(false), + // sFullType, + // sName, + eState(e_none) + // sLastPart +{ +} + +PE_Type::~PE_Type() +{ +} + +void +PE_Type::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + +void +PE_Type::Process_Identifier( const TokIdentifier & i_rToken ) +{ + if (eState == expect_type) + { + sLastPart = i_rToken.Text(); + eState = expect_quname_separator; + SetResult(done, stay); + } + else if (eState == expect_quname_part) + { + sLastPart = i_rToken.Text(); + eState = expect_quname_separator; + SetResult(done, stay); + } + else if (eState == expect_quname_separator) + { + Finish(); + } +} + +void +PE_Type::Process_NameSeparator() +{ + if (eState == expect_type) + { + sFullType.Init(true); + eState = expect_quname_part; + SetResult(done, stay); + } + else if (eState == expect_quname_separator) + { + sFullType += sLastPart; + eState = expect_quname_part; + SetResult(done, stay); + } +} + +void +PE_Type::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + Finish(); +} + +void +PE_Type::Process_BuiltInType( const TokBuiltInType & i_rToken ) +{ + if (eState == expect_type) + { + sLastPart = i_rToken.Text(); + eState = expect_quname_separator; + SetResult(done, stay); + } + else if (eState == expect_quname_part) + { + sLastPart = i_rToken.Text(); + eState = expect_quname_separator; + SetResult(done, stay); + } + else if (eState == expect_quname_separator) + { + sFullType.SetName(sLastPart); + SetResult(not_done, pop_success); + } +} + +void +PE_Type::Process_TypeModifier( const TokTypeModifier & i_rToken ) +{ + if (eState == expect_type) + { + switch ( i_rToken.Id() ) + { + case TokTypeModifier::tmod_unsigned: + bIsUnsigned = true; + break; + case TokTypeModifier::tmod_sequence: + nIsSequenceCounter++; + break; + default: + csv_assert(false); + } + SetResult(done, stay); + } + else if (eState == expect_quname_separator) + { + sFullType.SetName(sLastPart); + SetResult(not_done, pop_success); + } +} + +void +PE_Type::Process_Default() +{ + Finish(); +} + +void +PE_Type::Finish() +{ + sFullType.SetName(sLastPart); + SetResult(not_done, pop_success); +} + +void +PE_Type::InitData() +{ + eState = expect_type; + + nIsSequenceCounter = 0; + bIsUnsigned = false; + sFullType.Empty(); + sLastPart = ""; +} + +void +PE_Type::TransferData() +{ + csi::prl::RefType result = 0; + if (NOT bIsUnsigned) + { + result = Gate().CheckInType(MatchingNamespace(sFullType), sFullType.Name()); + } + else + { + udmstri sName( StreamLock(40)() << "unsigned " << sFullType.Name() << c_str ); + result = Gate().CheckInType(MatchingNamespace(sFullType), sName); + } + + while (nIsSequenceCounter) + { + result = Gate().CheckInSequence(result.Id()); + nIsSequenceCounter--; + } + + *pResult = result; + eState = e_none; +} + +UnoIDL_PE & +PE_Type::MyPE() +{ + return *this; +} + + +} // namespace uidl +} // namespace csi + +void +DeleteDyn(csi::uidl::PE_Type * i_pObj) +{ delete i_pObj; } + diff --git a/autodoc/source/parser_i/idl/pe_vari2.cxx b/autodoc/source/parser_i/idl/pe_vari2.cxx new file mode 100644 index 000000000000..859e2a202e01 --- /dev/null +++ b/autodoc/source/parser_i/idl/pe_vari2.cxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * $RCSfile: pe_vari2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pe_vari2.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/pe_type2.hxx> +#include <s2_luidl/tk_ident.hxx> +#include <s2_luidl/tk_punct.hxx> +#include <csi/l_uidl/struelem.hxx> + + +namespace csi +{ +namespace uidl +{ + + +PE_Variable::PE_Variable( csi::prl::RefType & i_rResult_Type, + udmstri & i_rResult_Name ) + : eState(), + pResult_Type(&i_rResult_Type), + pResult_Name(&i_rResult_Name), + pPE_Type(0) +{ + pPE_Type = new PE_Type(i_rResult_Type); +} + +void +PE_Variable::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult); + pPE_Type->EstablishContacts(this,io_rRepository,o_rResult); +} + +PE_Variable::~PE_Variable() +{ + +} + +void +PE_Variable::ProcessToken( const Token & i_rToken ) +{ + i_rToken.Trigger(*this); +} + + +void +PE_Variable::Process_Default() +{ + if (eState == expect_type) + { + SetResult( not_done, push_sure, pPE_Type.Ptr() ); + } + else + csv_assert(false); +} + +void +PE_Variable::Process_Identifier( const TokIdentifier & i_rToken ) +{ + if (eState == expect_type) + { + SetResult( not_done, push_sure, pPE_Type.Ptr() ); + } + else if (eState == expect_name) + { + *pResult_Name = i_rToken.Text(); + SetResult( done, stay ); + eState = expect_finish; + } + else + csv_assert(false); +} + +void +PE_Variable::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + if (eState == expect_finish) + { + SetResult( not_done, pop_success ); + eState = e_none; + } + else + csv_assert(false); +} + +void +PE_Variable::InitData() +{ + eState = expect_type; + + *pResult_Type = 0; + *pResult_Name = ""; +} + +void +PE_Variable::ReceiveData() +{ + eState = expect_name; +} + +void +PE_Variable::TransferData() +{ + eState = e_none; +} + +UnoIDL_PE & +PE_Variable::MyPE() +{ + return *this; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/pestate.cxx b/autodoc/source/parser_i/idl/pestate.cxx new file mode 100644 index 000000000000..b01e1e03593f --- /dev/null +++ b/autodoc/source/parser_i/idl/pestate.cxx @@ -0,0 +1,175 @@ +/************************************************************************* + * + * $RCSfile: pestate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_luidl/pestate.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_luidl/parsenv2.hxx> + + + + +namespace csi +{ +namespace uidl +{ + +void +ParseEnvState::Process_Identifier( const TokIdentifier & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_NameSeparator() +{ + Process_Default(); +} + +void +ParseEnvState::Process_Punctuation( const TokPunctuation & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_BuiltInType( const TokBuiltInType & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_TypeModifier( const TokTypeModifier & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_MetaType( const TokMetaType & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_Stereotype( const TokStereotype & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_ParameterHandling( const TokParameterHandling & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_Raises() +{ + Process_Default(); +} + +void +ParseEnvState::Process_Needs() +{ + Process_Default(); +} + +void +ParseEnvState::Process_Observes() +{ + Process_Default(); +} + +void +ParseEnvState::Process_Assignment( const TokAssignment & i_rToken ) +{ + Process_Default(); +} + +void +ParseEnvState::Process_EOL() +{ + MyPE().SetResult(done,stay); +} + + +void +ParseEnvState::On_SubPE_Left() +{ +} + +void +ParseEnvState::Process_Default() +{ + if (bDefaultIsError) + MyPE().SetResult(not_done, pop_failure); + else // ignore: + MyPE().SetResult(done, stay); +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/semnode.cxx b/autodoc/source/parser_i/idl/semnode.cxx new file mode 100644 index 000000000000..7a047e77f931 --- /dev/null +++ b/autodoc/source/parser_i/idl/semnode.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * $RCSfile: semnode.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/semnode.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/ary.hxx> +#include <ary_i/codeinf2.hxx> +#include <ary_i/uidl/gate.hxx> +#include <ary_i/uidl/cenamesp.hxx> +#include <s2_luidl/parsenv2.hxx> + + +namespace csi +{ +namespace uidl +{ + + + +SemanticNode::SemanticNode() + : pAryGate(0), + pTokenResult(0) +{ +} + +void +SemanticNode::EstablishContacts( UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & o_rResult ) +{ + pParentPE = io_pParentPE; + pAryGate = &io_rRepository.RwGate_Idl(); + pTokenResult = &o_rResult; +} + +SemanticNode::~SemanticNode() +{ +} + +void +SemanticNode::SetTokenResult( E_TokenDone i_eDone, + E_EnvStackAction i_eWhat2DoWithEnvStack, + UnoIDL_PE * i_pParseEnv2Push ) +{ + pTokenResult->eDone = i_eDone; + pTokenResult->eStackAction = i_eWhat2DoWithEnvStack; + pTokenResult->pEnv2Push = i_pParseEnv2Push; +} + + +} // namespace uidl +} // namespace csi + + + + +#if 0 +void +UnoIDL_PE::ProcessToken( const Token & i_rToken ) +{ +/* + CleanUp(); + + LetCurTokenTrigger(); + + if ( Done() ) + return true; + + for ( SubEnvIterator iter = Triggered_SubEnvs.begin(); + iter != Triggered_SubEnvs.end(); + ++iter ) + { + (*iter).Enter(); + + if ( (*iter).ProcessNextToken() ) + { + (*iter).Leave(); + return true; + } + } +*/ +} + +void +Trying_PE::ProcessToken( const Token & i_rToken ) +{ +/* + CleanUp(); + + LetCurTokenTrigger(); + + if ( Done() ) + return true; + + for ( SubEnvIterator iter = Triggered_SubEnvs.begin(); + iter != Triggered_SubEnvs.end(); + ++iter ) + { + (*iter).Enter(); + + if ( (*iter).ProcessNextToken() ) + { + (*iter).Leave(); + return true; + } + } +*/ +} +#endif // 0 + diff --git a/autodoc/source/parser_i/idl/tk_const.cxx b/autodoc/source/parser_i/idl/tk_const.cxx new file mode 100644 index 000000000000..addcfeebf016 --- /dev/null +++ b/autodoc/source/parser_i/idl/tk_const.cxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: tk_const.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/tk_const.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/tokintpr.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +void +TokAssignment::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Assignment(*this); +} + +const char * +TokAssignment::Text() const +{ + return sText; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/tk_ident.cxx b/autodoc/source/parser_i/idl/tk_ident.cxx new file mode 100644 index 000000000000..6cbc73337c10 --- /dev/null +++ b/autodoc/source/parser_i/idl/tk_ident.cxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: tk_ident.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/tk_ident.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/tokintpr.hxx> + + + +namespace csi +{ +namespace uidl +{ + +void +TokIdentifier::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Identifier(*this); +} + +const char * +TokIdentifier::Text() const +{ + return sText; +} + +void +TokNameSeparator::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_NameSeparator(); +} + +const char * +TokNameSeparator::Text() const +{ + return "::"; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/tk_keyw.cxx b/autodoc/source/parser_i/idl/tk_keyw.cxx new file mode 100644 index 000000000000..a3c674891815 --- /dev/null +++ b/autodoc/source/parser_i/idl/tk_keyw.cxx @@ -0,0 +1,249 @@ +/************************************************************************* + * + * $RCSfile: tk_keyw.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/tk_keyw.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/tokintpr.hxx> + + +using csi::uidl::TokBuiltInType; +using csi::uidl::TokTypeModifier; +using csi::uidl::TokMetaType; +using csi::uidl::TokStereotype; +using csi::uidl::TokParameterHandling; + + +udm::EnumValueMap G_aTokBuiltInType_EV_TokenId_Values; +TokBuiltInType::EV_TokenId ev_bty_none(TokBuiltInType::e_none,""); +TokBuiltInType::EV_TokenId ev_bty_any(TokBuiltInType::bty_any,"any"); +TokBuiltInType::EV_TokenId ev_bty_boolean(TokBuiltInType::bty_boolean,"boolean"); +TokBuiltInType::EV_TokenId ev_bty_byte(TokBuiltInType::bty_byte,"byte"); +TokBuiltInType::EV_TokenId ev_bty_char(TokBuiltInType::bty_char,"char"); +TokBuiltInType::EV_TokenId ev_bty_double(TokBuiltInType::bty_double,"double"); +TokBuiltInType::EV_TokenId ev_bty_hyper(TokBuiltInType::bty_hyper,"hyper"); +TokBuiltInType::EV_TokenId ev_bty_long(TokBuiltInType::bty_long,"long"); +TokBuiltInType::EV_TokenId ev_bty_short(TokBuiltInType::bty_short,"short"); +TokBuiltInType::EV_TokenId ev_bty_string(TokBuiltInType::bty_string,"string"); +TokBuiltInType::EV_TokenId ev_bty_void(TokBuiltInType::bty_void,"void"); + + +udm::EnumValueMap G_aTokTypeModifier_EV_TokenId_Values; +TokTypeModifier::EV_TokenId ev_tmod_none(TokTypeModifier::e_none,""); +TokTypeModifier::EV_TokenId ev_tmod_unsigned(TokTypeModifier::tmod_unsigned,"unsigned"); +TokTypeModifier::EV_TokenId ev_tmod_sequence(TokTypeModifier::tmod_sequence,"sequence"); + + +udm::EnumValueMap G_aTokMetaType_EV_TokenId_Values; +TokMetaType::EV_TokenId ev_mt_none(TokMetaType::e_none,""); +TokMetaType::EV_TokenId ev_mt_attribute(TokMetaType::mt_attribute,"attribute"); +TokMetaType::EV_TokenId ev_mt_constants(TokMetaType::mt_constants,"constants"); +TokMetaType::EV_TokenId ev_mt_enum(TokMetaType::mt_enum,"enum"); +TokMetaType::EV_TokenId ev_mt_exception(TokMetaType::mt_exception,"exception"); +TokMetaType::EV_TokenId ev_mt_ident(TokMetaType::mt_ident,"ident"); +TokMetaType::EV_TokenId ev_mt_interface(TokMetaType::mt_interface,"interface"); +TokMetaType::EV_TokenId ev_mt_module(TokMetaType::mt_module,"module"); +TokMetaType::EV_TokenId ev_mt_property(TokMetaType::mt_property,"property"); +TokMetaType::EV_TokenId ev_mt_service(TokMetaType::mt_service,"service"); +TokMetaType::EV_TokenId ev_mt_struct(TokMetaType::mt_struct,"struct"); +TokMetaType::EV_TokenId ev_mt_typedef(TokMetaType::mt_typedef,"typedef"); +TokMetaType::EV_TokenId ev_mt_uik(TokMetaType::mt_uik,"uik"); + + +udm::EnumValueMap G_aTokStereotype_EV_TokenId_Values; +TokStereotype::EV_TokenId ev_ste_none(TokStereotype::e_none,""); +TokStereotype::EV_TokenId ev_ste_const(TokStereotype::ste_const,"const"); +TokStereotype::EV_TokenId ev_ste_oneway(TokStereotype::ste_oneway,"oneway"); +TokStereotype::EV_TokenId ev_ste_optional(TokStereotype::ste_optional,"optional"); +TokStereotype::EV_TokenId ev_ste_readonly(TokStereotype::ste_readonly,"readonly"); +TokStereotype::EV_TokenId ev_ste_virtual(TokStereotype::ste_virtual,"virtual"); + + +udm::EnumValueMap G_aTokParameterHandling_EV_TokenId_Values; +TokParameterHandling::EV_TokenId ev_ph_none(TokParameterHandling::e_none,""); +TokParameterHandling::EV_TokenId ev_ph_in(TokParameterHandling::ph_in,"in"); +TokParameterHandling::EV_TokenId ev_ph_out(TokParameterHandling::ph_out,"out"); +TokParameterHandling::EV_TokenId ev_ph_inout(TokParameterHandling::ph_inout,"inout"); + + +namespace udm +{ + +EnumValueMap & +TokBuiltInType::EV_TokenId::Values_() { return G_aTokBuiltInType_EV_TokenId_Values; } +EnumValueMap & +TokTypeModifier::EV_TokenId::Values_() { return G_aTokTypeModifier_EV_TokenId_Values; } +EnumValueMap & +TokMetaType::EV_TokenId::Values_() { return G_aTokMetaType_EV_TokenId_Values; } +EnumValueMap & +TokStereotype::EV_TokenId::Values_() { return G_aTokStereotype_EV_TokenId_Values; } +EnumValueMap & +TokParameterHandling::EV_TokenId::Values_() { return G_aTokParameterHandling_EV_TokenId_Values; } + +} // namespace udm + + + +namespace csi +{ +namespace uidl +{ + +void +TokBuiltInType::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_BuiltInType(*this); +} + +const char * +TokBuiltInType::Text() const +{ + return eTag.Text(); +} + +void +TokTypeModifier::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_TypeModifier(*this); +} + +const char * +TokTypeModifier::Text() const +{ + return eTag.Text(); +} + +void +TokMetaType::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_MetaType(*this); +} + +const char * +TokMetaType::Text() const +{ + return eTag.Text(); +} + +void +TokStereotype::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Stereotype(*this); +} + +const char * +TokStereotype::Text() const +{ + return eTag.Text(); +} + +void +TokParameterHandling::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_ParameterHandling(*this); +} + +const char * +TokParameterHandling::Text() const +{ + return eTag.Text(); +} + +void +TokRaises::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Raises(); +} + +const char * +TokRaises::Text() const +{ + return "raises"; +} + +void +TokNeeds::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Needs(); +} + +const char * +TokNeeds::Text() const +{ + return "needs"; +} +void +TokObserves::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Observes(); +} + +const char * +TokObserves::Text() const +{ + return "observes"; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/tk_punct.cxx b/autodoc/source/parser_i/idl/tk_punct.cxx new file mode 100644 index 000000000000..3e4b58fa0c42 --- /dev/null +++ b/autodoc/source/parser_i/idl/tk_punct.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: tk_punct.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/tk_punct.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/tokintpr.hxx> + + +using csi::uidl::TokPunctuation; + + +udm::EnumValueMap G_aTokPunctuation_EV_TokenId_Values; +TokPunctuation::EV_TokenId ev_none(TokPunctuation::e_none,""); +TokPunctuation::EV_TokenId BracketOpen(TokPunctuation::BracketOpen,"("); +TokPunctuation::EV_TokenId BracketClose(TokPunctuation::BracketClose,")"); +TokPunctuation::EV_TokenId ArrayBracketOpen(TokPunctuation::ArrayBracketOpen,"["); +TokPunctuation::EV_TokenId ArrayBracketClose(TokPunctuation::ArrayBracketClose,"]"); +TokPunctuation::EV_TokenId CurledBracketOpen(TokPunctuation::CurledBracketOpen,"{"); +TokPunctuation::EV_TokenId CurledBracketClose(TokPunctuation::CurledBracketClose,"}"); +TokPunctuation::EV_TokenId Semicolon(TokPunctuation::Semicolon,";"); +TokPunctuation::EV_TokenId Colon(TokPunctuation::Colon,":"); +TokPunctuation::EV_TokenId DoubleColon(TokPunctuation::DoubleColon,"::"); +TokPunctuation::EV_TokenId Comma(TokPunctuation::Comma,","); +TokPunctuation::EV_TokenId Minus(TokPunctuation::Minus,"-"); +TokPunctuation::EV_TokenId Fullstop(TokPunctuation::Fullstop,"."); + + + + +namespace udm +{ +EnumValueMap & +TokPunctuation::EV_TokenId::Values_() { return G_aTokPunctuation_EV_TokenId_Values; } +} + + + + +namespace csi +{ +namespace uidl +{ + +void +TokPunctuation::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Punctuation(*this); +} + +const char * +TokPunctuation::Text() const +{ + return eTag.Text(); +} + +void +Tok_EOL::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_EOL(); +} + +const char * +Tok_EOL::Text() const +{ + return "\r\n"; +} + +void +Tok_EOF::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + csv_assert(false); +// io_rInterpreter.Process_EOF(); +} + +const char * +Tok_EOF::Text() const +{ + return ""; +} + + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/tkp_uidl.cxx b/autodoc/source/parser_i/idl/tkp_uidl.cxx new file mode 100644 index 000000000000..7d46feda0f01 --- /dev/null +++ b/autodoc/source/parser_i/idl/tkp_uidl.cxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: tkp_uidl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_luidl/tkp_uidl.hxx> + +// NOT FULLY DECLARED SERVICES +#include <s2_luidl/cx_idlco.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +TokenParser_Uidl::TokenParser_Uidl( Token_Receiver & o_rUidlReceiver, + DYN ::TkpDocuContext & let_drDocuContext ) + : pBaseContext(new Context_UidlCode(o_rUidlReceiver, let_drDocuContext)), + pCurContext(0) +{ + SetStartContext(); +} + +TokenParser_Uidl::~TokenParser_Uidl() +{ +} + +void +TokenParser_Uidl::SetStartContext() +{ + pCurContext = pBaseContext.Ptr(); +} + +void +TokenParser_Uidl::SetCurrentContext( TkpContext & io_rContext ) +{ + pCurContext = &io_rContext; +} + +TkpContext & +TokenParser_Uidl::CurrentContext() +{ + return *pCurContext; +} + +} // namespace uidl +} // namespace csi + diff --git a/autodoc/source/parser_i/idl/unoidl.cxx b/autodoc/source/parser_i/idl/unoidl.cxx new file mode 100644 index 000000000000..f7eac1942b31 --- /dev/null +++ b/autodoc/source/parser_i/idl/unoidl.cxx @@ -0,0 +1,170 @@ +/************************************************************************* + * + * $RCSfile: unoidl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <parser/unoidl.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/file.hxx> +#include <ary/ary.hxx> +#include <ary_i/codeinf2.hxx> +#include <ary_i/uidl/gate.hxx> +#include <tools/filecoll.hxx> +#include <tools/tkpchars.hxx> +#include <s2_luidl/tkp_uidl.hxx> +#include <s2_luidl/distrib.hxx> +#include <s2_luidl/pe_file2.hxx> +#include <s2_dsapi/cx_dsapi.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +class FileParsePerformers +{ + public: + FileParsePerformers( ary::Repository & io_rRepository ); + + void ParseFile( + const char * i_sFullPath ); + + void ConnectLinks(); + + private: + CharacterSource aFileLoader; + Dyn<TokenParser_Uidl> + pTokens; + TokenDistributor aDistributor; + Dyn<PE_File> pFileParseEnvironment; + ary::Repository & rRepository; +}; + + +Uidl_Parser::Uidl_Parser( ary::Repository & io_rRepository ) + : pRepository(&io_rRepository) +{ +} + +void +Uidl_Parser::Run( const autodoc::FileCollector_Ifc & i_rFiles ) +{ + FileParsePerformers aFileParsePerformers( *pRepository ); + + FileCollector::const_iterator iEnd = i_rFiles.End(); + for ( FileCollector::const_iterator iter = i_rFiles.Begin(); + iter != iEnd; + ++iter ) + { + Cout() << (*iter) << " ..."<< Endl(); + aFileParsePerformers.ParseFile(*iter); + } + + aFileParsePerformers.ConnectLinks(); +} + +FileParsePerformers::FileParsePerformers( ary::Repository & io_rRepository ) + : aDistributor(io_rRepository), + rRepository( io_rRepository ) +{ + DYN csi::dsapi::Context_Docu * dpDocuContext + = new csi::dsapi::Context_Docu( aDistributor.DocuTokens_Receiver() ); + pTokens = new TokenParser_Uidl( aDistributor.CodeTokens_Receiver(), *dpDocuContext ); + pFileParseEnvironment + = new PE_File(aDistributor); + + aDistributor.SetTokenProvider(*pTokens); + aDistributor.SetTopParseEnvironment(*pFileParseEnvironment); +} + +void +FileParsePerformers::ParseFile( const char * i_sFullPath ) +{ + csv::File aFile(i_sFullPath); + + aFile.open( csv::CFM_READ ); + csv_assert( aFile.is_open() ); + aFileLoader.LoadText(aFile); + aFile.close(); + + pTokens->Start(aFileLoader); + aDistributor.Reset(); + + do { + aDistributor.TradeToken(); + } while ( NOT aFileLoader.IsFinished() ); +} + +void +FileParsePerformers::ConnectLinks() +{ + rRepository.RwGate_Idl().ConnectAdditionalLinks(); +} + +} // namespace uidl +} // namespace csi + + diff --git a/autodoc/source/parser_i/idoc/cx_docu2.cxx b/autodoc/source/parser_i/idoc/cx_docu2.cxx new file mode 100644 index 000000000000..532b15c68724 --- /dev/null +++ b/autodoc/source/parser_i/idoc/cx_docu2.cxx @@ -0,0 +1,295 @@ +/************************************************************************* + * + * $RCSfile: cx_docu2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_dsapi/cx_docu2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <../../parser/inc/tokens/parseinc.hxx> +#include <s2_dsapi/tokrecv.hxx> +#include <s2_dsapi/tk_html.hxx> +#include <s2_dsapi/tk_xml.hxx> +#include <s2_dsapi/tk_docw2.hxx> +#include <x_parse2.hxx> + + + +namespace csi +{ +namespace dsapi +{ + + + +bool +Cx_Base::PassNewToken() +{ + if (pNewToken) + { + rReceiver.Receive(*pNewToken.Release()); + + return true; + } + return false; +} + +TkpContext & +Cx_Base::FollowUpContext() +{ + csv_assert(pFollowUpContext != 0); + return *pFollowUpContext; +} + +void +Cx_Base::Handle_DocuSyntaxError( CharacterSource & io_rText ) +{ + io_rText.MoveOn(); + Cerr() << "Error: Syntax error in documentation within " + << "this text:\n\"" + << io_rText.CutToken() + << "\"." + << Endl(); + SetToken( new Tok_Word(io_rText.CurToken()) ); +} + +void +Cx_EoHtml::ReadCharChain( CharacterSource & io_rText ) +{ + if ( NULCH == jumpTo(io_rText,'>') ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + io_rText.MoveOn(); + SetToken(new Tok_HtmlTag(io_rText.CutToken(),bToken_IsStartOfParagraph)); +} + +void +Cx_EoXmlConst::ReadCharChain( CharacterSource & io_rText ) +{ + char c = jumpTo(io_rText,'>','*'); + if ( NULCH == c OR '*' == c ) + { + Handle_DocuSyntaxError(io_rText); + return; + } + + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlConst(eTokenId)); +} + +void +Cx_EoXmlLink_BeginTag::ReadCharChain( CharacterSource & io_rText ) +{ + udmstri sScope; + udmstri sDim; + + do { + char cReached = jumpTo(io_rText,'"','>','*'); + switch (cReached) + { + case '"': + { + io_rText.MoveOn(); + io_rText.CutToken(); + char c = jumpTo(io_rText,'"','*', '>'); + if ( NULCH == c OR '*' == c OR '>' == c) + { + Handle_DocuSyntaxError(io_rText); + return; + } + + const char * pAttribute = io_rText.CutToken(); + if ( *pAttribute != '[' ) + sScope = pAttribute; + else + sDim = pAttribute; + + io_rText.MoveOn(); + break; + } + case '>': + break; + case '*': + Handle_DocuSyntaxError(io_rText); + return; + default: + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + } // end switch + } while ( io_rText.CurChar() != '>' ); + + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken( new Tok_XmlLink_BeginTag(eTokenId, sScope.c_str(), sDim.c_str()) ); +} + +void +Cx_EoXmlLink_EndTag::ReadCharChain( CharacterSource & io_rText ) +{ + char c = jumpTo(io_rText,'>','*'); + if ( NULCH == c OR '*' == c ) + { + Handle_DocuSyntaxError(io_rText); + return; + } + + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlLink_EndTag(eTokenId)); +} + +void +Cx_EoXmlFormat_BeginTag::ReadCharChain( CharacterSource & io_rText ) +{ + udmstri sDim; + + char cReached = jumpTo(io_rText,'"','>','*'); + switch (cReached) + { + case '"': + { + io_rText.MoveOn(); + io_rText.CutToken(); + + char c = jumpTo(io_rText,'"','*','>'); + if ( NULCH == c OR '*' == c OR '>' == c ) + { + Handle_DocuSyntaxError(io_rText); + return; + } + + sDim = io_rText.CutToken(); + + c = jumpTo(io_rText,'>','*'); + if ( NULCH == c OR '*' == c ) + { + Handle_DocuSyntaxError(io_rText); + return; + } + break; + } + case '>': + break; + case '*': + Handle_DocuSyntaxError(io_rText); + return; + default: + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + } // end switch + + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlFormat_BeginTag(eTokenId, sDim)); +} + +void +Cx_EoXmlFormat_EndTag::ReadCharChain( CharacterSource & io_rText ) +{ + char c = jumpTo(io_rText,'>','*'); + if ( NULCH == c OR '*' == c ) + { + Handle_DocuSyntaxError(io_rText); + return; + } + + io_rText.MoveOn(); + io_rText.CutToken(); + SetToken(new Tok_XmlFormat_EndTag(eTokenId)); +} + +void +Cx_CheckStar::ReadCharChain( CharacterSource & io_rText ) +{ + bEndTokenFound = false; + if (bIsEnd) + { + char cNext = jumpOver(io_rText,'*'); + if ( NULCH == cNext ) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + if (cNext == '/') + { + io_rText.MoveOn(); + SetToken(new Tok_DocuEnd); + bEndTokenFound = true; + } + else + { + SetToken( new Tok_Word(io_rText.CutToken()) ); + } + } + else + { + jumpToWhite(io_rText); + SetToken( new Tok_Word(io_rText.CutToken()) ); + } +} + +TkpContext & +Cx_CheckStar::FollowUpContext() +{ + if (bEndTokenFound) + return *pEnd_FollowUpContext; + else + return Cx_Base::FollowUpContext(); +} + +} // namespace dsapi +} // namespace csi + diff --git a/autodoc/source/parser_i/idoc/cx_dsapi.cxx b/autodoc/source/parser_i/idoc/cx_dsapi.cxx new file mode 100644 index 000000000000..fc6fd8d8726b --- /dev/null +++ b/autodoc/source/parser_i/idoc/cx_dsapi.cxx @@ -0,0 +1,546 @@ +/************************************************************************* + * + * $RCSfile: cx_dsapi.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_dsapi/cx_dsapi.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <x_parse2.hxx> +#include <tools/tkpchars.hxx> +#include <s2_dsapi/tk_atag2.hxx> +#include <s2_dsapi/tk_docw2.hxx> +#include <s2_dsapi/tk_xml.hxx> +#include <s2_dsapi/cx_docu2.hxx> +#include <s2_dsapi/tokrecv.hxx> + + +namespace csi +{ +namespace dsapi +{ + + +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_Eof = 3; +const uintt nF_fin_AnyWord = 4; +const uintt nF_fin_AtTag = 5; +const uintt nF_fin_EndSign = 6; +const uintt nF_goto_EoHtml = 7; +const uintt nF_goto_EoXmlConst = 8; +const uintt nF_goto_EoXmlLink_BeginTag = 9; +const uintt nF_goto_EoXmlLink_EndTag = 10; +const uintt nF_goto_EoXmlFormat_BeginTag = 11; +const uintt nF_goto_EoXmlFormat_EndTag = 12; +const uintt nF_goto_CheckStar = 13; +const uintt nF_fin_Comma = 14; + +const UINT16 nTok_at_author = 100 + Tok_AtTag::author; +const UINT16 nTok_at_see = 100 + Tok_AtTag::see; +const UINT16 nTok_at_param = 100 + Tok_AtTag::param; +const UINT16 nTok_at_return = 100 + Tok_AtTag::e_return; +const UINT16 nTok_at_throws = 100 + Tok_AtTag::e_throw; +const UINT16 nTok_at_example = 100 + Tok_AtTag::example; +const UINT16 nTok_at_deprecated = 100 + Tok_AtTag::deprecated; +const UINT16 nTok_at_suspicious = 100 + Tok_AtTag::suspicious; +const UINT16 nTok_at_missing = 100 + Tok_AtTag::missing; +const UINT16 nTok_at_incomplete = 100 + Tok_AtTag::incomplete; +const UINT16 nTok_at_version = 100 + Tok_AtTag::version; +const UINT16 nTok_at_guarantees = 100 + Tok_AtTag::guarantees; +const UINT16 nTok_at_exception = 100 + Tok_AtTag::exception; + +const UINT16 nTok_const_TRUE = 200 + Tok_XmlConst::e_true; +const UINT16 nTok_const_FALSE = 200 + Tok_XmlConst::e_false; +const UINT16 nTok_const_NULL = 200 + Tok_XmlConst::e_null; +const UINT16 nTok_const_void = 200 + Tok_XmlConst::e_void; + +const UINT16 nTok_link_typeB = 300 + Tok_XmlLink_BeginTag::type; +const UINT16 nTok_link_typeE = 325 + Tok_XmlLink_EndTag::type; +const UINT16 nTok_link_memberB = 300 + Tok_XmlLink_BeginTag::member; +const UINT16 nTok_link_membeE = 325 + Tok_XmlLink_EndTag::member; +const UINT16 nTok_link_constB = 300 + Tok_XmlLink_BeginTag::e_const; +const UINT16 nTok_link_constE = 325 + Tok_XmlLink_EndTag::e_const; + +const UINT16 nTok_format_listingB = 350 + Tok_XmlFormat_BeginTag::listing; +const UINT16 nTok_format_listingE = 375 + Tok_XmlFormat_EndTag::listing; +const UINT16 nTok_format_codeB = 350 + Tok_XmlFormat_BeginTag::code; +const UINT16 nTok_format_codeE = 375 + Tok_XmlFormat_EndTag::code; +const UINT16 nTok_format_atomB = 350 + Tok_XmlFormat_BeginTag::atom; +const UINT16 nTok_format_atomE = 375 + Tok_XmlFormat_EndTag::atom; + + +const UINT16 nTok_html_parastart = 400; + +const UINT16 nTok_MLDocuEnd = 501; +const UINT16 nTok_EOL = 502; + + +Context_Docu::Context_Docu( Token_Receiver & o_rReceiver ) + : aStateMachine(C_nStatusSize, C_nCppInitialNrOfStati), + pReceiver(&o_rReceiver), + pParentContext(0), + pCx_EoHtml( new Cx_EoHtml(o_rReceiver, *this) ), + pCx_EoXmlConst( new Cx_EoXmlConst(o_rReceiver, *this) ), + pCx_EoXmlLink_BeginTag( new Cx_EoXmlLink_BeginTag(o_rReceiver, *this) ), + pCx_EoXmlLink_EndTag( new Cx_EoXmlLink_EndTag(o_rReceiver, *this) ), + pCx_EoXmlFormat_BeginTag( new Cx_EoXmlFormat_BeginTag(o_rReceiver, *this) ), + pCx_EoXmlFormat_EndTag( new Cx_EoXmlFormat_EndTag(o_rReceiver, *this) ), + pCx_CheckStar( new Cx_CheckStar(*pReceiver,*this) ), + pNewToken(0), + pFollowUpContext(0), + bIsMultiline(false) +{ + SetupStateMachine(); +} + +void +Context_Docu::SetParentContext( TkpContext & io_rParentContext, + const char * i_sMultiLineEndToken ) +{ + pFollowUpContext = pParentContext = &io_rParentContext; + pCx_CheckStar->Set_End_FolloUpContext(io_rParentContext); +} + +Context_Docu::~Context_Docu() +{ +} + +void +Context_Docu::ReadCharChain( CharacterSource & io_rText ) +{ + csv_assert(pParentContext != 0); + + pNewToken = 0; + + UINT16 nTokenId = 0; + StmBoundsStatu2 & rBound = aStateMachine.GetCharChain(nTokenId, 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(), nTokenId, io_rText); +} + +bool +Context_Docu::PassNewToken() +{ + if (pNewToken) + { + pReceiver->Receive(*pNewToken.Release()); + return true; + } + return false; +} + +TkpContext & +Context_Docu::FollowUpContext() +{ + csv_assert(pFollowUpContext != 0); + return *pFollowUpContext; +} + +void +Context_Docu::PerformStatusFunction( uintt i_nStatusSignal, + UINT16 i_nTokenId, + CharacterSource & io_rText ) +{ + switch (i_nStatusSignal) + { + case nF_fin_Error: + throw X_AutodocParser(X_AutodocParser::x_InvalidChar); + break; + case nF_fin_Ignore: + pNewToken = 0; + io_rText.CutToken(); + break; + case nF_fin_Eof: + if (bIsMultiline) + throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF); + else + io_rText.CutToken(); + pNewToken = new Tok_EOF; + break; + case nF_fin_AnyWord: + pNewToken = new Tok_Word(io_rText.CutToken()); + break; + case nF_fin_AtTag: + io_rText.CutToken(); + pNewToken = new Tok_AtTag( i_nTokenId - 100 ); + break; + case nF_fin_Comma: + io_rText.CutToken(); + pNewToken = new Tok_Comma; + case nF_fin_EndSign: + io_rText.CutToken(); + switch (i_nTokenId) + { + case nTok_MLDocuEnd: + if (bIsMultiline) + { + pNewToken = new Tok_DocuEnd; + pFollowUpContext = pParentContext; + } + else + { + pNewToken = new Tok_Word(io_rText.CutToken()); + pFollowUpContext = this; + } + break; + case nTok_EOL: + if (bIsMultiline) + { + pNewToken = new Tok_EOL; + pFollowUpContext = this; + } + else + { + pNewToken = new Tok_DocuEnd; + pFollowUpContext = pParentContext; + } + break; + default: + csv_assert(false); + } + break; + case nF_goto_EoHtml: + pCx_EoHtml->SetIfIsStartOfParagraph(i_nTokenId == nTok_html_parastart); + break; + case nF_goto_EoXmlConst: + pCx_EoXmlConst->SetTokenId(i_nTokenId - 200); + break; + case nF_goto_EoXmlLink_BeginTag: + pCx_EoXmlLink_BeginTag->SetTokenId(i_nTokenId - 300); + break; + case nF_goto_EoXmlLink_EndTag: + pCx_EoXmlLink_EndTag->SetTokenId(i_nTokenId - 325); + break; + case nF_goto_EoXmlFormat_BeginTag: + pCx_EoXmlFormat_BeginTag->SetTokenId(i_nTokenId - 350); + break; + case nF_goto_EoXmlFormat_EndTag: + pCx_EoXmlFormat_EndTag->SetTokenId(i_nTokenId - 375); + break; + case nF_goto_CheckStar: + pCx_CheckStar->SetIsEnd( bIsMultiline ); + break; + default: + csv_assert(false); + } // end switch (i_nStatusSignal) +} + +void +Context_Docu::SetupStateMachine() +{ + // Besondere Array-Stati (kein Tokenabschluss oder Kontextwechsel): + const INT16 bas = 0; // Base-Status + const INT16 wht = 1; // Whitespace-overlook-Status + const INT16 awd = 2; // Any-Word-Read-Status + + // Kontextwechsel-Stati: + const INT16 goto_EoHtml = 3; + const INT16 goto_EoXmlConst = 4; + const INT16 goto_EoXmlLink_BeginTag = 5; + const INT16 goto_EoXmlLink_EndTag = 6; + const INT16 goto_EoXmlFormat_BeginTag = 7; + const INT16 goto_EoXmlFormat_EndTag = 8; + const INT16 goto_CheckStar = 9; + + // Tokenfinish-Stati: + const INT16 finError = 10; + const INT16 finIgnore = 11; + const INT16 finEof = 12; + const INT16 finAnyWord = 13; + const INT16 finAtTag = 14; + const INT16 finEndSign = 15; + const INT16 finComma = 16; + + // Konstanten zur Benutzung in der Tabelle: + const INT16 ght = goto_EoHtml; +/* + const INT16 gxc = goto_EoXmlConst; + const INT16 glb = goto_EoXmlLink_TagBegin; + const INT16 gle = goto_EoXmlLink_TagEnd; + const INT16 gfb = goto_EoXmlFormat_TagBegin; + const INT16 gfe = goto_EoXmlFormat_TagEnd; +*/ + const INT16 err = finError; + const INT16 faw = finAnyWord; + const INT16 fig = finIgnore; +// const INT16 fes = finEndSign; + const INT16 fof = finEof; +// const INT16 fat = finAtTag; + + /// 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, 0,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,fig,wht,wht,fig,err,err, + err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31 + 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, // ... 63 + 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, // ... 95 + 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 // ... 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,faw,awd,awd,awd, // ... 63 + faw,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,faw,awd,faw,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_nHtmlDefStatus[C_nStatusSize] = + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + {ght,err,err,err,err,err,err,err,err,ght,ght,ght,ght,ght,err,err, + err,err,err,err,err,err,err,err,err,err,ght,err,err,err,err,err, // ... 31 + ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, + ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, // ... 63 + ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, + ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, // ... 95 + ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, + ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght // ... 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 StmArrayStatu2 * dpStatusTop + = new StmArrayStatu2( C_nStatusSize, A_nTopStatus, 0, true); + DYN StmArrayStatu2 * dpStatusWhite + = new StmArrayStatu2( C_nStatusSize, A_nWhitespaceStatus, 0, true); + DYN StmArrayStatu2 * dpStatusWord + = new StmArrayStatu2( C_nStatusSize, A_nWordStatus, 0, true); + + DYN StmBoundsStatu2 * dpBst_goto_EoHtml + = new StmBoundsStatu2( *this, *pCx_EoHtml, nF_goto_EoHtml, true ); + DYN StmBoundsStatu2 * dpBst_goto_EoXmlConst + = new StmBoundsStatu2( *this, *pCx_EoXmlConst, nF_goto_EoXmlConst, true ); + DYN StmBoundsStatu2 * dpBst_goto_EoXmlLink_BeginTag + = new StmBoundsStatu2( *this, *pCx_EoXmlLink_BeginTag, nF_goto_EoXmlLink_BeginTag, true ); + DYN StmBoundsStatu2 * dpBst_goto_EoXmlLink_EndTag + = new StmBoundsStatu2( *this, *pCx_EoXmlLink_EndTag, nF_goto_EoXmlLink_EndTag, true ); + DYN StmBoundsStatu2 * dpBst_goto_EoXmlFormat_BeginTag + = new StmBoundsStatu2( *this, *pCx_EoXmlFormat_BeginTag, nF_goto_EoXmlFormat_BeginTag, true ); + DYN StmBoundsStatu2 * dpBst_goto_EoXmlFormat_EndTag + = new StmBoundsStatu2( *this, *pCx_EoXmlFormat_EndTag, nF_goto_EoXmlFormat_EndTag, true ); + DYN StmBoundsStatu2 * dpBst_goto_CheckStar + = new StmBoundsStatu2( *this, *pCx_CheckStar, nF_goto_CheckStar, true ); + + + DYN StmBoundsStatu2 * dpBst_finError + = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_Error, true ); + DYN StmBoundsStatu2 * dpBst_finIgnore + = new StmBoundsStatu2( *this, *this, nF_fin_Ignore, true); + DYN StmBoundsStatu2 * dpBst_finEof + = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_Eof, false); + DYN StmBoundsStatu2 * dpBst_finAnyWord + = new StmBoundsStatu2( *this, *this, nF_fin_AnyWord, true); + DYN StmBoundsStatu2 * dpBst_finAtTag + = new StmBoundsStatu2( *this, *this, nF_fin_AtTag, false); + DYN StmBoundsStatu2 * dpBst_finEndSign + = new StmBoundsStatu2( *this, *pParentContext, nF_fin_EndSign, false); + DYN StmBoundsStatu2 * dpBst_fin_Comma + = new StmBoundsStatu2( *this, *this, nF_fin_Comma, false ); + + + // dpMain aufbauen: + aStateMachine.AddStatus(dpStatusTop); + aStateMachine.AddStatus(dpStatusWhite); + aStateMachine.AddStatus(dpStatusWord); + + aStateMachine.AddStatus(dpBst_goto_EoHtml); + aStateMachine.AddStatus(dpBst_goto_EoXmlConst); + aStateMachine.AddStatus(dpBst_goto_EoXmlLink_BeginTag); + aStateMachine.AddStatus(dpBst_goto_EoXmlLink_EndTag); + aStateMachine.AddStatus(dpBst_goto_EoXmlFormat_BeginTag); + aStateMachine.AddStatus(dpBst_goto_EoXmlFormat_EndTag); + aStateMachine.AddStatus(dpBst_goto_CheckStar); + + aStateMachine.AddStatus(dpBst_finError); + aStateMachine.AddStatus(dpBst_finIgnore); + aStateMachine.AddStatus(dpBst_finEof); + aStateMachine.AddStatus(dpBst_finAnyWord); + aStateMachine.AddStatus(dpBst_finAtTag); + aStateMachine.AddStatus(dpBst_finEndSign); + aStateMachine.AddStatus(dpBst_fin_Comma); + + + aStateMachine.AddToken( "@author", nTok_at_author, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@param", nTok_at_param, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@throws", nTok_at_throws, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@see", nTok_at_see, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@example", nTok_at_example, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@return", nTok_at_return, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@returns", nTok_at_return, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@deprecated", + nTok_at_deprecated, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@suspicious", + nTok_at_suspicious, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@missing", nTok_at_missing, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@incomplete", + nTok_at_incomplete, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@version", nTok_at_version, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@guarantees", + nTok_at_guarantees, A_nAtTagDefStatus, finAtTag ); + aStateMachine.AddToken( "@exception", + nTok_at_exception, A_nAtTagDefStatus, finAtTag ); + + aStateMachine.AddToken( "<", 0, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "*", 0, A_nPunctDefStatus, goto_CheckStar ); +// aStateMachine.AddToken( ",", 0, A_nPunctDefStatus, finComma ); + + aStateMachine.AddToken( "<type", nTok_link_typeB, A_nHtmlDefStatus, goto_EoXmlLink_BeginTag ); + aStateMachine.AddToken( "</type", nTok_link_typeE, A_nHtmlDefStatus, goto_EoXmlLink_EndTag ); + aStateMachine.AddToken( "<member", nTok_link_memberB, A_nHtmlDefStatus, goto_EoXmlLink_BeginTag ); + aStateMachine.AddToken( "</member", nTok_link_membeE, A_nHtmlDefStatus, goto_EoXmlLink_EndTag ); + aStateMachine.AddToken( "<const", nTok_link_constB, A_nHtmlDefStatus, goto_EoXmlLink_BeginTag ); + aStateMachine.AddToken( "</const", nTok_link_constE, A_nHtmlDefStatus, goto_EoXmlLink_EndTag ); + + aStateMachine.AddToken( "<listing", nTok_format_listingB,A_nHtmlDefStatus, goto_EoXmlFormat_BeginTag ); + aStateMachine.AddToken( "</listing",nTok_format_listingE,A_nHtmlDefStatus, goto_EoXmlFormat_EndTag ); + aStateMachine.AddToken( "<code", nTok_format_codeB, A_nHtmlDefStatus, goto_EoXmlFormat_BeginTag ); + aStateMachine.AddToken( "</code", nTok_format_codeE, A_nHtmlDefStatus, goto_EoXmlFormat_EndTag ); + aStateMachine.AddToken( "<atom", nTok_format_atomB, A_nHtmlDefStatus, goto_EoXmlFormat_BeginTag ); + aStateMachine.AddToken( "</atom", nTok_format_atomE, A_nHtmlDefStatus, goto_EoXmlFormat_EndTag ); + + aStateMachine.AddToken( "<TRUE/", nTok_const_TRUE, A_nHtmlDefStatus, goto_EoXmlConst ); + aStateMachine.AddToken( "<true/", nTok_const_TRUE, A_nHtmlDefStatus, goto_EoXmlConst ); + aStateMachine.AddToken( "<FALSE/", nTok_const_FALSE, A_nHtmlDefStatus, goto_EoXmlConst ); + aStateMachine.AddToken( "<false/", nTok_const_FALSE, A_nHtmlDefStatus, goto_EoXmlConst ); + aStateMachine.AddToken( "<NULL/", nTok_const_NULL, A_nHtmlDefStatus, goto_EoXmlConst ); + aStateMachine.AddToken( "<void/", nTok_const_void, A_nHtmlDefStatus, goto_EoXmlConst ); + + aStateMachine.AddToken( "<p", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<pre", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<dl", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<ul", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<ol", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<table", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<P", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<PRE", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<DL", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<UL", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<OL", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + aStateMachine.AddToken( "<TABLE", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml ); + + aStateMachine.AddToken( "\r\n", nTok_EOL, A_nPunctDefStatus, finEndSign ); + aStateMachine.AddToken( "\n", nTok_EOL, A_nPunctDefStatus, finEndSign ); + aStateMachine.AddToken( "\r", nTok_EOL, A_nPunctDefStatus, finEndSign ); +}; + +void +Context_Docu::SetMode_IsMultiLine( bool i_bTrue ) +{ + bIsMultiline = i_bTrue; +} + + +} // namespace dsapi +} // namespace csi + diff --git a/autodoc/source/parser_i/idoc/docu_pe2.cxx b/autodoc/source/parser_i/idoc/docu_pe2.cxx new file mode 100644 index 000000000000..d984545a582b --- /dev/null +++ b/autodoc/source/parser_i/idoc/docu_pe2.cxx @@ -0,0 +1,428 @@ +/************************************************************************* + * + * $RCSfile: docu_pe2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include <s2_dsapi/docu_pe2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary_i/codeinf2.hxx> +#include <s2_dsapi/dsapitok.hxx> +#include <s2_dsapi/tk_atag2.hxx> +#include <s2_dsapi/tk_html.hxx> +#include <s2_dsapi/tk_docw2.hxx> +#include <s2_dsapi/tk_xml.hxx> +#include <csi/d_sapi/d_token.hxx> + + +#ifdef UNX +#define strnicmp strncasecmp +#endif + + +namespace csi +{ +namespace dsapi +{ + + +const char * AtTagTitle( + const Tok_AtTag & i_rToken ); + + +SapiDocu_PE::SapiDocu_PE() + : pDocu(0), + eState(e_none), + fCurTokenAddFunction(AddDocuToken2Void), + pCurAtTag(0) +{ +} + +SapiDocu_PE::~SapiDocu_PE() +{ +} + +void +SapiDocu_PE::ProcessToken( DYN csi::dsapi::Token & let_drToken ) +{ + if (IsComplete()) + { + pDocu = 0; + eState = e_none; + } + + if ( eState == e_none ) + { + pDocu = new ary::info::CodeInformation; + eState = st_short; + fCurTokenAddFunction = AddDocuToken2Short; + } + + csv_assert(pDocu); + + let_drToken.Trigger(*this); + delete &let_drToken; +} + +void +SapiDocu_PE::Process_AtTag( const Tok_AtTag & i_rToken ) +{ + if (NOT pCurAtTag) + { + eState = st_attags; + fCurTokenAddFunction = AddDocuToken2CurAtTag; + } + else + { + csv_assert(eState = st_attags); + pDocu->AddAtTag(*pCurAtTag.Release()); + } + + if (i_rToken.Id() == Tok_AtTag::param) + { + pCurAtTag = new DT_ParameterAtTag; + fCurTokenAddFunction = SetCurParameterAtTagName; + } + else if (i_rToken.Id() == Tok_AtTag::see) + { + pCurAtTag = new DT_SeeAlsoAtTag; + fCurTokenAddFunction = SetCurSeeAlsoAtTagLinkText; + } + else if (i_rToken.Id() == Tok_AtTag::deprecated) + { + pDocu->SetDeprecated(); + pCurAtTag = new DT_StdAtTag(""); + fCurTokenAddFunction = AddDocuToken2CurAtTag; + } + else + { + pCurAtTag = new DT_StdAtTag( AtTagTitle(i_rToken) ); + fCurTokenAddFunction = AddDocuToken2CurAtTag; + } +} + +void +SapiDocu_PE::Process_HtmlTag( const Tok_HtmlTag & i_rToken ) +{ + if (eState == st_short AND i_rToken.IsParagraphStarter()) + { + eState = st_description; + fCurTokenAddFunction = AddDocuToken2Description; + } + + // Workaround special for some errors in API docu: + if ( strnicmp("<true",i_rToken.Text(),5 ) == 0 ) + { + Cerr() << "Invalid const symbol: " << i_rToken.Text() << Endl(); + (this->*fCurTokenAddFunction)( *new DT_TextToken("<b>true</b>") ); + return; + } + else if ( strnicmp("<false",i_rToken.Text(),6 ) == 0 ) + { + Cerr() << "Invalid const symbol: " << i_rToken.Text() << Endl(); + (this->*fCurTokenAddFunction)( *new DT_TextToken("<b>false</b>") ); + return; + } + else if ( strnicmp("<NULL",i_rToken.Text(),5 ) == 0 ) + { + Cerr() << "Invalid const symbol: " << i_rToken.Text() << Endl(); + (this->*fCurTokenAddFunction)( *new DT_TextToken("<b>null</b>") ); + return; + } + else if ( strnicmp("<void",i_rToken.Text(),5 ) == 0 ) + { + Cerr() << "Invalid const symbol: " << i_rToken.Text() << Endl(); + (this->*fCurTokenAddFunction)( *new DT_TextToken("<b>void</b>") ); + return; + } + + (this->*fCurTokenAddFunction)( *new DT_Style(i_rToken.Text(),false) ); +} + +void +SapiDocu_PE::Process_XmlConst( const Tok_XmlConst & i_rToken ) +{ + (this->*fCurTokenAddFunction)(*new DT_MupConst(i_rToken.Text())); +} + +void +SapiDocu_PE::Process_XmlLink_BeginTag( const Tok_XmlLink_BeginTag & i_rToken ) +{ + switch (i_rToken.Id()) + { + case Tok_XmlLink_Tag::e_const: + (this->*fCurTokenAddFunction)(*new DT_Style("<b>",false)); + break; + case Tok_XmlLink_Tag::member: + (this->*fCurTokenAddFunction)(*new DT_MupMember(i_rToken.Scope())); + break; + case Tok_XmlLink_Tag::type: + (this->*fCurTokenAddFunction)(*new DT_MupType(i_rToken.Scope())); + break; + // default: + // Do nothing. + } + + if ( i_rToken.Dim().length() > 0 ) + sCurDimAttribute = i_rToken.Dim(); + else + sCurDimAttribute.clear(); +} + +void +SapiDocu_PE::Process_XmlLink_EndTag( const Tok_XmlLink_EndTag & i_rToken ) +{ + switch (i_rToken.Id()) + { + case Tok_XmlLink_Tag::e_const: + (this->*fCurTokenAddFunction)(*new DT_Style("</b>",false)); + break; + case Tok_XmlLink_Tag::member: + (this->*fCurTokenAddFunction)(*new DT_MupMember(true)); + break; + case Tok_XmlLink_Tag::type: + (this->*fCurTokenAddFunction)(*new DT_MupType(true)); + break; + // default: + // Do nothing. + } + if ( sCurDimAttribute.length() > 0 ) + { + (this->*fCurTokenAddFunction)( *new DT_TextToken(sCurDimAttribute.c_str()) ); + sCurDimAttribute.clear(); + } +} + +void +SapiDocu_PE::Process_XmlFormat_BeginTag( const Tok_XmlFormat_BeginTag & i_rToken ) +{ + switch (i_rToken.Id()) + { + case Tok_XmlFormat_Tag::code: + (this->*fCurTokenAddFunction)(*new DT_Style("<code>",false)); + break; + case Tok_XmlFormat_Tag::listing: + (this->*fCurTokenAddFunction)(*new DT_Style("<pre>",true)); + break; + case Tok_XmlFormat_Tag::atom: + (this->*fCurTokenAddFunction)(*new DT_Style("<code>",true)); + break; + // default: + // Do nothing. + } + if ( i_rToken.Dim().length() > 0 ) + sCurDimAttribute = i_rToken.Dim(); + else + sCurDimAttribute.clear(); +} + +void +SapiDocu_PE::Process_XmlFormat_EndTag( const Tok_XmlFormat_EndTag & i_rToken ) +{ + switch (i_rToken.Id()) + { + case Tok_XmlFormat_Tag::code: + (this->*fCurTokenAddFunction)(*new DT_Style("</code>",false)); + break; + case Tok_XmlFormat_Tag::listing: + (this->*fCurTokenAddFunction)(*new DT_Style("</pre>",true)); + break; + case Tok_XmlFormat_Tag::atom: + (this->*fCurTokenAddFunction)(*new DT_Style("</code>",true)); + break; + // default: + // Do nothing. + } + if ( sCurDimAttribute.length() > 0 ) + { + (this->*fCurTokenAddFunction)( *new DT_TextToken(sCurDimAttribute.c_str()) ); + sCurDimAttribute.clear(); + } +} + +void +SapiDocu_PE::Process_Word( const Tok_Word & i_rToken ) +{ + (this->*fCurTokenAddFunction)(*new DT_TextToken(i_rToken.Text())); +} + +void +SapiDocu_PE::Process_Comma() +{ + csv_assert(1==7); +// (this->*fCurTokenAddFunction)(*new DT_Comma(i_rToken.Text())); +} + +void +SapiDocu_PE::Process_DocuEnd() +{ + eState = st_complete; + if (pCurAtTag) + pDocu->AddAtTag(*pCurAtTag.Release()); + fCurTokenAddFunction = AddDocuToken2Void; +} + +void +SapiDocu_PE::Process_EOL() +{ + (this->*fCurTokenAddFunction)(*new DT_EOL); +} + + +DYN ary::info::CodeInformation * +SapiDocu_PE::ReleaseJustParsedDocu() +{ + if (IsComplete()) + { + eState = e_none; + return pDocu.Release(); + } + return 0; +} + + +bool +SapiDocu_PE::IsComplete() const +{ + return eState == st_complete; +} + +void +SapiDocu_PE::AddDocuToken2Void( DYN ary::info::DocuToken & let_drNewToken ) +{ + delete &let_drNewToken; +} + +void +SapiDocu_PE::AddDocuToken2Short( DYN ary::info::DocuToken & let_drNewToken ) +{ + csv_assert(pDocu); + pDocu->AddToken2Short(let_drNewToken); +} + +void +SapiDocu_PE::AddDocuToken2Description( DYN ary::info::DocuToken & let_drNewToken ) +{ + csv_assert(pDocu); + pDocu->AddToken2Description(let_drNewToken); +} + +void +SapiDocu_PE::AddDocuToken2CurAtTag( DYN ary::info::DocuToken & let_drNewToken ) +{ + csv_assert(pCurAtTag); + pCurAtTag->AddToken(let_drNewToken); +} + +void +SapiDocu_PE::SetCurParameterAtTagName( DYN ary::info::DocuToken & let_drNewToken ) +{ + csv_assert(pCurAtTag); + DT_TextToken * dpText = dynamic_cast< DT_TextToken* >(&let_drNewToken); + if (dpText != 0) + pCurAtTag->SetName(dpText->GetText()); + else + pCurAtTag->SetName("parameter ?"); + delete &let_drNewToken; + fCurTokenAddFunction = AddDocuToken2CurAtTag; +} + +void +SapiDocu_PE::SetCurSeeAlsoAtTagLinkText( DYN ary::info::DocuToken & let_drNewToken ) +{ + csv_assert(pCurAtTag); + DT_TextToken * dpText = dynamic_cast< DT_TextToken* >(&let_drNewToken); + if (dpText != 0) + pCurAtTag->SetName(dpText->GetText()); + else + pCurAtTag->SetName("unknown ?"); + delete &let_drNewToken; + fCurTokenAddFunction = AddDocuToken2CurAtTag; +} + +const char * +AtTagTitle( const Tok_AtTag & i_rToken ) +{ + switch (i_rToken.Id()) + { + case Tok_AtTag::author: return ""; + case Tok_AtTag::see: return "See also"; + case Tok_AtTag::param: return "Parameters"; + case Tok_AtTag::e_return: return "Returns"; + case Tok_AtTag::e_throw: return "Throws"; + case Tok_AtTag::example: return "Example"; + case Tok_AtTag::deprecated: return ""; + case Tok_AtTag::suspicious: return ""; + case Tok_AtTag::missing: return ""; + case Tok_AtTag::incomplete: return ""; + case Tok_AtTag::version: return ""; + case Tok_AtTag::guarantees: return "Guarantees"; + case Tok_AtTag::exception: return "Exception"; + } + return i_rToken.Text(); +} + + + +} // namespace dsapi +} // namespace csi + diff --git a/autodoc/source/parser_i/idoc/makefile.mk b/autodoc/source/parser_i/idoc/makefile.mk new file mode 100644 index 000000000000..4c9ecd4738e8 --- /dev/null +++ b/autodoc/source/parser_i/idoc/makefile.mk @@ -0,0 +1,97 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=parser2_s2_dsapi + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/cx_docu2.obj \ + $(OBJ)$/cx_dsapi.obj \ + $(OBJ)$/docu_pe2.obj \ + $(OBJ)$/tk_atag2.obj \ + $(OBJ)$/tk_docw2.obj \ + $(OBJ)$/tk_html.obj \ + $(OBJ)$/tk_xml.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/parser_i/idoc/tk_atag2.cxx b/autodoc/source/parser_i/idoc/tk_atag2.cxx new file mode 100644 index 000000000000..44f1dd1b5221 --- /dev/null +++ b/autodoc/source/parser_i/idoc/tk_atag2.cxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * $RCSfile: tk_atag2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_dsapi/tk_atag2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <s2_dsapi/tokintpr.hxx> + + + +using csi::dsapi::Tok_AtTag; + +udm::EnumValueMap G_aTokAtTag_EV_TokenId_Values; +Tok_AtTag::EV_TokenId ev_none2(Tok_AtTag::e_none,""); +Tok_AtTag::EV_TokenId ev_author(Tok_AtTag::author,"@author"); +Tok_AtTag::EV_TokenId ev_see(Tok_AtTag::see,"@see"); +Tok_AtTag::EV_TokenId ev_param(Tok_AtTag::param,"@param"); +Tok_AtTag::EV_TokenId ev_e_return(Tok_AtTag::e_return,"@return"); +Tok_AtTag::EV_TokenId ev_e_throw(Tok_AtTag::e_throw,"@throws"); +Tok_AtTag::EV_TokenId ev_example(Tok_AtTag::example,"@example"); +Tok_AtTag::EV_TokenId ev_deprecated(Tok_AtTag::deprecated,"@deprecated"); +Tok_AtTag::EV_TokenId ev_suspicious(Tok_AtTag::suspicious,"@suspicious"); +Tok_AtTag::EV_TokenId ev_missing(Tok_AtTag::missing,"@missing"); +Tok_AtTag::EV_TokenId ev_incomplete(Tok_AtTag::incomplete,"@incomplete"); +Tok_AtTag::EV_TokenId ev_version(Tok_AtTag::version,"@version"); +Tok_AtTag::EV_TokenId ev_guarantees(Tok_AtTag::guarantees,"@guarantees"); +Tok_AtTag::EV_TokenId ev_exception(Tok_AtTag::exception,"@exception"); + + +namespace udm +{ +EnumValueMap & +Tok_AtTag::EV_TokenId::Values_() { return G_aTokAtTag_EV_TokenId_Values; } +} + + +namespace csi +{ +namespace dsapi +{ + +void +Tok_AtTag::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_AtTag(*this); +} + +const char * +Tok_AtTag::Text() const +{ + return eTag.Text(); +} + +} // namespace dsapi +} // namespace csi + diff --git a/autodoc/source/parser_i/idoc/tk_docw2.cxx b/autodoc/source/parser_i/idoc/tk_docw2.cxx new file mode 100644 index 000000000000..928cd1996eee --- /dev/null +++ b/autodoc/source/parser_i/idoc/tk_docw2.cxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * $RCSfile: tk_docw2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_dsapi/tk_docw2.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <s2_dsapi/tokintpr.hxx> + + + +namespace csi +{ +namespace dsapi +{ + +void +Tok_Word::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Word(*this); +} + +const char * +Tok_Word::Text() const +{ + return sText; +} + +void +Tok_Comma::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_Comma(); +} + +const char * +Tok_Comma::Text() const +{ + return ","; +} + +void +Tok_DocuEnd::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_DocuEnd(); +} + +const char * +Tok_DocuEnd::Text() const +{ + return "*/"; +} + +void +Tok_EOL::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_EOL(); +} + +const char * +Tok_EOL::Text() const +{ + return "\r\n"; +} + +void +Tok_EOF::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + csv_assert(false); +} + +const char * +Tok_EOF::Text() const +{ + return ""; +} + + + +} // namespace dsapi +} // namespace csi + diff --git a/autodoc/source/parser_i/idoc/tk_html.cxx b/autodoc/source/parser_i/idoc/tk_html.cxx new file mode 100644 index 000000000000..b6a2bb0e624f --- /dev/null +++ b/autodoc/source/parser_i/idoc/tk_html.cxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * $RCSfile: tk_html.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_dsapi/tk_html.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <s2_dsapi/tokintpr.hxx> + + + +namespace csi +{ +namespace dsapi +{ + +void +Tok_HtmlTag::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_HtmlTag(*this); +} + +const char * +Tok_HtmlTag::Text() const +{ + return sTag; +} + + +} // namespace dsapi +} // namespace csi + + diff --git a/autodoc/source/parser_i/idoc/tk_xml.cxx b/autodoc/source/parser_i/idoc/tk_xml.cxx new file mode 100644 index 000000000000..8101260e7f72 --- /dev/null +++ b/autodoc/source/parser_i/idoc/tk_xml.cxx @@ -0,0 +1,208 @@ +/************************************************************************* + * + * $RCSfile: tk_xml.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <s2_dsapi/tk_xml.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <s2_dsapi/tokintpr.hxx> + +using csi::dsapi::Tok_XmlConst; +using csi::dsapi::Tok_XmlLink_Tag; +using csi::dsapi::Tok_XmlFormat_Tag; + + +udm::EnumValueMap G_aTok_XmlConst_EV_TokenId_Values; +Tok_XmlConst::EV_TokenId ev_consts_none(Tok_XmlConst::e_none,""); +Tok_XmlConst::EV_TokenId ev_e_true(Tok_XmlConst::e_true,"true"); +Tok_XmlConst::EV_TokenId ev_e_false(Tok_XmlConst::e_false,"false"); +Tok_XmlConst::EV_TokenId ev_e_null(Tok_XmlConst::e_null,"NULL"); +Tok_XmlConst::EV_TokenId ev_e_void(Tok_XmlConst::e_void,"void"); + +udm::EnumValueMap G_aTok_XmlLink_Tag_EV_TokenId_Values; +Tok_XmlLink_Tag::EV_TokenId ev_linktags_none(Tok_XmlLink_Tag::e_none,""); +Tok_XmlLink_Tag::EV_TokenId ev_e_const(Tok_XmlLink_Tag::e_const,"const"); +Tok_XmlLink_Tag::EV_TokenId ev_member(Tok_XmlLink_Tag::member,"member"); +Tok_XmlLink_Tag::EV_TokenId ev_type(Tok_XmlLink_Tag::type,"type"); + +udm::EnumValueMap G_aTok_XmlFormat_Tag_EV_TokenId_Values; +Tok_XmlFormat_Tag::EV_TokenId ev_formattags_none(Tok_XmlFormat_Tag::e_none,""); +Tok_XmlFormat_Tag::EV_TokenId ev_code(Tok_XmlFormat_Tag::code,"code"); +Tok_XmlFormat_Tag::EV_TokenId ev_listing(Tok_XmlFormat_Tag::listing,"listing"); +Tok_XmlFormat_Tag::EV_TokenId ev_atom(Tok_XmlFormat_Tag::atom,"code"); + + +namespace udm +{ + +EnumValueMap & +Tok_XmlConst::EV_TokenId::Values_() { return G_aTok_XmlConst_EV_TokenId_Values; } +EnumValueMap & +Tok_XmlLink_Tag::EV_TokenId::Values_() { return G_aTok_XmlLink_Tag_EV_TokenId_Values; } +EnumValueMap & +Tok_XmlFormat_Tag::EV_TokenId::Values_() { return G_aTok_XmlFormat_Tag_EV_TokenId_Values; } + +} // namespace udm + + + +namespace csi +{ +namespace dsapi +{ + +void +Tok_XmlConst::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_XmlConst(*this); +} + +const char * +Tok_XmlConst::Text() const +{ + return eTag.Text(); +} + +void +Tok_XmlLink_BeginTag::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_XmlLink_BeginTag(*this); +} + +const char * +Tok_XmlLink_BeginTag::Text() const +{ + static StreamStr ret(120); + ret.seekp(0); + if (sScope.length() > 0) + { + ret << "<" + << eTag.Text() + << " scope=\"" + << sScope + << "\">"; + } + else + { + ret << "<" + << eTag.Text() + << ">"; + } + return ret.c_str(); +} + +void +Tok_XmlLink_EndTag::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_XmlLink_EndTag(*this); +} + +const char * +Tok_XmlLink_EndTag::Text() const +{ + static StreamStr ret(120); + ret.seekp(0); + ret << "</" + << eTag.Text() + << ">"; + return ret.c_str(); +} + +void +Tok_XmlFormat_BeginTag::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_XmlFormat_BeginTag(*this); +} + +const char * +Tok_XmlFormat_BeginTag::Text() const +{ + static StreamStr ret(120); + ret.seekp(0); + ret << "<" + << eTag.Text() + << ">"; + return ret.c_str(); +} + +void +Tok_XmlFormat_EndTag::Trigger( TokenInterpreter & io_rInterpreter ) const +{ + io_rInterpreter.Process_XmlFormat_EndTag(*this); +} + +const char * +Tok_XmlFormat_EndTag::Text() const +{ + static StreamStr ret(120); + ret.seekp(0); + ret << "</" + << eTag.Text() + << ">"; + return ret.c_str(); +} + + +} // namespace dsapi +} // namespace csi + + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/cx_docu2.hxx b/autodoc/source/parser_i/inc/s2_dsapi/cx_docu2.hxx new file mode 100644 index 000000000000..d61cfb606587 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/cx_docu2.hxx @@ -0,0 +1,267 @@ +/************************************************************************* + * + * $RCSfile: cx_docu2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_CX_DOCU2_HXX +#define DSAPI_CX_DOCU2_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS + // PARAMETERS +#include <s2_dsapi/tk_xml.hxx> + +namespace csi +{ +namespace dsapi +{ + +class Token_Receiver; + + +/** +@descr +*/ + +class Cx_Base : public ::TkpContext +{ + public: + virtual bool PassNewToken(); + virtual TkpContext & + FollowUpContext(); + protected: + // LIFECYCLE + Cx_Base( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : rReceiver(o_rReceiver), + pFollowUpContext(&i_rFollowUpContext) + // pNewToken + { } + protected: + void SetToken( + DYN Token * let_dpToken ) + { pNewToken = let_dpToken; } + void Handle_DocuSyntaxError( + CharacterSource & io_rText ); + + private: + // DATA + Token_Receiver & rReceiver; + TkpContext * pFollowUpContext; + Dyn<Token> pNewToken; +}; + + +class Cx_EoHtml : public Cx_Base +{ + public: + // LIFECYCLE + Cx_EoHtml( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetIfIsStartOfParagraph( + bool i_bNextTokenProperty ) + { bToken_IsStartOfParagraph = i_bNextTokenProperty; } + + private: + bool bToken_IsStartOfParagraph; +}; + +class Cx_EoXmlConst : public Cx_Base +{ + public: + // LIFECYCLE + Cx_EoXmlConst( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetTokenId( + udm::Enum< Tok_XmlConst::E_TokenId > + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + Tok_XmlConst::EV_TokenId + eTokenId; +}; + +class Cx_EoXmlLink_BeginTag : public Cx_Base +{ + public: + // LIFECYCLE + Cx_EoXmlLink_BeginTag( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetTokenId( + Tok_XmlLink_BeginTag::EV_TokenId + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + Tok_XmlLink_BeginTag::EV_TokenId + eTokenId; +}; + +class Cx_EoXmlLink_EndTag : public Cx_Base +{ + public: + // LIFECYCLE + Cx_EoXmlLink_EndTag( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetTokenId( + Tok_XmlLink_EndTag::EV_TokenId + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + Tok_XmlLink_EndTag::E_TokenId + eTokenId; +}; + +class Cx_EoXmlFormat_BeginTag : public Cx_Base +{ + public: + // LIFECYCLE + Cx_EoXmlFormat_BeginTag( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetTokenId( + udm::Enum< Tok_XmlFormat_BeginTag::E_TokenId > + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + udm::Enum< Tok_XmlFormat_BeginTag::E_TokenId > + eTokenId; +}; + +class Cx_EoXmlFormat_EndTag : public Cx_Base +{ + public: + // LIFECYCLE + Cx_EoXmlFormat_EndTag( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetTokenId( + udm::Enum< Tok_XmlFormat_EndTag::E_TokenId > + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + udm::Enum< Tok_XmlFormat_EndTag::E_TokenId > + eTokenId; +}; + +class Cx_CheckStar : public Cx_Base +{ + public: + // LIFECYCLE + Cx_CheckStar( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext), + bIsEnd(false), bEndTokenFound(false) + { } + void Set_End_FolloUpContext( + TkpContext & i_rEnd_FollowUpContext ) + { pEnd_FollowUpContext = &i_rEnd_FollowUpContext; } + + virtual void ReadCharChain( + CharacterSource & io_rText ); + void SetIsEnd( + bool i_bIsEnd ) + { bIsEnd = i_bIsEnd; } + virtual TkpContext & + FollowUpContext(); + private: + TkpContext * pEnd_FollowUpContext; + bool bIsEnd; + bool bEndTokenFound; +}; + + +} // namespace dsapi +} // namespace csi + + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/cx_dsapi.hxx b/autodoc/source/parser_i/inc/s2_dsapi/cx_dsapi.hxx new file mode 100644 index 000000000000..4cf1b24b5ba4 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/cx_dsapi.hxx @@ -0,0 +1,157 @@ +/************************************************************************* + * + * $RCSfile: cx_dsapi.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_CX_DSAPI_HXX +#define ADC_CX_DSAPI_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS +#include <cosv/template/dyn.hxx> +#include <tokens/tkpstam2.hxx> + // PARAMETERS + + +namespace csi +{ +namespace dsapi +{ + +class Token_Receiver; +class Token; + +class Cx_EoHtml; +class Cx_EoXmlConst; +class Cx_EoXmlLink_BeginTag; +class Cx_EoXmlLink_EndTag; +class Cx_EoXmlFormat_BeginTag; +class Cx_EoXmlFormat_EndTag; +class Cx_CheckStar; + +/** +@descr +*/ +class Context_Docu : public TkpDocuContext, + private StateMachineContext +{ + public: + // LIFECYCLE + Context_Docu( + Token_Receiver & o_rReceiver ); + virtual void SetParentContext( + TkpContext & io_rParentContext, + const char * i_sMultiLineEndToken ); + + ~Context_Docu(); + // OPERATIONS + 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, + UINT16 i_nTokenId, + CharacterSource & io_rText ); + + void SetupStateMachine(); + + // DATA + StateMachin2 aStateMachine; + Token_Receiver * pReceiver; + + // Contexts + TkpContext * pParentContext; + udmstri sMultiLineEndToken; + + Dyn<Cx_EoHtml> pCx_EoHtml; + Dyn<Cx_EoXmlConst> pCx_EoXmlConst; + Dyn<Cx_EoXmlLink_BeginTag> + pCx_EoXmlLink_BeginTag; + Dyn<Cx_EoXmlLink_EndTag> + pCx_EoXmlLink_EndTag; + Dyn<Cx_EoXmlFormat_BeginTag> + pCx_EoXmlFormat_BeginTag; + Dyn<Cx_EoXmlFormat_EndTag> + pCx_EoXmlFormat_EndTag; + Dyn<Cx_CheckStar> pCx_CheckStar; + + // Temporary data, used during ReadCharChain() + Dyn<Token> pNewToken; + ::TkpContext * pFollowUpContext; + bool bIsMultiline; +}; + + +} // namespace dsapi +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx b/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx new file mode 100644 index 000000000000..7e58fb57bad8 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * $RCSfile: docu_pe2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DSAPI_DOCU_PE2_HXX +#define ADC_DSAPI_DOCU_PE2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_dsapi/tokintpr.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ +namespace info +{ +class CodeInformation; +class DocuToken; +} // namespace info +} // namespace ary + + + +namespace csi +{ +namespace dsapi +{ + + +class Token; +class DT_AtTag; + +class SapiDocu_PE : public TokenInterpreter +{ + public: + SapiDocu_PE(); + ~SapiDocu_PE(); + + void ProcessToken( + DYN csi::dsapi::Token & + let_drToken ); + + virtual void Process_AtTag( + const Tok_AtTag & i_rToken ); + virtual void Process_HtmlTag( + const Tok_HtmlTag & i_rToken ); + virtual void Process_XmlConst( + const Tok_XmlConst & + i_rToken ); + virtual void Process_XmlLink_BeginTag( + const Tok_XmlLink_BeginTag & + i_rToken ); + virtual void Process_XmlLink_EndTag( + const Tok_XmlLink_EndTag & + i_rToken ); + virtual void Process_XmlFormat_BeginTag( + const Tok_XmlFormat_BeginTag & + i_rToken ); + virtual void Process_XmlFormat_EndTag( + const Tok_XmlFormat_EndTag & + i_rToken ); + virtual void Process_Word( + const Tok_Word & i_rToken ); + virtual void Process_Comma(); + virtual void Process_DocuEnd(); + virtual void Process_EOL(); + + + DYN ary::info::CodeInformation * + ReleaseJustParsedDocu(); + + bool IsComplete() const; + + private: + enum E_State + { + e_none = 0, + st_short, + st_description, + st_attags, + st_complete + }; + + typedef void ( SapiDocu_PE::*F_TokenAdder )( DYN ary::info::DocuToken & let_drNewToken ); + + void AddDocuToken2Void( + DYN ary::info::DocuToken & + let_drNewToken ); + void AddDocuToken2Short( + DYN ary::info::DocuToken & + let_drNewToken ); + void AddDocuToken2Description( + DYN ary::info::DocuToken & + let_drNewToken ); + void AddDocuToken2CurAtTag( + DYN ary::info::DocuToken & + let_drNewToken ); + void SetCurParameterAtTagName( + DYN ary::info::DocuToken & + let_drNewToken ); + void SetCurSeeAlsoAtTagLinkText( + DYN ary::info::DocuToken & + let_drNewToken ); + + // DATA + Dyn<ary::info::CodeInformation> + pDocu; + E_State eState; + F_TokenAdder fCurTokenAddFunction; + + Dyn<DT_AtTag> pCurAtTag; + udmstri sCurDimAttribute; +}; + +} // namespace dsapi +} // namespace csi + + +// IMPLEMENTATION + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/dsapitok.hxx b/autodoc/source/parser_i/inc/s2_dsapi/dsapitok.hxx new file mode 100644 index 000000000000..f3b667761df8 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/dsapitok.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * $RCSfile: dsapitok.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_DSAPITOK_HXX +#define DSAPI_DSAPITOK_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/token2.hxx> + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace dsapi +{ + + +class TokenInterpreter; + + +class Token : public TextToken +{ + public: + // LIFECYCLE + virtual ~Token() {} + + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const = 0; +}; + + +} // namespace dsapi +} // namespace csi + + +#endif + + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/tk_atag2.hxx b/autodoc/source/parser_i/inc/s2_dsapi/tk_atag2.hxx new file mode 100644 index 000000000000..d9d1d353b506 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_atag2.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * $RCSfile: tk_atag2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_TK_ATAG2_HXX +#define DSAPI_TK_ATAG2_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_dsapi/dsapitok.hxx> + // COMPONENTS + // PARAMETERS +#include <luxenum.hxx> + +namespace csi +{ +namespace dsapi +{ + + +class Tok_AtTag : public Token +{ + public: + // TYPE + enum E_TokenId + { + e_none = 0, + author = 1, + see = 2, + param = 3, + e_return = 4, + e_throw = 5, + example = 6, + deprecated = 7, + suspicious = 8, + missing = 9, + incomplete = 10, + version = 11, + guarantees = 12, + exception = 13 + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + // Spring and Fall + Tok_AtTag( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + E_TokenId Id() const { return eTag; } + + private: + EV_TokenId eTag; +}; + +} // namespace dsapi +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/tk_docw2.hxx b/autodoc/source/parser_i/inc/s2_dsapi/tk_docw2.hxx new file mode 100644 index 000000000000..ebf4f99f80de --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_docw2.hxx @@ -0,0 +1,144 @@ +/************************************************************************* + * + * $RCSfile: tk_docw2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_TK_DOCW2_HXX +#define DSAPI_TK_DOCW2_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_dsapi/dsapitok.hxx> + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace dsapi +{ + + +class Tok_Word : public Token +{ + public: + // Spring and Fall + Tok_Word( + const char * i_sText ) + : sText(i_sText) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + + private: + // DATA + udmstri sText; +}; + +class Tok_Comma : public Token +{ + public: + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; +}; + +class Tok_DocuEnd : public Token +{ + public: + // Spring and Fall + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; +}; + +class Tok_EOL : public Token +{ + public: + // Spring and Fall + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; +}; + +class Tok_EOF : public Token +{ + public: + // Spring and Fall + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; +}; + + +} // namespace dsapi +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/tk_html.hxx b/autodoc/source/parser_i/inc/s2_dsapi/tk_html.hxx new file mode 100644 index 000000000000..f1eeee51497d --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_html.hxx @@ -0,0 +1,107 @@ +/************************************************************************* + * + * $RCSfile: tk_html.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_TK_HTML_HXX +#define DSAPI_TK_HTML_HXX + + +// USED SERVICES + // BASE CLASSES +#include <s2_dsapi/dsapitok.hxx> + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace dsapi +{ + + +class Tok_HtmlTag : public Token +{ + public: + // Spring and Fall + Tok_HtmlTag( + const char * i_sTag, + bool i_bIsParagraphStarter ) + : sTag(i_sTag), + bIsParagraphStarter(i_bIsParagraphStarter) + {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + bool IsParagraphStarter() const + { return bIsParagraphStarter; } + + private: + udmstri sTag; + bool bIsParagraphStarter; +}; + + +} // namespace dsapi +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/tk_xml.hxx b/autodoc/source/parser_i/inc/s2_dsapi/tk_xml.hxx new file mode 100644 index 000000000000..158b18d6a59d --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_xml.hxx @@ -0,0 +1,235 @@ +/************************************************************************* + * + * $RCSfile: tk_xml.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_TK_XML_HXX +#define DSAPI_TK_XML_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_dsapi/dsapitok.hxx> + // COMPONENTS + // PARAMETERS +#include <luxenum.hxx> + + +namespace csi +{ +namespace dsapi +{ + + +class Tok_XmlTag : public Token +{ + public: +}; + +class Tok_XmlConst : public Tok_XmlTag +{ + public: + // TYPE + enum E_TokenId + { + e_none = 0, + e_true = 1, + e_false = 2, + e_null = 3, + e_void = 4 + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + // Spring and Fall + Tok_XmlConst( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + +class Tok_XmlLink_Tag : public Tok_XmlTag +{ + public: + // TYPE + enum E_TokenId + { + e_none = 0, + e_const = 1, + member = 2, + type = 3 + }; + typedef udm::Enum<E_TokenId> EV_TokenId; +}; + +class Tok_XmlLink_BeginTag : public Tok_XmlLink_Tag +{ + public: + // Spring and Fall + Tok_XmlLink_BeginTag( + EV_TokenId i_eTag, + const udmstri & i_sScope, + const udmstri & i_sDim ) + : eTag(i_eTag), + sScope(i_sScope), + sDim(i_sDim) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + E_TokenId Id() const { return eTag; } + const udmstri & Scope() const { return sScope; } + const udmstri & Dim() const { return sDim; } + + private: + // DATA + EV_TokenId eTag; + udmstri sScope; + udmstri sDim; +}; + +class Tok_XmlLink_EndTag : public Tok_XmlLink_Tag +{ + public: + // Spring and Fall + Tok_XmlLink_EndTag( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + +class Tok_XmlFormat_Tag : public Tok_XmlTag +{ + public: + // TYPE + enum E_TokenId + { + e_none = 0, + code = 1, + listing = 2, + atom = 3 + }; + typedef udm::Enum<E_TokenId> EV_TokenId; +}; + +class Tok_XmlFormat_BeginTag : public Tok_XmlFormat_Tag +{ + public: + // Spring and Fall + Tok_XmlFormat_BeginTag( + EV_TokenId i_eTag, + const udmstri & i_sDim ) + : eTag(i_eTag), + sDim(i_sDim) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + E_TokenId Id() const { return eTag; } + const udmstri & Dim() const { return sDim; } + + private: + // DATA + EV_TokenId eTag; + udmstri sDim; +}; + +class Tok_XmlFormat_EndTag : public Tok_XmlFormat_Tag +{ + public: + // Spring and Fall + Tok_XmlFormat_EndTag( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + + +} // namespace dsapi +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/tokintpr.hxx b/autodoc/source/parser_i/inc/s2_dsapi/tokintpr.hxx new file mode 100644 index 000000000000..e920545b975b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tokintpr.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * $RCSfile: tokintpr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_DSAPI_TOKINTPR_HXX +#define ADC_DSAPI_TOKINTPR_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace dsapi +{ + + +class Tok_AtTag; +class Tok_XmlConst; +class Tok_XmlLink_BeginTag; +class Tok_XmlLink_EndTag; +class Tok_XmlFormat_BeginTag; +class Tok_XmlFormat_EndTag; +class Tok_Word; +class Tok_HtmlTag; + +class TokenInterpreter +{ + public: + virtual ~TokenInterpreter() {} + + virtual void Process_AtTag( + const Tok_AtTag & i_rToken ) = 0; + virtual void Process_HtmlTag( + const Tok_HtmlTag & i_rToken ) = 0; + virtual void Process_XmlConst( + const Tok_XmlConst & + i_rToken ) = 0; + virtual void Process_XmlLink_BeginTag( + const Tok_XmlLink_BeginTag & + i_rToken ) = 0; + virtual void Process_XmlLink_EndTag( + const Tok_XmlLink_EndTag & + i_rToken ) = 0; + virtual void Process_XmlFormat_BeginTag( + const Tok_XmlFormat_BeginTag & + i_rToken ) = 0; + virtual void Process_XmlFormat_EndTag( + const Tok_XmlFormat_EndTag & + i_rToken ) = 0; + virtual void Process_Word( + const Tok_Word & i_rToken ) = 0; + virtual void Process_Comma() = 0; + virtual void Process_DocuEnd() = 0; + virtual void Process_EOL() = 0; +}; + + + +// IMPLEMENTATION + + +} // namespace dsapi +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_dsapi/tokrecv.hxx b/autodoc/source/parser_i/inc/s2_dsapi/tokrecv.hxx new file mode 100644 index 000000000000..da26ee07089a --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tokrecv.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: tokrecv.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DSAPI_TOKRECV_HXX +#define DSAPI_TOKRECV_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace dsapi +{ + + +class Token; +/** +@descr +*/ +class Token_Receiver +{ + public: + virtual ~Token_Receiver() {} + virtual void Receive( + DYN Token & let_drToken ) = 0; +}; + + +} // namespace dsapi +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/cx_idlco.hxx b/autodoc/source/parser_i/inc/s2_luidl/cx_idlco.hxx new file mode 100644 index 000000000000..fcfd606f1d73 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/cx_idlco.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: cx_idlco.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_CX_IDLCO_HXX +#define LUIDL_CX_IDLCO_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS +#include <tokens/tkpstam2.hxx> + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + +class Token_Receiver; +class Token; + +/** +*/ +class Context_UidlCode : public TkpContext, + private StateMachineContext +{ + public: + // LIFECYCLE + Context_UidlCode( + Token_Receiver & o_rReceiver, + DYN TkpDocuContext & + let_drContext_Docu ); + ~Context_UidlCode(); + // OPERATORS + + // OPERATIONS + virtual void ReadCharChain( + CharacterSource & io_rText ); + virtual bool PassNewToken(); + + // INQUIRY + virtual TkpContext & + FollowUpContext(); + private: + // SERVICE FUNCTIONS + void PerformStatusFunction( + uintt i_nStatusSignal, + UINT16 i_nTokenId, + CharacterSource & io_rText ); + void SetupStateMachine(); + + // DATA + StateMachin2 aStateMachine; + Token_Receiver * pReceiver; + + // Contexts + Dyn<TkpDocuContext> pDocuContext; + + Dyn<TkpContext> dpContext_MLComment; + Dyn<TkpContext> dpContext_SLComment; + Dyn<TkpContext> dpContext_Preprocessor; + Dyn<TkpContext> dpContext_Assignment; + + // Temporary data, used during ReadCharChain() + Dyn<Token> pNewToken; + ::TkpContext * pFollowUpContext; +}; + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/cx_sub.hxx b/autodoc/source/parser_i/inc/s2_luidl/cx_sub.hxx new file mode 100644 index 000000000000..261ee64dbce7 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/cx_sub.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * $RCSfile: cx_sub.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_LUIDL_CX_SUB_HXX +#define ADC_LUIDL_CX_SUB_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + +class Token_Receiver; +class Token; + + +class Cx_Base : public ::TkpContext +{ + public: + virtual bool PassNewToken(); + virtual TkpContext & + FollowUpContext(); + protected: + // LIFECYCLE + Cx_Base( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : pFollowUpContext(&i_rFollowUpContext), + rReceiver(o_rReceiver) {} + protected: + void SetToken( + DYN Token * let_dpToken ) + { pNewToken = let_dpToken; } + private: + // DATA + Token_Receiver & rReceiver; + TkpContext * pFollowUpContext; + Dyn<Token> pNewToken; +}; + + + +/** +@descr +*/ + +class Context_MLComment : public Cx_Base +{ + public: + Context_MLComment( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + virtual void ReadCharChain( + CharacterSource & io_rText ); +}; + +class Context_SLComment : public Cx_Base +{ + public: + Context_SLComment( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + virtual void ReadCharChain( + CharacterSource & io_rText ); +}; + +class Context_Praeprocessor : public Cx_Base +{ + public: + Context_Praeprocessor( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + virtual void ReadCharChain( + CharacterSource & io_rText ); +}; + +class Context_Assignment : public Cx_Base +{ + public: + Context_Assignment( + Token_Receiver & o_rReceiver, + TkpContext & i_rFollowUpContext ) + : Cx_Base(o_rReceiver, i_rFollowUpContext) {} + virtual void ReadCharChain( + CharacterSource & io_rText ); +}; + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/distrib.hxx b/autodoc/source/parser_i/inc/s2_luidl/distrib.hxx new file mode 100644 index 000000000000..27e14f1cd7ca --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/distrib.hxx @@ -0,0 +1,285 @@ +/************************************************************************* + * + * $RCSfile: distrib.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_DISTRIB_HXX +#define LUIDL_DISTRIB_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/tokrecv.hxx> +#include <s2_dsapi/tokrecv.hxx> +#include <s2_luidl/tokproct.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ + class Repository; + + namespace info + { + class CodeInformation; + } // namespace info +} // namespace ary) + + + +namespace csi +{ +namespace dsapi +{ +class Token; +class SapiDocu_PE; +} // namespace dsapi +} // namespace csi + + +namespace csi +{ +namespace uidl +{ + + +typedef std::vector< DYN Token * > TokenQueue; +typedef TokenQueue::iterator TokenIterator; + +class TokenParser_Uidl; +class UnoIDL_PE; +class Token; + + +class TokenDistributor : private TokenProcessing_Types + +{ + public: + TokenDistributor( + ary::Repository & io_rRepository ); + void SetTokenProvider( + TokenParser_Uidl & io_rTokenSource ); + void SetTopParseEnvironment( + UnoIDL_PE & io_pTopParseEnvironment ); + ~TokenDistributor(); + + + void Reset() { aDocumentation.Reset(); } + /** calls pTokenSource->GetNextToken() and checks the incoming tokens, until a + usable token is found. This token will be forwarded to + pTopParseEnv; + */ + void TradeToken(); + + csi::uidl::Token_Receiver & + CodeTokens_Receiver(); + csi::dsapi::Token_Receiver & + DocuTokens_Receiver(); + + /** Used from PE_File, if there is a docu to get without + an environment to push (this is the case for modules). + */ + DYN ary::info::CodeInformation * + ReleaseLastParsedDocu() + { return aDocumentation.ReleaseLastParsedDocu(); } + + + private: + class Documentation; + class ProcessingData; + friend class ProcessingData; + + class ProcessingData : public csi::uidl::Token_Receiver, + private TokenProcessing_Types + { + public: + ProcessingData( + ary::Repository & io_rRepository, + Documentation & i_rDocuProcessor ); + ~ProcessingData(); + void SetTopParseEnvironment( + UnoIDL_PE & io_pTopParseEnvironment ); + + + /** is called from pTokenSource before finishing a ::TokenParse2::GetNextToken() + call and passes the just parsed token to this class. + */ + virtual void Receive( + DYN csi::uidl::Token & + let_drToken ); + void ProcessCurToken(); + + UnoIDL_PE & CurEnvironment() const; + bool NextTokenExists() const; + + private: + typedef uintt TokenQ_Position; + typedef std::pair< UnoIDL_PE *, TokenQ_Position > EnvironmentInfo; + typedef std::vector< EnvironmentInfo > EnvironmentStack; + + void AcknowledgeResult(); + const csi::uidl::Token & + CurToken() const; + UnoIDL_PE & CurEnv() const; + UnoIDL_PE & PushEnv() const; + uintt CurTokenPosition() const; + uintt CurEnv_TriedTokenPosition() const; + void DecrementTryCount(); + + EnvironmentStack aEnvironments; + TokenQueue aTokenQueue; + TokenIterator itCurToken; + TokenProcessing_Result + aCurResult; + uintt nTryCount; + bool bFinished; + ary::Repository & rRepository; + Documentation * pDocuProcessor; + }; + + class Documentation : public csi::dsapi::Token_Receiver + { + public: + Documentation(); + ~Documentation(); + + void Reset() { bIsPassedFirstDocu = false; } + + virtual void Receive( + DYN csi::dsapi::Token & + let_drToken ); + DYN ary::info::CodeInformation * + ReleaseLastParsedDocu() { return pMostRecentDocu.Release(); } + private: + Dyn<csi::dsapi::SapiDocu_PE> + pDocuParseEnv; + Dyn<ary::info::CodeInformation> + pMostRecentDocu; + bool bIsPassedFirstDocu; + }; + + // DATA + TokenParser_Uidl * pTokenSource; + ProcessingData aProcessingData; + Documentation aDocumentation; +}; + + + +// IMPLEMENTATION + +inline void +TokenDistributor::SetTokenProvider( TokenParser_Uidl & io_rTokenSource ) + { pTokenSource = &io_rTokenSource; } + +inline void +TokenDistributor::SetTopParseEnvironment( UnoIDL_PE & io_pTopParseEnvironment ) + { aProcessingData.SetTopParseEnvironment(io_pTopParseEnvironment); } + +inline csi::uidl::Token_Receiver & +TokenDistributor::CodeTokens_Receiver() + { return aProcessingData; } + +inline csi::dsapi::Token_Receiver & +TokenDistributor::DocuTokens_Receiver() + { return aDocumentation; } + +inline const csi::uidl::Token & +TokenDistributor::ProcessingData::CurToken() const +{ + csv_assert( itCurToken != aTokenQueue.end() ); + csv_assert( *itCurToken != 0 ); + return *(*itCurToken); +} + +inline UnoIDL_PE & +TokenDistributor::ProcessingData::CurEnv() const +{ + csv_assert( aEnvironments.size() > 0 ); + csv_assert( aEnvironments.back().first != 0 ); + return *aEnvironments.back().first; +} + +inline UnoIDL_PE & +TokenDistributor::ProcessingData::PushEnv() const +{ + csv_assert( aCurResult.pEnv2Push != 0 ); + return *aCurResult.pEnv2Push; +} + +inline uintt +TokenDistributor::ProcessingData::CurTokenPosition() const +{ + return itCurToken - aTokenQueue.begin(); +} + +inline uintt +TokenDistributor::ProcessingData::CurEnv_TriedTokenPosition() const +{ + csv_assert( aEnvironments.size() > 0 ); + return aEnvironments.back().second; +} + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/parsenv2.hxx b/autodoc/source/parser_i/inc/s2_luidl/parsenv2.hxx new file mode 100644 index 000000000000..4327def40895 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/parsenv2.hxx @@ -0,0 +1,169 @@ +/************************************************************************* + * + * $RCSfile: parsenv2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PARSENV2_HXX +#define LUIDL_PARSENV2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/tokproct.hxx> + // COMPONENTS +#include <s2_luidl/semnode.hxx> + // PARAMETERS +#include <ary_i/uidl/cenamesp.hxx> +#include <ary_i/ce2.hxx> + +namespace ary +{ +namespace uidl +{ + class CeStorage; +} // namespace uidl +} // namespace ary + +namespace ary +{ +namespace info +{ + class CodeInformation; +} +} + + + +namespace csi +{ +namespace uidl +{ + + +class Token; +class SemanticNode; + + +class UnoIDL_PE : virtual protected TokenProcessing_Types +{ + public: + virtual ~UnoIDL_PE(); + + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual void Enter( + E_EnvStackAction i_eWayOfEntering ); + virtual void Leave( + E_EnvStackAction i_eWayOfLeaving ); + virtual void ProcessToken( + const Token & i_rToken ) = 0; + + void SetDocu( + DYN ary::info::CodeInformation * + let_dpDocu ) + { pDocu = let_dpDocu; } + void SetOptional(); + void PassDocuAt( + ary::Cei i_nCeId ); + +/* + const SemanticNode & + Node() const { return aMyNode; } + SemanticNode & Node() { return aMyNode; } +*/ + UnoIDL_PE * Parent() const { return aMyNode.Parent(); } + + void SetResult( + E_TokenDone i_eDone, + E_EnvStackAction i_eWhat2DoWithEnvStack, + UnoIDL_PE * i_pParseEnv2Push = 0 ) + { aMyNode.SetTokenResult( i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push ); } + virtual ary::uidl::CeNamespace & + CurNamespace() const; + ary::Cei MatchingNamespace( + const QuName & i_rQualification ); + ary::uidl::Gate & Gate() const { return aMyNode.AryGate(); } + + DYN ary::info::CodeInformation * + ReleaseDocu() { return pDocu.Release(); } + + private: + virtual void InitData(); + virtual void TransferData() = 0; + virtual void ReceiveData(); + + SemanticNode aMyNode; + Dyn<ary::info::CodeInformation> + pDocu; +}; + + +// IMPLEMENTATION + + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_attri.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_attri.hxx new file mode 100644 index 000000000000..d9312f0ec89b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_attri.hxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * $RCSfile: pe_attri.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_ATTRI_HXX +#define ADC_UIDL_PE_ATTRI_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> +#include <ary_i/uidl/gate.hxx> + + +namespace csi +{ +namespace uidl +{ + + +class PE_Variable; + +class PE_Attribute : public UnoIDL_PE, + public ParseEnvState +{ + public: + typedef ary::uidl::Gate::RInterface RInterface; + typedef ary::uidl::Gate::RAttribute RAttribute; + + PE_Attribute( + RAttribute & o_rResult, + const RInterface & i_rCurInterface ); + + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual ~PE_Attribute(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ); + virtual void Process_MetaType( + const TokMetaType & i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_Default(); + + void PresetOptional() { bIsOptional = true; } + void PresetReadonly() { bIsReadonly = true; } + + private: + enum E_State + { + e_none, + e_start, + expect_variable, + in_variable + }; + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + E_State eState; + Attribute * pData; + RAttribute * pResult; + const RInterface * pCurInterface; + + Dyn<PE_Variable> pPE_Variable; + csi::prl::RefType aCurParsedType; + udmstri sCurParsedName; + bool bIsOptional; + bool bIsReadonly; +}; + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_const.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_const.hxx new file mode 100644 index 000000000000..0e81407ace7c --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_const.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * $RCSfile: pe_const.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_CONST_HXX +#define LUIDL_PE_CONST_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> +#include <ary_i/cei.hxx> + + +namespace udm { +class Agent_Struct; +} // namespace udm + + +namespace csi +{ +namespace uidl +{ + +class ConstantsGroup; + +class PE_Type; +class PE_Value; + +class PE_Constant : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Constant(); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_Constant(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ); + + private: + enum E_State + { + e_none, + expect_name, + expect_curl_bracket_open, + expect_const, + expect_value, + expect_finish, + e_STATES_MAX + }; + enum E_TokenType + { + tt_stereotype, + tt_identifier, + tt_punctuation, + tt_MAX + }; + typedef void (PE_Constant::*F_TOK)(const char *); + + + void CallHandler( + const char * i_sTokenText, + E_TokenType i_eTokenType ); + + void On_expect_name_Identifier(const char * i_sText); + void On_expect_curl_bracket_open_Punctuation(const char * i_sText); + void On_expect_const_Stereotype(const char * i_sText); + void On_expect_const_Punctuation(const char * i_sText); + void On_expect_value_Identifier(const char * i_sText); + void On_expect_finish_Punctuation(const char * i_sText); + void On_Default(const char * ); + + void EmptySingleConstData(); + void CreateSingleConstant(); + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + // DATA + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + + ConstantsGroup * pData; + ary::Cei nDataId; + + Dyn<PE_Type> pPE_Type; + csi::prl::RefType pType; + + Dyn<PE_Value> pPE_Value; + udmstri sName; + udmstri sAssignment; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_enum2.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_enum2.hxx new file mode 100644 index 000000000000..7a12fa0f0dd4 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_enum2.hxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * $RCSfile: pe_enum2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_ENUM2_HXX +#define ADC_UIDL_PE_ENUM2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + + +namespace csi +{ +namespace uidl +{ + +class Enum; + +class PE_Value; + +class PE_Enum : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Enum(); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_Enum(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + + private: + enum E_State + { + e_none, + expect_name, + expect_curl_bracket_open, + expect_value, + expect_finish, + e_STATES_MAX + }; + enum E_TokenType + { + tt_identifier, + tt_punctuation, + tt_MAX + }; + typedef void (PE_Enum::*F_TOK)(const char *); + + + void CallHandler( + const char * i_sTokenText, + E_TokenType i_eTokenType ); + + void On_expect_name_Identifier(const char * i_sText); + void On_expect_curl_bracket_open_Punctuation(const char * i_sText); + void On_expect_value_Punctuation(const char * i_sText); + void On_expect_value_Identifier(const char * i_sText); + void On_expect_finish_Punctuation(const char * i_sText); + void On_Default(const char * ); + + void EmptySingleValueData(); + void CreateSingleValue(); + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + // DATA + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + + Enum * pData; + ary::Cei nDataId; + + Dyn<PE_Value> pPE_Value; + udmstri sName; + udmstri sAssignment; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_evalu.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_evalu.hxx new file mode 100644 index 000000000000..9641a23b96c3 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_evalu.hxx @@ -0,0 +1,161 @@ +/************************************************************************* + * + * $RCSfile: pe_evalu.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_EVALU_HXX +#define LUIDL_PE_EVALU_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + +namespace udm { +class Agent_Struct; +} // namespace udm + + +namespace csi +{ +namespace uidl +{ + +class PE_Value : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Value( + udmstri & o_rName, + udmstri & o_rAssignment, + bool i_bIsConst ); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_Value(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_Assignment( + const TokAssignment & + i_rToken ); + private: + enum E_State + { + e_none = 0, + expect_name, + got_name, + e_STATES_MAX + }; + enum E_TokenType /// @ATTENTION Do not change existing values (except of tt_MAX) !!! Else array-indices will break. + { + tt_identifier = 0, + tt_punctuation = 1, + tt_assignment = 2, + tt_MAX + }; + typedef void (PE_Value::*F_TOK)(const char *); + + + void CallHandler( + const char * i_sTokenText, + E_TokenType i_eTokenType ); + + void On_expect_name_Identifier(const char * i_sText); + void On_got_name_Punctuation(const char * i_sText); + void On_got_name_Assignment(const char * i_sText); + void On_Default(const char * ); + + virtual void InitData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + bool IsConst() const { return bIsConst; } + + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + udmstri * pName; + udmstri * pAssignment; + bool bIsConst; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_excp.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_excp.hxx new file mode 100644 index 000000000000..3df0adfdd6ae --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_excp.hxx @@ -0,0 +1,293 @@ +/************************************************************************* + * + * $RCSfile: pe_excp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_EXCP_HXX +#define LUIDL_PE_EXCP_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS +#include <s2_luidl/semnode.hxx> +#include <csi/prl/quname2.hxx> + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + + +namespace csi +{ +namespace prl +{ + class TNamespace; +} +} + + + +namespace csi +{ +namespace uidl +{ + + +class Exception; +class StructElement; +class PE_StructElement; +class PE_Type; + + +class PE_Exception : public UnoIDL_PE +{ + public: + PE_Exception(); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_Exception(); + virtual void ProcessToken( + const Token & i_rToken ); + + private: + struct S_Work + { + S_Work(); + + void InitData(); + void Prepare_PE_QualifiedName(); + void Prepare_PE_Element(); + void Data_Set_Name( + const char * i_sName ); + void Data_Add_CurParsed_ElementRef(); + + Exception * pData; + bool bIsPreDeclaration; + udm::IRef< Exception > + pCurStruct; + + Dyn<PE_StructElement> + pPE_Element; + udm::IRef< StructElement > + aCurParsed_ElementRef; + Dyn<PE_Type> pPE_Type; + csi::prl::RefType aCurParsed_Base; + }; + + struct S_Stati; + class PE_StructState; + friend struct S_Stati; + friend class PE_StructState; + + + class PE_StructState : public ParseEnvState + { + public: + + protected: + PE_StructState( + PE_Exception & i_rStruct ) + : rStruct(i_rStruct) {} + void MoveState( + ParseEnvState & i_rState ) const; + void SetResult( + E_TokenDone i_eDone, + E_EnvStackAction i_eWhat2DoWithEnvStack, + UnoIDL_PE * i_pParseEnv2Push = 0 ) const + { rStruct.SetResult(i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push); } + + S_Stati & Stati() const { return *rStruct.pStati; } + S_Work & Work() const { return rStruct.aWork; } + PE_Exception & PE() const { return rStruct; } + + private: + virtual UnoIDL_PE & MyPE(); + // DATA + PE_Exception & rStruct; + }; + + class State_None : public PE_StructState + { + public: + State_None( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + }; + class State_WaitForName : public PE_StructState + { // -> Name + public: + State_WaitForName( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + }; + class State_GotName : public PE_StructState + { // -> : { ; + public: + State_GotName( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + }; + class State_WaitForBase : public PE_StructState + { // -> Base + public: + State_WaitForBase( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void On_SubPE_Left(); + }; + class State_GotBase : public PE_StructState + { // -> { + public: + State_GotBase( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + }; + class State_WaitForElement : public PE_StructState + { // -> Typ } + public: + State_WaitForElement( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_NameSeparator(); + virtual void Process_BuiltInType( + const TokBuiltInType & + i_rToken ); + virtual void Process_TypeModifier( + const TokTypeModifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void On_SubPE_Left(); + }; + class State_WaitForFinish : public PE_StructState + { // -> ; + public: + State_WaitForFinish( + PE_Exception & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + }; + + struct S_Stati + { + S_Stati( + PE_Exception & io_rStruct ); + void SetState( + ParseEnvState & i_rNextState ) + { pCurStatus = &i_rNextState; } + + State_None aNone; + State_WaitForName aWaitForName; + State_GotName aGotName; + State_WaitForBase aWaitForBase; + State_GotBase aGotBase; + State_WaitForElement + aWaitForElement; + State_WaitForFinish aWaitForFinish; + + ParseEnvState * pCurStatus; + }; + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + + friend class PE_StructState; + + S_Stati & Stati() { return *pStati; } + S_Work & Work() { return aWork; } + + // DATA + S_Work aWork; + Dyn<S_Stati> pStati; +}; + + +inline void +PE_Exception::PE_StructState::MoveState( + ParseEnvState & i_rState ) const + { rStruct.Stati().SetState(i_rState); } + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_file2.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_file2.hxx new file mode 100644 index 000000000000..855f7354e338 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_file2.hxx @@ -0,0 +1,167 @@ +/************************************************************************* + * + * $RCSfile: pe_file2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_FILE2_HXX +#define LUIDL_PE_FILE2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace uidl +{ +class CeNamespace; +} // namespace uidl +} // namespace ary + + +namespace csi +{ +namespace uidl +{ + +class TokenDistributor; +class PE_Service; +class PE_Interface; +class PE_Struct; +class PE_Exception; +class PE_Constant; +class PE_Enum; +class PE_Typedef; + + +class PE_File : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_File( + TokenDistributor & i_rTokenAdmin ); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_File(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_MetaType( + const TokMetaType & i_rToken ); + virtual void Process_Default(); + + private: + enum E_State + { + e_none, + e_std, + wait_for_module, + wait_for_module_bracket, + wait_for_module_semicolon, + in_sub_pe, + on_default + }; + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + virtual UnoIDL_PE & MyPE(); + virtual ary::uidl::CeNamespace & + CurNamespace() const; + + + // DATA + TokenDistributor * pTokenAdmin; + Dyn<PE_Service> pPE_Service; + Dyn<PE_Interface> pPE_Interface; + Dyn<PE_Struct> pPE_Struct; + Dyn<PE_Exception> pPE_Exception; + Dyn<PE_Constant> pPE_Constant; + Dyn<PE_Enum> pPE_Enum; + Dyn<PE_Typedef> pPE_Typedef; + + ary::uidl::CeNamespace * + pCurNamespace; + + E_State eState; + uintt nBracketCount_inDefMode; +}; + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_func2.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_func2.hxx new file mode 100644 index 000000000000..d26347a30668 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_func2.hxx @@ -0,0 +1,178 @@ +/************************************************************************* + * + * $RCSfile: pe_func2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_FUNC2_HXX +#define ADC_UIDL_PE_FUNC2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS +#include <csi/l_uidl/param.hxx> + // PARAMETERS +#include <csi/prl/tsk_type.hxx> +#include <ary_i/uidl/gate.hxx> + + +namespace csi +{ +namespace uidl +{ + +class Interface; + +class PE_Type; +class PE_Variable; + +class PE_Function : public UnoIDL_PE, + public ParseEnvState +{ + public: + typedef ary::uidl::Gate::RInterface RInterface; + typedef ary::uidl::Gate::RFunction RFunction; + + PE_Function( + RFunction & o_rResult, + const RInterface & i_rCurInterface ); + + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual ~PE_Function(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ); + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_ParameterHandling( + const TokParameterHandling & + i_rToken ); + virtual void Process_Raises(); + virtual void Process_Default(); + + private: + enum E_State + { + e_none, + e_start, + in_return_type, + expect_name, + expect_params_list, + expect_parameter, + expect_parameter_variable, + in_parameter_variable, + expect_parameter_separator, + params_finished, + expect_exceptions_list, + expect_exception, + in_exception, + expect_exception_separator, + exceptions_finished + }; + + void GoIntoReturnType(); + void GoIntoParameterVariable(); + void GoIntoException(); + void OnDefault(); + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + E_State eState; + Function * pData; + RFunction * pResult; + const RInterface * pCurInterface; + + Dyn<PE_Type> pPE_Type; + csi::prl::RefType aCurParsedType; // ReturnType or Exception + + udmstri sName; + + Dyn<PE_Variable> pPE_Variable; + E_ParameterDirection + eCurParsedParam_Direction; + csi::prl::RefType aCurParsedParam_Type; + udmstri sCurParsedParam_Name; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_iface.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_iface.hxx new file mode 100644 index 000000000000..2ada4ede5d5c --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_iface.hxx @@ -0,0 +1,214 @@ +/************************************************************************* + * + * $RCSfile: pe_iface.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_IFACE_HXX +#define ADC_UIDL_PE_IFACE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + + +namespace csi +{ +namespace uidl +{ + + +class Interface; +class Function; +class Attribute; + +class PE_Function; +class PE_Attribute; +class PE_Type; + +class PE_Interface : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Interface(); + virtual ~PE_Interface(); + + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_MetaType( + const TokMetaType & i_rToken ); + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_NameSeparator(); + virtual void Process_BuiltInType( + const TokBuiltInType & + i_rToken ); + virtual void Process_TypeModifier( + const TokTypeModifier & + i_rToken ); + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ); + virtual void Process_Default(); + + private: + enum E_State + { + e_none = 0, + need_uik, + uik, + need_ident, + ident, + need_interface, + need_name, + wait_for_base, + in_base, + need_curlbr_open, + e_std, + in_function, + in_attribute, + need_finish, + e_STATES_MAX + }; + enum E_TokenType /// @ATTENTION Do not change existing values (except of tt_MAX) !!! Else array-indices will break. + { + tt_metatype = 0, + tt_identifier = 1, + tt_punctuation = 2, + tt_startoftype = 3, + tt_stereotype = 4, + tt_MAX + }; + typedef void (PE_Interface::*F_TOK)(const char *); + + + void On_need_uik_MetaType(const char * i_sText); + void On_uik_Identifier(const char * i_sText); + void On_uik_Punctuation(const char * i_sText); + void On_need_ident_MetaType(const char * i_sText); + void On_ident_Identifier(const char * i_sText); + void On_ident_Punctuation(const char * i_sText); + void On_need_interface_MetaType(const char * i_sText); + void On_need_name_Identifer(const char * i_sText); + void On_wait_for_base_Punctuation(const char * i_sText); + void On_need_curlbr_open_Punctuation(const char * i_sText); + void On_std_Punctuation(const char * i_sText); + void On_std_Stereotype(const char * i_sText); + void On_std_GotoFunction(const char * i_sText); + void On_std_GotoAttribute(const char * i_sText); + void On_need_finish_Punctuation(const char * i_sText); + void On_Default(const char * i_sText); + + void CallHandler( + const char * i_sTokenText, + E_TokenType i_eTokenType ); + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + virtual UnoIDL_PE & MyPE(); + + // DATA + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + Interface * pData; + bool bIsPreDeclaration; + udm::IRef< Interface > + pCurInterface; + + Dyn<PE_Function> pPE_Function; + udm::IRef< Function > + aCurParsed_Function; + Dyn<PE_Attribute> pPE_Attribute; + udm::IRef< Attribute > + aCurParsed_Attribute; + Dyn<PE_Type> pPE_Type; + csi::prl::RefType aCurParsed_Base; + char cUik[37]; + unsigned nUikCharCounter; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx new file mode 100644 index 000000000000..2587a793f2d2 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: pe_modul.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_MODUL_HXX +#define LUIDL_PE_MODUL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <semantic/semnode.hxx> + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + + +class PE_Module : public ::ParseEnvironment +{ + public: + + virtual void Enter( + E_EnvStackAction i_eWayOfEntering ); + virtual void Leave( + E_EnvStackAction i_eWayOfLeaving ); + + private: +}; + + +} // namespace uidl +} // namespace csi + + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_selem.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_selem.hxx new file mode 100644 index 000000000000..3a10d523c4d2 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_selem.hxx @@ -0,0 +1,148 @@ +/************************************************************************* + * + * $RCSfile: pe_selem.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_SELEM_HXX +#define LUIDL_PE_SELEM_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> +#include <ary_i/uidl/gate.hxx> + + +namespace udm { +class Agent_Struct; +} // namespace udm + + +namespace csi +{ +namespace uidl +{ + +class PE_Type; +class StructElement; +class Struct; + +class PE_StructElement : public UnoIDL_PE, + public ParseEnvState +{ + public: + typedef ary::uidl::Gate::RStructElement RStructElement; + typedef ary::uidl::Gate::RStruct RStruct; + + PE_StructElement( + RStructElement & o_rResult, + const RStruct & i_rCurStruct ); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_StructElement(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Default(); + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + + private: + enum E_State + { + e_none, + expect_type, + expect_name, + expect_finish + }; + + virtual void InitData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + E_State eState; + RStructElement * pResult; + const RStruct * pCurStruct; + + Dyn<PE_Type> pPE_Type; + csi::prl::RefType pType; + udmstri sName; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_servi.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_servi.hxx new file mode 100644 index 000000000000..5507ddc8502b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_servi.hxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * $RCSfile: pe_servi.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_SERVI_HXX +#define ADC_UIDL_PE_SERVI_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + + +namespace csi +{ +namespace uidl +{ + +class Service; +class Interface; +class Attribute; + +class PE_Attribute; +class PE_Type; + +class PE_Service : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Service(); + virtual ~PE_Service(); + + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_MetaType( + const TokMetaType & i_rToken ); + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ); + virtual void Process_Needs(); + virtual void Process_Observes(); + virtual void Process_Default(); + + private: + void On_Default(); + + enum E_State + { + e_none = 0, + need_name, + need_curlbr_open, + e_std, + in_property, + in_ifc_type, + in_service_type, + expect_ifc_separator, + expect_service_separator, + at_ignore, + need_finish, + e_STATES_MAX + }; + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + virtual UnoIDL_PE & MyPE(); + + void StartProperty(); + + + // DATA + E_State eState; + Service * pData; + bool bIsPreDeclaration; + udm::IRef< Service > + pCurService; + + Dyn<PE_Attribute> pPE_Property; + udm::IRef< Attribute > + aCurParsed_Property; + + Dyn<PE_Type> pPE_Type; + csi::prl::RefType aCurParsed_Type; + bool bOptionalMember; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_struc.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_struc.hxx new file mode 100644 index 000000000000..4b2bf36349f3 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_struc.hxx @@ -0,0 +1,292 @@ +/************************************************************************* + * + * $RCSfile: pe_struc.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_STRUC_HXX +#define LUIDL_PE_STRUC_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS +#include <s2_luidl/semnode.hxx> +#include <csi/prl/quname2.hxx> + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + + +namespace csi +{ +namespace prl +{ + class TNamespace; +} +} + + + +namespace csi +{ +namespace uidl +{ + + +class Struct; +class StructElement; +class PE_StructElement; +class PE_Type; + + +class PE_Struct : public UnoIDL_PE +{ + public: + PE_Struct(); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_Struct(); + virtual void ProcessToken( + const Token & i_rToken ); + + private: + struct S_Work + { + S_Work(); + + void InitData(); + void Prepare_PE_QualifiedName(); + void Prepare_PE_Element(); + void Data_Set_Name( + const char * i_sName ); + void Data_Add_CurParsed_ElementRef(); + + Struct * pData; + bool bIsPreDeclaration; + udm::IRef< Struct > pCurStruct; + + Dyn<PE_StructElement> + pPE_Element; + udm::IRef< StructElement > + aCurParsed_ElementRef; + Dyn<PE_Type> pPE_Type; + csi::prl::RefType aCurParsed_Base; + }; + + struct S_Stati; + class PE_StructState; + friend struct S_Stati; + friend class PE_StructState; + + + class PE_StructState : public ParseEnvState + { + public: + + protected: + PE_StructState( + PE_Struct & i_rStruct ) + : rStruct(i_rStruct) {} + void MoveState( + ParseEnvState & i_rState ) const; + void SetResult( + E_TokenDone i_eDone, + E_EnvStackAction i_eWhat2DoWithEnvStack, + UnoIDL_PE * i_pParseEnv2Push = 0 ) const + { rStruct.SetResult(i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push); } + + S_Stati & Stati() const { return *rStruct.pStati; } + S_Work & Work() const { return rStruct.aWork; } + PE_Struct & PE() const { return rStruct; } + + private: + virtual UnoIDL_PE & MyPE(); + // DATA + PE_Struct & rStruct; + }; + + class State_None : public PE_StructState + { + public: + State_None( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + }; + class State_WaitForName : public PE_StructState + { // -> Name + public: + State_WaitForName( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + }; + class State_GotName : public PE_StructState + { // -> : { ; + public: + State_GotName( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + }; + class State_WaitForBase : public PE_StructState + { // -> Base + public: + State_WaitForBase( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void On_SubPE_Left(); + }; + class State_GotBase : public PE_StructState + { // -> { + public: + State_GotBase( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + }; + class State_WaitForElement : public PE_StructState + { // -> Typ } + public: + State_WaitForElement( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_NameSeparator(); + virtual void Process_BuiltInType( + const TokBuiltInType & + i_rToken ); + virtual void Process_TypeModifier( + const TokTypeModifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void On_SubPE_Left(); + }; + class State_WaitForFinish : public PE_StructState + { // -> ; + public: + State_WaitForFinish( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + }; + + struct S_Stati + { + S_Stati( + PE_Struct & io_rStruct ); + void SetState( + ParseEnvState & i_rNextState ) + { pCurStatus = &i_rNextState; } + + State_None aNone; + State_WaitForName aWaitForName; + State_GotName aGotName; + State_WaitForBase aWaitForBase; + State_GotBase aGotBase; + State_WaitForElement + aWaitForElement; + State_WaitForFinish aWaitForFinish; + + ParseEnvState * pCurStatus; + }; + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + + friend class PE_StructState; + + S_Stati & Stati() { return *pStati; } + S_Work & Work() { return aWork; } + + // DATA + S_Work aWork; + Dyn<S_Stati> pStati; +}; + + +inline void +PE_Struct::PE_StructState::MoveState( + ParseEnvState & i_rState ) const + { rStruct.Stati().SetState(i_rState); } + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx new file mode 100644 index 000000000000..8b0d12d1e75f --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx @@ -0,0 +1,158 @@ +/************************************************************************* + * + * $RCSfile: pe_tydf2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_PE_TYDF2_HXX +#define LUIDL_PE_TYDF2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + + + +namespace csi +{ +namespace uidl +{ + +class PE_Type; + + +class PE_Typedef : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Typedef(); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~PE_Typedef(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_Default(); + + private: + enum E_State + { + e_none = 0, + expect_description, + expect_name, + got_name, + e_STATES_MAX + }; + enum E_TokenType /// @ATTENTION Do not change existing values (except of tt_MAX) !!! Else array-indices will break. + { + tt_any = 0, + tt_identifier, + tt_punctuation, + tt_MAX + }; + typedef void (PE_Typedef::*F_TOK)(const char *); + + + void CallHandler( + const char * i_sTokenText, + E_TokenType i_eTokenType ); + + void On_expect_description_Any(const char * i_sText); + void On_expect_name_Identifier(const char * i_sText); + void On_got_name_Punctuation(const char * i_sText); + void On_Default(const char * ); + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + Dyn<PE_Type> pPE_Type; + csi::prl::RefType pType; + udmstri sName; +}; + + + +} // namespace uidl +} // namespace csi + + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_type2.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_type2.hxx new file mode 100644 index 000000000000..2309868deb9b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_type2.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: pe_type2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_PE_TYPE2_HXX +#define ADC_PE_TYPE2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include<s2_luidl/parsenv2.hxx> +#include<s2_luidl/pestate.hxx> + // COMPONENTS +#include<csi/prl/quname2.hxx> + // PARAMETERS +#include<csi/prl/tsk_type.hxx> + + +namespace csi +{ +namespace uidl +{ + + +class PE_Type : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Type( + csi::prl::RefType & o_rResult ); + ~PE_Type(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_NameSeparator(); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_BuiltInType( + const TokBuiltInType & + i_rToken ); + virtual void Process_TypeModifier( + const TokTypeModifier & + i_rToken ); + virtual void Process_Default(); + + private: + enum E_State + { + e_none = 0, + expect_type, + expect_quname_part, + expect_quname_separator + }; + + void Finish(); + + virtual void InitData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + // DATA + csi::prl::RefType * pResult; + + uintt nIsSequenceCounter; + bool bIsUnsigned; + QuName sFullType; + + E_State eState; + udmstri sLastPart; +}; + + + +// IMPLEMENTATION + + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_vari2.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_vari2.hxx new file mode 100644 index 000000000000..a6ad1562e877 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_vari2.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * $RCSfile: pe_vari2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_VARI2_HXX +#define ADC_UIDL_PE_VARI2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/tsk_type.hxx> + + +namespace csi +{ +namespace uidl +{ + + +class PE_Type; + + +class PE_Variable : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Variable( + csi::prl::RefType & i_rResult_Type, + udmstri & i_rResult_Name ); + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual ~PE_Variable(); + + virtual void ProcessToken( + const Token & i_rToken ); + + virtual void Process_Default(); + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + + private: + enum E_State + { + e_none, + expect_type, + expect_name, + expect_finish + }; + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + E_State eState; + csi::prl::RefType * pResult_Type; + udmstri * pResult_Name; + + Dyn<PE_Type> pPE_Type; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/pestate.hxx b/autodoc/source/parser_i/inc/s2_luidl/pestate.hxx new file mode 100644 index 000000000000..db560f40a8b9 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pestate.hxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * $RCSfile: pestate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_PESTATE_HXX +#define ADC_PESTATE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include<s2_luidl/tokintpr.hxx> +#include<s2_luidl/tokproct.hxx> + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace uidl +{ + + +class TokIdentifier; +class TokBuiltInType; +class TokPunctuation; +class Tok_Documentation; + +class ParseEnvState : public TokenInterpreter, + virtual protected TokenProcessing_Types +{ + public: + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + virtual void Process_NameSeparator(); + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ); + virtual void Process_BuiltInType( + const TokBuiltInType & + i_rToken ); + virtual void Process_TypeModifier( + const TokTypeModifier & + i_rToken ); + virtual void Process_MetaType( + const TokMetaType & i_rToken ); + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ); + virtual void Process_ParameterHandling( + const TokParameterHandling & + i_rToken ); + virtual void Process_Raises(); + virtual void Process_Needs(); + virtual void Process_Observes(); + virtual void Process_Assignment( + const TokAssignment & + i_rToken ); + virtual void Process_EOL(); + + virtual void On_SubPE_Left(); + + virtual void Process_Default(); + + protected: + ParseEnvState() : bDefaultIsError(true) {} + void SetDefault2Ignore() { bDefaultIsError = false; } + + private: + virtual UnoIDL_PE & MyPE() = 0; + bool bDefaultIsError; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/semnode.hxx b/autodoc/source/parser_i/inc/s2_luidl/semnode.hxx new file mode 100644 index 000000000000..e151e5b82dcc --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/semnode.hxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * $RCSfile: semnode.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_SEMNODE_HXX +#define ADC_SEMNODE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/tokproct.hxx> + // COMPONENTS + // PARAMETERS +#include <csi/prl/quname2.hxx> +#include <udm/ref.hxx> + +namespace ary +{ +class Repository; +namespace uidl +{ +class Gate; +class CeNamespace; +} // namespace uidl +} // namespace ary + + +namespace csi +{ +namespace uidl +{ + + +class Struct; +class QualifiedName; +class Token; + + +/** is an implementation class for UnoIDL_PE s +*/ +class SemanticNode : private TokenProcessing_Types +{ + public: + SemanticNode(); + void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~SemanticNode(); + + udm::IRef< Struct > GetStructRef( + const QuName & i_rText, + ary::uidl::CeNamespace & + i_rCurNamespace ); + void SetTokenResult( + E_TokenDone i_eDone, + E_EnvStackAction i_eWhat2DoWithEnvStack, + UnoIDL_PE * i_pParseEnv2Push = 0 ); + UnoIDL_PE * Parent() const { return pParentPE; } + ary::uidl::Gate & AryGate() const { return *pAryGate; } + + private: + // DATA + UnoIDL_PE * pParentPE; + ary::uidl::Gate * pAryGate; + TokenProcessing_Result * + pTokenResult; +}; + + +/* +class Trying_PE +{ + public: + virtual ~Trying_PE() {} + + protected: + Trying_PE(); + + virtual void ProcessToken( + const Token & i_rToken ); + + void StartTry( + UnoIDL_PE & i_rFirstTry ); + void Add2Try( + UnoIDL_PE & i_rTry ); + bool AmITrying() const; + UnoIDL_PE * NextTry() const; + void FinishTry(); + + private: + std::vector<UnoIDL_PE*> + aTryableSubEnvironments; + uintt nTryCounter; +}; + +*/ + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx b/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx new file mode 100644 index 000000000000..98fbdd0bc5b9 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * $RCSfile: smp_uidl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_SMP_HXX +#define ADC_SMP_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/tok_recv.hxx> +#include <s2_dsapi/tok_recv.hxx> + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace uidl +{ + + + +/** is an implementation class for ParseEnvironment +*/ +class SemanticParser : public csi::uidl::Token_Receiver, + public csi::dsapi::Token_Receiver +{ + public: + typedef std::deque< DYN TextToken * > TokenQueue; + + ~SemanticParser(); + + + void Receive( + DYN csi::uidl::Token & + let_drToken ); + void Receive( + DYN csi::dsapi::Token & + let_drToken ); + + private: + // DATA + TokenQueue aTokenQueue; + + +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + +#endif + + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tk_const.hxx b/autodoc/source/parser_i/inc/s2_luidl/tk_const.hxx new file mode 100644 index 000000000000..25a15ff773b3 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_const.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * $RCSfile: tk_const.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_TK_CONST_HXX +#define ADC_UIDL_TK_CONST_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/uidl_tok.hxx> + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace uidl +{ + + +class TokAssignment : public Token +{ + public: + TokAssignment( + const char * i_sText ) + : sText(i_sText) {} + + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; + private: + // DATA + udmstri sText; +}; + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tk_ident.hxx b/autodoc/source/parser_i/inc/s2_luidl/tk_ident.hxx new file mode 100644 index 000000000000..73d6119b9bf7 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_ident.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: tk_ident.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_TK_IDENT_HXX +#define ADC_UIDL_TK_IDENT_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/uidl_tok.hxx> + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + +class TokIdentifier : public Token +{ + public: + TokIdentifier( + const char * i_sText ) + : sText(i_sText) {} + + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; + private: + // DATA + udmstri sText; +}; + +class TokNameSeparator : public Token +{ + public: + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; +}; + + +} // namespace uidl +} // namespace csi + +#endif + + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tk_keyw.hxx b/autodoc/source/parser_i/inc/s2_luidl/tk_keyw.hxx new file mode 100644 index 000000000000..b57edb2129f0 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_keyw.hxx @@ -0,0 +1,272 @@ +/************************************************************************* + * + * $RCSfile: tk_keyw.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_TK_KEYW_HXX +#define ADC_UIDL_TK_KEYW_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/uidl_tok.hxx> + // COMPONENTS +#include <luxenum.hxx> + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + +class TokKeyword : public Token +{ +}; + + +class TokBuiltInType : public TokKeyword +{ + public: + enum E_TokenId + { + e_none = 0, + bty_any = 1, + bty_boolean = 2, + bty_byte = 3, + bty_char = 4, + bty_double = 5, + bty_hyper = 6, + bty_long = 7, + bty_short = 8, + bty_string = 9, + bty_void = 10 + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + TokBuiltInType( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; + private: + // DATA + EV_TokenId eTag; +}; + + +class TokTypeModifier : public TokKeyword +{ + public: + enum E_TokenId + { + e_none = 0, + tmod_unsigned = 1, + tmod_sequence + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + TokTypeModifier( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + +class TokMetaType : public TokKeyword +{ + public: + enum E_TokenId + { + e_none = 0, + mt_attribute = 1, + mt_constants, + mt_enum, + mt_exception, + mt_ident, + mt_interface, + mt_module, + mt_property, + mt_service, + mt_struct, + mt_typedef, + mt_uik + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + TokMetaType( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; + E_TokenId Id() const { return eTag; } + + + private: + // DATA + EV_TokenId eTag; +}; + +class TokStereotype : public TokKeyword +{ + public: + // TYPES + enum E_TokenId + { + e_none = 0, + ste_const = 1, + ste_oneway, + ste_optional, + ste_readonly, + ste_virtual + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + TokStereotype( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char * + Text() const; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + +class TokParameterHandling : public TokKeyword +{ + public: + // TYPES + enum E_TokenId + { + e_none = 0, + ph_in, + ph_out, + ph_inout + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + TokParameterHandling( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char * + Text() const; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + +class TokRaises : public TokKeyword +{ + public: + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; +}; + +class TokNeeds : public TokKeyword +{ + public: + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; +}; + +class TokObserves : public TokKeyword +{ + public: + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; +}; + + +} // namespace uidl +} // namespace csi + +#endif + + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tk_punct.hxx b/autodoc/source/parser_i/inc/s2_luidl/tk_punct.hxx new file mode 100644 index 000000000000..0cd070e2e637 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_punct.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: tk_punct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_TK_PUNCT_HXX +#define ADC_UIDL_TK_PUNCT_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/uidl_tok.hxx> + // COMPONENTS +#include <luxenum.hxx> + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + +class TokPunctuation : public Token +{ + public: + // TYPES + enum E_TokenId + { + e_none = 0, + BracketOpen = 1, // "(" + BracketClose = 2, // ")" + ArrayBracketOpen = 3, // "[" + ArrayBracketClose = 4, // "]" + CurledBracketOpen = 5, // "{" + CurledBracketClose = 6, // "}" + Semicolon = 7, // ";" + Colon = 8, // ":" + DoubleColon = 9, // "::" + Comma = 10, // "," + Minus = 11, // "-" + Fullstop = 12 // "." + }; + typedef udm::Enum<E_TokenId> EV_TokenId; + + + TokPunctuation( + EV_TokenId i_eTag ) + : eTag(i_eTag) {} + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char * + Text() const; + EV_TokenId Id() const { return eTag; } + + + private: + // DATA + EV_TokenId eTag; +}; + +class Tok_EOL : public Token +{ + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char * + Text() const; +}; + +class Tok_EOF : public Token +{ + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char * + Text() const; +}; + + +} // namespace uidl +} // namespace csi + +#endif + + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tkp_uidl.hxx b/autodoc/source/parser_i/inc/s2_luidl/tkp_uidl.hxx new file mode 100644 index 000000000000..59154dd5b694 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tkp_uidl.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: tkp_uidl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TKP_UIDL_HXX +#define ADC_TKP_UIDL_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkp2.hxx> + // COMPONENTS + // PARAMETRS + +class TkpDocuContext; + + +namespace csi +{ +namespace uidl +{ + + + +class Token_Receiver; +class Context_UidlCode; + + +/** This is a TokenParser which is able to parse tokens from + C++ source code. +*/ +class TokenParser_Uidl : public TokenParse2 +{ + public: + // LIFECYCLE + TokenParser_Uidl( + Token_Receiver & o_rUidlReceiver, + DYN TkpDocuContext & + let_drDocuContext ); + virtual ~TokenParser_Uidl(); + + // OPERATIONS + private: + virtual ::TkpContext & + CurrentContext(); + + virtual void SetStartContext(); + virtual void SetCurrentContext( + TkpContext & io_rContext ); + // DATA + Dyn<Context_UidlCode> + pBaseContext; + ::TkpContext * pCurContext; +}; + + +} // namespace uidl +} // namespace csi + +#endif + + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tokintpr.hxx b/autodoc/source/parser_i/inc/s2_luidl/tokintpr.hxx new file mode 100644 index 000000000000..b369ff7c8daa --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tokintpr.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: tokintpr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_LUIDL_TOKINTPR_HXX +#define ADC_LUIDL_TOKINTPR_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace uidl +{ + + +class TokIdentifier; +class TokPunctuation; +class TokBuiltInType; +class TokTypeModifier; +class TokMetaType; +class TokStereotype; +class TokParameterHandling; +class TokAssignment; +class Tok_Documentation; + + +class TokenInterpreter +{ + public: + virtual ~TokenInterpreter() {} + + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ) = 0; + virtual void Process_NameSeparator() = 0; // :: + virtual void Process_Punctuation( + const TokPunctuation & + i_rToken ) = 0; + virtual void Process_BuiltInType( + const TokBuiltInType & + i_rToken ) = 0; + virtual void Process_TypeModifier( + const TokTypeModifier & + i_rToken ) = 0; + virtual void Process_MetaType( + const TokMetaType & i_rToken ) = 0; + virtual void Process_Stereotype( + const TokStereotype & + i_rToken ) = 0; + virtual void Process_ParameterHandling( + const TokParameterHandling & + i_rToken ) = 0; + virtual void Process_Raises() = 0; + virtual void Process_Needs() = 0; + virtual void Process_Observes() = 0; + virtual void Process_Assignment( + const TokAssignment & + i_rToken ) = 0; + virtual void Process_EOL() = 0; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tokproct.hxx b/autodoc/source/parser_i/inc/s2_luidl/tokproct.hxx new file mode 100644 index 000000000000..11084c101e4d --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tokproct.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * $RCSfile: tokproct.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TOKPROCT_HXX +#define ADC_TOKPROCT_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + +class UnoIDL_PE; + + +/** 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_sure, // push sub environment, which must be the correct one + push_try, // push sub environment, which is tried, if it may be the right one + 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; + UnoIDL_PE * 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 + }; +}; + + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/tokrecv.hxx b/autodoc/source/parser_i/inc/s2_luidl/tokrecv.hxx new file mode 100644 index 000000000000..955c741b1362 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tokrecv.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: tokrecv.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef LUIDL_TOKRECV_HXX +#define LUIDL_TOKRECV_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS + +namespace csi +{ +namespace uidl +{ + + +class Token; + +/** +@descr +*/ +class Token_Receiver +{ + public: + virtual ~Token_Receiver() {} + virtual void Receive( + DYN Token & let_drToken ) = 0; +}; + +} // namespace uidl +} // namespace csi + +#endif + diff --git a/autodoc/source/parser_i/inc/s2_luidl/uidl_tok.hxx b/autodoc/source/parser_i/inc/s2_luidl/uidl_tok.hxx new file mode 100644 index 000000000000..d8cf139aed47 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/uidl_tok.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: uidl_tok.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_UIDL_TOK_HXX +#define ADC_UIDL_TOK_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/token2.hxx> + // COMPONENTS + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + +class TokenInterpreter; + + +class Token : public TextToken +{ + public: + // LIFECYCLE + virtual ~Token() {} + + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const = 0; +}; + +} // namespace uidl +} // namespace csi + +#endif + + diff --git a/autodoc/source/parser_i/inc/semantic/parsenv2.hxx b/autodoc/source/parser_i/inc/semantic/parsenv2.hxx new file mode 100644 index 000000000000..79ff146c0c4b --- /dev/null +++ b/autodoc/source/parser_i/inc/semantic/parsenv2.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * $RCSfile: parsenv2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_PARSEENV2_HXX +#define ADC_PARSEENV2_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <queue> + + + +class ParseEnvironment +{ + public: + virtual ~ParseEnvironment(); + + virtual void Enter() = 0; +}; + + +#endif + diff --git a/autodoc/source/parser_i/inc/tokens/stmstar2.hxx b/autodoc/source/parser_i/inc/tokens/stmstar2.hxx new file mode 100644 index 000000000000..bfc84550f2f3 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/stmstar2.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: stmstar2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_STMSTAR2_HXX +#define ADC_STMSTAR2_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/stmstat2.hxx> + // COMPONENTS + // PARAMETERS + // SERVICES + + +class StmArrayStatu2 : public StmStatu2 +{ + public: + // LIFECYCLE + StmArrayStatu2( + intt i_nStatusSize, + const INT16 * in_aArrayModel, + uintt i_nTokenId, + bool in_bIsDefault ); + ~StmArrayStatu2(); + + // INQUIRY + StmStatu2::Branch NextBy( + intt in_nFollowersIndex) const; + UINT16 TokenId() const { return nTokenId; } + virtual bool IsADefault() const; + + // ACCESS + virtual StmArrayStatu2 * + AsArray(); + void SetBranches( + intt in_nStartBranchIx, + StmStatu2::Branch * + in_aBranchValues, + intt in_nNrofValues ); + bool SetBranch( + intt in_nBranchIx, + StmStatu2::Branch + in_nBranch ); + void SetTokenId( + UINT16 in_nTokenId ); + private: + StmStatu2::Branch * dpBranches; + intt nNrOfBranches; + UINT16 nTokenId; + bool bIsADefault; +}; + + +// IMPLEMENTATION + +inline void +StmArrayStatu2::SetTokenId( UINT16 in_nTokenId ) + { nTokenId = in_nTokenId; } + + + +#endif + + diff --git a/autodoc/source/parser_i/inc/tokens/stmstat2.hxx b/autodoc/source/parser_i/inc/tokens/stmstat2.hxx new file mode 100644 index 000000000000..5a901036b5ab --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/stmstat2.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: stmstat2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_STMSTAT2_HXX +#define ADC_STMSTAT2_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +class StmArrayStatu2; +class StmBoundsStatu2; + +/** A StmStatu2 is a state within a StateMachin2. + 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 StateMachin2. +**/ +class StmStatu2 // := "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 ~StmStatu2() {} + + // OPERATIONS + virtual StmArrayStatu2 * + AsArray(); + virtual StmBoundsStatu2 * + AsBounds(); + + // INQUIRY + virtual bool IsADefault() const = 0; +}; + + + +#endif + + diff --git a/autodoc/source/parser_i/inc/tokens/stmstfi2.hxx b/autodoc/source/parser_i/inc/tokens/stmstfi2.hxx new file mode 100644 index 000000000000..eafe15bf79a4 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/stmstfi2.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * $RCSfile: stmstfi2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_STMSTFI2_HXX +#define ADC_STMSTFI2_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/stmstat2.hxx> + // COMPONENTS + // PARAMETERS + + +class TkpContext; +class StateMachineContext; + +/** +**/ +class StmBoundsStatu2 : public StmStatu2 +{ + public: + // LIFECYCLE + StmBoundsStatu2( + StateMachineContext & + o_rOwner, + TkpContext & i_rFollowUpContext, + uintt i_nStatusFunctionNr, + bool i_bIsDefault ); + // INQUIRY + TkpContext * FollowUpContext(); + uintt StatusFunctionNr() const; + virtual bool IsADefault() const; + + // ACCESS + virtual StmBoundsStatu2 * + AsBounds(); + + private: + StateMachineContext * + pOwner; + TkpContext * pFollowUpContext; + uintt nStatusFunctionNr; + bool bIsDefault; +}; + +inline TkpContext * +StmBoundsStatu2::FollowUpContext() + { return pFollowUpContext; } +inline uintt +StmBoundsStatu2::StatusFunctionNr() const + { return nStatusFunctionNr; } + + +#endif + + diff --git a/autodoc/source/parser_i/inc/tokens/tkp2.hxx b/autodoc/source/parser_i/inc/tokens/tkp2.hxx new file mode 100644 index 000000000000..06f9dace620e --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/tkp2.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: tkp2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TKP2_HXX +#define ADC_TKP2_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +class CharacterSource; +class TkpContext; + // PARAMETRS + + + +/** This is the interface for parser classes, which get a sequence of Token s 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. The last time GetNextToken() + returns NULL. + + The algorithms for parsing tokens from the text are an issue of + the derived classes. +*/ +class TokenParse2 +{ + public: + // LIFECYCLE + TokenParse2(); + virtual ~TokenParse2() {} + + // OPERATIONS + virtual void Start( + CharacterSource & + i_rSource ); + + /** @short Gets the next identifiable token out of the + source code. + @return true, if there was passed a valid token. + false, if the parsed stream is finished or + an error occured. + */ + bool GetNextToken(); + + private: + virtual void SetStartContext() = 0; + virtual void SetCurrentContext( + TkpContext & io_rContext ) = 0; + virtual TkpContext & + CurrentContext() = 0; + // DATA + CharacterSource * pChars; +}; + + +#endif + + diff --git a/autodoc/source/parser_i/inc/tokens/tkpcont2.hxx b/autodoc/source/parser_i/inc/tokens/tkpcont2.hxx new file mode 100644 index 000000000000..cbb360c8fb60 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/tkpcont2.hxx @@ -0,0 +1,155 @@ +/************************************************************************* + * + * $RCSfile: tkpcont2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TKPCONT2_HXX +#define ADC_TKPCONT2_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +class CharacterSource; +class TkpNullContext; +class TkpNullContex2; + +/** @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. +**/ +class TkpContext +{ + public: + // LIFECYCLE + virtual ~TkpContext() {} + + // OPERATIONS + /** @descr + The functions starts to parse with the CurToken() of io_rText. + It leaves io_rText 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, PassNewToken() returns false + and cuts the token from io_rText. + If the token is to be parsed further in a different context, + PassNewToken() returns false, but the token is + NOT cut from io_rText. + + 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. + @return true, if a token was passed. + false, if no token was parsed complete by this context. + */ + virtual bool PassNewToken() = 0; + virtual TkpContext & + FollowUpContext() = 0; + + static TkpNullContext & + Null_(); +}; + +TkpNullContex2 & TkpContext_Null2_(); + +class StateMachineContext +{ + public: + /// Is used by StmBoundsStatu2 only. + virtual void PerformStatusFunction( + uintt i_nStatusSignal, + UINT16 i_nTokenId, + CharacterSource & io_rText ) = 0; +}; + +class TkpNullContex2 : public TkpContext +{ + public: + ~TkpNullContex2(); + + virtual void ReadCharChain( + CharacterSource & io_rText ); + virtual bool PassNewToken(); + virtual TkpContext & + FollowUpContext(); +}; + +class TkpDocuContext : public TkpContext +{ + public: + virtual void SetParentContext( + TkpContext & io_rParentContext, + const char * i_sMultiLineEndToken ) = 0; + virtual void SetMode_IsMultiLine( + bool i_bTrue ) = 0; +}; + + + +#endif + + diff --git a/autodoc/source/parser_i/inc/tokens/tkpstam2.hxx b/autodoc/source/parser_i/inc/tokens/tkpstam2.hxx new file mode 100644 index 000000000000..3de1e53317de --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/tkpstam2.hxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * $RCSfile: tkpstam2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TKPSTAM2_HXX +#define ADC_TKPSTAM2_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS +#include <tokens/stmstar2.hxx> +#include <tokens/stmstfi2.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. + + StateMachin2 needs the array-size of all stati as a guess, how many stati + the state machine will contain, when at work. + + +**/ +class StateMachin2 +{ + public: + // Types + typedef StmStatu2::Branch Branch; + typedef StmStatu2 * * StatusList; + + //# Interface self + // LIFECYCLE + StateMachin2( + 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 StmStatu2 * let_dpStatus); + /// @#AddToken + void AddToken( + const char * in_sToken, + UINT16 in_nTokenId, + const INT16 * in_aBranches, + INT16 in_nBoundsStatus ); + ~StateMachin2(); + + + // FOR TESTS ONLY: + void PrintOut(); + + // OPERATIONS + StmBoundsStatu2 & + GetCharChain( + UINT16 & o_nTokenId, + CharacterSource & io_rText ); + private: + // SERVICE FUNCTIONS + StmStatu2 & Status( + intt in_nStatusNr) const; + StmArrayStatu2 & + CurrentStatus() const; + StmBoundsStatu2 * + 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_i/inc/tokens/token2.hxx b/autodoc/source/parser_i/inc/tokens/token2.hxx new file mode 100644 index 000000000000..af443efd461b --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/token2.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: token2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_TOKEN2_HXX +#define ADC_TOKEN2_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETRS + + + +/** This is the interface for parser classes, which get a sequence of Token s 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. The last time GetNextToken() + returns NULL. + + The algorithms for parsing tokens from the text are an issue of + the derived classes. +*/ +class TextToken +{ + public: + // LIFECYCLE + virtual ~TextToken() {} + + + // INQUIRY + virtual const char* Text() const = 0; +}; + + +#endif + + diff --git a/autodoc/source/parser_i/inc/x_parse2.hxx b/autodoc/source/parser_i/inc/x_parse2.hxx new file mode 100644 index 000000000000..744d19b21832 --- /dev/null +++ b/autodoc/source/parser_i/inc/x_parse2.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * $RCSfile: x_parse2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_X_PARSE2_HXX +#define ADC_X_PARSE2_HXX + +// USED SERVICES + // BASE CLASSES +#include <cosv/x.hxx> + // COMPONENTS + // PARAMETERS + + +class X_AutodocParser : public csv::Exception +{ + public: + // TYPES + enum E_Type + { + x_Any = 0, + x_InvalidChar, + x_UnexpectedToken, + x_UnexpectedEOF + }; + // LIFECYCLE + X_AutodocParser( + E_Type i_eType, + const char * i_sName = "" ) + : eType(i_eType), sName(i_sName) {} + // INQUIRY + virtual void GetInfo( + ostream & o_rOutputMedium ) const; + + private: + E_Type eType; + udmstri sName; + +}; + +#endif + diff --git a/autodoc/source/parser_i/tokens/makefile.mk b/autodoc/source/parser_i/tokens/makefile.mk new file mode 100644 index 000000000000..30aa8f88a48d --- /dev/null +++ b/autodoc/source/parser_i/tokens/makefile.mk @@ -0,0 +1,98 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=garden +TARGET=parser2_tokens +TARGETTYPE=CUI + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/stmstar2.obj \ + $(OBJ)$/stmstat2.obj \ + $(OBJ)$/stmstfi2.obj \ + $(OBJ)$/tkpstam2.obj \ + $(OBJ)$/tkp2.obj \ + $(OBJ)$/tkpcont2.obj \ + $(OBJ)$/x_parse2.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/parser_i/tokens/stmstar2.cxx b/autodoc/source/parser_i/tokens/stmstar2.cxx new file mode 100644 index 000000000000..525a01489073 --- /dev/null +++ b/autodoc/source/parser_i/tokens/stmstar2.cxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * $RCSfile: stmstar2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tokens/stmstar2.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <x_parse2.hxx> + + + +StmArrayStatu2::StmArrayStatu2( intt i_nStatusSize, + const INT16 * in_aArrayModel, + uintt i_nTokenId, + bool in_bIsDefault ) + : dpBranches(new StmStatu2::Branch[i_nStatusSize]), + nNrOfBranches(i_nStatusSize), + nTokenId(UINT16(i_nTokenId)), + bIsADefault(in_bIsDefault) +{ + // KORR: Interface of StmArrayStatu2() has to be changed. + csv_assert(i_nTokenId < 64536); + + 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 +} + +StmArrayStatu2::~StmArrayStatu2() +{ + delete [] dpBranches; +} + +void +StmArrayStatu2::SetBranches( intt in_nStartBranchIx, + StmStatu2::Branch * in_aBranchValues, + intt in_nNrofValues ) +{ + precond(in_nStartBranchIx >= 0); + precond(in_aBranchValues != 0); + precond( in_nNrofValues > 0 + AND in_nStartBranchIx + in_nNrofValues <= nNrOfBranches ); + + memcpy(&dpBranches[in_nStartBranchIx],in_aBranchValues,in_nNrofValues); +} + + + +bool +StmArrayStatu2::SetBranch( intt in_nBranchIx, + StmStatu2::Branch in_nBranch ) +{ + if ( csv::in_range(intt(0), in_nBranchIx, intt(nNrOfBranches) ) ) + { + dpBranches[in_nBranchIx] = in_nBranch; + return true; + } + return false; +} + + +StmStatu2::Branch +StmArrayStatu2::NextBy(intt in_nIndex) const +{ + if (in_nIndex < 0) + throw X_AutodocParser(X_AutodocParser::x_InvalidChar); + + return in_nIndex < nNrOfBranches + ? dpBranches[in_nIndex] + : dpBranches[nNrOfBranches - 1]; +} + + +bool +StmArrayStatu2::IsADefault() const +{ + return bIsADefault; +} + +StmArrayStatu2 * +StmArrayStatu2::AsArray() +{ + return this; +} + diff --git a/autodoc/source/parser_i/tokens/stmstat2.cxx b/autodoc/source/parser_i/tokens/stmstat2.cxx new file mode 100644 index 000000000000..63882d4bfcd5 --- /dev/null +++ b/autodoc/source/parser_i/tokens/stmstat2.cxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * $RCSfile: stmstat2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tokens/stmstat2.hxx> + + +// NOT FULLY DECLARED SERVICES + +StmArrayStatu2 * +StmStatu2::AsArray() +{ + return 0; +} + +StmBoundsStatu2 * +StmStatu2::AsBounds() +{ + return 0; +} + + diff --git a/autodoc/source/parser_i/tokens/stmstfi2.cxx b/autodoc/source/parser_i/tokens/stmstfi2.cxx new file mode 100644 index 000000000000..437253236d65 --- /dev/null +++ b/autodoc/source/parser_i/tokens/stmstfi2.cxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * $RCSfile: stmstfi2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tokens/stmstfi2.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <tokens/tkpcont2.hxx> + + +StmBoundsStatu2::StmBoundsStatu2( 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 +StmBoundsStatu2::IsADefault() const +{ + return bIsDefault; +} + +StmBoundsStatu2 * +StmBoundsStatu2::AsBounds() +{ + return this; +} + + + diff --git a/autodoc/source/parser_i/tokens/tkp2.cxx b/autodoc/source/parser_i/tokens/tkp2.cxx new file mode 100644 index 000000000000..f04f37926bc5 --- /dev/null +++ b/autodoc/source/parser_i/tokens/tkp2.cxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * $RCSfile: tkp2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tokens/tkp2.hxx> + +// NOT FULLY DECLARED SERVICES +#include <tools/tkpchars.hxx> +#include <tokens/tkpcont2.hxx> + +TokenParse2::TokenParse2() + : pChars(0) +{ +} + +void +TokenParse2::Start( CharacterSource & i_rSource ) +{ + pChars = &i_rSource; + SetStartContext(); +} + +bool +TokenParse2::GetNextToken() +{ + csv_assert(pChars != 0); + + bool bDone = false; + while ( NOT bDone AND NOT pChars->IsFinished() ) + { + CurrentContext().ReadCharChain(*pChars); + bDone = CurrentContext().PassNewToken(); + SetCurrentContext(CurrentContext().FollowUpContext()); + } + return bDone; +} + + diff --git a/autodoc/source/parser_i/tokens/tkpcont2.cxx b/autodoc/source/parser_i/tokens/tkpcont2.cxx new file mode 100644 index 000000000000..8b8ab3abeeb0 --- /dev/null +++ b/autodoc/source/parser_i/tokens/tkpcont2.cxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * $RCSfile: tkpcont2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tokens/tkpcont2.hxx> + +// NOT FULLY DECLARED SERVICES + + + +TkpNullContex2 G_aNullContex2; + +TkpNullContex2 & +TkpContext_Null2_() +{ + return G_aNullContex2; +} + +TkpNullContex2::~TkpNullContex2() +{ +} + +void +TkpNullContex2::ReadCharChain( CharacterSource & ) +{ +} + +bool +TkpNullContex2::PassNewToken() +{ + return false; +} + +TkpContext & +TkpNullContex2::FollowUpContext() +{ + return *this; +} + + + diff --git a/autodoc/source/parser_i/tokens/tkpstam2.cxx b/autodoc/source/parser_i/tokens/tkpstam2.cxx new file mode 100644 index 000000000000..77fa6f1338f5 --- /dev/null +++ b/autodoc/source/parser_i/tokens/tkpstam2.cxx @@ -0,0 +1,239 @@ +/************************************************************************* + * + * $RCSfile: tkpstam2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tokens/tkpstam2.hxx> + +// NOT FULLY DECLARED SERVICES +#include <tokens/stmstar2.hxx> +#include <tools/tkpchars.hxx> + + +const intt C_nStatuslistResizeValue = 32; +const intt C_nTopStatus = 0; + +StateMachin2::StateMachin2( intt in_nStatusSize, + intt in_nInitial_StatusListSize ) + : pStati(new StmStatu2*[in_nInitial_StatusListSize]), + nCurrentStatus(C_nTopStatus), + nPeekedStatus(C_nTopStatus), + nStatusSize(in_nStatusSize), + nNrofStati(0), + nStatiSpace(in_nInitial_StatusListSize) +{ + precond(in_nStatusSize > 0); + precond(in_nInitial_StatusListSize > 0); + + memset(pStati, 0, sizeof(StmStatu2*) * nStatiSpace); +} + +intt +StateMachin2::AddStatus(StmStatu2 * let_dpStatus) +{ + if (nNrofStati == nStatiSpace) + { + ResizeStati(); + } + pStati[nNrofStati] = let_dpStatus; + return nNrofStati++; +} + +void +StateMachin2::AddToken( const char * in_sToken, + UINT16 in_nTokenId, + 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); + StmStatu2 & rPst = Status(nPeekedStatus); + if ( rPst.IsADefault() OR rPst.AsBounds() != 0 ) + { + nPeekedStatus = AddStatus( new StmArrayStatu2(nStatusSize, in_aBranches, 0, false ) ); + CurrentStatus().SetBranch( *pChar, nPeekedStatus ); + } + nCurrentStatus = nPeekedStatus; + } // end for + StmArrayStatu2 & rLastStatus = CurrentStatus(); + rLastStatus.SetTokenId(in_nTokenId); + for (intt i = 0; i < nStatusSize; i++) + { + if (Status(rLastStatus.NextBy(i)).AsBounds() != 0) + rLastStatus.SetBranch(i,in_nBoundsStatus); + } // end for +} + +StateMachin2::~StateMachin2() +{ + for (intt i = 0; i < nNrofStati; i++) + { + delete pStati[i]; + } + delete [] pStati; +} + +StmBoundsStatu2 & +StateMachin2::GetCharChain( UINT16 & o_nTokenId, + CharacterSource & io_rText ) +{ + nCurrentStatus = C_nTopStatus; + Peek(io_rText.CurChar()); + while (BoundsStatus() == 0) + { + nCurrentStatus = nPeekedStatus; + Peek(io_rText.MoveOn()); + } + o_nTokenId = CurrentStatus().TokenId(); + + return *BoundsStatus(); +} + +void +StateMachin2::ResizeStati() +{ + intt nNewSize = nStatiSpace + C_nStatuslistResizeValue; + intt i = 0; + StatusList pNewStati = new StmStatu2*[nNewSize]; + + for ( ; i < nNrofStati; i++) + { + pNewStati[i] = pStati[i]; + } + memset( pNewStati+i, + 0, + (nNewSize-i) * sizeof(StmStatu2*) ); + + delete [] pStati; + pStati = pNewStati; + nStatiSpace = nNewSize; +} + +StmStatu2 & +StateMachin2::Status(intt in_nStatusNr) const +{ + csv_assert( csv::in_range(intt(0), in_nStatusNr, intt(nNrofStati)) ); + return *pStati[in_nStatusNr]; +} + +StmArrayStatu2 & +StateMachin2::CurrentStatus() const +{ + StmArrayStatu2 * pCurSt = Status(nCurrentStatus).AsArray(); + if (pCurSt == 0) + { + csv_assert(false); + } + return *pCurSt; +} + +StmBoundsStatu2 * +StateMachin2::BoundsStatus() const +{ + return Status(nPeekedStatus).AsBounds(); +} + +void +StateMachin2::Peek(intt in_nBranch) +{ + StmArrayStatu2 & rSt = CurrentStatus(); + nPeekedStatus = rSt.NextBy(in_nBranch); +} + +void +StateMachin2::PrintOut() +{ + const anzahl = nNrofStati; + for (int i = 0; i < anzahl; i++) + { + Cout() << i << ':'; + StmArrayStatu2 * pArrSt = pStati[i]->AsArray(); + if (pArrSt != 0) + { + Cout() << Endl(); + for (int b = 0; b < 128; b++) + { + Cout().width(4); + Cout() << pArrSt->NextBy(b); + if (b%16 == 15) + Cout() << Endl(); + } + } + else if (pStati[i]->AsBounds() != 0) + { + Cout() << "Bounds "; + } + else + Cout() << "Error! "; + Cout() << (pStati[i]->IsADefault() ? "DEF" : "---") + << Endl(); + } // for +} + diff --git a/autodoc/source/parser_i/tokens/x_parse2.cxx b/autodoc/source/parser_i/tokens/x_parse2.cxx new file mode 100644 index 000000000000..41bd3426bee4 --- /dev/null +++ b/autodoc/source/parser_i/tokens/x_parse2.cxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * $RCSfile: x_parse2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <x_parse2.hxx> + +// NOT FULLY DECLARED SERVICES + + enum E_Type + { + x_Any = 0, + x_InvalidChar, + x_UnexpectedEOF + }; +void +X_AutodocParser::GetInfo( ostream & o_rOutputMedium ) const +{ + switch (eType) + { + case x_Any: + o_rOutputMedium << "Unspecified parsing exception ." << Endl(); + break; + case x_InvalidChar: + o_rOutputMedium << "Unknown character during parsing." << Endl(); + break; + case x_UnexpectedToken: + o_rOutputMedium << "Unexpected token " << sName << " found." << Endl(); + break; + case x_UnexpectedEOF: + o_rOutputMedium << "Unexpected end of file found." << Endl(); + break; + default: + o_rOutputMedium << "Unknown error during parsing." << Endl(); + } +} + + diff --git a/autodoc/source/tools/filecoll.cxx b/autodoc/source/tools/filecoll.cxx new file mode 100644 index 000000000000..fd46cc0d0841 --- /dev/null +++ b/autodoc/source/tools/filecoll.cxx @@ -0,0 +1,185 @@ +/************************************************************************* + * + * $RCSfile: filecoll.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tools/filecoll.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <stdio.h> +#include <cosv/ploc_dir.hxx> + + +FileCollector::FileCollector( uintt i_nRoughNrOfFiles ) + // : aFoundFiles +{ + if (i_nRoughNrOfFiles > 0) + aFoundFiles.reserve(i_nRoughNrOfFiles); +} + +uintt +FileCollector::AddFilesFrom( const char * i_sRootDir, + const char * i_sFilter, + E_SearchMode i_eSearchMode ) +{ + uintt nSizeAtStart = aFoundFiles.size(); + + if (csv::no_str(i_sFilter) OR csv::no_str(i_sRootDir)) + { + Cout() << "Warning: The filter contains no files." << Endl(); + return 0; + } + + GetFiles( aFoundFiles, i_sRootDir, i_sFilter ); + + + if (i_eSearchMode == recursive) + { + StreamStr aPath(1020); + aPath << i_sRootDir << csv::ploc::Delimiter(); + uintt nSubDirStart = aPath.tellp(); + + DirNameList aSubDirs; + GetSubDirectories( aSubDirs, i_sRootDir ); + for ( const_iterator iter = aSubDirs.begin(); + iter != aSubDirs.end(); + ++iter ) + { + aPath.seekp(nSubDirStart); + aPath << (*iter); + AddFilesFrom( aPath.c_str(), i_sFilter, i_eSearchMode ); + } + } + + return aFoundFiles.size() - nSizeAtStart; +} + +uintt +FileCollector::AddFile( const char * i_sFilePath ) +{ + FILE * pFile = fopen( i_sFilePath, "r" ); + if ( pFile == 0 ) + { + Cerr() << "Error: The path for the file to be parsed could not be found." + << Endl(); + return 0; + } + + fclose(pFile); + aFoundFiles.push_back(i_sFilePath); + return 1; +} + +void +FileCollector::EraseAll() +{ + csv::erase_container(aFoundFiles); +} + +FileCollector::const_iterator +FileCollector::Begin() const +{ + return aFoundFiles.begin(); +} + +FileCollector::const_iterator +FileCollector::End() const +{ + return aFoundFiles.end(); +} + +uintt +FileCollector::Size() const +{ + return aFoundFiles.size(); +} + +void +FileCollector::GetSubDirectories( DirNameList & o_rList, + const char * i_sParentDir ) +{ + csv::ploc::Directory aSubDirs(i_sParentDir); + aSubDirs.GetContainedDirectories(o_rList); +} + +void +FileCollector::GetFiles( FileNameList & o_rList, + const char * i_sParentDir, + const char * i_sFilter ) +{ + // Alife sign: + Cout() << "." << Flush(); + + csv::ploc::Directory aDir(i_sParentDir); + if (NOT aDir.Exists()) + { + Cerr() << "Error: The path for the files to be parsed could not be found." + << Endl(); + return; + } + + aDir.GetContainedFiles(o_rList, i_sFilter); +} + + + + + diff --git a/autodoc/source/tools/makefile.mk b/autodoc/source/tools/makefile.mk new file mode 100644 index 000000000000..d128d8cefde0 --- /dev/null +++ b/autodoc/source/tools/makefile.mk @@ -0,0 +1,93 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=autodoc +TARGET=autodoc_tools +TARGETTYPE=CUI + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/filecoll.obj \ + $(OBJ)$/tkpchars.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + + + diff --git a/autodoc/source/tools/tkpchars.cxx b/autodoc/source/tools/tkpchars.cxx new file mode 100644 index 000000000000..5d23e65ba22f --- /dev/null +++ b/autodoc/source/tools/tkpchars.cxx @@ -0,0 +1,205 @@ +/************************************************************************* + * + * $RCSfile: tkpchars.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: np $ $Date: 2002-03-08 14:45:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <precomp.h> +#include <tools/tkpchars.hxx> + +// NOT FULLY DECLARED SERVICES +#include <cosv/bstream.hxx> + + + +CharacterSource::CharacterSource() + : dpSource(new char[2]), + nSourceSize(0), + nCurPos(0), + nLastCut(0), + nLastTokenStart(0), + cCharAtLastCut(0) +{ + dpSource[nSourceSize] = NULCH; + dpSource[nSourceSize+1] = NULCH; +} + +CharacterSource::~CharacterSource() +{ + delete [] dpSource; +} + +void +CharacterSource::LoadText(csv::bstream & io_rSource) +{ + if (dpSource != 0) + delete dpSource; + + io_rSource.seek(0, csv::end); + nSourceSize = intt(io_rSource.position()); + io_rSource.seek(0); + + dpSource = new char[nSourceSize+1]; + + intt nCount = (intt) io_rSource.read(dpSource,nSourceSize); + csv_assert( nCount == nSourceSize ); + + dpSource[nSourceSize] = NULCH; + + BeginSource(); +} + +void +CharacterSource::LoadText( const char * i_sSourceText ) +{ + if (dpSource != 0) + delete dpSource; + + nSourceSize = strlen(i_sSourceText); + + dpSource = new char[nSourceSize+1]; + strcpy( dpSource, i_sSourceText); + + BeginSource(); +} + +/// KORR: So far, this works only when tokens do not cross inserted text boundaries. +void +CharacterSource::InsertTextAtCurPos( const char * i_sText2Insert ) +{ + if ( i_sText2Insert == 0 ? true : strlen(i_sText2Insert) == 0 ) + return; + + aSourcesStack.push( S_SourceState( + dpSource, + nSourceSize, + nCurPos, + nLastCut, + nLastTokenStart, + cCharAtLastCut ) ); + + nSourceSize = strlen(i_sText2Insert); + dpSource = new char[nSourceSize+1]; + strcpy( dpSource, i_sText2Insert); + + BeginSource(); +} + +const char * +CharacterSource::CutToken() +{ + dpSource[nLastCut] = cCharAtLastCut; + nLastTokenStart = nLastCut; + nLastCut = CurPos(); + cCharAtLastCut = dpSource[nLastCut]; + dpSource[nLastCut] = NULCH; + + return &dpSource[nLastTokenStart]; +} + +void +CharacterSource::BeginSource() +{ + nCurPos = 0; + nLastCut = 0; + nLastTokenStart = 0; + cCharAtLastCut = dpSource[nLastCut]; + dpSource[nLastCut] = NULCH; +} + +/// KORR: So far, this works only when tokens do not cross inserted text boundaries. +const char & +CharacterSource::MoveOn_OverStack() +{ + while ( aSourcesStack.size() > 0 AND nCurPos >= nSourceSize-1 ) + { + S_SourceState & aState = aSourcesStack.top(); + delete dpSource; + + dpSource = aState.dpSource; + nSourceSize = aState.nSourceSize; + nCurPos = aState.nCurPos; + nLastCut = aState.nLastCut; + nLastTokenStart = aState.nLastTokenStart; + cCharAtLastCut = aState.cCharAtLastCut; + + aSourcesStack.pop(); + } + + if ( nLastCut < nCurPos ) + CutToken(); + + return CurChar(); +} + +CharacterSource:: +S_SourceState::S_SourceState( DYN char * dpSource, + intt nSourceSize, + intt nCurPos, + intt nLastCut, + intt nLastTokenStart, + char cCharAtLastCut ) + : dpSource(dpSource), + nSourceSize(nSourceSize), + nCurPos(nCurPos), + nLastCut(nLastCut), + nLastTokenStart(nLastTokenStart), + cCharAtLastCut(cCharAtLastCut) +{ +} + |