Is it a Lexer's Job to Parse Numbers and Strings?

后端 未结 3 1505
时光取名叫无心
时光取名叫无心 2020-12-03 04:51

Is it a lexer\'s job to parse numbers and strings?

This may or may not sound dumb, given that fact that I\'m asking whether a lexer should parse in

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 05:12

    A lexer essentially identifies TOKENs from the input. In this case, the lexer will possibly "match" the number as a float number TOKEN. The parser essentially processes tokens and does syntax analysis

提交回复
热议问题