Output of Lexer

后端 未结 3 1175
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 11:30

I am currently writing a compiler and I\'m in the Lexer phase.

I know that the lexer tokenizes the input stream.

However, consider the following stream:

3条回答
  •  有刺的猬
    2021-01-15 12:00

    There is no real gain to have "letter" as an intermediate step - instead "foo" should probably be an identifier. Otherwise you could understand int as "letter letter letter" too, which doesn't make much sense.

提交回复
热议问题