diff options
author | Nikolai Pretzell <np@openoffice.org> | 2002-06-25 14:16:17 +0000 |
---|---|---|
committer | Nikolai Pretzell <np@openoffice.org> | 2002-06-25 14:16:17 +0000 |
commit | 187524129d40e68c317cd585699ab5f6ddc9ae6e (patch) | |
tree | 3aa4b5563f06f124fec76d83d62c830f928a93ce | |
parent | 6abe10805ce123a6ebdac0b6e8d61fa146a5ad52 (diff) |
#100647# Missing anonymous namespaces and replaced assertion in namespace parsing by exception.
-rw-r--r-- | autodoc/source/parser/cpp/pe_namsp.cxx | 30 | ||||
-rw-r--r-- | autodoc/source/parser/cpp/pe_namsp.hxx | 5 | ||||
-rw-r--r-- | cosv/inc/cosv/csv_env.hxx | 16 | ||||
-rw-r--r-- | cosv/inc/cosv/string.hxx | 7 | ||||
-rw-r--r-- | cosv/source/fullcpp.mk | 5 | ||||
-rw-r--r-- | udm/inc/udm/html/htmlitem.hxx | 24 | ||||
-rw-r--r-- | udm/inc/udm/xml/xmlitem.hxx | 19 | ||||
-rw-r--r-- | udm/source/html/htmlitem.cxx | 22 | ||||
-rw-r--r-- | udm/source/xml/xmlitem.cxx | 40 |
9 files changed, 122 insertions, 46 deletions
diff --git a/autodoc/source/parser/cpp/pe_namsp.cxx b/autodoc/source/parser/cpp/pe_namsp.cxx index 13e6f8a2daab..f171b5167763 100644 --- a/autodoc/source/parser/cpp/pe_namsp.cxx +++ b/autodoc/source/parser/cpp/pe_namsp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pe_namsp.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: np $ $Date: 2002-05-14 09:02:19 $ + * last change: $Author: np $ $Date: 2002-06-25 15:16:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,7 @@ #include <ary/cpp/c_namesp.hxx> #include <ary/cpp/c_rwgate.hxx> #include <semantic/callf.hxx> +#include "x_parse.hxx" namespace cpp { @@ -89,8 +90,10 @@ void PE_Namespace::Setup_StatusFunctions() { typedef CallFunction<PE_Namespace>::F_Tok F_Tok; - static F_Tok stateF_start[] = { &PE_Namespace::On_start_Identifier }; - static INT16 stateT_start[] = { Tid_Identifier }; + static F_Tok stateF_start[] = { &PE_Namespace::On_start_Identifier, + &PE_Namespace::On_start_SwBracket_Left }; + static INT16 stateT_start[] = { Tid_Identifier, + Tid_SwBracket_Left }; static F_Tok stateF_gotName[] = { &PE_Namespace::On_gotName_SwBracket_Left, &PE_Namespace::On_gotName_Assign }; static INT16 stateT_gotName[] = { Tid_SwBracket_Left, @@ -129,9 +132,12 @@ PE_Namespace::TransferData() } void -PE_Namespace::Hdl_SyntaxError( const char *) +PE_Namespace::Hdl_SyntaxError( const char * i_sText) { - csv_assert(false); + throw X_Parser( X_Parser::x_UnexpectedToken, + i_sText != 0 ? i_sText : "", + Env().CurFileName(), + Env().LineCount() ); } void @@ -144,6 +150,18 @@ PE_Namespace::On_start_Identifier(const char * i_sText) } void +PE_Namespace::On_start_SwBracket_Left(const char * i_sText) +{ + SetTokenResult(done, pop_success); + pStati->SetCur(size_of_states); + + sLocalName = ""; // Anonymous namespace, a name is created in + // Gate().CheckIn_Namespace() . + + bPush = true; +} + +void PE_Namespace::On_gotName_SwBracket_Left(const char * ) { SetTokenResult(done, pop_success); diff --git a/autodoc/source/parser/cpp/pe_namsp.hxx b/autodoc/source/parser/cpp/pe_namsp.hxx index 32415fe467c6..21750232be78 100644 --- a/autodoc/source/parser/cpp/pe_namsp.hxx +++ b/autodoc/source/parser/cpp/pe_namsp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: pe_namsp.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:31 $ + * last change: $Author: np $ $Date: 2002-06-25 15:16:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,6 +112,7 @@ class PE_Namespace : public Cpp_PE void Hdl_SyntaxError( const char *); void On_start_Identifier(const char * i_sText); + void On_start_SwBracket_Left(const char * i_sText); void On_gotName_SwBracket_Left(const char * i_sText); void On_gotName_Assign(const char * i_sText); void On_expectSemicolon_Semicolon(const char * i_sText); diff --git a/cosv/inc/cosv/csv_env.hxx b/cosv/inc/cosv/csv_env.hxx index 8dbd6ae5380d..eb2979a0e3ac 100644 --- a/cosv/inc/cosv/csv_env.hxx +++ b/cosv/inc/cosv/csv_env.hxx @@ -2,9 +2,9 @@ * * $RCSfile: csv_env.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ + * last change: $Author: np $ $Date: 2002-06-25 15:15:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,13 +67,13 @@ // BEGIN Compiler dependent defines regarding standard compliance, // subject to changes: // #define CSV_NO_BOOL_TYPE // States that no system type 'bool' exists -// #define CSV_NO_MUTABLE // No keyword mutable -#define CSV_NO_EXPLICIT // No keyword explicit +// #define CSV_NO_MUTABLE // No keyword mutable +// #define CSV_NO_EXPLICIT // No keyword explicit // #define CSV_NO_IOSTREAMS // No iostreams // END Compiler dependent defines, subject to changes -// BEGIN Compiler dependent defines, controlled by above defines +// BEGIN Compiler dependant defines, controlled by above defines #ifdef CSV_NO_BOOL_TYPE typedef int bool_int; #define bool bool_int @@ -91,6 +91,12 @@ typedef int bool_int; // END Compiler dependent defines, controlled by above defines +//******* Include c-language-types ************// +// size_t, wchar_t +#include <stdlib.h> + + + //******* Builtin types of exact length ************// // Exact length builtin types diff --git a/cosv/inc/cosv/string.hxx b/cosv/inc/cosv/string.hxx index 7baacbd0b77c..39767fa99861 100644 --- a/cosv/inc/cosv/string.hxx +++ b/cosv/inc/cosv/string.hxx @@ -2,9 +2,9 @@ * * $RCSfile: string.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:39 $ + * last change: $Author: np $ $Date: 2002-06-25 15:15:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,7 +104,8 @@ class String // LIFECYCLE String(); - explicit String( + /// Intentionally not explicit, smooth casting is intended. + String( const char * i_str ); /// @precond i_nLength <= strlen(i_str) or i_nLength == str::maxsize. String( diff --git a/cosv/source/fullcpp.mk b/cosv/source/fullcpp.mk index e3c5a5d6d300..4c871d0a2e6d 100644 --- a/cosv/source/fullcpp.mk +++ b/cosv/source/fullcpp.mk @@ -2,9 +2,9 @@ # # $RCSfile: fullcpp.mk,v $ # -# $Revision: 1.2 $ +# $Revision: 1.3 $ # -# last change: $Author: np $ $Date: 2002-05-31 16:34:29 $ +# last change: $Author: np $ $Date: 2002-06-25 15:15:46 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -86,6 +86,7 @@ CFLAGS+= -YX"precomp.h" /Fp$(PRJ)$/$(INPATH)$/misc$/$(PCH_NAME).pcd -DNP_LOCALBU .ENDIF .IF "$(OS)"=="LINUX" +# RTTI CFLAGSCXX+= -frtti .ENDIF diff --git a/udm/inc/udm/html/htmlitem.hxx b/udm/inc/udm/html/htmlitem.hxx index 1db63e4382f0..0de8edbc2473 100644 --- a/udm/inc/udm/html/htmlitem.hxx +++ b/udm/inc/udm/html/htmlitem.hxx @@ -2,9 +2,9 @@ * * $RCSfile: htmlitem.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-05-14 08:29:35 $ + * last change: $Author: np $ $Date: 2002-06-25 15:15:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,7 +84,7 @@ class Body : public csi::xml::AnElement { public: Body() - : csi::xml::AnElement("body") {} + : csi::xml::AnElement( "body" ) {} private: virtual bool LineBreakAfterBeginTag() const; }; @@ -135,7 +135,7 @@ class Label : public csi::xml::AnElement Label( const ::csv::String & i_sLabel ) : csi::xml::AnElement("a") - { *this << new csi::xml::AnAttribute("name", i_sLabel); } + { *this << new csi::xml::AnAttribute(String("name"), i_sLabel); } private: virtual bool LineBreakAfterEndTag() const; }; @@ -242,7 +242,7 @@ class Link : public csi::xml::AnElement Link( const ::csv::String &i_sDestinaton ) : csi::xml::AnElement("a") - { *this << new csi::xml::AnAttribute("href", i_sDestinaton); } + { *this << new csi::xml::AnAttribute(String("href"), i_sDestinaton); } }; class TableCell : public csi::xml::AnElement @@ -364,7 +364,7 @@ class ClassAttr : public csi::xml::AnAttribute public: ClassAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "class", i_sValue ) {} + : csi::xml::AnAttribute( String("class"), i_sValue ) {} }; class StyleAttr : public csi::xml::AnAttribute @@ -372,7 +372,7 @@ class StyleAttr : public csi::xml::AnAttribute public: StyleAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "style", i_sValue ) {} + : csi::xml::AnAttribute( String("style"), i_sValue ) {} }; class SizeAttr : public csi::xml::AnAttribute @@ -380,7 +380,7 @@ class SizeAttr : public csi::xml::AnAttribute public: SizeAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "size", i_sValue ) {} + : csi::xml::AnAttribute( String("size"), i_sValue ) {} }; class ColorAttr : public csi::xml::AnAttribute @@ -388,7 +388,7 @@ class ColorAttr : public csi::xml::AnAttribute public: ColorAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "color", i_sValue ) {} + : csi::xml::AnAttribute( String("color"), i_sValue ) {} }; class BgColorAttr : public csi::xml::AnAttribute @@ -396,7 +396,7 @@ class BgColorAttr : public csi::xml::AnAttribute public: BgColorAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "bgcolor", i_sValue ) {} + : csi::xml::AnAttribute( String("bgcolor"), i_sValue ) {} }; class AlignAttr : public csi::xml::AnAttribute @@ -404,7 +404,7 @@ class AlignAttr : public csi::xml::AnAttribute public: AlignAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "align", i_sValue ) {} + : csi::xml::AnAttribute( String("align"), i_sValue ) {} }; class WidthAttr : public csi::xml::AnAttribute @@ -412,7 +412,7 @@ class WidthAttr : public csi::xml::AnAttribute public: WidthAttr( const ::csv::String & i_sValue ) - : csi::xml::AnAttribute( "width", i_sValue ) {} + : csi::xml::AnAttribute( String("width"), i_sValue ) {} }; diff --git a/udm/inc/udm/xml/xmlitem.hxx b/udm/inc/udm/xml/xmlitem.hxx index e80939881288..bea7a6ecabcd 100644 --- a/udm/inc/udm/xml/xmlitem.hxx +++ b/udm/inc/udm/xml/xmlitem.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlitem.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-05-14 08:29:35 $ + * last change: $Author: np $ $Date: 2002-06-25 15:15:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -239,6 +239,8 @@ class AnElement : public Element public: AnElement( const ::csv::String& i_sTagName ); + AnElement( + const char * i_sTagName ); ~AnElement(); private: // Interface Element @@ -255,7 +257,7 @@ class AnElement : public Element virtual const AttrList * inq_Attrs() const; // DATA - ::csv::String sTagName; + ::csv::String sTagName; Dyn< Item > pContent; AttrList aAttrs; }; @@ -266,6 +268,8 @@ class AnEmptyElement : public EmptyElement public: AnEmptyElement( const ::csv::String & i_sTagName ); + AnEmptyElement( + const char * i_sTagName ); ~AnEmptyElement(); private: // Interface Element: @@ -284,6 +288,8 @@ class APureElement : public PureElement public: APureElement( const ::csv::String & i_sTagName ); + APureElement( + const char * i_sTagName ); ~APureElement(); private: // Interface Element: @@ -302,6 +308,8 @@ class ASglTag : public SglTag public: ASglTag( const ::csv::String & i_sTagName ); + ASglTag( + const char * i_sTagName ); ~ASglTag(); private: // Interface Element: @@ -320,6 +328,9 @@ class AnAttribute : public Attribute AnAttribute( const ::csv::String & i_sName, const ::csv::String & i_sValue ); + AnAttribute( + const char * i_sName, + const char * i_sValue ); ~AnAttribute(); private: // Interface Attribute: @@ -361,6 +372,8 @@ class XmlCode : public TextContent public: XmlCode( const ::csv::String & i_sText ); + XmlCode( + const char * i_sText ); ~XmlCode(); private: virtual void do_WriteOut( diff --git a/udm/source/html/htmlitem.cxx b/udm/source/html/htmlitem.cxx index de654aff20d0..3dc0fcf08191 100644 --- a/udm/source/html/htmlitem.cxx +++ b/udm/source/html/htmlitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: htmlitem.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-05-14 08:29:36 $ + * last change: $Author: np $ $Date: 2002-06-25 15:16:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,11 +107,11 @@ Image::Image( const String & i_sSrc, const String & i_sBorder ) : AnEmptyElement( "img" ) { - *this << new AnAttribute("src",i_sSrc) - << new AnAttribute("width",i_sWidth) - << new AnAttribute("height",i_sHeight) - << new AnAttribute("align",i_sAlign) - << new AnAttribute("border",i_sBorder); + *this << new AnAttribute(String("src"),i_sSrc) + << new AnAttribute(String("width"),i_sWidth) + << new AnAttribute(String("height"),i_sHeight) + << new AnAttribute(String("align"),i_sAlign) + << new AnAttribute(String("border"),i_sBorder); } bool @@ -172,13 +172,13 @@ Table::Table( const String & i_sBorder, : csi::xml::AnElement("table") { if ( i_sBorder.length() > 0 ) - *this << new AnAttribute("border",i_sBorder); + *this << new AnAttribute(String("border"),i_sBorder); if ( i_sBorder.length() > 0 ) - *this << new AnAttribute("width",i_sWidth); + *this << new AnAttribute(String("width"),i_sWidth); if ( i_sBorder.length() > 0 ) - *this << new AnAttribute("cellpadding",i_sCellPadding); + *this << new AnAttribute(String("cellpadding"),i_sCellPadding); if ( i_sBorder.length() > 0 ) - *this << new AnAttribute("cellspacing",i_sCellSpacing); + *this << new AnAttribute(String("cellspacing"),i_sCellSpacing); } TableRow & diff --git a/udm/source/xml/xmlitem.cxx b/udm/source/xml/xmlitem.cxx index 99d4284c20c1..538dde8a6ec7 100644 --- a/udm/source/xml/xmlitem.cxx +++ b/udm/source/xml/xmlitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlitem.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-05-14 08:29:37 $ + * last change: $Author: np $ $Date: 2002-06-25 15:16:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -349,6 +349,13 @@ AnElement::AnElement( const String & i_sTagName ) { } +AnElement::AnElement( const char * i_sTagName ) + : sTagName( i_sTagName ) + // pContent, + // aAttrs +{ +} + AnElement::~AnElement() { } @@ -398,6 +405,12 @@ AnEmptyElement::AnEmptyElement( const String & i_sTagName ) { } +AnEmptyElement::AnEmptyElement( const char * i_sTagName ) + : sTagName( i_sTagName ) + // aAttrs +{ +} + AnEmptyElement::~AnEmptyElement() { @@ -424,6 +437,12 @@ APureElement::APureElement( const String & i_sTagName ) { } +APureElement::APureElement( const char * i_sTagName ) + : sTagName( i_sTagName ) + // pContent +{ +} + APureElement::~APureElement() { } @@ -449,6 +468,11 @@ ASglTag::ASglTag( const String & i_sTagName ) { } +ASglTag::ASglTag( const char * i_sTagName ) + : sTagName( i_sTagName ) +{ +} + ASglTag::~ASglTag() { } @@ -468,6 +492,13 @@ AnAttribute::AnAttribute( const String & i_sName, { } +AnAttribute::AnAttribute( const char * i_sName, + const char * i_sValue ) + : sName(i_sName), + sValue(i_sValue) +{ +} + AnAttribute::~AnAttribute() { } @@ -544,6 +575,11 @@ XmlCode::XmlCode( const String & i_sText ) { } +XmlCode::XmlCode( const char * i_sText ) + : sText(i_sText) +{ +} + XmlCode::~XmlCode() { } |