Program Compilation Process :-
compilaton की प्रक्रिया को छह phases में विभाजित किया गया है, जिनमें से प्रत्येक एक symbol table manager और एक error handler के साथ intract करता है। इस compilation को विश्लेषण / संश्लेषण (analysis/synthesis) model कहा जाता है।
| Phases of compilation process |
Lexical Analysis : In a compiler, linnar analysis is called lexical analysis or scanning .It combines characters in the source file, to form a "TOKEN" .A token is a set of characters that does not have 'space', 'tab' and 'new line'. यह comments, generates symbol table and relocation table entries को भी हटाता है.
- Type mismatch
- Undeclared variable
- Reserved identifier misuse
- Multiple declaration of variable in a scope
- Accessing an out of scope variable
- Actual and formal parameter mismatch
intermediate code generation : एक compiler के analysis-synthesis model में, पहले एक compiler के सामने का अंत एक स्रोत प्रोग्राम का एक स्वतंत्र intermediate code में अनुवाद करता है, फिर compiler के पीछे का अंत target code उत्पन्न करने के लिए इस मध्यवर्ती कोड का उपयोग करता है ( जिसे समझा जा सकता है मशीन द्वारा)। compiler प्रक्रिया को अधिक कुशल बनाने के लिए और कई प्लेटफार्मों के लिए कई स्रोत भाषा में Program से compile के लिए we need to have less number of backend and frontend operations form compiling की आवश्यकता है। तो इस उद्देश्य के लिए हम intermediate code generation. के इस चरण का वर्णन करते हैं।
Code Optimization: In a general way, to make the execution of programs efficient, like usage of fewer resources and time efficient, the compiler will optimize our code up to some extent. We should write the codes by following some code tuning techniques.
Common optimizations include :
- removing redundant identifiers
- removing unreachable sections of code identifying common sub expressions
- unfolding loops
- eliminating procedures
- memory management
- register assignment
- machine-specific optimization
- report the error in a helpful way.
- correct the error if possible.
- continue processing (if possible) after the error to look for further errors.

0 Comments