Monday, April 14, 2014

preprocessor explanation with example

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...

Wednesday, March 26, 2014

Why learn about compilers?

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...

Compiler Requirements

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...

Definations

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

FIRST AND FOLLOWS

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α...

Classification of parsing Techniques

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...

The Role of a Parser

 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...

Syntax Analysis

 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

Aho Alfred V. Pearson Education India, 1999 - 796 pages ...

A.A.Puntambekar Technical Publications, 01-Jan-2009 - 540 pages ...

compiler design by A.A.Putambekar

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

LINUX and UNIX Vi Editor Commonds

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...