LARA

Tools for Constructing Lexers

We can use JavaCC file to generate lexers.

Files:

Instructions:

javacc polyTokens.jj
javac *.java
java -cp . PolyTokenTest < TestPolyInput.poly

Note:

  • still must e.g. manually convert digit sequence into an integer
  • but easier once you know that you have correct token (we know its beginning and end)