HamroCSIT Logo
HAMRO CSIT
  • Course New
  • Entrance
    • Entrance Preparation
    • MCQ Questions
    • Colleges
    • Entrance Class
    • Entrance Books
    • Free Entrance Video Course
  • Semester
    • First Semester
    • Second Semester
    • Third Semester
    • Fourth Semester
    • Fifth Semester
    • Sixth Semester
    • Seventh Semester
    • Eight Semester
  • Questions
  • Subscription Automated
  • Notices
  • Articles
  • More
    • Ask Question
    • College Ambassadors
    • Financial Support Program
    • Contribute
    • Contact Us
Login Register
Hamro CSIT User Account
  • Sign In
  • Create Account


Shape | Hamro CSIT Shape | Hamro CSIT Shape | Hamro CSIT Shape | Hamro CSIT

Questions

  • Ask Any Question From TU CSIT Syllabus?
Search
Semester
Subject
Answer
Order
HamroCSIT User
What is a macro? Differentiate between macro and procedure. Explain macro expansion with example.

Show the complete macro expansion for:

#define SQUARE(x) ((x) * (x))

#define MAX(a, b) ((a) > (b) ? (a) : (b))

#define CUBE(x) (SQUARE(x) * (x))

result = MAX(SQUARE(3), CUBE(2));

Not Answered Compiler Design and Construction
HamroCSIT User
Draw the detailed block diagram of a compiler showing all phases with inputs and outputs of each phase. Explain how symbol table and error handler interact with different phases of compilation.
Not Answered Compiler Design and Construction
HamroCSIT User
What is L-attributed definition? Differentiate between S-attributed and L-attributed definitions with examples.

Write an L-attributed syntax-directed definition for the following grammar that builds a syntax tree:

E → E₁ + T    

E → T

T → T₁ * F    

T → F

F → (E)       

F → id

Draw the annotated parse tree showing all attribute values for the input: id₁ + id₂ * id₃

Not Answered Compiler Design and Construction
HamroCSIT User
What is the difference between LR(0), SLR(1), and LR(1) parsing? Explain with examples when each would fail or succeed.

Compute the LR(1) items and construct the LR(1) parsing table for:

S’ → S

S → AA

A → aA | b

Show the parsing actions for the input string “aab”.

Not Answered Compiler Design and Construction
HamroCSIT User
Write short notes on:

a) Error recovery in parsing (panic mode, phrase-level recovery)
b) Parameter passing mechanisms (call by value, call by reference, call by name)

Not Answered Compiler Design and Construction
HamroCSIT User
What is register allocation? Explain register allocation using graph coloring algorithm. Given the following live ranges, perform register allocation with 3 registers available:

Variables: a, b, c, d, e

 

Live ranges overlap:

– a and b overlap

– b and c overlap  

– c and d overlap

– d and e overlap

– a and c don’t overlap

– b and e overlap

 

Draw the interference graph and assign registers.

Not Answered Compiler Design and Construction
HamroCSIT User
Explain the following code optimization techniques with examples:

  1. a) Copy propagation
    b) Constant folding
    c) Dead code elimination
    d) Strength reduction

Apply all applicable optimizations to:

x = 3;

y = x;

z = x + 5;

a = y * 2;

b = 8;

c = b / 2;

d = a + 0;

Not Answered Compiler Design and Construction
HamroCSIT User
Write syntax-directed definitions for translating boolean expressions into three-address code using backpatching. Generate code for:

if (a < b && c > d || e == f) 

    x = 1;

else

    x = 0;

Not Answered Compiler Design and Construction
HamroCSIT User
What is intermediate code? Explain the advantages of three-address code. Generate three-address code, quadruples, triples, and indirect triples for:

a = b * (-c) + d / e

Not Answered Compiler Design and Construction
HamroCSIT User
What are handles in LR parsing? Explain handle pruning with example. For the grammar:

E → E + T | T

T → T * F | F

F → (E) | id

Show the handle at each step for reducing the string: id + id * id

Not Answered Compiler Design and Construction
Page navigation
  • «
  • « First
  • Page 31
  • Page 32
  • Current Page 33
  • Page 34
  • Page 35
  • Last »
  • »
Question's Answer
Solution Video
Solution
Share

Share this link via

Or copy link

logoHAMROCSIT

Hamro CSIT is a comprehensive web and mobile platform that provides B.Sc. CSIT students with resources like notes, syllabi, question banks, solved past papers, practical files, and free entrance preparation materials — all in one place.

  • [email protected]
Semester
  • First Semester
  • Second Semester
  • Third Semester
  • Fourth Semester
  • Fifth Semester
  • Sixth Semester
  • Seventh Semester
  • Eighth Semester
Links
  • About Us
  • FAQs
  • Sitemap
  • Privacy Policy
  • Terms and Conditions
  • College Ambassadors
  • Financial Support Program
Hits Counter
20245002
Google Play App Store
Follow Us

Copyright 2026 | HAMROCSIT | All Right Reserved

Official Payment Partner Esewa Logo
HAMROCSIT.COM

Copyright 2024 | HAMROCSIT.COM | All Right Reserved - Nymna Technology