saleban Posted January 6, 2009 Share Posted January 6, 2009 hi mates i have project in compiler design especialy lexical analysis so i need help 4 u A C++ program which takes sequence of characters then gives me sequence of their token types. example. if. ............ keyword 3 int value x,,,,,,,,,,,,, variable =.............. equal sign this is an example i neeed more wich help me creating complete compiler Link to comment Share on other sites More sharing options...
Shadow Posted January 6, 2009 Share Posted January 6, 2009 What you're trying to achieve is pretty complicated. What will be the input? Link to comment Share on other sites More sharing options...
bascule Posted January 6, 2009 Share Posted January 6, 2009 Is the goal here to write your own FSA from scratch, or are you allowed to use existing lexer generators like flex? Link to comment Share on other sites More sharing options...
alan2here Posted January 6, 2009 Share Posted January 6, 2009 Do you mean input int n = 3; if (n == 3) { n++; } and the following is output? int, keyword n, variable integer =, keyword 3, literal integer if, keyword (, open bracket type 1 n, variable int n ==, keyword 3, literal int 3 ), close bracket type 1 {, open bracket type 2 n, variable int n ++, keyword }, close bracket type 2 or more like this? int, keyword .=, keyword ..n, variable integer ..3, literal integer ;, keyword if, keyword (), bracket set type 1 .==, keyword ..n, variable int n ..3, literal int 3 {}, bracket set type 2 .++, keyword ..n, variable int n ;, keyword Link to comment Share on other sites More sharing options...
morganparkar Posted February 12, 2009 Share Posted February 12, 2009 Hi friend, I can't explain the whole procedure in this post.It's very difficult for me.I have the source code but i can't post it because it's very long. Link to comment Share on other sites More sharing options...
bascule Posted February 13, 2009 Share Posted February 13, 2009 Use a service like http://gist.github.com, http://pastie.org, http://pastebin.com, etc. Then post a link here. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now