logo

Ambiguous Grammar and BNF Grammar in Programming

Assignment 1 for CS 331 requiring written solutions, no programming required.

6 Pages1081 Words79 Views
   

Added on  2023-04-21

About This Document

This document discusses the concept of ambiguous grammar and BNF grammar in programming. It explains the process of leftmost derivation, rightmost derivation, and parse tree. It also covers the use of EBNF in declaring grammar rules.

Ambiguous Grammar and BNF Grammar in Programming

Assignment 1 for CS 331 requiring written solutions, no programming required.

   Added on 2023-04-21

ShareRelated Documents
Programming
Ambiguous Grammar and BNF Grammar in Programming_1
Table of Contents
4 (a) Question.............................................................................................................................1
Question 6..................................................................................................................................3
Question 7..................................................................................................................................3
Ambiguous Grammar and BNF Grammar in Programming_2
4 (a) Question
The ambiguous grammar can be used for the context free grammar that can be
performed on the string, which can derive the process in two steps, where it can
include the leftmost derivation or the parse tree.
The given equation is,
It is possible to consider the terminal and non-terminal ambiguous variable { x, y, a, b, o, i }.
To find the parse tree, the following is used,
The left associative process is the production of left recursive function and the
right associative process can be considered for the production of the right
recursive function.
The ambiguous grammar is the semantic action, which can be used for adding
the parsers and displays the result on the arithmetic operation.
1
Ambiguous Grammar and BNF Grammar in Programming_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Compiler Construction: Context-Free Grammars and Top-Down Parsing
|2
|750
|282

Concepts of Programming Language
|15
|1712
|339