100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary The function of a compiler

Rating
-
Sold
-
Pages
1
Uploaded on
04-08-2022
Written in
2022/2023

This document describes the function of a compiler









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
August 4, 2022
Number of pages
1
Written in
2022/2023
Type
Summary

Content preview

COMPILER SOURCE CODE = COMPILER = MACHINE CODE
. A compiler is a complex machine that bridges the gap between 1.LEXICAL ANALYSIS
human-readable code and computer readable code
. The compiler first divides the source code into TOKENS. It’s
. At low level computers can only a small number of things kind of like a compiler is figuring out what the words are in the
. They can read and write to memory, and they can do math with program.
numbers they are holding
2.SYNTACTIC ANALYSIS
. An executable program is the one generated by a compiler
. The tokens are organized into a hierarchical structure known as
. an executable program is also a list of instructions for the processor a PARSE TREE, which is like figuring out what the gramma is in
to follow, written in binary. the program
. The instructions like… read these bites from memory, jump forward
this many lines, jump back this many lines, but only if this flag is set
3.SEMENTIC ANALYSIS
. The compiler recovers context about the program, including
MACHINE CODE variable function names.
. The machine code is a program expressed in a list of binary . this is the stuff that the compiler needs to keep track of in
instructions. different parts of the program.
. It is also the kind of programing that your computer can read . In our case the only contact we need is the variable (X) and the
main function is not that important.
SOURSE CODE
. The final step is to reverse the parse tree and figure out some
. Source code is a version of a program that a human understands.
machine code that would effectively do the same thing as a
THE FUNCTION OF A COMPILER source code.
Typically the does not go straight from the parse tree to the machine code it first
The compiler’s job is to take the source find the tokens, parses, contextualizes, and generates


code which is Human-readable and turns it
into machine code which is computer-
readable
R153,00
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ngxinjanaazille

Get to know the seller

Seller avatar
ngxinjanaazille Durban University of Technology
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
3 year
Number of followers
0
Documents
3
Last sold
-

0,0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions