Alternative Method to Check Ambiguity in Context Free Grammars

L. A. Alamirew

Abstract


Compilation of source code from different papers and books is a tedious and lengthy process. The result of the first phase of compilation, which is tokens, is given to the next phase called parsing which outputs a parse tree (also called syntax tree) to a grammar for a given input string. If there is more than one parse tree which are different with one another, then it calls the grammar as ambiguous grammar, or in short there exists an ambiguity in the grammar This paper tries to present an alternative method for checking the so called ambiguity problem in context free grammars by having an infix tree structure for a given input and comparing it with the corresponding parse trees and obtained from the given grammar in a top-down parsing approach


Keywords


Ambiguous grammar; Top-down parsing; Parse tree

Full Text:

PDF


   

ISSN : 2180-3811       E-ISSN : 2289-814X

Best viewed using Mozilla Firefox, Google Chrome and Internet Explorer with the resolution of 1280 x 800