Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Creation/AI/Mods/Scenarios > YACC Stack Overload
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:24
  Old Post 08-09-2004 04:06
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
YACC Stack Overload Got spare money?

Quick question.

Can anyone tell me what a YACC Stack Overload error means when running a slic file. Its a biggie, 32 pages, but not as big as script.slc. Could it be 74 elseif statements in a row?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:24
  Old Post 08-09-2004 04:59 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Re: YACC Stack Overload Support Apolyton, buy Galactic Civilizations

quote:
Originally posted by stankarp
Quick question.

Can anyone tell me what a YACC Stack Overload error means when running a slic file. Its a biggie, 32 pages, but not as big as script.slc. Could it be 74 elseif statements in a row?


The short answer is: Yes, the 74 elseif statements in a row are probably to blame.

The jargon-filled answer is:

yacc uses an LALR(1) parser which works as a finite state automaton with a stack attached to it which runs along the file, finding the handle (the last production required to produce the current sentential form in rightmost-production-first order) and undoing that production first. The stack must maintain all of the symbols to the left of the last token in the handle. If the elseif statements are right-associative when the time comes to parse them the last one will be the handle, and all the previous ones will have to be stored in the stack at the same time, and this could well be several symbols per elseif block, which could easily result in a stack of more than 256 symbols, which might well be the limit.

If this is the problem then it might be possible to fix this by changing the grammar so that elseif statements are made left-associative, rather than right-associative.

stankarp is offline stankarp
Prince
australia
Feb 2002
time: 05:24
  Old Post 08-09-2004 08:17
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Help yourself to an AD-FREE life

I changed one of the "elseif" statements to an "if " and the error did not occur.

Thanks.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:24
  Old Post 09-09-2004 03:39 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton buy from Amazon

Glad to be of (very little) assistance .

Really yacc should use a stack with an unlimited size to avoid this kind of problem, but I guess thry think that would slow it too much...

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:24.
Apolyton Time is 00:24.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0324 seconds (88.01% PHP - 11.99% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net