Ginni has Published 1522 Articles

What is Ambiguous Grammar?

Ginni

Ginni

Updated on 26-Oct-2021 08:59:12

21K+ Views

A Grammar that makes more than one Leftmost Derivation (or Rightmost Derivation) for the similar sentence is called Ambiguous Grammar.Example − Verify whether the following Grammar is Ambiguous or Not.E → E+E|E $\ast$ E|idSolutionFor string id + id * id, there exist two parse trees.E ⇒lm $\underline{E}$+E ⇒ id+ $\underline{E}$⇒ id+$\underline{E}$ $\ast$ ... Read More

What are Derivations?

Ginni

Ginni

Updated on 26-Oct-2021 08:38:45

5K+ Views

Derivations mean replacing a given string’s non-terminal by the right-hand side of the production rule. The sequence of applications of rules that makes the completed string of terminals from the starting symbol is known as derivation.It can derive terminal strings, beginning with the start symbol, by repeatedly replacing a variable ... Read More

What is Context-Free Grammar?

Ginni

Ginni

Updated on 26-Oct-2021 08:20:44

6K+ Views

Grammar − It is a set of rules which checks whether a string belongs to a particular language a not.A program consists of various strings of characters. But, every string is not a proper or meaningful string. So, to identify valid strings in a language, some rules should be specified ... Read More

What is the implementation of a Lexical Analyzer?

Ginni

Ginni

Updated on 26-Oct-2021 08:18:10

12K+ Views

Lexical Analysis is the first step of the compiler which reads the source code one character at a time and transforms it into an array of tokens. The token is a meaningful collection of characters in a program. These tokens can be keywords including do, if, while etc. and identifiers ... Read More

What is minimizing of DFA in compiler design?

Ginni

Ginni

Updated on 26-Oct-2021 08:09:57

4K+ Views

Minimizing means reducing the number of states in DFA. We have to detect those states of DFA whose presence or absence in DFA does not affect language accepted by DFA. These states can be eliminated from DFA.Algorithm: Minimization of DFAInput − DFA D1 with a set of states Q with ... Read More

Can we convert a non-deterministic finite automata into a deterministic finite Automata?

Ginni

Ginni

Updated on 26-Oct-2021 08:02:51

1K+ Views

Yes, we can convert a NFA into DFA. For every NFA there exists an equivalent DFA. The equivalence is defined in terms of languages acceptance. Since NFA is nothing but a finite automata in which zero, one or more transitions on an input symbols are permitted. It can always construct ... Read More

What is the conversion of a regular expression to finite Automata (NFA)?

Ginni

Ginni

Updated on 26-Oct-2021 07:39:21

34K+ Views

A Regular Expression is a representation of Tokens. But, to recognize a token, it can need a token Recognizer, which is nothing but a Finite Automata (NFA). So, it can convert Regular Expression into NFA.Algorithm for the conversion of Regular Expression to NFAInput − A Regular Expression ROutput − NFA ... Read More

What is Finite Automata in Compiler Design?

Ginni

Ginni

Updated on 26-Oct-2021 07:34:11

5K+ Views

An automata is an abstract model of digital computers with discrete inputs and outputs. Every automata include a mechanism for reading inputs. It is considered that input is a string over a given alphabet, written on an input file that the automata can read. The input file is divided into ... Read More

What are the Rules of Regular Expressions in Compiler Design?

Ginni

Ginni

Updated on 26-Oct-2021 07:30:48

4K+ Views

The language accepted by finite automata can be simply defined by simple expressions known as Regular Expressions. It is an effective approach to describe any language. A regular expression can also be represented as a sequence of patterns that represent a string. Regular expressions are used to connect character sequence ... Read More

What is Design of Lexical Analysis in Compiler Design?

Ginni

Ginni

Updated on 23-Oct-2021 12:17:36

15K+ Views

Lexical Analysis can be designed using Transition Diagrams.Finite Automata (Transition Diagram) − A Directed Graph or flowchart used to recognize token.The transition Diagram has two parts −States − It is represented by circles.Edges − States are connected by Edges Arrows.Example − Draw Transition Diagram for "if" keyword.To recognize Token ("if"), ... Read More

Advertisements