{"id":6456,"date":"2025-12-20T11:09:08","date_gmt":"2025-12-20T05:39:08","guid":{"rendered":"https:\/\/study.madeeasy.in\/?p=6456"},"modified":"2025-12-20T12:39:19","modified_gmt":"2025-12-20T07:09:19","slug":"lexical-analysis","status":"publish","type":"post","link":"https:\/\/www.madeeasy.in\/study\/cs-it\/lexical-analysis","title":{"rendered":"Lexical Analysis"},"content":{"rendered":"<ul>\n<li style=\"text-align: justify;\">As the first phase of compiler, the main task of the lexical analyzer is to read the input characters of the source program, group them into lexemes, and produce as output a sequence of token for each lexeme in the source program. The stream of tokens is sent to the parser for syntax analysis. The stream of tokens is sent to the parser for syntax analysis.<\/li>\n<li style=\"text-align: justify;\">Lexical analyzer also interacts with symbol table. As when the lexical analyzer discover a lexeme constituting an identifier, it needs to enter that lexemes into the symbol table. This interaction is shown below:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6458 size-full\" src=\"https:\/\/study.madeeasy.in\/wp-content\/uploads\/2025\/12\/token.jpg\" alt=\"Token\" width=\"558\" height=\"134\" srcset=\"https:\/\/www.madeeasy.in\/study\/wp-content\/uploads\/2025\/12\/token.jpg 558w, https:\/\/www.madeeasy.in\/study\/wp-content\/uploads\/2025\/12\/token-300x72.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/li>\n<li>Above interaction is implemented by having the parser call the lexical analyzer. The call, suggested by the get Net Token command, causes the lexical analyzer to read characters from its input until it can identify the next lexeme and produce for it the next token, which it returns to the parser.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>As the first phase of compiler, the main task of the lexical analyzer is to read the input characters of<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1908,3],"tags":[1909,1911,1912,1913,1914],"class_list":["post-6456","post","type-post","status-publish","format-standard","hentry","category-compiler","category-cs-it","tag-compiler","tag-lexical-analysis","tag-parser","tag-source-of-language","tag-syntax-analysis"],"_links":{"self":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/comments?post=6456"}],"version-history":[{"count":0,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6456\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/media?parent=6456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/categories?post=6456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/tags?post=6456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}