yacc, same token

Discussion in 'C Programming' started by cmk128@hotmail.com, Dec 23, 2005.

  1. Guest

    Hi All

    Here is my .l file, when the input is '1', the token will match mame,
    but sometime i want it matches "values". how to?

    chars [A-za-z0-9\_\'\.\"]
    int [0-9]+
    string \"{chars}+\"
    words {chars}+
    values {int}|{string}|{bool}
    name [a-zA-Z0-9]+

    thanks
    from Peter ()
    , Dec 23, 2005
    #1
    1. Advertising

  2. wrote:
    > Hi All
    >
    > Here is my .l file, when the input is '1', the token will match mame,
    > but sometime i want it matches "values". how to?
    >
    > chars [A-za-z0-9\_\'\.\"]
    > int [0-9]+
    > string \"{chars}+\"
    > words {chars}+
    > values {int}|{string}|{bool}
    > name [a-zA-Z0-9]+
    >
    > thanks
    > from Peter ()
    >

    Well, how do you distinguish between a name and a value? (Perhaps you
    shouldn't allow a number to be a name)

    Robert
    Robert Harris, Dec 23, 2005
    #2
    1. Advertising

  3. Flash Gordon Guest

    wrote:
    > Hi All
    >
    > Here is my .l file, when the input is '1', the token will match mame,
    > but sometime i want it matches "values". how to?


    <snip>

    Yacc is not C, please ask somewhere yacc is topical, not here.
    --
    Flash Gordon
    Living in interesting times.
    Although my email address says spam, it is real and I read it.
    Flash Gordon, Dec 23, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. exits funnel

    Parsing - YACC to java

    exits funnel, Jul 31, 2003, in forum: Java
    Replies:
    3
    Views:
    5,625
    exits funnel
    Jul 31, 2003
  2. Cronus
    Replies:
    1
    Views:
    663
    Paul Mensonides
    Jul 15, 2004
  3. G Fernandes
    Replies:
    1
    Views:
    525
  4. Wessi
    Replies:
    3
    Views:
    848
    Lawrence Kirby
    Aug 11, 2005
  5. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    This is an unexpected token. The expected token is 'NAME'

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Jul 13, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    775
    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=
    Jul 13, 2007
Loading...

Share This Page