help-bison
[Top][All Lists]
Advanced

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

How to use our own token ?


From: Aurelien Tran
Subject: How to use our own token ?
Date: Wed, 27 Jan 2010 22:34:01 -0800 (PST)

Hi,

I have my own lexer which is returning me a token_type identifier define as
follow:

  namespace mynamespace {
    enum token_type {
      mytoken1 = 123,
      mytoken2 = 456,
      mytoken3 = 789
    };
  }
When I tried to write the parser, how do I need to write the bison script to
use my token system ?

I tried to include my enum token_type include file and redefining the token
as following
  %token mytoken1 mynamespace::mytoken1
  %token ...

but it did not work...
Any help would be really appreciated.




-- 
View this message in context: 
http://old.nabble.com/How-to-use-our-own-token---tp27351674p27351674.html
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.





reply via email to

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