Flex regular expression problems

kpetrov@jagor.srce.hr (Omadon)
9 Apr 1999 14:08:17 -0400

          From comp.compilers

Related articles
Flex regular expression problems kpetrov@jagor.srce.hr (1999-04-09)
| List of all articles for this month |

From: kpetrov@jagor.srce.hr (Omadon)
Newsgroups: comp.compilers
Date: 9 Apr 1999 14:08:17 -0400
Organization: FER
Keywords: lex, question

I'm having problems defining a flex regular expression for line numbers for
a BASIC-like language.

I define the reg. expression for line numbers:

^[[:space:]]*[0-9]+ { out_word("LINENUM"); }

This works when the line number is at the beginning of the text line, but
if I have some spaces before the line number the lexer jams.

10 for blah blah <- this works

          10 for blah... <- this jams the scanner


Post a followup to this message

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