Regular Expressions

The lexical analyzer needs to scan and identify only a finite set of valid string/token/lexeme that belong to the language in hand. It searches for the pattern defined by the…

Boomi Nathan

Finite Automata

Finite automata is a state machine that takes a string of symbols as input and changes its state accordingly. Finite automata is a recognizer for regular expressions. When a regular…

Boomi Nathan

RECOGNITION OF TOKENS

Consider the following grammar fragment: stmt → if expr then stmt | if expr then stmt else stmt | ε expr → term relop term | term                            term →…

Boomi Nathan

SPECIFICATION OF TOKENS

There are 3 specifications of tokens: 1)Strings 2) Language 3)Regular expression Strings and Languages ·         An alphabet or character class is a finite set of symbols. ·         A string over an alphabet is a finite sequence of…

Boomi Nathan

Tokens

Lexemes are said to be a sequence of characters (alphanumeric) in a token. There are some predefined rules for every lexeme to be identified as a valid token. These rules…

Boomi Nathan

Input Buffering in Compiler Design

The lexical analyzer scans the input from left to right one character at a time. It uses two pointers begin ptr(bp) and forward to keep track of the pointer of…

Boomi Nathan

Roles of the Lexical analyzer

Lexical analyzer performs below given tasks: Helps to identify token into the symbol table Removes white spaces and comments from the source program Correlates error messages with the source program…

Boomi Nathan

Starting & Reversing Problems in Marine Engines

There are a number of reasons for starting and reversing problems in marine engines. This malfunction is one of the most frightening and dangerous situations to encounter when maneuvering a…

senseadmin

Architecture

A compiler can broadly be divided into two phases based on the way they compile. Analysis Phase Known as the front-end of the compiler, the analysis phase of the compiler reads the…

Boomi Nathan

Lexical Analysis

Lexical analysis is the first phase of a compiler. It takes the modified source code from language preprocessors that are written in the form of sentences. The lexical analyzer breaks…

Boomi Nathan