Closed erose closed 10 years ago
This is for the transition table, not the action table, right? I think it's for the ~40 characters that are readable in the language: 26 alphas, 10 digits, parentheses, etc.
Yeah, it's the transition table. Okay, that makes sense. Just confused me because you don't do anything different upon e.g. seeing a '0' as opposed to a '9'. I ended up having a lot fewer states, which, upon reflection, I guess was because I didn't strictly speaking use a table.
Yeah, you can use states or—maybe what you did—use object orientation to kind of implicitly define states.
It seemed like Bob was saying we needed 40-ish "states" for the table-driven scanner (a 40 x 127 table). Does anyone know where that number is coming from? To me it seems like you would only need a few -- "default" (not currently reading in a keyword or identifier), "in_word" (in the middle of reading a word that might turn out to be a keyword or identifier). Also an "in_comment" I guess. I think Bob said something about why all those states were necessary but I don't remember what it was. Does anyone know?