HDTenEightyP/NetNews huggingface dataset:
From: ges@stiatl.salestech.com (Gerald Sullivan)
Newsgroups: comp.lang.c++
Subject: Re: yacc in c++?
Date: 30 Sep 92 12:39:33 GMT
Distribution: usa
Organization: Sales Technologies, Inc.

carney@rocky.rational (Mike Carney) writes:

>Not it the version of yacc that I have (SunOS 4.1.2). The output from
>this is K&R C, which will not compile with a C++ compiler. Therefore,
>I cannot have (with my version of yacc) C++ actions in my grammar. In
>fact, I've only seen third party products, and a special version of
>yacc from Sun called yacc++, which work properly with C++ code.
>    Michael D. Carney           \\_V_//
>    email: carney@rational.com  \/=|=\/   
>    phone: 408-496-3790          [=v=]     

It is easy to get any yacc to work with C++. All you have to do is make the
output C++ compatable. You can do this by modifying the parser and lexer
template files so that the will compile under C++. I assume all yaccs
have these files hidden somwhere.

The template files 
are skelatal versions of the output files (ytab.c and lexyy.c). With my 
version of yacc (mks for dos) they are called yylex.c and yyparse.c and are
found in .../etc directory.

I had to make the following modifications:
1. provide prototypes for  all functions.
2. provide explicit casts for some assignments (ie casts from void *).
3. replace malloc with new.
4. replace free with delete.

After you do this, ypu will be able to compile the parser output
files with your C++ compiler and therefore call C++ actions from your
yacc grammer.

-- 
___________________________________________________________________
Jerry Sullivan, Sales Technologies, Inc.  Atlanta,GA 
ges@salestech.com,...uupsi!stiatl!ges I don't speak for my employer.
Just say no to Republicrats, vote Libertarian.
Newsgroups: comp.lang.c++
From: Nico Tranquilli 
Subject: Re: Good book on C++
X-Xxmessage-Id: <A6F0BEFE62040B1A@mac1.di.unipi.it>
X-Xxdate: Thu, 1 Oct 92 13: 43:10 GMT
Organization: Computer Science Dpt. , University of Pisa
X-Useragent: Nuntius v1.1.1d9
Date: Thu, 1 Oct 1992 13:43:24 GMT

