Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 15 pages
Exam (elaborations)

Compiler Construction 2025/2026 Exam Questions and Verified Answers | Already Graded A+

Document preview thumbnail
Preview 2 out of 15 pages

Compiler Construction 2025/2026 Exam Questions and Verified Answers | Already Graded A+ What does the compiler take as input and produce as output? -

Content preview

Compiler Construction 2025/2026 Exam
Questions and Verified Answers |
Already Graded A+



What does the compiler take as input and produce as output? - 🧠ANSWER

✔✔Source program text - the source language, and outputs program target

for the machine - the target language

What is the difference between a compiler and an interpreter? - 🧠ANSWER

✔✔A compiler takes source language and outputs target language, which

is then executed accepting input and producing output. Interpreters don't

produce a target program as a translation, and instead appear to directly

take execute the operations specified in the source program on inputs

supplied by the user


What is LLVM? - 🧠ANSWER ✔✔set of libraries containing the clang

compiler, and C/C++/Objective-C compilers. Introduced to allow reuse of

the parser, for example, from a static compiler. Implements statically and

runtime compiled languages.




COPYRIGHT©JOSHCLAY 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
1
STATEMENT. ALL RIGHTS RESERVED

, LLVM allows you to provide a front and back-end and the LLVM optimiser

takes your AST and produces LLVM intermediate representation.


Give a flowchart of a language-processing system - 🧠ANSWER ✔✔source

program -> PREPROCESSOR -> modified source code -> COMPILER ->

target assembly program -> ASSEMBLER -> relocatable machine code ->

LINKER/LOADER -> target machine code

Describe the four stages of the Slang front end. What is the difference

between the Parsed AST and Internal AST? What does static.ml do? -

🧠ANSWER ✔✔We input the slang file, which is then parsed using LEX and

YACC. We then get a parsed AST Past.expr and do static analysis,

checking types, context-sensitive rules and resolve overloaded operators.

Then we remove syntactic sugar, file loc info and types. Then we get an

intermediate AST (Act.expr).




Parsed AST has expr as Boolean of loc * bool for example.

Locations are used for errors.




COPYRIGHT©JOSHCLAY 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
2
STATEMENT. ALL RIGHTS RESERVED

Document information

Uploaded on
April 10, 2025
Number of pages
15
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
JOSHCLAY
3.5
(83)
Sold
387
Followers
16
Items
20447
Last sold
4 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions