delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/12/14:05:44

From: ams AT ludd DOT luth DOT se (Martin Str|mberg)
Newsgroups: comp.os.msdos.djgpp,comp.programming
Subject: Re: Bison and [f]lexical tie-ins
Followup-To: comp.os.msdos.djgpp,comp.programming
Date: 12 Jul 1999 16:57:43 GMT
Organization: University of Lulea, Sweden
Lines: 27
Message-ID: <7md6q7$l06$1@news.luth.se>
References: <37863AAA DOT BF85DE25 AT americasm01 DOT nt DOT com> <7m5r26$see$1 AT news DOT luth DOT se> <3786BC45 DOT B89C14F5 AT unb DOT ca> <7m784h$dd5$2 AT news DOT luth DOT se> <37876DD0 DOT 8AFDFDA0 AT unb DOT ca> <7m84ov$ns5$1 AT news DOT luth DOT se> <3789FE57 DOT 2FF899BD AT americasm01 DOT nt DOT com>
NNTP-Posting-Host: queeg.ludd.luth.se
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Campbell, Rolf [SKY:1U32:EXCH] (cp1v45 AT americasm01 DOT nt DOT com) wrote:
: The code was (C++):
: 
: struct {int c,d;} b;
: b={1,2};
: 
: Here, 'b' is a variable-name, and should be known as a variable-name in the parsing stage
: immediately after the ";".  But, because of Bison's (or yacc's) look-ahead token, the 2nd
: 'b' has already been tokenized as an ID, which is not allowed as an rValue in an
: expression, thus producing a parse error.

Hmm. It seems we are talking past each other. Please read teh next
lines carefully.

No. There, "b" is an ID. This ID can be at least two different
things. 1, a variable name. 2, a type name. At this point you don't
know which one of those it is.

That's what I've deduced from the problem description. I don't know if
this is generally true.

[Klippa, klapp, kluppit bison expert question, as I'm not one of them.]


Right,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019