In article <stephen.717721582@mont> Stephen Montgomery-Smith,
stephen@mont.cs.missouri.edu writes:
>What is the `definitive' C++ book?  Or at least, is there a complete
>book on C++ that is fast paced, something like K&R on C.

"C++ at first glance", I remember neither the plubisher nor the editor!.

Nico.
Newsgroups: comp.lang.c++
From: skdutta@ucs.att.com (Saumen Dutta)
Subject: Problems with initializing classes declared virtual.
Organization: AT&T Universal Card Services, Jacksonville FL
Date: Tue, 6 Oct 1992 00:16:48 GMT

The following program gives a bus error when compiled with gcc-2.2.2 on
sparc station. It however runs without any problems with ATT C++. Can 
somebody confirm whether my installation of gcc is correct!

Thanks
skdutta



-----------------

class coord{
 public:
    double ctm[6]; 
    coord();
};

//--------------------------------------------------------

class xdisp{
  
public:
  xdisp();
};

//------------------------------------------------------------

class xwin: virtual public xdisp, virtual public coord{

public:
  xwin();

};

//----------------------------------------------------------



main()
{
        xwin tryme;
}


xwin::xwin():xdisp(), coord()
{

}


xdisp::xdisp()
{
}


coord::coord(){
        ctm[0] = (double)1.0;
        ctm[1] = ctm[2] = (double)0.0;
        ctm[4] = (double)1.0;
        ctm[5] = (double)0.0;
} 


Newsgroups: comp.lang.c++
From: pvonk@scott.skidmore.edu (Pierre VonKaenel)
Subject: Re: Turbo Vision's redraw()
Organization: Skidmore College, Saratoga Springs NY, 12866
Date: Fri, 2 Oct 1992 13:14:43 GMT

In article <21020@drutx.ATT.COM> tmr@drutx!att.com writes:
>By the way, anyone know how to make context-sensitive Status line
>or how to make disabled commands from the menu bar blacked out the
>way they are in the IDE??
>

Here's just a rough outline:

For context sensitive status line :
  When you define the menu system, be sure to include hc commands,
such as:
	*new TMenuItem( "...", cmTHis, kbNoKey, hcThis);
Also, within fuctions you might call, do a..
	this->helpCtx = hcMyProc;

Then, in the initStatusLine, include stuff like:

	*new TStatusDef( hcThis, hcThis ) +
		*new TStatusItem( "~F2~ Execute this", kbF2, .. );
--------------
To black out some menu items:

	if ( something_is_true )
	{
		TCommandSet  menuCommands;
		menuCommands += cmThis;
		menuCommands += cmThat;  // cm... used in menu def
		disableCommands( menuCommands);
	}

I have the above in the program constructor.  I suppose you could
reintroduce this within other member functions of the program.  I'm
assuming that cmThis, cmThat are cm Commands used in the TMenuItem
statements when you define the menu.

-- 
Pierre von Kaenel	| Skidmore College	     | pvonk@skidmore.edu
Math & CS Dept.		| Saratoga Springs, NY 12866 | (518)584-5000 Ext 2391

[.... old sig has been retired.  New sig isn't ready yet. ]
From: david@csource.oz.au (david nugent)
Newsgroups: comp.lang.c++
Subject: Re: System crash while compiling
Date: Tue, 29 Sep 92 23:09:09 +1000
Reply-To: david@csource.oz.au
Organization: Unique Computing Pty Ltd, Melbourne, Australia

Chris Chew <CCHEW@UCF1VM.BITNET> writes:

> Hi all,
>          I don't know if this is a common question, but I have a system
> that keeps crashing when I compile in Borland C++ 3.0/3.1  It only
> happens when I compile, usually when the machine is slightly warm,
[...]
> I have installed this several times, both version 3.0 and now 3.1. I have
> absoulutely no other problem with my system running anything else.
> 
> 386 40 MHz
> 8 Meg Ram,
> Conner 200Mb HD
> VGA, blah, blah.
> 
> Anybody have a suggestion ?  It's starting to get annoying.


Using QEMM?

Sorry, no direct experience here, but I've heard of collisions between
these two. If it runs reliably under Win 3.1 but not out of it, then
this is a good indication that this is the problem.


..............................................................................
david nugent          Public Access Usenet      "Only Nixon could go to China"
david@csource.oz.au     +61-3-792-3507                    - old Vulcan proverb
3:632/400@fidonet, 58:4100/1@intlnet, 199:4242/5@rainbownet, 33:300/6@admin
PO Box 260, Endeavour Hills, Victoria, Australia, 3802.
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++
Subject: Re: Safe C via C++ ???
Date: 4 Oct 92 01:44:36 GMT
Reply-To: tmb@idiap.ch
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
In-reply-to: glenn@sharebase.com's message of 2 Oct 92 04:30:05 GMT

In article <1992Oct2.043005.18757@sharebase.com> glenn@sharebase.com (Glenn Linderman) writes:

   Under the following assumptions:

      Use of pointers in C is "dangerous" (they can point anywhere)
      I am a C++ ignoramous (I've only just read a bit about it)
      Most programmers today don't know C++ yet (many are learning)

   can anyone provide some answers to the following questions?

   0. Is it possible to make a "bounds checked C compiler" out of a
      C++ compiler?  The remaining questions serve mostly to clarify
      this one, and start discussion about techniques to do so?

Well, sort of. C++ doesn't quite give you enough freedom. For example,
you could define a type "Pointer" that would behave somewhat like the
real thing, but the declaration syntax would be different:

	float *p;
	Pointer<float> p;

Essentially, the problem is that you can't keep people from using
"old" pointers.

   I guess a "bounds checked C++ compiler", i.e. one that wasn't quite
   C syntax, but was C++ syntax, and supports 1 through 3 above, would
   also be acceptable to me.

There are some commercial products that do this as a post-processor to
the compiler. From a cursory examination, it would seem to be all that
difficult to modify GCC to output code directly in which all pointers
are bounds checked (of course, when you pass "safe" pointers to
library functions, you do have to convert). I think this would be very
useful.

For the time being, I have resigned myself to live with a collection
of checked template classes for basic data types like arrays The
resulting code doesn't look like real C code, but it is mostly safe.
Mainly what I'm missing is a set of integral numerical classes that
check for overflows.

					Thomas.
From: j_theof@pavo.concordia.ca (THEOFANOPOULOS, JOHN)
Newsgroups: comp.lang.c++
Subject: Borland C++
Date: 30 Sep 92 21:14:00 GMT
Organization: Concordia University
News-Software: VAX/VMS VNEWS 1.41

Hi all...

I'm planning on purchasing Borland C++ v.3.1, and have a question.  I currently have
a choice between getting the regular version or paying $120.00 more and
getting the version with Application Frameworks.

Most of my work (all of it actually) is done in DOS, and all my programs
are made to run under DOS, so would this Application Frameworks really
help me?  I spoke to a Borland Rep and he wasn't too much help in 
telling me what Application Frameworks really is (what kind of functions
etc.)...

Anybody out there know about this, and if so, could you shed some light
on the subject.

You can mail me, or just post a reply....

Cheers...
--------------------------------------------------------------------------------
| John Theofanopoulos  | J_THEOF@pavo.concordia.ca!system                      |
| FidoNet  1:167/208 <AAXIS BBS--Home of JTFOX>   |  Electrical Engineering    |
 -------------------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: andrewsc@runx.oz.au (Andrew Schonberger)
Subject: class libraries for network management
Organization: RUNX Un*x Timeshare.  Sydney, Australia.
Date: Wed, 30 Sep 92 00:32:41 GMT

Perhaps this has been asked before:

    are there any C++ class libraries for network management ?

The 'open' architectures for network management (SNMP, CMIP, DME, ..?)
are modeling the manageable elements as 'objects'. The interface of 
an object-class is accurately defined (MIB-RFCs, GDMO templates, etc).
Meanwhile, most API's I've seen so far are designed for plain C. 

I'm looking for a platform which has C++ classes for common objects 
in a network. Perhaps it's feasable for a development tool to read the
object's definition from a MIB and to produce both the declaration and 
the definition of a C++ class. 

Would be really nice for the same platform to have C++ classes for GUI
as well. This means both to low level graphic primitives and
higher level objects which display bar-charts, pies, graphs, etc.

Andrew Schonberger           
                     andrewsc@runx.oz.au
                              

Newsgroups: comp.lang.c++
From: sakkinen@jyu.fi (Markku Sakkinen)
Subject: Re: downcasting (was Re: GOTOo wars)
Organization: University of Jyvaskyla, Finland
Date: Fri, 2 Oct 1992 14:16:36 GMT

In article <361@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
>In article <9227521.28722@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
>>hartman@ulogic.UUCP (Richard M. Hartman) writes:
>>
>>>We're using the NIH Linked List.  When you get something off
>>>the list it is just an Object *.  To actually use it you have
>>>to downcast it to it's proper (and hopefully Object-derived :)
>>>class.  If someone knows a way around this, please let me know
>>>and I will *gladly* give up my use of castdown......
>>
>>The Politically Correct way of doing this, I believe, is to use a template
>>linked list class. (Look Ma, no casts! :-)
>
>That only works if you compiler supports templates.....	:(

And templates only help in defining homogeneous container classes.
If you really need a heterogeneous list, it's hard to avoid castdowns.

----------------------------------------------------------------------
Markku Sakkinen (sakkinen@jytko.jyu.fi)
       SAKKINEN@FINJYU.bitnet (alternative network address)
Department of Computer Science and Information Systems
University of Jyvaskyla (a's with umlauts)
PL 35
SF-40351 Jyvaskyla (umlauts again)
Finland
----------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: cnhasan@casbah.acns.nwu.edu (Nirmal Hasan)
Subject: Re: can != be used in compound if
Organization: Northwestern University, Evanston, Illinois, USA
Date: Wed, 30 Sep 1992 16:16:50 GMT

In <1992Sep28.195425.26253@julian.uwo.ca> operator@julian.uwo.ca (Operator) writes:



>if (rnum != number_set[1] && rnum != number_set[2] && rnum != number_set[3])

>is this if statement correct because the computer has been hanging on it

Try

  if ((rnum != number_set[1]) && (rnum != number_set[2]) && (rnum !=
number_set[3]))
{
}
In other words, the problem may be because you did not use parenthesis around
each of the conditions.

Hope this helps

Nirmal()
Xref: sparky comp.lang.c++:14367 comp.std.c++:1260
From: pkturner@world.std.com (Prescott K Turner)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: Conceptual Constness
Keywords: const, const member, lazy
Date: 1 Oct 92 02:06:58 GMT
Organization: The World Public Access UNIX, Brookline, MA

In article <1ackm3INNno2@fido.asd.sgi.com> Mark Linton writes:
> Several people missed the basic issue, which is that you have a member function
> that you want to be able to pass a const object (such as a const parameter)
> but the implementation of the function wants to modify member data.
> This happens commonly for cached or lazily-evaluated data, where modifying
> the data doesn't change the future behavior of the object.  The example I typica
> lly use      
> for this is a matrix object that has an identity() test.
> [...]
> Perhaps most importantly, we shouldn't have to change the specification
> of identity() if we decide to change the implementation (switching between
> non-caching and caching or lazy and non-lazy, for example).
> 
> Splitting the class into two classes, one read-only and one read-write doesn't help
> because we really want to call the member function in question on an immutable object
> (the storage changes, but the behavior other than performance does not).

I don't think you grasped my workaround.  See my second article
<BvDxMo.5yu@world.std.com>.  You want to call the member function on a
conceptually immutable object.  The two-class workaround does not use the
existing 'const' keyword/mechanism at all.  The 'identity' or whatever
would be a public member function of the const_matrix base class.
An "immutable object" would be declared as a const_matrix, and so could have
'identity' called for it.  Since const_matrix::identity is not declared
with the const keyword, caching or laziness can be used in the implementation.

	class const_matrix {
	public:
		int identity ();
		...
	};
	class matrix : public const_matrix ();
	public:
		matrix & operator = (const_matrix &);
		...
	};
	// Declare a conceptually immutable matrix.
	const_matrix conceptually_immutable = ...
	int is_ident = conceptually_immutable.identity();

I wouldn't call this a solution, only a workaround.  And for most purposes
I prefer the indirection approach described by Joe Buck, because the 
interfaces are more what people expect.
--
Prescott K. Turner, Jr.
Liant Software Corp. (developers of LPI languages)
959 Concord St., Framingham, MA 01701 USA    (508) 872-8700
UUCP: uunet!lpi!pkt                          Internet: pkt@lpi.liant.com
Newsgroups: comp.lang.c++,comp.std.c++,gnu.g++
From: francis@dogwood.atl.ga.us (John Stracke)
Subject: Re: C++ Parser Class wanted
Organization: National Science Center Foundation
Date: Tue, 6 Oct 1992 16:49:09 GMT

In article <1992Oct5.133606@cs.utwente.nl> leonard@cs.utwente.nl (Leonard Thierry) writes:

   Does anyone know whether there exists a public domain
   C++ parser class or something like that.

There is such a thing.  I haven't used it, and I forget where I got
it, but I've put it up for anon ftp at
galois.nscf.org:/pub/CmParser.tar.Z.

--
/===========================================================================\
|John (Francis) Stracke         |My opinions are my own.                    |
|Natl. Science Center Foundation|===========================================|
|Augusta, GA                    |If God had not given us duct tape, it would|
|francis@galois.nscf.org        |  have been necessary to invent it.        |
\===========================================================================/
(Formerly francis@dogwood.atl.ga.us,francis@zaphod.uchicago.edu)
-- 
/===========================================================================\
|John (Francis) Stracke         |My opinions are my own.                    |
|Natl. Science Center Foundation|===========================================|
|Augusta, GA                    |If God had not given us duct tape, it would|
Xref: sparky comp.lang.c++:14387 comp.std.c++:1269
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: Conceptual Constness
Date: 1 Oct 1992 16:02:29 GMT
Organization: sgi
Distribution: world
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
NNTP-Posting-Host: marktwain.rad.sgi.com
Keywords: const, const member, lazy

In article <BvF77n.972@world.std.com>, pkturner@world.std.com (Prescott K Turner) writes:
|> 	class const_matrix {
|> 	public:
|> 		int identity ();
|> 		...
|> 	};
|> 	class matrix : public const_matrix ();
|> 	public:
|> 		matrix & operator = (const_matrix &);
|> 		...
|> 	};
|> 	// Declare a conceptually immutable matrix.
|> 	const_matrix conceptually_immutable = ...
|> 	int is_ident = conceptually_immutable.identity();
|> 
|> I wouldn't call this a solution, only a workaround.

This is really the second solution I suggested (don't use const).
It is true that once you decide not to use const, you can try to use
subclassing as a replacement mechanism.

The problem is if I want to declare a function p(const const_matrix& m),
I can't call m.identity().  If I declare p(const_matrix& m) and call p(a*b)
then the compiler may give me a warning about passing a temporary
to a non-const ref.

|> And for most purposes
|> I prefer the indirection approach described by Joe Buck, because the 
|> interfaces are more what people expect.

Indirection is fine when you can afford it.  I would rather write a cast
or maybe flush const altogether than write a fancy memory allocator,
but const usage is more a convention that programmers on a project
must agree on than an issue where there is one right approach.
Newsgroups: comp.lang.c++
From: gardiner@milli.cs.umn.edu (David Gardiner)
Subject: Persistent C++ Object Systems
Organization: University of Minnesota, Minneapolis, CSci dept.
Distribution: usa
Date: Sat, 3 Oct 1992 21:54:16 GMT

I am looking for a relatively inexpensive persistent C++ object system
to act as an Object-Oriented Database for my thesis project.  The
programming environment is MS Windows.  The best bet I have found to date is 
POET from BKS Software.  Does anyone have any experience with POET and/or
have suggestions for alternatives.

The essence of the application is building a semantic network, thus
direct storage of sets would be nice.

Please respond via e-mail as I do not always have time to read this group.
Thanks in advance.

David Gardiner
Newsgroups: comp.lang.c++
From: shang@corp.mot.com (David (Lujun) Shang)
Subject: Re: Downcasting
Reply-To: shang@corp.mot.com
Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
Date: Tue, 6 Oct 92 16:31:11 GMT

In article <1992Sep29.144714.3326@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John  
MAX Skaller) writes:
> In article <1992Sep28.153045.13422@cadsun.corp.mot.com> shang@corp.mot.com  
writes:
> >Try this:
> >
> >class EQ
> >{ public: virtual void enQ();
> >};
> >
> >class DQ
> >{ public: virtual void deQ();
> >};
> >
> >class Q: public EQ, public DQ
> >{
> >  protected:
> >    void enQ() {...};
> >    void deQ() {...};
> >  public:
> >    // some queue management functions...
> >};
> >
> >Q * q = new Q;
> >EQ * eq = q;
> >DE * dq = q;
> >
> >eq->enQ(); // okay;
> >dq->deQ(); // okay;
> >q->enQ();  // error: enQ is not accessible in Q
> >q->deQ();  // error: deQ is not accessible in Q
> >
> >David Shang
> >
> 
> 	But this doesnt address the problem. Because given
> downcasting and an EQ object I can downcast to Q then upcast to DQ,
> and thus access both functions. I dont have to call it through
> Q.
> 
> 	Thus 
> 
> 	f(EQ* eq){ NQ *nq= (NQ*)(Q*)eq; nq->enQ(); }
> 				^^^^
> 				downcast

I would say it is not the downcasting that breaks the protection:

   (Q*) eq

does not break the protection rule. In contrast, it is the upcast 
that breaks the protection rule:

   (NQ*)(Q*)eq

I don't think it is fair to say that it is the fault of downcasting 
that breaks the protection rule. This is special case. In general,
a derived class interface will contain more operations than its base 
class'. This is the basic assumption that we can make the upcast. BUT 
if the derived class' interface contains less operations than its 
base's, i.e., some member functions have been protected in derived 
classes, than the upcast is no longer sound. Consider an example:

  class Base
  {  public:
       virtual void foo1 ();
       virtual void foo2 ();
  };
  class Derived: public Base
  {  protected:
       void foo1();  // foo1 is protected
     public:
       void foo2();  // foo2 is still accessible
  };

  Base * b = new Derived;  // upcast
  b->foo1();               // protection rule is violated here!

David Shang
From: bisc@zellweger.ch (Thomas K. Bischoff)
Newsgroups: comp.lang.c++
Subject: __vtbl__XY undefined
Date: 6 Oct 92 11:44:25 GMT
Reply-To: bisc@zellweger.CH (Thomas K. Bischoff)
Organization: Zellweger Uster AG, Switzerland

Recently there was an thread about the vtbl undefined problem.

ld: Undefined symbol 
   ___vtbl__16ANS_LibClient_Cl
   
 But I did not save the thread. Could some kind soul please mail me the
 answers. 
 
 Thank you.
 
 
-- 
Thomas K. Bischoff    Net: bit@ten.ch,bisc@zellweger.ch 
***** Minds, like parachutes, only function when open.
Newsgroups: comp.lang.c++
From: ats@lems.brown.edu (Aaron T. Smith)
Subject: Libg++ classes...
Keywords: classlib
Organization: Laboratory for Engineering Man/Machine Systems
Date: Fri, 2 Oct 1992 16:36:33 GMT

I was wondering if anyone has extendend the libg++ library for 
such things as directed-graphs, fancy trees, etc..  I am specifically
looking for graph classes.

-- 
----------------------------------------------------------------------------
Aaron Smith - ats@lems.brown.edu
			
Brown University	... I had to let go of that cow in order to see   
Providence, RI 02912	my other options ... It is not the thing that you 
			fling, but the fling that is everything ...          
			                                                  
----------------------------------------------------------------------------
From: jurlwin@gandalf.UMCS.Maine.EDU (Jeff Urlwin)
Newsgroups: comp.lang.c++
Subject: Re: Exception handling & Borland C++ 3.1
Date: 28 Sep 92 16:28:57 GMT
Organization: University of Maine, Department of Computer Science

>              I am using BORALAND C++ Version 3.1 for Windows.  Nowhere within
>              its documentation does it mention try, throw, and catch. 
>              However, if you type these words in, the editor will boldface
>              them as if they are apart of the language.

That's because they're not there yet...but the editor is just waiting for them
(at least I Assume that's what the editor is doing...

Jeff Urlwin
jurlwin@gandalf.umcs.umain.edu
Newsgroups: comp.lang.c++,comp.os2.misc
From: feustel@netcom.com (David Feustel)
Subject: Symantec Announces C++ for OS/2 V2.0!
Organization: DAFCO: OS/2 Software Support & Consulting
Date: Sat, 3 Oct 1992 19:46:09 GMT

Today I received a flyer from Symantec announcing their Zortech
C++ for OS/2 v2.0. It costs $495(new user) or $250(update). Does
anyone have any experience with this product yet?
-- 
Dave Feustel N9MYI <feustel@netcom.com>
 
[.sig on vacation]