Where does the compiler spend most of its time during parsing?

I read in the Sebesta book that the compiler spends most of its time in the lexing source code. Therefore, lexer optimization is a necessity, unlike a syntax analyzer.

If so, why does the lexical analysis stage take so much time compared to parsing in general?

I mean the parsing of the derivation process.

+3
source share
4 answers

-, , : lexing. , ++ (, g++) , ( , ). , C ++ ( , ).

, . , , .. , () , ().

+7

- , . ,

foreach (x in o)

- "f", "o" ..

( "foreach", "for" ..)

"" . , , , .

+1

, . , , , , , , , .

0

, , . . , , , , . , , .

0

Source: https://habr.com/ru/post/1712159/


All Articles