Flex/yacc problems

Omar Al-Kaisy <omar@sambusys.com>
7 Jun 2001 17:08:36 -0400

          From comp.compilers

Related articles
Flex/yacc problems omar@sambusys.com (Omar Al-Kaisy) (2001-06-07)
Re: Flex/yacc problems tmoog@polhode.com (Tom Moog) (2001-06-08)
Re: Flex/yacc problems wzzhu@csis.hku.hk (Zhu Wenzhang) (2001-06-21)
| List of all articles for this month |

From: Omar Al-Kaisy <omar@sambusys.com>
Newsgroups: comp.compilers
Date: 7 Jun 2001 17:08:36 -0400
Organization: Compilers Central
Keywords: lex, question
Posted-Date: 07 Jun 2001 17:08:36 EDT


I am currently converting an already-existing lex program into flex,
and have hit upon a couple of obstacles. The original lex program did
all sorts of fancy stuff in order to determine that it had reached the
end of the file. Due to the existence of a flex <<EOF>> token, a lot
of this code could now be removed. However, I am encountering some
strange situations when utilising this token. If the file being parsed
(I use yacc with the flex) contains only one input/message then the
EOF is recognised and can therefore be handled. However, on multiple
messages/inputs, the program does not seem to recognise EOF at
all. Are there any known irregularities/bugs with the EOF token in
flex (possibly when used with yacc), or does anyone know how to
succussfully utilise the token, or know of documentation outside of
the man pages where I can obtain information/examples?

Secondly, if I attempt to process messages whose combined size is
greater than 8KB, my program falls over. Does anyone have any idea why
this may be? Does this have anything to do with my flex/yacc settings?


Omar Al-Kaisy Omar.AlKaisy@SamBuSys.com
SAM Business Systems Ltd http://www.SamBuSys.com
22-24 Claremont Road (+44 or 0)20 8390 7333
Surbiton, Surrey KT6 4QU Fax: 8390 7699
[The 8KB problem sounds like the input buffer size in PC versions of
flex. You can redefine YY_BUF_SIZE to fix that. Re pushback at EOF,
I have to say that in 20 years of using lex and flex, nobody's ever
complained about it before, so I can't say I'd call it a bug. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.