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
Class notes

PRINCIPLE OF PROGRAMMING LANGUAGE

Rating
-
Sold
-
Pages
5
Uploaded on
15-03-2023
Written in
2022/2023

Providing a quick notes to cover your entire syllabus for University exam.

Institution
Course

Content preview

Structure of Compiler
A compiler takes input as source program and produces as output an equivalence sequence of machine
instructions.

The compilation process is divided into a series of sub process called phases. A phase is a logically
cohesive operation that takes as input one representation of source program and produce as output i.e;
target program in other representation.


Phases of Compilation:
1. First Phase: lexical analyzer or scanner separate character of source language into a group of logically
belongs to each other. This group is called as tokens. The usual tokens are keywords such as do or if,
identifiers such as a or b, operator symbol as = + < > and punctuation symbol as () and comma. The
output is a stream of tokens pass to the rest of phases.
2. Second Phase: the syntax analyzer or parser group tokens together into syntactic structure for
example 3 tokens as A+B group together into syntactic structure as expression. Expression might further
be combined into statement. We form a tree who's leaf are tokens, an interior node represent string of
token that logically belong together. for example : the statement - if(5 equ max) goto 100 has 8 tokens.
3. Third Phase: intermediate code generator use the structure produced by syntax analyzer to create a
stream of simple instructions. Different style we are using like MACROS.

, 4. Fourth Phase: code optimization is an optional phase design to improve the intermediate code so that
object program run faster and take less space. Its output is also intermediate code but it saves time.
5. Fifth Phase: the final phase at code generation produce the object code by deciding on memory
location for data, selecting code and selecting register in which each computation done.
The table management or book keeping keeps track of the name and record and all the essential
information about each of the data type. The data structure which is used to record the information
called the symbol table.




SYNTAX AND SEMANTICS:
Syntax is the arrangement of elements and attributes to create well-formed documents.
Semantics is concerned with meaning.
Syntax is about the structure or the grammar of the language. It answers the question: how do I
construct a valid sentence? All languages, even English and other human (aka "natural")
languages have grammars, that is, rules that define whether or not the sentence is properly
constructed.

Written for

Course

Document information

Uploaded on
March 15, 2023
Number of pages
5
Written in
2022/2023
Type
Class notes
Professor(s)
Siddhant bhatt
Contains
All classes

Subjects

$10.99
Get access to the full document:

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

Get to know the seller
Seller avatar
siddhantbhatt

Get to know the seller

Seller avatar
siddhantbhatt Aakash
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
4
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 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