From 8ab086b6cc054501bfbf7ef6fa509c393691e860 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Mon, 18 Sep 2000 16:07:07 +0000
Subject: initial import
---
rsc/source/parser/erscerr.cxx | 512 +++++++++
rsc/source/parser/makefile.mk | 111 ++
rsc/source/parser/parser.cxx | 91 ++
rsc/source/parser/parser.hxx | 60 +
rsc/source/parser/rscdb.cxx | 1127 +++++++++++++++++++
rsc/source/parser/rscibas.cxx | 736 ++++++++++++
rsc/source/parser/rscicpx.cxx | 2483 +++++++++++++++++++++++++++++++++++++++++
rsc/source/parser/rscinit.cxx | 1037 +++++++++++++++++
rsc/source/parser/rsckey.cxx | 297 +++++
rsc/source/parser/rsclex.cxx | 588 ++++++++++
rsc/source/parser/rsclex.hxx | 217 ++++
rsc/source/parser/rscpar.cxx | 299 +++++
rsc/source/parser/rscyacc.cxx | 322 ++++++
13 files changed, 7880 insertions(+)
create mode 100644 rsc/source/parser/erscerr.cxx
create mode 100644 rsc/source/parser/makefile.mk
create mode 100644 rsc/source/parser/parser.cxx
create mode 100644 rsc/source/parser/parser.hxx
create mode 100644 rsc/source/parser/rscdb.cxx
create mode 100644 rsc/source/parser/rscibas.cxx
create mode 100644 rsc/source/parser/rscicpx.cxx
create mode 100644 rsc/source/parser/rscinit.cxx
create mode 100644 rsc/source/parser/rsckey.cxx
create mode 100644 rsc/source/parser/rsclex.cxx
create mode 100644 rsc/source/parser/rsclex.hxx
create mode 100644 rsc/source/parser/rscpar.cxx
create mode 100644 rsc/source/parser/rscyacc.cxx
(limited to 'rsc/source/parser')
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
new file mode 100644
index 000000000000..1a0453dca865
--- /dev/null
+++ b/rsc/source/parser/erscerr.cxx
@@ -0,0 +1,512 @@
+/*************************************************************************
+ *
+ * $RCSfile: erscerr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+/************************************************************************
+
+ Source Code Control System - Header
+
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/erscerr.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $
+
+************************************************************************/
+#pragma hdrstop
+#include
+#include
+
+#include
+
+#ifndef _RSCHASH_HXX
+#include
+#endif
+#ifndef _RSCERROR_H
+#include
+#endif
+#ifndef _RSCALL_H
+#include
+#endif
+#ifndef _RSCDB_HXX
+#include
+#endif
+#ifndef _RSCPAR_HXX
+#include
+#endif
+
+#include "rsclex.hxx"
+
+/*************************************************************************
+|*
+|* ERRTYPE::operator = ;
+|*
+|* Beschreibung
+|* Ersterstellung MM 25.09.91
+|* Letzte Aenderung MM 25.09.91
+|*
+*************************************************************************/
+ERRTYPE& ERRTYPE::operator = ( const ERRTYPE & rError )
+{
+ if( !IsError() ){
+ if( rError.IsError() || !IsWarning() )
+ nError = rError.nError;
+ }
+ return *this;
+}
+
+/*************************************************************************
+|*
+|* RscError::StdOut();
+|*
+|* Beschreibung
+|* Ersterstellung MM 06.05.91
+|* Letzte Aenderung MM 06.05.91
+|*
+*************************************************************************/
+void RscError::StdOut( const char * pStr )
+{
+#ifndef WIN
+ if( pStr ){
+ printf( "%s", pStr );
+ fflush( stdout );
+ }
+#endif
+}
+
+/*************************************************************************
+|*
+|* RscError::LstOut();
+|*
+|* Beschreibung
+|* Ersterstellung MM 06.05.91
+|* Letzte Aenderung MM 06.05.91
+|*
+*************************************************************************/
+void RscError::LstOut( const char * pStr ){
+ if( fListing && pStr )
+ fprintf( fListing, "%s", pStr );
+}
+
+/*************************************************************************
+|*
+|* RscError::StdLstOut();
+|*
+|* Beschreibung
+|* Ersterstellung MM 06.05.91
+|* Letzte Aenderung MM 06.05.91
+|*
+*************************************************************************/
+void RscError::StdLstOut( const char * pStr ){
+ StdOut( pStr );
+ LstOut( pStr );
+}
+
+/*************************************************************************
+|*
+|* RscError::WriteError();
+|*
+|* Beschreibung
+|* Ersterstellung MM 06.05.91
+|* Letzte Aenderung MM 06.05.91
+|*
+*************************************************************************/
+void RscError::WriteError( const ERRTYPE& rError, const char * pMessage )
+{
+ switch( rError )
+ {
+ case ERR_ERROR: {
+ StdLstOut( "!! " );
+ if( 1 == nErrors )
+ StdLstOut( ByteString::CreateFromInt32( nErrors ).GetBuffer() );
+ else
+ StdLstOut( ByteString::CreateFromInt32( (USHORT)(nErrors -1) ).GetBuffer() );
+ StdLstOut( " Error" );
+ StdLstOut( " found!!" );
+ }
+ break;
+
+ case ERR_UNKNOWN_METHOD:
+ StdLstOut( "The used type is not allowed." );
+ break;
+
+ case ERR_OPENFILE:
+ StdLstOut( "This file <" );
+ StdLstOut( pMessage );
+ StdLstOut( "> cannot be opened." );
+ break;
+
+ case ERR_FILESIZE:
+ StdLstOut( "Wrong file <" );
+ StdLstOut( pMessage );
+ StdLstOut( "> length." );
+ break;
+
+ case ERR_FILEFORMAT:
+ StdLstOut( "Wrong file type <" );
+ StdLstOut( pMessage );
+ StdLstOut( ">." );
+ break;
+
+ case ERR_NOCHAR:
+ StdLstOut( "Character: '\\xxx'; The value xxx is greater than 255.");
+ break;
+
+ case ERR_NORSCINST:
+ StdLstOut( "Internal error, instance invalid.");
+ break;
+
+
+ case ERR_NOINPUT:
+ StdLstOut( "Input file was not specified.\n");
+ case ERR_USAGE:
+ StdLstOut( "Copyright (C) 1990-92 STAR DIVISION GmbH\n" );
+ {
+ char buf[40];
+
+ StdLstOut( "DataVersion: " );
+ sprintf( buf, "%d.%d\n\n",
+ RSCVERSION_ID / 100, RSCVERSION_ID % 100 );
+ StdLstOut( buf );
+ };
+
+ StdLstOut( "Command line: rsc [Switches]