diff options
Diffstat (limited to 'autodoc/source/parser_i/inc')
52 files changed, 6416 insertions, 0 deletions
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..b8a08fa987b4 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/cx_docu2.hxx @@ -0,0 +1,235 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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( + lux::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( + lux::Enum< Tok_XmlFormat_BeginTag::E_TokenId > + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + lux::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( + lux::Enum< Tok_XmlFormat_EndTag::E_TokenId > + i_eTokenId ) + { eTokenId = i_eTokenId; } + private: + lux::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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..6e229c0af51b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/cx_dsapi.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ADC_CX_DSAPI_HXX +#define ADC_CX_DSAPI_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS +#include <cosv/tpl/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; + String 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..4b6723dce82f --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/docu_pe2.hxx @@ -0,0 +1,183 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ADC_DSAPI_DOCU_PE2_HXX +#define ADC_DSAPI_DOCU_PE2_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_dsapi/tokintpr.hxx> + // COMPONENTS + // PARAMETERS + +class ParserInfo; + +namespace ary +{ +namespace doc +{ + class OldIdlDocu; +} + +namespace inf +{ + class DocuToken; +} // namespace info +} // namespace ary + + + +namespace csi +{ +namespace dsapi +{ + + +class Token; +class DT_AtTag; + +class SapiDocu_PE : public TokenInterpreter +{ + public: + SapiDocu_PE( + ParserInfo & io_rPositionInfo ); + ~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(); + virtual void Process_White(); + + + DYN ary::doc::OldIdlDocu * + 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::inf::DocuToken & let_drNewToken ); + + void AddDocuToken2Void( + DYN ary::inf::DocuToken & + let_drNewToken ); + void AddDocuToken2Short( + DYN ary::inf::DocuToken & + let_drNewToken ); + void AddDocuToken2Description( + DYN ary::inf::DocuToken & + let_drNewToken ); + void AddDocuToken2Deprecated( + DYN ary::inf::DocuToken & + let_drNewToken ); + void AddDocuToken2CurAtTag( + DYN ary::inf::DocuToken & + let_drNewToken ); + void SetCurParameterAtTagName( + DYN ary::inf::DocuToken & + let_drNewToken ); + void SetCurSeeAlsoAtTagLinkText( + DYN ary::inf::DocuToken & + let_drNewToken ); + void SetCurSeeAlsoAtTagLinkText_2( + DYN ary::inf::DocuToken & + let_drNewToken ); + void SetCurSeeAlsoAtTagLinkText_3( + DYN ary::inf::DocuToken & + let_drNewToken ); + void SetCurSinceAtTagVersion_OOo( + DYN ary::inf::DocuToken & + let_drNewToken ); + void SetCurSinceAtTagVersion_Number( + DYN ary::inf::DocuToken & + let_drNewToken ); + void AddDocuToken2SinceAtTag( + DYN ary::inf::DocuToken & + let_drNewToken ); + + bool CheckVersionSyntax_OOo( + const String & i_versionPart1 ); + bool CheckVersionSyntax_Number( + const String & i_versionPart2 ); + // DATA + Dyn<ary::doc::OldIdlDocu> + pDocu; + E_State eState; + ParserInfo * pPositionInfo; + F_TokenAdder fCurTokenAddFunction; + + Dyn<DT_AtTag> pCurAtTag; + String sCurDimAttribute; + StreamStr sCurAtSeeType_byXML; +}; + +} // namespace dsapi +} // namespace csi + + +// IMPLEMENTATION + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..9ccccee02ef8 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/dsapitok.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..57bf561ffdce --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_atag2.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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, + since = 14 + }; + typedef lux::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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..5ee763969ad6 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_docw2.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + String 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; +}; + +class Tok_White : public Token +{ + public: + // OPERATIONS + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + // INQUIRY + virtual const char* Text() const; +}; + + + +} // namespace dsapi +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..3d69c13d296c --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_html.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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: + String sTag; + bool bIsParagraphStarter; +}; + + +} // namespace dsapi +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..7bb8db52a27f --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tk_xml.hxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 lux::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 lux::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 String & i_sScope, + const String & 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 String & Scope() const { return sScope; } + const String & Dim() const { return sDim; } + + private: + // DATA + EV_TokenId eTag; + String sScope; + String 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 lux::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 String & 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 String & Dim() const { return sDim; } + + private: + // DATA + EV_TokenId eTag; + String 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..fed4c0e25121 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tokintpr.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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; + virtual void Process_White() = 0; +}; + + + +// IMPLEMENTATION + + +} // namespace dsapi +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..14ef872d4306 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_dsapi/tokrecv.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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; + virtual void Increment_CurLine() = 0; +}; + + +} // namespace dsapi +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..07d325846238 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/cx_idlco.hxx @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..0113a87c11e7 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/cx_sub.hxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ADC_LUIDL_CX_SUB_HXX +#define ADC_LUIDL_CX_SUB_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/tkpcont2.hxx> + // COMPONENTS + // PARAMETERS + +#include "uidl_tok.hxx" + +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 ) + : rReceiver(o_rReceiver), + pFollowUpContext(&i_rFollowUpContext), + pNewToken() + {} + protected: + void SetToken( + DYN Token * let_dpToken ) + { pNewToken = let_dpToken; } + Token_Receiver & Receiver() { return rReceiver; } + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..411fc402eb42 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/distrib.hxx @@ -0,0 +1,274 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +class ParserInfo; + +namespace ary +{ + class Repository; + +namespace doc +{ + class OldIdlDocu; +} // namespace inf +} // namespace ary) + + + +namespace csi +{ +namespace dsapi +{ + class Token_Receiver; + class SapiDocu_PE; +} + + + +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, + ParserInfo & io_rParserInfo ); + 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::doc::OldIdlDocu * + ReleaseLastParsedDocu() + { return aDocumentation.ReleaseLastParsedDocu(); } + + /** Used from PE_File, if the term "published" was parsed. + The next opened parse environment will be set to be published + (call ->UnoIDL_PE::SetPublished()). + */ + void Set_PublishedOn() + { aProcessingData.Set_PublishedOn(); } + + + 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, + ParserInfo & io_rParserInfo ); + ~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 ); + virtual void Increment_CurLine(); + + void ProcessCurToken(); + + UnoIDL_PE & CurEnvironment() const; + bool NextTokenExists() const; + void Set_PublishedOn() + { bPublishedRecentlyOn = true; } + + 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; + ParserInfo & rParserInfo; + Documentation * pDocuProcessor; + bool bPublishedRecentlyOn; + }; + + class Documentation : public csi::dsapi::Token_Receiver + { + public: + Documentation( + ParserInfo & io_rParserInfo); + ~Documentation(); + + void Reset() { bIsPassedFirstDocu = false; } + + virtual void Receive( + DYN csi::dsapi::Token & + let_drToken ); + virtual void Increment_CurLine(); + DYN ary::doc::OldIdlDocu * + ReleaseLastParsedDocu() + { return pMostRecentDocu.Release(); } + private: + Dyn<csi::dsapi::SapiDocu_PE> + pDocuParseEnv; + ParserInfo & rParserInfo; + Dyn<ary::doc::OldIdlDocu> + pMostRecentDocu; + bool bIsPassedFirstDocu; + }; + + // DATA + TokenParser_Uidl * pTokenSource; + Documentation aDocumentation; + ProcessingData aProcessingData; +}; + + + +// 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..7708ac66775e --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/parsenv2.hxx @@ -0,0 +1,145 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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/idl/i_types4idl.hxx> +#include <ary/idl/i_module.hxx> + + + +class ParserInfo; + +namespace ary +{ + class QualifiedName; + class Repository; + +namespace doc +{ + class OldIdlDocu; +} + +namespace idl +{ + class CodeEntity; +} +} + + + +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 EstablishContacts( +// UnoIDL_PE * io_pParentPE, +// ary::idl::Gate & +// io_rGate, +// 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::doc::OldIdlDocu * + let_dpDocu ); + void SetPublished(); + void SetOptional(); + void PassDocuAt( + ary::idl::CodeEntity & + io_rCe ); + + 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 const ary::idl::Module & + CurNamespace() const; + virtual const ParserInfo & + ParseInfo() const; + ary::idl::Gate & Gate() const { return aMyNode.AryGate(); } + TokenProcessing_Result & + TokenResult() const { return aMyNode.TokenResult(); } + DYN ary::doc::OldIdlDocu * + ReleaseDocu() { return pDocu.Release(); } + protected: + UnoIDL_PE(); + ary::Repository & MyRepository() { csv_assert(pRepository != 0); + return *pRepository; } + private: + virtual void InitData(); + virtual void TransferData() = 0; + virtual void ReceiveData(); + + SemanticNode aMyNode; + Dyn<ary::doc::OldIdlDocu> + pDocu; + ary::Repository * pRepository; +}; + + + + +} // namespace uidl +} // namespace csi +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..222fcdf43b7a --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_attri.hxx @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 +#include <ary/idl/i_property.hxx> + // PARAMETERS +#include <ary/idl/i_gate.hxx> + + +namespace ary +{ + namespace idl + { + class Attribute; + } +} + +namespace csi +{ +namespace uidl +{ + + +class PE_Variable; +class PE_Type; + +class PE_Attribute : public UnoIDL_PE, + public ParseEnvState +{ + public: + typedef ary::idl::Ce_id Ce_id; + typedef ary::idl::Type_id Type_id; + + PE_Attribute( + const Ce_id & i_rCurOwner ); + + 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_Identifier( + const TokIdentifier & + 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_Raises(); + virtual void Process_Default(); + + private: + enum E_State + { + e_none, + e_start, + in_variable, + expect_end, + in_raise_std, /// before 'get', 'set', ';' or '}' + in_get, + in_set + }; + + virtual void InitData(); + virtual void ReceiveData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + // DATA + E_State eState; + const Ce_id * pCurOwner; + + Dyn<PE_Variable> pPE_Variable; + Dyn<PE_Type> pPE_Exception; + + // object-data + ary::idl::Attribute * + pCurAttribute; + Type_id nCurParsedType; + String sCurParsedName; + bool bReadOnly; + bool bBound; +}; + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..397a235e4748 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_const.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +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; + + String sData_Name; + ary::idl::Ce_id nDataId; + + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nType; + + Dyn<PE_Value> pPE_Value; + String sName; + String sAssignment; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..2fef65658d9b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_enum2.hxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + + +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; + + String sData_Name; + ary::idl::Ce_id nDataId; + + Dyn<PE_Value> pPE_Value; + String sName; + String sAssignment; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..13bb996e6380 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_evalu.hxx @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +namespace udm { +class Agent_Struct; +} // namespace udm + + +namespace csi +{ +namespace uidl +{ + +class PE_Value : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Value( + String & o_rName, + String & 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; + String * pName; + String * pAssignment; + bool bIsConst; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..4d6a9bd96872 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_excp.hxx @@ -0,0 +1,261 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 <ary/qualiname.hxx> + // PARAMETERS + + + +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 ); + // DATA + String sData_Name; + bool bIsPreDeclaration; + ary::idl::Ce_id nCurStruct; + + Dyn<PE_StructElement> + pPE_Element; + ary::idl::Ce_id nCurParsed_ElementRef; + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nCurParsed_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(); + + public: + + void store_Exception(); + + private: + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..e499565e466a --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_file2.hxx @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 idl +{ +class Module; +} // namespace idl +} // namespace ary + + +namespace csi +{ +namespace uidl +{ + +class TokenDistributor; +class PE_Service; +class PE_Singleton; +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, + const ParserInfo & i_parseInfo ); + 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_Stereotype( + const TokStereotype & + 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 const ary::idl::Module & + CurNamespace() const; + virtual const ParserInfo & + ParseInfo() const; + // DATA + TokenDistributor * pTokenAdmin; + Dyn<PE_Service> pPE_Service; + Dyn<PE_Singleton> pPE_Singleton; + 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; + + const ary::idl::Module * + pCurNamespace; + const ParserInfo * pParseInfo; + + E_State eState; + uintt nBracketCount_inDefMode; +}; + + +} // namespace uidl +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..c39d4f553073 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_func2.hxx @@ -0,0 +1,165 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 <ary/idl/i_param.hxx> + // PARAMETERS + +namespace ary +{ + namespace idl + { + class Function; + } +} + + +namespace csi +{ +namespace uidl +{ + +class PE_Type; +class PE_Variable; + +class PE_Function : public UnoIDL_PE, + public ParseEnvState +{ + public: + typedef ary::idl::Ce_id RParent; + typedef ary::idl::Ce_id RFunction; + + enum E_Constructor { constructor }; + + /// Constructor for interfaces. + PE_Function( + const RParent & i_rCurInterface ); + + /// Constructor for single interface based services. + PE_Function( + const RParent & i_rCurService, + E_Constructor i_eCtorMarker ); + + 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_BuiltInType( + const TokBuiltInType & + 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(); + + // DATA + E_State eState; + + String sData_Name; + ary::idl::Type_id nData_ReturnType; + bool bData_Oneway; + ary::idl::Function * + pCurFunction; + + const RParent * pCurParent; + + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nCurParsedType; // ReturnType or Exception + + String sName; + + Dyn<PE_Variable> pPE_Variable; + ary::idl::E_ParameterDirection + eCurParsedParam_Direction; + ary::idl::Type_id nCurParsedParam_Type; + String sCurParsedParam_Name; + bool bIsForConstructors; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..37f33cf8a73a --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_iface.hxx @@ -0,0 +1,186 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + +namespace ary +{ +namespace idl +{ + class Interface; +} +} + +namespace csi +{ +namespace uidl +{ + + + +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 /// @ATTENTION Do not change existing values (except of e_STATES_MAX) !!! Else array-indices will break. + { + e_none = 0, + need_uik, + uik, + need_ident, + ident, + need_interface, + need_name, + wait_for_base, + in_base, // in header, after ":" + need_curlbr_open, + e_std, + in_function, + in_attribute, + need_finish, + in_base_interface, // in body, after "interface" + 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_Metatype(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_std_GotoBaseInterface(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(); + + void store_Interface(); + + // DATA + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + String sData_Name; + bool bIsPreDeclaration; + ary::idl::Interface * + pCurInterface; + ary::idl::Ce_id nCurInterface; + + Dyn<PE_Function> pPE_Function; + Dyn<PE_Attribute> pPE_Attribute; + + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nCurParsed_Base; + bool bOptionalMember; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..1c75d25203d1 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_property.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_property.hxx new file mode 100644 index 000000000000..15aa52b7c31a --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_property.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ADC_UIDL_PE_PROPERTY_HXX +#define ADC_UIDL_PE_PROPERTY_HXX + + + +// USED SERVICES + // BASE CLASSES + +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS +#include <ary/idl/i_property.hxx> + // PARAMETERS +#include <ary/idl/i_gate.hxx> + + +namespace csi +{ +namespace uidl +{ + + +class PE_Variable; + +class PE_Property : public UnoIDL_PE, + public ParseEnvState +{ + public: + typedef ary::idl::Ce_id Ce_id; + typedef ary::idl::Type_id Type_id; + typedef ary::idl::Property::Stereotypes Stereotypes; + + + PE_Property( + const Ce_id & i_rCurOwner ); + + virtual void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::Repository & + io_rRepository, + TokenProcessing_Result & + o_rResult ); + virtual ~PE_Property(); + + 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 PresetStereotypes( + Stereotypes::E_Flags + i_eFlag ) + { aStereotypes.Set_Flag(i_eFlag); } + 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(); + + // DATA + E_State eState; + const Ce_id * pCurOwner; + + Dyn<PE_Variable> pPE_Variable; + + // object-data + Type_id nCurParsedType; + String sCurParsedName; + bool bIsOptional; + Stereotypes aStereotypes; +}; + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..54088fdbdd9c --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_selem.hxx @@ -0,0 +1,124 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 <ary/idl/i_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::idl::Ce_id RStructElement; + typedef ary::idl::Ce_id RStruct; + + PE_StructElement( /// Use for Struct-elements + RStructElement & o_rResult, + const RStruct & i_rCurStruct, + const String & i_rCurStructTemplateParam ); + PE_StructElement( /// Use for Exception-elements + RStructElement & o_rResult, + const RStruct & i_rCurExc ); + 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(); + + ary::idl::Type_id lhf_FindTemplateParamType() const; + + // DATA + E_State eState; + RStructElement * pResult; + const RStruct * pCurStruct; + bool bIsExceptionElement; + + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nType; + String sName; + const String * pCurStructTemplateParam; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..691b97d5a432 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_servi.hxx @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + +namespace ary +{ + namespace idl + { + class Service; + class SglIfcService; + } +} + +namespace csi +{ +namespace uidl +{ + +class PE_Property; +class PE_Type; +class PE_Function; + + +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, + need_base_interface, /// After ":". + need_curlbr_open_sib, /// After base interface in single interface based service. + e_std_sib, /// Standard in single interface based service. + e_STATES_MAX + }; + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + virtual UnoIDL_PE & MyPE(); + + void StartProperty(); + + + // DATA + E_State eState; + String sData_Name; + bool bIsPreDeclaration; + ary::idl::Service * pCurService; + ary::idl::SglIfcService * + pCurSiService; + ary::idl::Ce_id nCurService; // Needed for PE_Attribute. + + Dyn<PE_Property> pPE_Property; + ary::idl::Ce_id nCurParsed_Property; + + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nCurParsed_Type; + + Dyn<PE_Function> pPE_Constructor; + + bool bOptionalMember; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_singl.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_singl.hxx new file mode 100644 index 000000000000..5affacaa925e --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_singl.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef LUIDL_PE_SINGL_HXX +#define LUIDL_PE_SINGL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/parsenv2.hxx> +#include <s2_luidl/pestate.hxx> + // COMPONENTS + // PARAMETERS + +namespace ary +{ + namespace idl + { + class Singleton; + class SglIfcSingleton; + } +} + + +namespace csi +{ +namespace uidl +{ + +class PE_Type; + + +class PE_Singleton : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Singleton(); + virtual ~PE_Singleton(); + + 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_Default(); + + private: + enum E_State + { + e_none = 0, + need_name, + need_curlbr_open, + e_std, + in_service, + need_finish, + in_base_interface, + e_STATES_MAX + }; + + void On_Default(); + + 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; + String sData_Name; + bool bIsPreDeclaration; + ary::idl::Singleton * + pCurSingleton; + ary::idl::SglIfcSingleton * + pCurSiSingleton; + + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nCurParsed_Type; +}; + + +} // namespace uidl +} // namespace csi + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..3746d74e4144 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_struc.hxx @@ -0,0 +1,287 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 <ary/qualiname.hxx> + // PARAMETERS + + + +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_Set_TemplateParam( + const char * i_sTemplateParam ); + + String sData_Name; + String sData_TemplateParam; + bool bIsPreDeclaration; + ary::idl::Ce_id nCurStruct; + + Dyn<PE_StructElement> + pPE_Element; + ary::idl::Ce_id nCurParsed_ElementRef; + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nCurParsed_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_WaitForTemplateParam : public PE_StructState + { // -> Template parameter identifier + public: + State_WaitForTemplateParam( + PE_Struct & i_rStruct ) + : PE_StructState(i_rStruct) {} + virtual void Process_Identifier( + const TokIdentifier & + i_rToken ); + }; + class State_WaitForTemplateEnd : public PE_StructState + { // -> > + public: + State_WaitForTemplateEnd( + 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 ); + }; + 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_WaitForTemplateParam + aWaitForTemplateParam; + State_WaitForTemplateEnd + aWaitForTemplateEnd; + State_WaitForBase aWaitForBase; + State_GotBase aGotBase; + State_WaitForElement + aWaitForElement; + State_WaitForFinish aWaitForFinish; + + ParseEnvState * pCurStatus; + }; + + virtual void InitData(); + virtual void TransferData(); + virtual void ReceiveData(); + + public: + + void store_Struct(); + + private: + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..ea8228fecbae --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + + + +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(); + + // DATA + static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; + + E_State eState; + Dyn<PE_Type> pPE_Type; + ary::idl::Type_id nType; + String sName; +}; + + + +} // namespace uidl +} // namespace csi + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..2d6367528672 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_type2.hxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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<ary/qualiname.hxx> + // PARAMETERS + + +namespace csi +{ +namespace uidl +{ + + +class PE_Type : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Type( + ary::idl::Type_id & o_rResult ); + virtual ~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, + in_template_type + }; + + void Finish(); + PE_Type & MyTemplateType(); + + virtual void InitData(); + virtual void TransferData(); + virtual UnoIDL_PE & MyPE(); + + // DATA + ary::idl::Type_id * pResult; + + uintt nIsSequenceCounter; + uintt nSequenceDownCounter; + bool bIsUnsigned; + ary::QualifiedName sFullType; + + E_State eState; + String sLastPart; + + Dyn<PE_Type> pPE_TemplateType; /// @attention Recursion, only initiate, if needed! + ary::idl::Type_id nTemplateType; + std::vector<ary::idl::Type_id> + aTemplateParameters; +}; + + + +// IMPLEMENTATION + + +} // namespace uidl +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..961539c57abd --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pe_vari2.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +namespace csi +{ +namespace uidl +{ + + +class PE_Type; + + +class PE_Variable : public UnoIDL_PE, + public ParseEnvState +{ + public: + PE_Variable( + ary::idl::Type_id & i_rResult_Type, + String & 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 ); + virtual void Process_BuiltInType( + const TokBuiltInType & + 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(); + + // DATA + E_State eState; + ary::idl::Type_id * pResult_Type; + String * pResult_Name; + + Dyn<PE_Type> pPE_Type; +}; + + + +} // namespace uidl +} // namespace csi + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..78582ab0abae --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/pestate.hxx @@ -0,0 +1,108 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..b734fd9f72f4 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/semnode.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ADC_SEMNODE_HXX +#define ADC_SEMNODE_HXX + +// USED SERVICES + // BASE CLASSES +#include <s2_luidl/tokproct.hxx> + // COMPONENTS + // PARAMETERS +#include <ary/qualiname.hxx> + + +namespace ary +{ + class QualifiedName; + class Repository; + +namespace idl +{ + class Gate; + class Module; +} // namespace idl +} // namespace ary + + +namespace csi +{ +namespace uidl +{ + + +class Struct; +class Token; + + +/** is an implementation class for UnoIDL_PE s +*/ +class SemanticNode : private TokenProcessing_Types +{ + public: + SemanticNode(); + void EstablishContacts( + UnoIDL_PE * io_pParentPE, + ary::idl::Gate & io_rRepository, + TokenProcessing_Result & + o_rResult ); + ~SemanticNode(); + + void SetTokenResult( + E_TokenDone i_eDone, + E_EnvStackAction i_eWhat2DoWithEnvStack, + UnoIDL_PE * i_pParseEnv2Push = 0 ); + UnoIDL_PE * Parent() const { return pParentPE; } + ary::idl::Gate & AryGate() const { return *pAryGate; } + TokenProcessing_Result & + TokenResult() const { return *pTokenResult; } + + private: + // DATA + UnoIDL_PE * pParentPE; + ary::idl::Gate * pAryGate; + TokenProcessing_Result * + pTokenResult; +}; + + +} // namespace uidl +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..c29f7297c181 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..e423a8130b0d --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_const.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + String sText; +}; + + +} // namespace uidl +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..1abc3cf77a46 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_ident.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + String sText; +}; + +class TokNameSeparator : public Token +{ + public: + virtual void Trigger( + TokenInterpreter & io_rInterpreter ) const; + virtual const char * + Text() const; +}; + + +} // namespace uidl +} // namespace csi + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..ac0120c7582d --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_keyw.hxx @@ -0,0 +1,253 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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, + bty_ellipse = 11 + }; + typedef lux::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; + E_TokenId Id() const { return eTag; } + + private: + // DATA + EV_TokenId eTag; +}; + + +class TokTypeModifier : public TokKeyword +{ + public: + enum E_TokenId + { + e_none = 0, + tmod_unsigned = 1, + tmod_sequence + }; + typedef lux::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_singleton, + mt_struct, + mt_typedef, + mt_uik + }; + typedef lux::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_bound = 1, + ste_const, + ste_constrained, + ste_maybeambiguous, + ste_maybedefault, + ste_maybevoid, + ste_oneway, + ste_optional, + ste_readonly, + ste_removable, + ste_virtual, + ste_transient, + ste_published + }; + + typedef lux::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 lux::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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..043256ef27e5 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tk_punct.hxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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, // . + Lesser = 13, // < + Greater = 14 // > + }; + typedef lux::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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..02c35e2fd871 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tkp_uidl.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..fcfd1972ce1b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tokintpr.hxx @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..ad996ecd1359 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tokproct.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 occurred. + }; + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..f1d43dd5a435 --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/tokrecv.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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; + virtual void Increment_CurLine() = 0; +}; + +} // namespace uidl +} // namespace csi + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..a316582b381b --- /dev/null +++ b/autodoc/source/parser_i/inc/s2_luidl/uidl_tok.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ADC_UIDL_TOK_HXX +#define ADC_UIDL_TOK_HXX + +// USED SERVICES + // BASE CLASSES +#include <tokens/token2.hxx> + // COMPONENTS + // PARAMETERS + + +class ParserInfo; + +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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..75facea675ce --- /dev/null +++ b/autodoc/source/parser_i/inc/semantic/parsenv2.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..1555cde5e0d6 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/stmstar2.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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(); + 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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..3d83bb0f77fb --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/stmstat2.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..d5550752e6a3 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/stmstfi2.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..21b0e2bc4895 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/tkp2.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 occurred. + */ + bool GetNextToken(); + + private: + virtual void SetStartContext() = 0; + virtual void SetCurrentContext( + TkpContext & io_rContext ) = 0; + virtual TkpContext & + CurrentContext() = 0; + // DATA + CharacterSource * pChars; +}; + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..fc7991ae1832 --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/tkpcont2.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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: + virtual ~StateMachineContext() {} + + /// 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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..a23da72f2c1e --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/tkpstam2.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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(); + + // 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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..d1a4ac3b275c --- /dev/null +++ b/autodoc/source/parser_i/inc/tokens/token2.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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..0301dc74f5a4 --- /dev/null +++ b/autodoc/source/parser_i/inc/x_parse2.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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( + std::ostream & o_rOutputMedium ) const; + + private: + E_Type eType; + String sName; + +}; + + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |