{"id":7587,"date":"2022-04-09T12:33:08","date_gmt":"2022-04-09T07:03:08","guid":{"rendered":"https:\/\/www.goseeko.com\/blog\/?p=7587"},"modified":"2025-10-24T22:23:30","modified_gmt":"2025-10-24T16:53:30","slug":"what-is-the-phases-of-compiler","status":"publish","type":"post","link":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/","title":{"rendered":"What is the Phases of Compiler?"},"content":{"rendered":"\n<p>The method of compilation includes the sequence of different stages. Each phases of compiler takes a source programme in one representation and produces output in another representation. On the other hand, From its previous stage, each process takes input.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Phases of Compiler<\/h2>\n\n\n\n<p>The various phases of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Compiler\" target=\"_blank\" rel=\"noreferrer noopener\">compiler <\/a>take place :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lexical Analysis<\/li>\n\n\n\n<li>Syntax Analysis<\/li>\n\n\n\n<li>Semantic Analysis<\/li>\n\n\n\n<li>Intermediate Code Generation<\/li>\n\n\n\n<li>Code Optimization<\/li>\n\n\n\n<li>Code Generation\u00a0<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Lexical Analysis : <\/strong><\/h2>\n\n\n\n<p>The first phase of the compilation process is the lexical analyzer phase. As input, it takes source code. Moreover, One character at a time, it reads the source programme and translates it into meaningful lexemes. Furthermore, These lexemes are interpreted in the form of tokens by the Lexical analyzer.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Syntax Analysis : <\/strong><\/h2>\n\n\n\n<p>Syntax analysis is the second step of the method of compilation. On the other hand, Tokens is require as input and a parse tree is generated as output. In addition, The parser verifies that the expression made by the tokens is syntactically right or not in the syntax analysis process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Semantic Analysis :<\/strong> <\/h2>\n\n\n\n<p>The third step of the method of compilation is semantic analysis. Furthermore, This tests whether the parse tree complies with language rules. In addition, The semantic analyzer keeps track of identifiers, forms, and expressions of identifiers. The output step of semantic analysis is the syntax of the annotated tree.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Intermediate Code Generation :<\/strong> <\/h2>\n\n\n\n<p>The compiler generates the source code into an intermediate code during the intermediate code generation process. Between high-level language and machine language, intermediate code is created. Moreover, You can produce the intermediate code in such a way that you can convert it easily into the code of the target computer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Code Optimization : <\/strong><\/h2>\n\n\n\n<p>An optional step is code optimization. It is use to enhance the intermediate code so that the program&#8217;s output can run quicker and take up less space. Furthermore, It eliminates redundant code lines and arranges the sequence of statements to speed up the execution of the programme.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Code Generation :<\/strong> <\/h2>\n\n\n\n<p>The final stage of the compilation process is code generation. Furthermore, It takes as its input the optimized intermediate code and maps it to the language of the target computer. Moreover, The code generator converts the intermediate code to the required computer&#8217;s machine code.<\/p>\n\n\n\n<p><strong>Interested in learning about similar topics? Here are a few hand-picked blogs for you!<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.goseeko.com\/blog\/what-is-single-source-shortest-path\/\" target=\"_blank\" rel=\"noreferrer noopener\">What is the single-source shortest path?<\/a> <a href=\"https:\/\/tuv.cfga.gov.mn\/\">https:\/\/tuv.cfga.gov.mn\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.goseeko.com\/blog\/what-is-a-binary-search-tree\/\" target=\"_blank\" rel=\"noreferrer noopener\">Explain binary search tree?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.goseeko.com\/blog\/what-is-asymptotic-notation\/\" target=\"_blank\" rel=\"noreferrer noopener\">What is Asymptotic notation?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.goseeko.com\/blog\/what-is-a-greedy-algorithm\/\" target=\"_blank\" rel=\"noreferrer noopener\">Illustrate greedy algorithm?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.goseeko.com\/blog\/what-is-recursion\/\" target=\"_blank\" rel=\"noreferrer noopener\">What is recursion?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The method of compilation includes the sequence of different stages. <\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7587","post","type-post","status-publish","format-standard","hentry","category-computer-science-software-engineering-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is the Phases of Compiler? - Goseeko blog<\/title>\n<meta name=\"description\" content=\"The method of compilation includes the sequence of different stages. Each phases of the compiler takes a source programme in one representation and produces output in another representation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the Phases of Compiler? - Goseeko blog\" \/>\n<meta property=\"og:description\" content=\"The method of compilation includes the sequence of different stages. Each phases of the compiler takes a source programme in one representation and produces output in another representation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\" \/>\n<meta property=\"og:site_name\" content=\"Goseeko blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/goseeko\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-09T07:03:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-24T16:53:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.goseeko.com\/blog\/wp-content\/uploads\/2021\/09\/GoSeeko_Stacked-logo-01.png?fit=2471%2C2471&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"2471\" \/>\n\t<meta property=\"og:image:height\" content=\"2471\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Gunjan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@goseeko\" \/>\n<meta name=\"twitter:site\" content=\"@goseeko\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gunjan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\"},\"author\":{\"name\":\"Gunjan\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/#\/schema\/person\/843a7ac71fc4ae8c177dbb7820f2dc9c\"},\"headline\":\"What is the Phases of Compiler?\",\"datePublished\":\"2022-04-09T07:03:08+00:00\",\"dateModified\":\"2025-10-24T16:53:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\"},\"wordCount\":413,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/#organization\"},\"articleSection\":[\"Computers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\",\"url\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\",\"name\":\"What is the Phases of Compiler? - Goseeko blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/#website\"},\"datePublished\":\"2022-04-09T07:03:08+00:00\",\"dateModified\":\"2025-10-24T16:53:30+00:00\",\"description\":\"The method of compilation includes the sequence of different stages. Each phases of the compiler takes a source programme in one representation and produces output in another representation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.goseeko.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the Phases of Compiler?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/#website\",\"url\":\"https:\/\/www.goseeko.com\/blog\/\",\"name\":\"Goseeko blog\",\"description\":\"Learning beyond college, Students platform for life skills.\",\"publisher\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.goseeko.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/#organization\",\"name\":\"Goseeko.com\",\"url\":\"https:\/\/www.goseeko.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i1.wp.com\/www.goseeko.com\/blog\/wp-content\/uploads\/2021\/09\/GoSeeko_Stacked-logo-01.png?fit=2471%2C2471&ssl=1\",\"contentUrl\":\"https:\/\/i1.wp.com\/www.goseeko.com\/blog\/wp-content\/uploads\/2021\/09\/GoSeeko_Stacked-logo-01.png?fit=2471%2C2471&ssl=1\",\"width\":2471,\"height\":2471,\"caption\":\"Goseeko.com\"},\"image\":{\"@id\":\"https:\/\/www.goseeko.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/goseeko\",\"https:\/\/x.com\/goseeko\",\"https:\/\/www.instagram.com\/goseeko\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/#\/schema\/person\/843a7ac71fc4ae8c177dbb7820f2dc9c\",\"name\":\"Gunjan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.goseeko.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/603118e8b67d49e1d7409d0214533c962209d94d08d298ce69d8e191ed573faa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/603118e8b67d49e1d7409d0214533c962209d94d08d298ce69d8e191ed573faa?s=96&d=mm&r=g\",\"caption\":\"Gunjan\"},\"url\":\"https:\/\/www.goseeko.com\/blog\/author\/gunjangoseeko\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the Phases of Compiler? - Goseeko blog","description":"The method of compilation includes the sequence of different stages. Each phases of the compiler takes a source programme in one representation and produces output in another representation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/","og_locale":"en_US","og_type":"article","og_title":"What is the Phases of Compiler? - Goseeko blog","og_description":"The method of compilation includes the sequence of different stages. Each phases of the compiler takes a source programme in one representation and produces output in another representation.","og_url":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/","og_site_name":"Goseeko blog","article_publisher":"https:\/\/www.facebook.com\/goseeko","article_published_time":"2022-04-09T07:03:08+00:00","article_modified_time":"2025-10-24T16:53:30+00:00","og_image":[{"width":2471,"height":2471,"url":"https:\/\/i0.wp.com\/www.goseeko.com\/blog\/wp-content\/uploads\/2021\/09\/GoSeeko_Stacked-logo-01.png?fit=2471%2C2471&ssl=1","type":"image\/png"}],"author":"Gunjan","twitter_card":"summary_large_image","twitter_creator":"@goseeko","twitter_site":"@goseeko","twitter_misc":{"Written by":"Gunjan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#article","isPartOf":{"@id":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/"},"author":{"name":"Gunjan","@id":"https:\/\/www.goseeko.com\/blog\/#\/schema\/person\/843a7ac71fc4ae8c177dbb7820f2dc9c"},"headline":"What is the Phases of Compiler?","datePublished":"2022-04-09T07:03:08+00:00","dateModified":"2025-10-24T16:53:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/"},"wordCount":413,"commentCount":0,"publisher":{"@id":"https:\/\/www.goseeko.com\/blog\/#organization"},"articleSection":["Computers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/","url":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/","name":"What is the Phases of Compiler? - Goseeko blog","isPartOf":{"@id":"https:\/\/www.goseeko.com\/blog\/#website"},"datePublished":"2022-04-09T07:03:08+00:00","dateModified":"2025-10-24T16:53:30+00:00","description":"The method of compilation includes the sequence of different stages. Each phases of the compiler takes a source programme in one representation and produces output in another representation.","breadcrumb":{"@id":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.goseeko.com\/blog\/what-is-the-phases-of-compiler\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.goseeko.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is the Phases of Compiler?"}]},{"@type":"WebSite","@id":"https:\/\/www.goseeko.com\/blog\/#website","url":"https:\/\/www.goseeko.com\/blog\/","name":"Goseeko blog","description":"Learning beyond college, Students platform for life skills.","publisher":{"@id":"https:\/\/www.goseeko.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.goseeko.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.goseeko.com\/blog\/#organization","name":"Goseeko.com","url":"https:\/\/www.goseeko.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.goseeko.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i1.wp.com\/www.goseeko.com\/blog\/wp-content\/uploads\/2021\/09\/GoSeeko_Stacked-logo-01.png?fit=2471%2C2471&ssl=1","contentUrl":"https:\/\/i1.wp.com\/www.goseeko.com\/blog\/wp-content\/uploads\/2021\/09\/GoSeeko_Stacked-logo-01.png?fit=2471%2C2471&ssl=1","width":2471,"height":2471,"caption":"Goseeko.com"},"image":{"@id":"https:\/\/www.goseeko.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/goseeko","https:\/\/x.com\/goseeko","https:\/\/www.instagram.com\/goseeko\/"]},{"@type":"Person","@id":"https:\/\/www.goseeko.com\/blog\/#\/schema\/person\/843a7ac71fc4ae8c177dbb7820f2dc9c","name":"Gunjan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.goseeko.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/603118e8b67d49e1d7409d0214533c962209d94d08d298ce69d8e191ed573faa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/603118e8b67d49e1d7409d0214533c962209d94d08d298ce69d8e191ed573faa?s=96&d=mm&r=g","caption":"Gunjan"},"url":"https:\/\/www.goseeko.com\/blog\/author\/gunjangoseeko\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/posts\/7587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/comments?post=7587"}],"version-history":[{"count":3,"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/posts\/7587\/revisions"}],"predecessor-version":[{"id":12131,"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/posts\/7587\/revisions\/12131"}],"wp:attachment":[{"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/media?parent=7587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/categories?post=7587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.goseeko.com\/blog\/wp-json\/wp\/v2\/tags?post=7587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}