Skip to content
roneill edited this page Jan 31, 2012 · 9 revisions

Welcome to the CS-4410-Compilers-Homework wiki?

Running the lexer:

echo 'Parse.parse "test1.tig";' | sml sources.cm

Known issues:

  • I need to expand the string builder structure and actually use it to append chars
  • We may want to have a helper function/structure that pushes/pops things off the comment stack

Things to do:

  • A text file describing the members of your team
  • How you handled comments
  • How you handled errors
  • How you handled end-of-file
  • Anything else you think is of interest about your lexer

Possible issues:

  • Having all of the above machinery interact with your line-number tracking machinery has its own complications.
  • Does your lexer do the right thing if eof occurs inside a comment or string-literal?
  • How about illegal escape codes in string literals?
  • Is \q allowed inside a string literal?
  • How about \938?
  • What will your lexer do if the input ends inside a comment? Or a string literal?
  • Does your lexer use O(n^2) operations? E.g., suppose you are accumulating a bunch of characters into a string, left to right.
    • Do you use string concatenation to tack the new character onto the end of the accumulated string?
    • Or do you cons up a list of characters, then reverse the list and convert it to a string when done? The first option is O(n^2) in time and space. The latter is O(n).
Clone this wiki locally