Hacker News new | ask | show | jobs
by agalunar 1534 days ago
> When AST is built, it is validated to make sure it makes sense (that’s called lexing) and converted it to the bytecode.

I've never heard "lexing" used this way, and I believe it's simply incorrect. Lexing (tokenizing) precedes parsing (parse tree and then syntax tree construction). It isn't syntax tree validation.

Or so I thought. Are there other examples (besides this article) of "lexing" also being used to mean something else?

3 comments

Thank you for catching that! Not sure where my eyes were, feels like it's a remnant of another version of the sentence. Removed
No problem! Same thing happens to me, where my eyes begin to gloss over things I've written (because I know what I mean to say).

Thanks for the submission!

BTW, a good technique for catching those kinds of mistakes is to read the piece out loud. Engaging more of your nervous system makes the visual elision easier to detect.
I think, it's called "elaboration" (In Standard ML) .. into elaborative semantics (AST that makes sense for evaluation phrase).
> validated to make sure it makes sense

Indeed, I always thought that it's called "syntax checking" :)