Showing posts with label Compiler. Show all posts
Showing posts with label Compiler. Show all posts

Thursday, 14 May 2020

Code Optimization Techniques in Compiler Design with Examples

                    In this post, we will see code optimization techniques in compiler design with examples, code optimization in compiler design, code optimization techniques, code optimization techniques, code optimization techniques in compiler design, code optimization techniques in compiler, code optimization techniques in compiler construction, Compiler Design, compiler design six phases, six phases of compiler.

Watch following video:



Watch on YouTube: https://www.youtube.com/watch?v=CTmIQxIMdJ8

Tuesday, 12 May 2020

How To Find First and Follow in Compiler Design Examples | How To Find First and Follow of a Grammar

                    In this video, we will see How To Find First and Follow in Compiler Design Examples, how to find first and follow of a grammar, how to find first and follow in compiler design, how to find first and follow in predictive parser, how to find first and follow of a grammar, how to find first and follow in compiler, how to find first and follow in compiler design in english

Blog link for How to find FIRST and FOLLOW of a grammar with examples:
https://www.comrevo.com/2015/08/how-to-find-first-and-follow-of-grammar-with-examples.html 


Watch following Video:



Watch on YouTube: https://www.youtube.com/watch?v=rnzGbQ3VjMU

Monday, 17 February 2020

Independent compilation in Java language


                    In this post, we will see Independent compilation in Java language

How to Create Header File in C / CPP or Independent compilation in C language

                    In this post, we will see How to Create Header File in C / CPP | Independent compilation in C language

Saturday, 15 February 2020

Side Effect of Aliasing with Example

                 In this post, we will see Side Effect of Aliasing with Example

How C / C++ Compiler evaluates arithmetic expression / Side Effect of Global Variables in C / C++

                   In this post, we will see How C / C++ Compiler evaluates arithmetic expression / Side Effect of Global Variables in C / C++.

Tuesday, 11 February 2020

Syntax Directed Translation Scheme (SDT)

What is SDT?
                     SDT stands for Syntax Directed Translation. SDT is combination of Grammar with Semantic Rules (Translation Rules).

e.g. 
S->AB {S.val=A.val+B.val}
A->a {A.val=a.lval}
B->b {B.val=b.lval}
                     This is Syntax Directed Translation (SDT). Here S->AB is grammar production while {S.val=A.val+B.val} is semantic rule or translation rule.

Wednesday, 8 November 2017

Lexical Analyzer for Sample Language

                       In this post, we will see LEX code to generate Lexical Analyzer for sample language.

Sunday, 28 May 2017

Interview / Viva Questions on Compiler Design

                          Following are the questions on "Compiler Design" generally asked in interviews. Go through them:

1. What is Compiler?


2. 
What is Editor, Preprocessor, Compiler, Assembler?

3. 
What is Linker and Loader?


Wednesday, 3 May 2017

LEX YACC program to check / recognize valid Arithmetic Expression

                  In this post, we will see LEX and YACC programs to check or recognize valid arithmetic expression. This expression may have operations like Addition(+), Subtraction(-), Multiplication(*), Division(/) or Modulus(%). Expression may contain balanced round brackets.
                 Explanation of the program, is given at the end of this post.
                Go through the following programs:

Monday, 3 October 2016

Recursive Descent Parser Example in C language

              In this post, we will see Recursive Descent Parser with an example and its implementation in C Language.

Tuesday, 9 August 2016

How To Construct CLR(1) or LR(1) Parsing Table

                      In this post, we will see how to construct CLR(1) or LR(1) parsing table for given grammar.

What is meaning of name CLR(1)???
C: Canonical
L: Left To Right Scanning of String
R: Reverse to Right Most Derivation
(1): Size of Look ahead is 1. 


How To Construct LALR(1) Parsing Table

                    In this post, we will see how to construct LALR(1) parsing table for given grammar.
                    If you know how to construct CLR(1) parsing table, then directly jump to LALR(1) Parsing Table: at the last section of the post.

What is meaning of name LALR(1)???
L: Look
A: Ahead
L: Left To Right Scanning of String
R: Reverse to Right Most Derivation
(1): Size of Look ahead is 1. 

How To Construct SLR(1) Parsing Table

                    In this post, we will see how to construct SLR(1) parsing table for given grammar.
                    SLR(1) is Bottom Up Parsing algorithm.

What is meaning of name SLR(1)???
S: Simple
L: Left To Right Scanning of String
R: Reverse to Right Most Derivation
(1): Size of Look ahead is 1. This means one symbol is considered at a time.

How To Construct LR(0) Parsing Table

                    In this post, we will see how to construct LR(0) parsing table for given grammar.
                    LR(0) is Bottom Up Parsing algorithm.

What is meaning of name LR(0)???
L: Left To Right Scanning of String
R: Reverse to Right Most Derivation
(0): Size of Look ahead is 0. In LR(0), the reduce action is not dependent on next symbol that is why it is 0.

Wednesday, 27 July 2016

How To Construct LL(1) Parsing Table


                  In this post, we will see how to construct LL(1) parsing table for the given grammar.
                   LL(1) is Top Down Parsing algorithm.

What is meaning of name LL(1)???
L: Left To Right Scanning of String
L: Left Most Derivation

(1): Size of Look ahead i.e. number of symbols under consideration is 1.

Friday, 22 July 2016

What are the Different Types of Parsers

                  In this post, we will see different types of parsers.

Monday, 18 January 2016

Concurrent YACC to Parse Input Text File

(With the help from Prof. Shailesh Cheke)
                In this post, we will see concurrent Lex-YACC program to parse a input text file which consists of several arithmetic expressions.
                To create threads, here we have used OpenMP API. To avoid race condition among threads to get access of global variables (like yylval, yyin, yytext), we have to use re-entrant parser. 

                Go through the following program: