Jump to content

Recommended Posts

Posted

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

Posted

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

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.