# Category Archives: Compiler Design

Problem: Write a Lex program for Decimal to Hexadecimal conversion. Explanation: Lex reads an input stream specifying the lexical analyzer and outputs source code implementing… Read More
Problem: Write a Lex program to find the Length of a String Explanation: FLEX (Fast Lexical Analyzer Generator) is a computer program that generates lexical… Read More
Lex is a computer program that generates lexical analyzers and was written by Mike Lesk and Eric Schmidt. Lex reads an input stream specifying the… Read More
Given a text file as input, the task is to replace a given word with another word in the file. Lex is a computer program… Read More
Problem: Write a Lex program to search a word in a file. Explanation: FLEX (Fast Lexical Analyzer Generator) is a tool/computer program for generating lexical… Read More
Loop Optimization is the process of increasing execution speed and reducing the overheads associated with loops. It plays an important role in improving cache performance… Read More
Lex is a computer program that generates lexical analyzers. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer… Read More
Lex is a computer program that generates lexical analyzers. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer… Read More
Given a number n, the task is to check whether the given n is even or odd using Lex program. Examples: Input : 10 Output… Read More
Lex is a computer program that generates lexical analyzers. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer… Read More
Prerequisite: Flex (Fast lexical Analyzer Generator) Given a string containing both vowels and consonants, write a LEX program to count the number of vowels and… Read More
Prerequisite – Construction of LL(1) Parsing Table, Classification of top down parsers  Parsing is the process to determine whether the start symbol can derive the… Read More
The lexical analyzer scans the input from left to right one character at a time. It uses two pointers begin ptr(bp) and forward ptr(fp) to… Read More
Bootstrapping is a process in which simple language is used to translate more complicated program which in turn may handle for more complicated program. This… Read More
Assembler is a program for converting instructions written in low-level assembly code into relocatable machine code and generating along information for the loader. It generates… Read More