There are three basic
phases that are important in programming e.g. C- programming. The phases are
Pre-processing, compiling and Linking, only two phases are required: compiler
and linking.
prog.càPREPROCESSORà
temp.càCOMPILERà
prog.objàLINKERàprog.exe
A
preprocessor basically reads line by line from the input and replicates the
line to the output. If the line is a preprocessing statement, then it performs
the preprocessing directives. All preprocessing statements in C begin with the
# symbol and are at the beginning of a line. The...
Monday, April 14, 2014
Wednesday, March 26, 2014
Posted by Knowledegehub on 3:55 AM with No comments
Why learn about compilers?
Few people will ever be required to write a compiler for a general-purpose language like C, Pascal or SML. So why do most computer science institutions offer compiler courses and often make these mandatory Some typical reasons are:
It is considered a topic that you should know in order to be “well-cultured” in computer science.
A good craftsman should know his tools, and compilers are important tools for programmers and computer scientists.
The techniques used for constructing a compiler are useful for other purposes...
Posted by Knowledegehub on 3:43 AM with 1 comment
Compiler Requirements
Correctness.
Correctness
is absolutely paramount. A buggy compiler is next to useless in practice. Since
we cannot formally prove the correctness of your compilers, we use extensive
testing. This testing is end-to-end, verifying the correctness of the generated
code on sample inputs. We also verify that your compiler rejects programs as
expected when the input is not well-formed (lexically, syntactically, or with
respect to the static semantics), and that the generated code raises an
exception as expected if the language...
Posted by Knowledegehub on 2:52 AM with No comments
Definitions:
Translator
A device that changes a sentence from one language to another without change of meaning.
Compiler
A program that translates between programming languages.
Interpreter
A processor that compiles and executes programming language statements one by one in an interleaved manner.
Syntax
An alphabet and a set of rules defining spatial relationships between symbols and symbol sets in a language.
Semantics
The meanings assigned to symbols and symbol sets in a language.
Pragmatics
The...
Friday, October 4, 2013
Posted by Knowledegehub on 10:10 AM with No comments
FIRST:
If α is any string of grammar symbols, the FIRST (α) be the set of terminals
that begins strings derived from α.
If αà€,
then € is also in FIRST (α).
To compute FIRST (α) for all grammar
symbols ’X’, apply the following rules until no more terminals or € can be
added to any FIRST set.
1) If
x is terminal ,the FIRST(x)={x}
2) If
x is non terminal and xà
aα...
Posted by Knowledegehub on 10:04 AM with No comments

There
are two parsing techniques, these parsing techniques work on the following
principle
1.
The parser scans the input string from left to right and identifiers that the
derivation is leftmost or rightmost.
2. The parser makes use of production
rules for choosing the appropriate derivation. The different parsing techniques
use different approaches in selecting the appropriate rules for derivation and
finally a parse tree is constructed.
When...
Posted by Knowledegehub on 10:01 AM with No comments

In this process of
compilation the parser and lexical analyzer work together. That means, when
parser required string of tokens it invokes lexical analyzer .In turn, the
lexical analyzer supplies tokens to syntax analyzer (parser).
The parser collects sufficient number of
tokens and builds a parse tree. Then by building the parse tree, parse smartly
finds the syntactical errors if any. It is also necessary that the parse should
recover...
Posted by Knowledegehub on 9:58 AM with No comments
The parser or syntax analysis checks
for whether the string given can be generated from the given grammar.
A parser for grammar G is a program that
takes as input a string w and produces as output either a parser tree for w, if
w is a sentences of G, or an end message indicating that w is not a sentence of
G. ...
Thursday, October 3, 2013
Posted by Knowledegehub on 3:11 AM with No comments
Aho Alfred V.
Pearson Education India, 1999 - 796 pages
...
Posted by Knowledegehub on 3:09 AM with No comments
A.A.Puntambekar
Technical Publications, 01-Jan-2009 - 540 pages
...
Posted by Knowledegehub on 3:06 AM with 9 comments
A.A.Puntambekar
Technical Publications, 01-Jan-2010 - Compilers (Computer programs) - 461 pages
Overview of Compilation : Phases of compilation - Lexical analysis, Regular grammar and regular expression for common programming language features, Pass and phases of translation, Interpretation, Bootstrapping, Data structures in compilation - LEX lexical analyzer generator.Top Down Parsing : Context free grammars, Top down parsing, Backtracking, LL (1), Recursive descent parsing, Predictive parsing, Preprocessing steps required for predictive parsing.Bottom...
Wednesday, July 11, 2012
Posted by Knowledegehub on 11:34 PM with No comments
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
MicrosoftInternetExplorer4
...
Subscribe to:
Posts (Atom)