Lecture 1 - Programming Language Compiler Flashcards
6 (Importance of Studying Programming Languages)
Importance of Studying Programming Languages
- To improve your ability to develop effective algorithms
- To improve use of your existing programming language
- To increase your vocabulary of useful programming constructs
- To allow better choice of programming language
- To make it easier to learn a new language
- To make it easier to design a new language
6 (Importance of Studying Programming Languages)
Importance of Studying Programming Languages
- To improve your ability to develop effective algorithms
- To improve use of your existing programming language
- To increase your vocabulary of useful programming constructs
- To allow better choice of programming language
- To make it easier to learn a new language
- To make it easier to design a new language
?
is a computer program that transforms code written in a high-level programming language into the machine code
Compiler and Interpretation
Compiler
?
It is a program which translates the human-readable code to a language a computer processor understands (binary 1 and 0 bits)
Compiler and Interpretation
Compiler
?
compiler is only program and cannot fix errors found in that program.
Compiler and Interpretation
Compiler
?
is a computer program, which coverts each high-level program statement into the machine code. This includes source code, pre-compiled code, and scripts.
Compiler and Interpreter
Interpreter
?
do the same job which is converting higher level programming language to machine code.
Compiler and Interpreter
compiler and interpreters
?
will convert the code into machine code (create an exe) before program run
Compiler and Interpreter
compiler
?
convert code into machine code when the program is run.
Compiler and Interpreter
Interpreters
?
Compiled code runs faster
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Compiler
?
Interpreted code runs slower
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Interpreter
?
? takes an inter program
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Compiler
?
? takes a single line of code
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Interpreter
?
? will parse all of the language statements for its correctness. If incorrect, throws an error
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Compiler
?
No linking of files or machine code generation
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Interpreter
?
If no error, the compiler will convert source code to machine
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Compiler
?
Source statements executed line by line during execution
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Interpreter
?
It links different code files into a runnable program
KEY DIFFERENCES OF COMPILER AND INTERPRETER
Compiler and Interpreter
Compiler
? reads the source code, outputs executable code
Role of Compiler
Compiler and Interpreter
Compliers
Translates software written in a ? into instructions that computer can understand.
Role of Compiler
Compiler and Interpreter
higher-level language
It converts the text that a programmer writes into a format the ? can understand.
Role of Compiler
Compiler and Interpreter
CPU
The process of ? is relatively complicated. It spends a lot of time analyzing and processing the program
Role of Compiler
Compiler and Interpreter
compilation
The executable result is some form of machine-specific ?
Role of Compiler
Compiler and Interpreter
binary code
The ? converts the source code line-by-line during RUN Time
Role of Interpreter
Compiler and Interpreter
interpreter
?
completely translates a program written in a high-level language into machine level language
Role of Interpreter
Compiler and Interpreter
Interpret
Interpreter allows evaluation and ? of the program while it is executing.
Role of Interpreter
Compiler and Interpreter
modification
Relatively less time spent for analyzing and processing the ?
Role of Interpreter
Compiler and Interpreter
program
Program execution is relatively slow compared to ?
Role of Interpreter
Compiler and Interpreter
compiler
(5) Compiler Construction Tools
Compiler Construction Tools
- Scanner generators
- Syntax-directed translation engines
- Parser generators
- Automatic code generators
- Data-flow engines
?
This tool takes regular expressions as input. For example LEX for Unix Operating System.
Compiler Construction Tools
Scanner generators
?
These software tools offer an intermediate code by using the parse tree.
Compiler Construction Tools
Syntax-directed translation engines
?
It has a goal of associating one or more translations with each node of the parse tree.
Compiler Construction Tools
Syntax-directed translation engines
?
A ? takes a grammar as input and automatically generates source code which can parse streams of characters with the help of a grammar.
Compiler Construction Tools
Parser generators
?
Takes intermediate code and converts them into Machine Language
Compiler Construction Tools
Automatic code generators
?
This tool is helpful for code optimization.
Compiler Construction Tools
Data-flow engines
?
Here, information is supplied by user and intermediate code is compared to analyze any relation.
Compiler Construction Tools
Data-flow engines
?
It is also known as data-flow analysis
Compiler Construction Tools
Data-flow engines
?
It helps you to find out how values are transmitted from one part of the program to another part.
Compiler Construction Tools
Data-flow engines