Search code examples
javacompiler-constructiontokenizelexical-analysisstringtokenizer

Ideas for Create a lexical analyzer program using java


I am trying to create a lexical analyzer program using java.Program must have the concept of tokenization .I have beginner level knowledge in compiler programming.I know there are lot of Lexical generators exist on internet.I can use them to test my own lexical analyzer out put .But i need to do my own lexical analyzer .Can any one please give some best references or articles or ideas to start my cording ?


Solution

  • I would try taking a look at the source code for some of the better ones out there. I have used Sablecc in the past. If you go to this page describing how to to set you your environment, there is a link to the source code for it. Antlr is also a really commonly used one. Here is the source code for it.

    Also, The Dragon Book is really good.

    As Suggested by SK-logic I am adding Modern Compiler Implementation as another option.