www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/16/15:34:27

From: Gary R Sekinger <sekinger+@andrew.cmu.edu>
Newsgroups: comp.os.msdos.djgpp
Subject: yet another bison question
Date: Fri, 16 May 1997 13:39:17 -0400
Organization: Masters student, Software Engineering, Carnegie Mellon, Pittsburgh, PA
Lines: 25
Message-ID: <cnT9j5G00WBLE3fkpZ@andrew.cmu.edu>
NNTP-Posting-Host: po7.andrew.cmu.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm trying to specify a grammar that contains a several of blocks like this:

Block: 
     GeneralBlock
           output_file    equal STRING
           comment        equal STRING
           seed           equal INTEGER	
           vectors        equal INTEGER
           quantity       equal INTEGER
           indices        equal BOOLEAN
           index_start    equal FLOAT
           index_interval equal FLOAT
           precision      equal INTEGER
     EndGeneralBlock


My problem is that I don't want to impose an order on the statements
within the block. I could use brute force and specify all 362880 (9!)
permeation's, but that method would really suck! A second idea was to
make all of the statements optional and then at the "EndGeneralBlock"
token check to make sure that they were all specified, but this also
seems like a hack. Is there an better way to do this? 

I've search for yacc/bison examples and haven't come across very many.

- Raw text -


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