help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is going in this syntax


From: wim delvaux
Subject: What is going in this syntax
Date: Fri, 8 Oct 2004 03:45:15 +0200
User-agent: KMail/1.7

Hi all,

this excerpt.

"unsigned"{WSPC}+{IDENT}    {
                              fprintf(stderr, "ERROR\n" );
                              (*(yylval)).sval = AC_Strdup( yytext );
                              DORETURN( T_Identifier );
                            }

{IDENT}                     {
                              fprintf(stderr, "IIIERROR\n" );
                              (*(yylval)).sval = AC_Strdup( yytext );
                              DORETURN( T_Identifier );
                            }

Where defined are 

WSPC                [ \t]
EOL                 [\n\r]
ASPC                ({WSPC}|{EOL})
SPCs                {ASPC}*
VAROF               "AC_VariantOf_t"{SPCs}"("{SPCs}[^)]+{SPCs}")"
REALIDENT           ([[:alpha:]]|_)([[:alnum:]]|_)*
IDENT               {VAROF}|{REALIDENT}

when the input presents 'unsigned long' the first rule applies (which is what 
you would expect) but ONLY with the tokenvalue "unsigned" (which is NOT what 
you would expect).

next the long token is matched ... and NO not the second rule first but the 
first fires again.

I have run my syntax in debug to find out what was going on

Why is that




reply via email to

[Prev in Thread] Current Thread [Next in Thread]