[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-700985-105":59,"doc-detail-700985-en":130,"doc-similar-700985":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","the-hackers-guide-to-javac-an-introduction-to-java-compiler-internals","The Hacker's Guide to Javac - An Introduction to Java Compiler Internals","","The Hacker's Guide to Javac explains the Java compiler as open-source in the OpenJDK project and outlines its internal architecture and compilation phases. It walks through how javac parses Java source files into AST nodes, enters symbols, processes annotations, attributes syntax trees, performs data-flow checks, desugars constructs, and generates class or source outputs. It also demonstrates plugin-based extensions including hello world and AST rewriting that transforms assertion statements into if-throw expressions.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/the-hackers-guide-to-javac-an-introduction-to-java-compiler-internals/700985/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/the-hackers-guide-to-javac-an-introduction-to-java-compiler-internals/700985.png","ImageObject",300,407,{"name":92,"@type":93},"miaandmiso","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-19","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the purpose of this guide to javac?","Question",{"text":112,"@type":113},"It introduces hacking the Java compiler by explaining its internals and showing how to extend it with compiler plugins and examples.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Which compilation passes does javac run under the default compile policy?",{"text":117,"@type":113},"The document lists parse, enter, process annotations, attribute, flow, desugar, and generate, each responsible for specific analysis or transformation steps.",{"name":119,"@type":110,"acceptedAnswer":120},"What does the guide demonstrate as an extension example beyond “hello world”?",{"text":121,"@type":113},"It implements AST rewriting by casting JSR objects to compiler internal interfaces, replacing assertions with explicit if-throw expressions.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},700985,1794522630,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":19,"preview_urls":145},7971478544854,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","The Hacker's Guide to Javac  \nDavid Erni and Adrian Kuhn  \nUniversity of Bern, March 2008  \nAbstract  \nThis document is an introduction to hacking the Java compiler. An introduction to the Java compiler is given. Two examples are exercised, a simple hello world and a AST rewriting plugin.  \n1 Introduction  \nWith the release of Java 6, the Java compiler is available as open source. The compiler is part of the OpenJDK project, and can be downloaded from the Java compiler group website at [http://www.openjdk.org/groups/compiler/](http://www.openjdk.org/groups/compiler/) . However, for the purpose of this tutorial, any Java 6 installation will work 􀀌ne. The examples do not recompile the compiler, they just extend it.  \nThis document introduces the internals of the Java compiler. First we give a broad overview of its internal parts and phases, then we exercise two examples. Both examples use the compiler's novel plugin mechanism, which has been speci􀀌ed as JSR 269 . However, the second example goes way beyond JSR 269 . Casting to the JSR objects to their compiler internal interfaces, we implement AST rewriting. Our example replaces assertions statements with explicit if-throw expressions.  \n2 Java Compiler in a Nutshell  \nThis section summarizes the OpenJDKJava compiler passes and their documentation respectively. This section contains a short introduction to the main compiler passes.  \nThe compilation process is managed by the Java Compiler class that is de􀀌ned in com.sun.tools.javac.main. When the Java compiler is invoked with default compile policy it performs the following passes (see also Figure 1):  \n1. parse: Reads a set of * .java source 􀀌les and maps the resulting token sequence into AST-Nodes.  \n2. enter: Enters symbols for the de􀀌nitions into the symbol table.  \n3. process annotations: If Requested, processes annotations found in the specifed compilation units.  \n4. attribute: Attributes the Syntax trees. This step includes name resolution, type checking and constant folding.  \n5. 􀀍ow: Performs data􀀍ow analysis on the trees from the previous step. This includes checks for assignments and reachability.  \n6. desugar: Rewrites the AST and translates away some syntactic sugar.  \n7. generate: Generates Source Files or Class Files.  \nFigure 1: When the Java compiler is invoked with default compile policy it performs these passes.  \n2.1 Parse  \nTo Parse the 􀀌les, the compiler relies on the classes available under [com.sun.tools.javac.parser](com.sun.tools.javac.parser). * . As a 􀀌rst step, the lexical analyzer maps an input stream consisting of characters into a token sequence. Then the parser maps the generated token sequence into an abstract syntax tree.  \n2.2 Enter  \nDuring this step the compiler registers symbols for all the de􀀌nitions that were found into their enclosing scope. Enter consists of the following two phases:  \nDuring the 􀀌rst phase, all class symbols are registered with their corresponding scope. This is implemented by using a visitor that descends down the hierarchy, visiting all classes, including inner classes. The compiler attaches a MemberEnter object to each class symbol that will be used for completion in phase 2 .  \nIn the second phase these classes are completed using the MemberEnter object mentioned above. First step during completion is the determination of a class's parameters, supertype and interfaces. In a second step those symbols are entered into the class's scope (ignoring the class symbols that have been entered during the 􀀌rst step) . Unlike the 􀀌rst phase, the second one is lazily executed. The members of a class are entered as soon as the contents of a class are 􀀌rst accessed. This is achieved by installing a completer object in the class symbols. Those objects can invoke the member-enter phase on-demand.  \nFinally, enter adds all top-level classes to a todo-queue that will be used during the Attribution pass.  \n2.3 Process Annotations  \nIf an annotation processor is present and annotation","cbCaikHVhgjWT16B","https://ap.wps.com/l/cbCaikHVhgjWT16B","pdf",200295,18,"English","# Introduction\n## Java Compiler in a Nutshell\n## Parse\n## Enter\n## Process Annotations\n## Attribute\n## Flow\n## Desugar\n## Generate\n# What is JSR 269?","[{\"question\":\"What is the purpose of this guide to javac?\",\"answer\":\"It introduces hacking the Java compiler by explaining its internals and showing how to extend it with compiler plugins and examples.\"},{\"question\":\"Which compilation passes does javac run under the default compile policy?\",\"answer\":\"The document lists parse, enter, process annotations, attribute, flow, desugar, and generate, each responsible for specific analysis or transformation steps.\"},{\"question\":\"What does the guide demonstrate as an extension example beyond “hello world”?\",\"answer\":\"It implements AST rewriting by casting JSR objects to compiler internal interfaces, replacing assertions with explicit if-throw expressions.\"}]","The Hacker's Guide to Javac - An Introduction to Java Compiler Internals | PDF",45,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/d28db733f71e985e9ff2aee491a652aa.webp",983,1390,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/decd1ed4f18b3b3381aff48537bbc8f1.webp",982,1388,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/8d3ea61cc255e6e00689b7bcbe8b6dd0.webp",981,1387,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/66e57f21297dc68f4e9e1077cb3941b8.webp",980,1385,{"list":163,"token":66},[164,171,178,185,192,199,206,213,220,227],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":169,"category_name":30,"create_tm":170},347826,"Advanced java - Part 1 - How to create and destroy objects","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911558162/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=xJZ0rRMmf4oc0dRnFT790fO6FjQ%3D","advanced-java-part-1-how-to-create-and-destroy-objects",14,1790069260,{"doc_id":172,"doc_title":173,"file_type":137,"home_preview_img_url":174,"slug":175,"view_count":176,"category_name":30,"create_tm":177},115355,"Claude AI Bible - The Complete Guide to Mastering Claude, Claude Code, Claude Cowork, MCP, AI Agents, Automation & Advanced Prompting","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229831893665/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=yccc7ODCtnXq%2B2euVcYyrwyGbj0%3D","claude-ai-bible-the-complete-guide-to-mastering-claude-claude-code-claude-cowork-mcp-ai-agents-automation-advanced-prompting",913,1785472614,{"doc_id":179,"doc_title":180,"file_type":137,"home_preview_img_url":181,"slug":182,"view_count":183,"category_name":30,"create_tm":184},185,"XNX Universal Transmitter Installation Manual (Complete Guide) [Honeywell Official]","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693710157/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=kffj6JQTtUiTFRTQlthbGArt6VQ%3D","xnx-universal-transmitter-installation-manual",854,1776135954,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":190,"category_name":30,"create_tm":191},299143,"THE CANDLESTICK TRADING BIBLE - Trading Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229905832418/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=McncqgY0t%2BfnMHHmY4N1svvw7k8%3D","the-candlestick-trading-bible-trading-guide",804,1789767270,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":197,"category_name":30,"create_tm":198},176,"Free Fire Proxy Server","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693709822/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=ujBdZyFiHxWo5K%2BumG39CcNjrjc%3D","free-fire-proxy-server",565,1776135932,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":204,"category_name":30,"create_tm":205},129220,"Operations and Supply Chain Management - Eleventh Edition - Dedicated to students and faculty","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229840674154/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=39ZBY3GPyEhiSuKWf6ILSp%2BBTjA%3D","operations-and-supply-chain-management-eleventh-edition-dedicated-to-students-and-faculty",498,1786012506,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":211,"category_name":30,"create_tm":212},8566,"Trik Ngonten TikTok dari 0 Sampai FYP","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229696842324/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=vytAcjx1QD8xXAJNiecdyFoV%2Fck%3D","tiktok-content-tricks-from-0-to-fyp",489,1776338393,{"doc_id":214,"doc_title":215,"file_type":137,"home_preview_img_url":216,"slug":217,"view_count":218,"category_name":30,"create_tm":219},387603,"Building Applications with AI Agents - Multiagent Systems - Designing and Implementing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229916172328/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=DSZrNH94zCqkRVKSzAb62z%2FUIbc%3D","building-applications-with-ai-agents-multiagent-systems-designing-and-implementing",454,1790287169,{"doc_id":221,"doc_title":222,"file_type":137,"home_preview_img_url":223,"slug":224,"view_count":225,"category_name":30,"create_tm":226},14249,"EW 101: A First Course in Electronic Warfare","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229699258216/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=Epf09Rhba2K9g%2FAWiWtrV%2BBZGQg%3D","ew-101-a-first-course-in-electronic-warfare",438,1776558348,{"doc_id":228,"doc_title":229,"file_type":137,"home_preview_img_url":230,"slug":231,"view_count":232,"category_name":30,"create_tm":233},238737,"Spectrum Channel List 2026","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229894154298/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111399&Signature=HFpz74gh05Eh7v26UOtzsyu8a%2FI%3D","spectrum-channel-list-2026",436,1789139284]