(SEM V) THEORY EXAMINATION 2020-21 COMPILER DESIGN
SECTION A (Any 2 Questions Explained Briefly)
What is YACC?
YACC stands for Yet Another Compiler Compiler. It is a parser generator tool used to produce syntax analyzers for compilers. YACC takes a grammar specification as input and generates a parser that checks whether the source program follows the given grammar rules. It is commonly used along with LEX.
What do you understand by shift-reduce parsing?
Shift-reduce parsing is a bottom-up parsing technique used in syntax analysis. In this method, symbols are shifted onto a stack and then reduced using grammar rules to derive the start symbol. It is mainly used in LR parsers and is efficient for handling programming language grammars.
SECTION B (Any 2 Questions Explained)
Explain lexical, syntax and semantic phase errors.
Lexical errors occur during token formation, such as invalid identifiers or symbols. Syntax errors occur when the structure of the program does not follow grammar rules, like missing semicolons or brackets. Semantic errors arise when the meaning of the statement is incorrect, such as type mismatch or undeclared variables. These errors are detected in different phases of compilation.
Explain loop optimization.
Loop optimization is a code optimization technique used to improve program performance by reducing execution time. It involves techniques such as loop unrolling, loop invariant code motion and strength reduction. Since loops execute repeatedly, optimizing them significantly enhances overall program efficiency.
SECTION C (Any 2 Questions Explained)
Explain cross compiler.
A cross compiler is a compiler that runs on one machine but generates executable code for another machine with a different architecture. It is commonly used in embedded systems development where the target system does not have enough resources to run a compiler.
Explain ambiguity in grammar.
A grammar is said to be ambiguous if a single string can be derived in more than one parse tree. Ambiguous grammars create confusion in syntax analysis and must be converted into unambiguous grammars to ensure correct parsing and code generation.
Most Questions in This PDF Are Related To
Most questions in the Compiler Design (KCS-502) paper are related to phases of compiler, lexical analysis, syntax analysis, parsing techniques, grammar and automata, intermediate code generation, symbol tables, error handling, optimization techniques, and code generation. The paper mainly focuses on theoretical concepts and problem-solving related to compiler construction.
Related Notes
BASIC ELECTRICAL ENGINEERING
ENGINEERING PHYSICS THEORY EXAMINATION 2024-25
(SEM I) ENGINEERING CHEMISTRY THEORY EXAMINATION...
THEORY EXAMINATION 2024-25 ENGINEERING MATHEMATICS...
(SEM I) THEORY EXAMINATION 2024-25 ENGINEERING CHE...
(SEM I) THEORY EXAMINATION 2024-25 ENVIRONMENT AND...
Need more notes?
Return to the notes store to keep exploring curated study material.
Back to Notes StoreLatest Blog Posts
Best Home Tutors for Class 12 Science in Dwarka, Delhi
Top Universities in Chennai for Postgraduate Courses with Complete Guide
Best Home Tuition for Competitive Exams in Dwarka, Delhi
Best Online Tutors for Maths in Noida 2026
Best Coaching Centers for UPSC in Rajender Place, Delhi 2026
How to Apply for NEET in Gurugram, Haryana for 2026
Admission Process for BTech at NIT Warangal 2026
Best Home Tutors for JEE in Maharashtra 2026
Meet Our Exceptional Teachers
Discover passionate educators who inspire, motivate, and transform learning experiences with their expertise and dedication
Explore Tutors In Your Location
Discover expert tutors in popular areas across India
Discover Elite Educational Institutes
Connect with top-tier educational institutions offering world-class learning experiences, expert faculty, and innovative teaching methodologies