Вы находитесь на странице: 1из 8

DISCLAIMER

I HEREBY MAKE NO CLAIM THAT THE SAME QUESTIONS WILL BE REPEATED OR ASKED IN THE INTERVIEW AND AS YOU DOWNLOAD THIS POWERPOINT SLIDES IT IS UNDERSTOOD THAT YOU ARE USING THESE SLIDES AT YOUR OWN RISK. FURTHER EVERY ATTEMPT HAS BEEN TAKEN TO ENSURE THAT THERE IS NO ERRATA IN THE DATA PROVIDED AND IF ANY FOUND IT IS UPTO YOU TO CORRECT IT. THIS IN NO WAY IS AN EXHAUSTIVE COLLECTION OF QUESTIONS.AS YOU DOWNLOAD THESE FILES IT IS UNDERSTOOD THAT YOU AGREE WITH ME. PLEASE MAIL ANY BUGS,REPORTS,SUGGESTIONS TO raghavarun@indiatimes.com

COMPILER DESIGN
Finite State Automaton(FSA) It is a triple(s,,T) S Finite set of states - Alphabet of source symbols T Finite set of state Transitions. Deterministic FSA(DFA) Transitions in a DFA are deterministic, that is at most one transition exists out of a state si from a symbol symb. Halts when 1) all symbols in the source string are recognized, or 2) a symbol cannot be recognized.

Compiler Design
Parsing Goals: To check the validity of a source string and To determine the syntactic structure of a source string. Top Down Parsing: To a grammar G attempts to derive a string identical to a source string through a sequence of derivations starting from the distinguished symbol from G. Recursive Descent Parser: A variant of top down parser without backtracking.

Compiler Design
Bottom Up Parsing A bottom up parser constructs a parse tree for a source string through a sequence of reductions. Macro Definition: Is enclosed between a macro header statement and a macro end statement.consists of A macro prototype statement One or more model statements and Macro preprocessor statements A macro call leads to macro expansion.

Compiler Design
Forward reference: A forward reference of a program entity is a reference to the entity which precedes its definition in the program. Grammar of a programming language: The lexical and Syntactic features of a programming language is specified by its grammar. A symbol is a finite sequence of symbols. { , , ,} are called meta symbols, to differentiate from terminate symbols.

Compiler Design
A grammar G of a language LG is a quadruple (,SNT,S,P) - set of Ts SNT set of NTs(noun,verb,etc.,) S is the distinguished symbol P is the set of productions Grammar is used for two purposes to generate valid strings and to recognize valid strings.

Compiler Design
Translator outputs a program form called object module for a program. The linker processes a set of object modules to produce a ready to execute program form called binary program. Translator is a program that takes as input a program written in one programming language and produces as output a program in another programming language. Phases of a compiler: Lexical and Syntax analysis. IC generation,Table management and Error Handling Code Optimization Code Generation.

Compiler Design
The scope of a name is the portion of the program over which it may be used. Non Deterministic Finite Automaton(NFA): Looks almost like a transition diagram, but edges can be labeled by as well as characters, and the same character can label two or more transitions out of one state. NFA accepts an input string x iff there is a path from the start state to some accepting state, such that the labels along that path spell out x. DFA: It has no transitions on input . For each state s and input symbol a, there is at most one edge labeled a leaving s.

Вам также может понравиться