[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Flex query
From: |
Karen Loughran |
Subject: |
Flex query |
Date: |
22 Mar 2004 13:23:37 +0000 |
Hi there, I notice on GNU's site it indicates there are currently no
mailing groups for Flex. I hope this is the correct place to email for
a query on use of Flex.
I have the following two rules in my Lexical input file :
@ { printf("@ received\n"); }
[[:alnum:][:punct:address@hidden { printf("ALNUMFIELD received\n"); }
Which will tokenise the following input correctly :
address@hidden
The ouput I receive when I run the lexer with this input is:
ALNUMFIELD received
@ received
ALNUMFIELD received
However, as the rule which identifies an ALUMFIELD contains an "*" to
indicate 0 or more occurrences of the characters are allowed I would
expected the output for the following to be the same.
address@hidden
But it decides to treat the first "a" and second "a" as two separate
ALNUMFIELD's and I'm can't understand why.
ALNUMFIELD received
ALNUMFIELD received
@ received
ALNUMFIELD received
Please can you provide an explanation as to why it doesn't treat "aa" to
be one ALNUMFIELD in this case ?
I want to define a rule which accepts any number of alphanumeric and
punctuation characters (except for "@") as one token.
Thanks for your help,
Karen
- Flex query,
Karen Loughran <=