ResearchBib Share Your Research, Maximize Your Social Impacts
Sign for Notice Everyday Sign up >> Login

Stack Based Implementation of Ordered Choice in Packrat Parsing

Journal: International Journal of Computer Science and Mobile Computing - IJCSMC (Vol.2, No. 11)

Publication Date:

Authors : ;

Page : 303-309

Keywords : Parsing; PEG; Packrat; CFG;

Source : Downloadexternal Find it from : Google Scholarexternal

Abstract

Packrat Parsing is a variant of recursive decent parsing technique with memoization by saving intermediate parsing result as they are computed so that result will not be reevaluated. It is extremely useful as it allows the use of unlimited look ahead without compromising on the power and flexibility of backtracking. However, Packrat parsers need storage which is in the order of constant multiple of input size for memoization. This makes packrat parsers not suitable for parsing input streams which appears to be in simple format but have large amount of data. In this paper instead of translating productions into procedure calls with memoization, an attempt is made to eliminate the calls by using stack without using memoization for implementation of ordered choice operator in Parsing expression Grammar (PEG). The experimental results show the possibility of using this stack based algorithm to eliminate the need of storage for memoization with a guarantee of linear parse time.

Last modified: 2013-11-30 16:32:22