www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/09/04:40:37

From: GBeushausen AT t-online DOT de (Gunnar Beushausen)
Newsgroups: comp.os.msdos.djgpp
Subject: Bison optionality
Date: 8 Feb 1997 03:05:33 GMT
Organization: Telekom Online Internet Gateway
Lines: 18
Message-ID: <5dgqht$nu3@news00.btx.dtag.de>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi there!

Does anyone know how to implement optionality into a bison script?
I'm creating a command that's called "circle" with the arguments
x_position, y_position, radius and color. But i want color to be an
optional argumend. My current code looks like this

| circle expression expression expression expression {circle();}

But when i execute the code i can't leave out the last expression,
otherwise there would be a parse error. 

Can somebody help me please?

---
Gunnar Beushausen
GBeushausen AT t-online DOT de
http://www.hof.de/~gbasic

- Raw text -


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