compiler design

my prof wants us to write a lexical analyzer for C programming language. and design a lexical analyzer which can be called by a parser and return a quadraple (tokentype, attributevalue, line number, line position). should not return a quadraple for a comment, it should return the next token after skipping the comments.how to design a driver program which reads the name of a file which holds a sample program in this prog lang, and prints this token of this sample program into another file.

Comments

  • : my prof wants us to write a lexical analyzer for C programming language. and design a lexical analyzer which can be called by a parser and return a quadraple (tokentype, attributevalue, line number, line position). should not return a quadraple for a comment, it should return the next token after skipping the comments.how to design a driver program which reads the name of a file which holds a sample program in this prog lang, and prints this token of this sample program into another file.
    :

    you might look at lex and yacc (yet another compiler compiler)

    http://dinosaur.compilertools.net/
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion