2002-03-08 13:45:36 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:53:37 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
2008-04-10 14:53:37 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
2008-04-10 14:53:37 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
2008-04-10 14:53:37 +00:00
|
|
|
* 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.
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
2008-04-10 14:53:37 +00:00
|
|
|
* 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).
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
2008-04-10 14:53:37 +00:00
|
|
|
* 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.
|
2002-03-08 13:45:36 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include <precomp.h>
|
|
|
|
#include <s2_dsapi/docu_pe2.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
// NOT FULLY DEFINED SERVICES
|
2007-11-02 16:11:35 +00:00
|
|
|
#include <ary/doc/d_oldidldocu.hxx>
|
2002-11-01 16:15:51 +00:00
|
|
|
#include <ary_i/d_token.hxx>
|
2005-01-27 10:29:42 +00:00
|
|
|
#include <parser/parserinfo.hxx>
|
2004-11-15 12:43:57 +00:00
|
|
|
#include <adc_cl.hxx>
|
2005-01-27 10:29:42 +00:00
|
|
|
#include <adc_msg.hxx>
|
2009-09-18 09:05:17 +00:00
|
|
|
#include <../parser/inc/x_docu.hxx>
|
2002-03-08 13:45:36 +00:00
|
|
|
#include <s2_dsapi/dsapitok.hxx>
|
|
|
|
#include <s2_dsapi/tk_atag2.hxx>
|
|
|
|
#include <s2_dsapi/tk_html.hxx>
|
|
|
|
#include <s2_dsapi/tk_docw2.hxx>
|
|
|
|
#include <s2_dsapi/tk_xml.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef UNX
|
|
|
|
#define strnicmp strncasecmp
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
namespace csi
|
|
|
|
{
|
|
|
|
namespace dsapi
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
const char * AtTagTitle(
|
|
|
|
const Tok_AtTag & i_rToken );
|
|
|
|
|
|
|
|
|
2005-01-27 10:29:42 +00:00
|
|
|
SapiDocu_PE::SapiDocu_PE(ParserInfo & io_rPositionInfo)
|
2002-03-08 13:45:36 +00:00
|
|
|
: pDocu(0),
|
|
|
|
eState(e_none),
|
2005-01-27 10:29:42 +00:00
|
|
|
pPositionInfo(&io_rPositionInfo),
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction(&SapiDocu_PE::AddDocuToken2Void),
|
2007-07-31 15:09:31 +00:00
|
|
|
pCurAtTag(0),
|
|
|
|
sCurDimAttribute(),
|
|
|
|
sCurAtSeeType_byXML(200)
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SapiDocu_PE::~SapiDocu_PE()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::ProcessToken( DYN csi::dsapi::Token & let_drToken )
|
|
|
|
{
|
|
|
|
if (IsComplete())
|
|
|
|
{
|
|
|
|
pDocu = 0;
|
|
|
|
eState = e_none;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( eState == e_none )
|
|
|
|
{
|
2007-11-02 16:11:35 +00:00
|
|
|
pDocu = new ary::doc::OldIdlDocu;
|
2002-03-08 13:45:36 +00:00
|
|
|
eState = st_short;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2Short;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
csv_assert(pDocu);
|
|
|
|
|
|
|
|
let_drToken.Trigger(*this);
|
|
|
|
delete &let_drToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_AtTag( const Tok_AtTag & i_rToken )
|
|
|
|
{
|
|
|
|
if (NOT pCurAtTag)
|
|
|
|
{
|
|
|
|
eState = st_attags;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2CurAtTag;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-08-24 09:44:58 +00:00
|
|
|
csv_assert(eState == st_attags);
|
2002-03-08 13:45:36 +00:00
|
|
|
pDocu->AddAtTag(*pCurAtTag.Release());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i_rToken.Id() == Tok_AtTag::param)
|
|
|
|
{
|
|
|
|
pCurAtTag = new DT_ParameterAtTag;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::SetCurParameterAtTagName;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
else if (i_rToken.Id() == Tok_AtTag::see)
|
|
|
|
{
|
|
|
|
pCurAtTag = new DT_SeeAlsoAtTag;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::SetCurSeeAlsoAtTagLinkText;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
else if (i_rToken.Id() == Tok_AtTag::deprecated)
|
|
|
|
{
|
|
|
|
pDocu->SetDeprecated();
|
2003-06-10 10:35:09 +00:00
|
|
|
pCurAtTag = new DT_StdAtTag(""); // Dummy that will not be used.
|
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2Deprecated;
|
|
|
|
}
|
|
|
|
else if (i_rToken.Id() == Tok_AtTag::since)
|
|
|
|
{
|
|
|
|
pCurAtTag = new DT_SinceAtTag;
|
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::SetCurSinceAtTagVersion;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pCurAtTag = new DT_StdAtTag( AtTagTitle(i_rToken) );
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2CurAtTag;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_HtmlTag( const Tok_HtmlTag & i_rToken )
|
|
|
|
{
|
|
|
|
if (eState == st_short AND i_rToken.IsParagraphStarter())
|
|
|
|
{
|
|
|
|
eState = st_description;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2Description;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Workaround special for some errors in API docu:
|
|
|
|
if ( strnicmp("<true",i_rToken.Text(),5 ) == 0 )
|
|
|
|
{
|
2005-01-27 10:29:42 +00:00
|
|
|
if ( strcmp("<TRUE/>",i_rToken.Text()) != 0 )
|
|
|
|
TheMessages().Out_InvalidConstSymbol( i_rToken.Text(),
|
|
|
|
pPositionInfo->CurFile(),
|
|
|
|
pPositionInfo->CurLine() );
|
2002-03-08 13:45:36 +00:00
|
|
|
(this->*fCurTokenAddFunction)( *new DT_TextToken("<b>true</b>") );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if ( strnicmp("<false",i_rToken.Text(),6 ) == 0 )
|
|
|
|
{
|
2005-01-27 10:29:42 +00:00
|
|
|
if ( strcmp("<FALSE/>",i_rToken.Text()) != 0 )
|
|
|
|
TheMessages().Out_InvalidConstSymbol( i_rToken.Text(),
|
|
|
|
pPositionInfo->CurFile(),
|
|
|
|
pPositionInfo->CurLine() );
|
2002-03-08 13:45:36 +00:00
|
|
|
(this->*fCurTokenAddFunction)( *new DT_TextToken("<b>false</b>") );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if ( strnicmp("<NULL",i_rToken.Text(),5 ) == 0 )
|
|
|
|
{
|
2005-01-27 10:29:42 +00:00
|
|
|
if ( strcmp("<NULL/>",i_rToken.Text()) != 0 )
|
|
|
|
TheMessages().Out_InvalidConstSymbol( i_rToken.Text(),
|
|
|
|
pPositionInfo->CurFile(),
|
|
|
|
pPositionInfo->CurLine() );
|
2002-03-08 13:45:36 +00:00
|
|
|
(this->*fCurTokenAddFunction)( *new DT_TextToken("<b>null</b>") );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if ( strnicmp("<void",i_rToken.Text(),5 ) == 0 )
|
|
|
|
{
|
2005-01-27 10:29:42 +00:00
|
|
|
if ( strcmp("<void/>",i_rToken.Text()) != 0 )
|
|
|
|
TheMessages().Out_InvalidConstSymbol( i_rToken.Text(),
|
|
|
|
pPositionInfo->CurFile(),
|
|
|
|
pPositionInfo->CurLine() );
|
2002-03-08 13:45:36 +00:00
|
|
|
(this->*fCurTokenAddFunction)( *new DT_TextToken("<b>void</b>") );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
(this->*fCurTokenAddFunction)( *new DT_Style(i_rToken.Text(),false) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_XmlConst( const Tok_XmlConst & i_rToken )
|
|
|
|
{
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_MupConst(i_rToken.Text()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_XmlLink_BeginTag( const Tok_XmlLink_BeginTag & i_rToken )
|
|
|
|
{
|
|
|
|
switch (i_rToken.Id())
|
|
|
|
{
|
|
|
|
case Tok_XmlLink_Tag::e_const:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("<b>",false));
|
|
|
|
break;
|
|
|
|
case Tok_XmlLink_Tag::member:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_MupMember(i_rToken.Scope()));
|
|
|
|
break;
|
|
|
|
case Tok_XmlLink_Tag::type:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_MupType(i_rToken.Scope()));
|
|
|
|
break;
|
2004-11-15 12:43:57 +00:00
|
|
|
default:
|
|
|
|
// Do nothing.
|
|
|
|
;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( i_rToken.Dim().length() > 0 )
|
|
|
|
sCurDimAttribute = i_rToken.Dim();
|
|
|
|
else
|
|
|
|
sCurDimAttribute.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_XmlLink_EndTag( const Tok_XmlLink_EndTag & i_rToken )
|
|
|
|
{
|
|
|
|
switch (i_rToken.Id())
|
|
|
|
{
|
|
|
|
case Tok_XmlLink_Tag::e_const:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("</b>",false));
|
|
|
|
break;
|
|
|
|
case Tok_XmlLink_Tag::member:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_MupMember(true));
|
|
|
|
break;
|
|
|
|
case Tok_XmlLink_Tag::type:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_MupType(true));
|
|
|
|
break;
|
2004-11-15 12:43:57 +00:00
|
|
|
default:
|
|
|
|
// Do nothing.
|
|
|
|
;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
if ( sCurDimAttribute.length() > 0 )
|
|
|
|
{
|
|
|
|
(this->*fCurTokenAddFunction)( *new DT_TextToken(sCurDimAttribute.c_str()) );
|
|
|
|
sCurDimAttribute.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_XmlFormat_BeginTag( const Tok_XmlFormat_BeginTag & i_rToken )
|
|
|
|
{
|
|
|
|
switch (i_rToken.Id())
|
|
|
|
{
|
|
|
|
case Tok_XmlFormat_Tag::code:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("<code>",false));
|
|
|
|
break;
|
|
|
|
case Tok_XmlFormat_Tag::listing:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("<pre>",true));
|
|
|
|
break;
|
|
|
|
case Tok_XmlFormat_Tag::atom:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("<code>",true));
|
|
|
|
break;
|
2004-11-15 12:43:57 +00:00
|
|
|
default:
|
|
|
|
// Do nothing.
|
|
|
|
;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
if ( i_rToken.Dim().length() > 0 )
|
|
|
|
sCurDimAttribute = i_rToken.Dim();
|
|
|
|
else
|
|
|
|
sCurDimAttribute.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_XmlFormat_EndTag( const Tok_XmlFormat_EndTag & i_rToken )
|
|
|
|
{
|
|
|
|
switch (i_rToken.Id())
|
|
|
|
{
|
|
|
|
case Tok_XmlFormat_Tag::code:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("</code>",false));
|
|
|
|
break;
|
|
|
|
case Tok_XmlFormat_Tag::listing:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("</pre>",true));
|
|
|
|
break;
|
|
|
|
case Tok_XmlFormat_Tag::atom:
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_Style("</code>",true));
|
|
|
|
break;
|
2004-11-15 12:43:57 +00:00
|
|
|
default:
|
|
|
|
// Do nothing.
|
|
|
|
;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
if ( sCurDimAttribute.length() > 0 )
|
|
|
|
{
|
|
|
|
(this->*fCurTokenAddFunction)( *new DT_TextToken(sCurDimAttribute.c_str()) );
|
|
|
|
sCurDimAttribute.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_Word( const Tok_Word & i_rToken )
|
|
|
|
{
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_TextToken(i_rToken.Text()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_Comma()
|
|
|
|
{
|
|
|
|
csv_assert(1==7);
|
|
|
|
// (this->*fCurTokenAddFunction)(*new DT_Comma(i_rToken.Text()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_DocuEnd()
|
|
|
|
{
|
|
|
|
eState = st_complete;
|
|
|
|
if (pCurAtTag)
|
|
|
|
pDocu->AddAtTag(*pCurAtTag.Release());
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2Void;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_EOL()
|
|
|
|
{
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_EOL);
|
|
|
|
}
|
|
|
|
|
2007-09-18 13:25:24 +00:00
|
|
|
void
|
|
|
|
SapiDocu_PE::Process_White()
|
|
|
|
{
|
|
|
|
(this->*fCurTokenAddFunction)(*new DT_White);
|
|
|
|
}
|
2002-03-08 13:45:36 +00:00
|
|
|
|
2007-11-02 16:11:35 +00:00
|
|
|
DYN ary::doc::OldIdlDocu *
|
2002-03-08 13:45:36 +00:00
|
|
|
SapiDocu_PE::ReleaseJustParsedDocu()
|
|
|
|
{
|
|
|
|
if (IsComplete())
|
|
|
|
{
|
|
|
|
eState = e_none;
|
|
|
|
return pDocu.Release();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
SapiDocu_PE::IsComplete() const
|
|
|
|
{
|
|
|
|
return eState == st_complete;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::AddDocuToken2Void( DYN ary::inf::DocuToken & let_drNewToken )
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
|
|
|
delete &let_drNewToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::AddDocuToken2Short( DYN ary::inf::DocuToken & let_drNewToken )
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
|
|
|
csv_assert(pDocu);
|
|
|
|
pDocu->AddToken2Short(let_drNewToken);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::AddDocuToken2Description( DYN ary::inf::DocuToken & let_drNewToken )
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
|
|
|
csv_assert(pDocu);
|
|
|
|
pDocu->AddToken2Description(let_drNewToken);
|
|
|
|
}
|
|
|
|
|
2003-06-10 10:35:09 +00:00
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::AddDocuToken2Deprecated( DYN ary::inf::DocuToken & let_drNewToken )
|
2003-06-10 10:35:09 +00:00
|
|
|
{
|
|
|
|
csv_assert(pDocu);
|
|
|
|
pDocu->AddToken2DeprecatedText(let_drNewToken);
|
|
|
|
}
|
|
|
|
|
2002-03-08 13:45:36 +00:00
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::AddDocuToken2CurAtTag( DYN ary::inf::DocuToken & let_drNewToken )
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
|
|
|
csv_assert(pCurAtTag);
|
|
|
|
pCurAtTag->AddToken(let_drNewToken);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::SetCurParameterAtTagName( DYN ary::inf::DocuToken & let_drNewToken )
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
2007-09-18 13:25:24 +00:00
|
|
|
if (let_drNewToken.IsWhiteOnly())
|
|
|
|
{
|
|
|
|
delete &let_drNewToken;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-03-08 13:45:36 +00:00
|
|
|
csv_assert(pCurAtTag);
|
|
|
|
DT_TextToken * dpText = dynamic_cast< DT_TextToken* >(&let_drNewToken);
|
|
|
|
if (dpText != 0)
|
|
|
|
pCurAtTag->SetName(dpText->GetText());
|
|
|
|
else
|
|
|
|
pCurAtTag->SetName("parameter ?");
|
|
|
|
delete &let_drNewToken;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2CurAtTag;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::SetCurSeeAlsoAtTagLinkText( DYN ary::inf::DocuToken & let_drNewToken )
|
2002-03-08 13:45:36 +00:00
|
|
|
{
|
|
|
|
csv_assert(pCurAtTag);
|
2007-09-18 13:25:24 +00:00
|
|
|
|
|
|
|
if (let_drNewToken.IsWhiteOnly())
|
|
|
|
{
|
|
|
|
delete &let_drNewToken;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-07-31 15:09:31 +00:00
|
|
|
DT_TextToken * pText = dynamic_cast< DT_TextToken* >(&let_drNewToken);
|
|
|
|
if (pText != 0)
|
|
|
|
pCurAtTag->SetName(pText->GetText());
|
2002-03-08 13:45:36 +00:00
|
|
|
else
|
2007-07-31 15:09:31 +00:00
|
|
|
{
|
|
|
|
DT_MupType *
|
|
|
|
pTypeBegin = dynamic_cast< DT_MupType* >(&let_drNewToken);
|
|
|
|
DT_MupMember *
|
|
|
|
pMemberBegin = dynamic_cast< DT_MupMember* >(&let_drNewToken);
|
|
|
|
if (pTypeBegin != 0 OR pMemberBegin != 0)
|
|
|
|
{
|
|
|
|
sCurAtSeeType_byXML.reset();
|
|
|
|
|
|
|
|
sCurAtSeeType_byXML
|
|
|
|
<< ( pTypeBegin != 0
|
|
|
|
? pTypeBegin->Scope()
|
|
|
|
: pMemberBegin->Scope() );
|
|
|
|
|
|
|
|
if (sCurAtSeeType_byXML.tellp() > 0)
|
|
|
|
{
|
|
|
|
sCurAtSeeType_byXML
|
|
|
|
<< "::";
|
|
|
|
}
|
|
|
|
delete &let_drNewToken;
|
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::SetCurSeeAlsoAtTagLinkText_2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pCurAtTag->SetName("? (no identifier found)");
|
|
|
|
}
|
|
|
|
}
|
2002-03-08 13:45:36 +00:00
|
|
|
delete &let_drNewToken;
|
2002-05-14 08:02:21 +00:00
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2CurAtTag;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
|
2007-07-31 15:09:31 +00:00
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::SetCurSeeAlsoAtTagLinkText_2( DYN ary::inf::DocuToken & let_drNewToken )
|
2007-07-31 15:09:31 +00:00
|
|
|
{
|
|
|
|
csv_assert(pCurAtTag);
|
2007-09-18 13:25:24 +00:00
|
|
|
|
|
|
|
if (let_drNewToken.IsWhiteOnly())
|
|
|
|
{
|
|
|
|
delete &let_drNewToken;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-07-31 15:09:31 +00:00
|
|
|
DT_TextToken *
|
|
|
|
pText = dynamic_cast< DT_TextToken* >(&let_drNewToken);
|
|
|
|
if (pText != 0)
|
|
|
|
{
|
|
|
|
sCurAtSeeType_byXML
|
|
|
|
<< pText->GetText();
|
|
|
|
pCurAtTag->SetName(sCurAtSeeType_byXML.c_str());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pCurAtTag->SetName("? (no identifier found)");
|
|
|
|
}
|
|
|
|
sCurAtSeeType_byXML.reset();
|
|
|
|
delete &let_drNewToken;
|
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::SetCurSeeAlsoAtTagLinkText_3;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::SetCurSeeAlsoAtTagLinkText_3( DYN ary::inf::DocuToken & let_drNewToken )
|
2007-07-31 15:09:31 +00:00
|
|
|
{
|
|
|
|
csv_assert(pCurAtTag);
|
|
|
|
|
2007-09-18 13:25:24 +00:00
|
|
|
if (let_drNewToken.IsWhiteOnly())
|
|
|
|
{
|
|
|
|
delete &let_drNewToken;
|
|
|
|
return;
|
|
|
|
}
|
2007-07-31 15:09:31 +00:00
|
|
|
|
|
|
|
/// Could emit warning, but don't because this parser is obsolete.
|
|
|
|
// Tok_XmlLink_BeginTag *
|
|
|
|
// pLinkEnd = dynamic_cast< Tok_XmlLink_EndTag* >(&let_drNewToken);
|
|
|
|
// if (pLinkEnd == 0)
|
|
|
|
// {
|
|
|
|
// warn_aboutMissingClosingTag();
|
|
|
|
// }
|
|
|
|
|
|
|
|
delete &let_drNewToken;
|
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2CurAtTag;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-10 10:35:09 +00:00
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::SetCurSinceAtTagVersion( DYN ary::inf::DocuToken & let_drNewToken )
|
2003-06-10 10:35:09 +00:00
|
|
|
{
|
|
|
|
csv_assert(pCurAtTag);
|
|
|
|
|
2004-07-12 14:43:23 +00:00
|
|
|
DT_TextToken * pToken = dynamic_cast< DT_TextToken* >(&let_drNewToken);
|
|
|
|
if (pToken == 0)
|
2003-06-10 10:35:09 +00:00
|
|
|
{
|
2004-07-12 14:43:23 +00:00
|
|
|
delete &let_drNewToken;
|
2003-06-10 10:35:09 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-09-18 09:05:17 +00:00
|
|
|
const String
|
|
|
|
sVersion(pToken->GetText());
|
|
|
|
const char
|
|
|
|
cFirst = *sVersion.begin();
|
|
|
|
const char
|
|
|
|
cCiphersend = '9' + 1;
|
|
|
|
const autodoc::CommandLine &
|
|
|
|
rCommandLine = autodoc::CommandLine::Get_();
|
|
|
|
|
|
|
|
|
|
|
|
if ( rCommandLine.DoesTransform_SinceTag())
|
2004-07-12 14:43:23 +00:00
|
|
|
{
|
2009-09-18 09:05:17 +00:00
|
|
|
// The @since version number shall be interpreted,
|
|
|
|
|
|
|
|
if ( NOT csv::in_range('0', cFirst, cCiphersend) )
|
|
|
|
{
|
|
|
|
// But this is a non-number-part, so we wait for
|
|
|
|
// the next one.
|
|
|
|
delete &let_drNewToken;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (rCommandLine.DisplayOf_SinceTagValue(sVersion).empty())
|
|
|
|
{
|
|
|
|
// This is the numbered part, but we don't know it.
|
|
|
|
delete &let_drNewToken;
|
|
|
|
|
|
|
|
StreamLock
|
|
|
|
sl(200);
|
|
|
|
sl()
|
|
|
|
<< "Since-value '"
|
|
|
|
<< sVersion
|
|
|
|
<< "' not found in translation table.";
|
|
|
|
throw X_Docu("since", sl().c_str());
|
|
|
|
}
|
2003-06-30 14:28:19 +00:00
|
|
|
}
|
2003-06-10 10:35:09 +00:00
|
|
|
|
2009-09-18 09:05:17 +00:00
|
|
|
// Either since tags are not specially interpreted, or
|
|
|
|
// we got a known one.
|
2004-07-12 14:43:23 +00:00
|
|
|
pCurAtTag->AddToken(let_drNewToken);
|
|
|
|
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2SinceAtTag;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-11-02 16:11:35 +00:00
|
|
|
SapiDocu_PE::AddDocuToken2SinceAtTag( DYN ary::inf::DocuToken & let_drNewToken )
|
2004-07-12 14:43:23 +00:00
|
|
|
{
|
|
|
|
csv_assert(pCurAtTag);
|
2007-11-02 16:11:35 +00:00
|
|
|
String &
|
|
|
|
sValue = pCurAtTag->Access_Text().Access_TextOfFirstToken();
|
|
|
|
StreamLock
|
|
|
|
sHelp(1000);
|
2004-07-12 14:43:23 +00:00
|
|
|
|
2007-11-02 16:11:35 +00:00
|
|
|
DT_TextToken *
|
|
|
|
pToken = dynamic_cast< DT_TextToken* >(&let_drNewToken);
|
2004-07-12 14:43:23 +00:00
|
|
|
if (pToken != 0)
|
|
|
|
{
|
2007-09-18 13:25:24 +00:00
|
|
|
sValue = sHelp() << sValue << pToken->GetText() << c_str;
|
|
|
|
}
|
|
|
|
else if (dynamic_cast< DT_White* >(&let_drNewToken) != 0)
|
|
|
|
{
|
|
|
|
sValue = sHelp() << sValue << " " << c_str;
|
2004-07-12 14:43:23 +00:00
|
|
|
}
|
|
|
|
delete &let_drNewToken;
|
2003-06-10 10:35:09 +00:00
|
|
|
}
|
|
|
|
|
2002-03-08 13:45:36 +00:00
|
|
|
const char *
|
|
|
|
AtTagTitle( const Tok_AtTag & i_rToken )
|
|
|
|
{
|
|
|
|
switch (i_rToken.Id())
|
|
|
|
{
|
|
|
|
case Tok_AtTag::author: return "";
|
|
|
|
case Tok_AtTag::see: return "See also";
|
|
|
|
case Tok_AtTag::param: return "Parameters";
|
|
|
|
case Tok_AtTag::e_return: return "Returns";
|
|
|
|
case Tok_AtTag::e_throw: return "Throws";
|
|
|
|
case Tok_AtTag::example: return "Example";
|
2003-06-10 10:35:09 +00:00
|
|
|
case Tok_AtTag::deprecated: return "Deprecated";
|
2002-03-08 13:45:36 +00:00
|
|
|
case Tok_AtTag::suspicious: return "";
|
|
|
|
case Tok_AtTag::missing: return "";
|
|
|
|
case Tok_AtTag::incomplete: return "";
|
|
|
|
case Tok_AtTag::version: return "";
|
|
|
|
case Tok_AtTag::guarantees: return "Guarantees";
|
|
|
|
case Tok_AtTag::exception: return "Exception";
|
2003-06-10 10:35:09 +00:00
|
|
|
case Tok_AtTag::since: return "Since version";
|
2004-11-15 12:43:57 +00:00
|
|
|
default:
|
|
|
|
// See below.
|
|
|
|
;
|
2002-03-08 13:45:36 +00:00
|
|
|
}
|
|
|
|
return i_rToken.Text();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace dsapi
|
|
|
|
} // namespace csi
|
|
|
|
|