The steps involved in the analysis of source program are given below.
Discuss the steps involved in the analysis of a source program with the help of a block diagram/ language processing system
The steps involved in the analysis of source program are given below.
When did first compiler start to appear?
Towards the end of the 1950s machine-independent programming languages
were first proposed. Subsequently several experimental compilers were
developed.
The first compiler was written by Grace Hopper, in 1952, for the A-0 programming language.
The FORTRAN team led by John Backus at IBM is generally credited as having introduced the first complete compiler in 1957.
COBOL was an early language to be compiled on multiple architectures, in 1960.
Now compiler can be implemented even as a student project.
The first compiler was written by Grace Hopper, in 1952, for the A-0 programming language.
The FORTRAN team led by John Backus at IBM is generally credited as having introduced the first complete compiler in 1957.
COBOL was an early language to be compiled on multiple architectures, in 1960.
Now compiler can be implemented even as a student project.
Write short notes on compiler construction tools.
For the construction of a compiler, the compiler writer uses different types of software tools that are known as compiler construction tools.
Compiler-construction tools are,
- Parser generators
- Scanner generators
- Syntax-directed translation engines
- Automatic code generators
- Data-flow engines
Show the different phases of compiler with figure.
Compiler translates an input source program written in any high-level
programming language into an equivalent target program in machine
language. As compilation is a complex process, it is divided into
several phases. A phase is a reasonably interrelated procedure
that takes input in one representation and produces the output in
another representation. The structure of compiler comprises various
phases as shown in Figure
Lexical analysis phase: Lexical analysis (also known as scanning)
is the first phase of a compiler. Lexical analyzer or scanner reads the
source program in the form of character stream and groups the logically
related characters together that are known as lexemes. For each lexeme, a token
is generated by the lexical analyzer. A stream of tokens is generated
as the output of the lexical analysis phase, which acts as an input for
the syntax analysis phase. Tokens can be of different types, namely, keywords, identifiers, constants, punctuation symbols, operator symbols, etc. The syntax for any token is:
Syntax analysis phase: Syntax analysis phase is also known as parsing. Syntax analysis phase can be further divided into two parts, namely, syntax analysis and semantic analysis.
Intermediate code generation phase:
In intermediate code generation phase, the parse tree representation of
the source code is converted into low-level or machine-like
intermediate representation. The intermediate code should be easy to
generate and easy to translate into machine language. There are several
forms for representing the intermediate code. Three address code is the
most popular form for representing intermediate code. An example of
three address code language is given below.
Code optimization phase:
Code optimization phase, which is an optional phase, performs the
optimization of the intermediate code. Optimization means making the
code shorter and less complex, so that it can execute faster and takes
lesser space. The output of the code generation phase is also an
intermediate code, which performs the same task as the input code, but
requires lesser time and space.
Code generation phase:
Code generation phase translates the intermediate code representation
of the source program into the target language program. If the target
program is in machine language, the code generator produces the target
code by assigning registers or memory locations to store variables
defined in the program and to hold the intermediate computation results.
The machine code produced by the code generation phase can be executed
directly on the machine.
Figure 1.7 Phases of a Compiler
where token_name is the name or symbol which
is used during the syntax analysis phase and value is the location of
that token in the symbol table.
• Syntax analysis: Parser uses the token_name token from the token stream to generate the output in the form of a tree-like structure known as syntax tree or parse tree. The parse tree illustrates the grammatical structure of the token stream.
• Semantic analysis: Semantic analyzer
uses the parse tree and symbol table for checking the semantic
consistency of the language definition of the source program. The main
function of the semantic analysis is type checking in which semantic
analyzer checks whether the operator has the operands of matching type.
Semantic analyzer gathers the type information and saves it either in
the symbol table or in the parse tree.
Symbol table management: A symbol table
is a data structure that is used by the compiler to record and collect
information about source program constructs like variable names and all
of its attributes, which provide information about the storage space
occupied by a variable (name, type, and scope of the variables). A
symbol table should be designed in an efficient way so that it permits
the compiler to locate the record for each token name quickly and to
allow rapid transfer of data from the records.
Error handler: Error handler is invoked whenever any fault occurs in the compilation process of source program.
Both the symbol table management and error handling mechanisms are associated with all phases of the compiler.
Define Compiler
A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).
The most common reason for wanting to transform source code is to create an executable program.
A compiler is a program that translates a source program written in some high-level programming language (such as Java) into machine code for some computer architecture (such as the Intel Pentium architecture).
The most common reason for wanting to transform source code is to create an executable program.
A compiler is a program that translates a source program written in some high-level programming language (such as Java) into machine code for some computer architecture (such as the Intel Pentium architecture).
Public IP addresses and Private IP addresses
Public IP addresses
A public IP address is any valid address, or number, that can be accessed over the Internet. Internet standards groups, such as the Network Information Center (NIC) or the Internet Assigned Numbers Authority (IANA), are the organizations responsible for registering IP ranges and assigning them to organizations, such as Internet Service Providers (ISPs).
In the Cloud(n) system, a public IP address is an identifier assigned to a virtual router on the network. Any resources that will be available over the Internet will require a public IP address. Public IP addresses can be added in the Cloud Console.
Private IP addresses
A private IP address is any number or address assigned to a device on a private TCP/IP Local Area Network that is accessible only within the Local Area Network. For a resource inside the Local Area Network to be accessible over the Internet, a device within the Local Area Network must be connected to the Internet with a public IP address, and the networking must be appropriately configured. The same Internet standards organizations have reserved the following three IP address ranges that will never be registered publicly:
A private IP address is assigned to each instance created in the Cloud(n) system. Consequently, each instance may only have one private IP address, and additional private IP addresses cannot be added.
A public IP address is any valid address, or number, that can be accessed over the Internet. Internet standards groups, such as the Network Information Center (NIC) or the Internet Assigned Numbers Authority (IANA), are the organizations responsible for registering IP ranges and assigning them to organizations, such as Internet Service Providers (ISPs).
In the Cloud(n) system, a public IP address is an identifier assigned to a virtual router on the network. Any resources that will be available over the Internet will require a public IP address. Public IP addresses can be added in the Cloud Console.
Private IP addresses
A private IP address is any number or address assigned to a device on a private TCP/IP Local Area Network that is accessible only within the Local Area Network. For a resource inside the Local Area Network to be accessible over the Internet, a device within the Local Area Network must be connected to the Internet with a public IP address, and the networking must be appropriately configured. The same Internet standards organizations have reserved the following three IP address ranges that will never be registered publicly:
|
First IP in block
|
Last IP in block
|
|
10.0.0.0
|
10.255.255.255
|
|
172.16.0.0
|
172.31.255.255
|
|
192.168.0.0
|
192.168.255.255
|
A private IP address is assigned to each instance created in the Cloud(n) system. Consequently, each instance may only have one private IP address, and additional private IP addresses cannot be added.
Explain why we need IP address
An Ip address is the address of our computer
and is needed to receive communication between your computer and the
WEB. It's the numeric address which computers use to locate Web sites,
servers and other computers throughout the Internet. If you're connected
to the Internet, you have one. The Web site you're surfing has one.
Subscribe to:
Posts (Atom)


