Filters








3,768 Hits in 5.0 sec

Parser Combinators for Ambiguous Left-Recursive Grammars [chapter]

Richard A. Frost, Rahmatullah Hafiz, Paul Callaghan
Practical Aspects of Declarative Languages  
Some existing implementations are only able to handle limited ambiguity, some have exponential time and/or space complexity for ambiguous input, most cannot accommodate left-recursive grammars.  ...  Parser combinators are higher-order functions used to build parsers as executable specifications of grammars.  ...  Acknowledgements The authors would like to thank the referees for their careful reviews, constructive criticisms, and helpful suggestions.  ... 
doi:10.1007/978-3-540-77442-6_12 dblp:conf/padl/FrostHC08 fatcat:j2wytzanorg55hdt2von3x6544

Lazy Combinators for Executable Specifications of General Attribute Grammars [chapter]

Rahmatullah Hafiz, Richard A. Frost
2010 Lecture Notes in Computer Science  
specification of slide #8 For non-left recursive grammars, parsing complexity w.r.t. length of the input, n, is O(n 3 ), and for left recursive grammars, the complexity is O(n 4 ) − Our compact representation  ...  Require exponential time and space for ambiguous grammars e.g., grammars for NL 3.  ...  An example application A simple domain-specific NL interface: − The Attribute Grammar is a fully-general CFG with 15 nonterminals and 32 AG rules.  ... 
doi:10.1007/978-3-642-11503-5_15 fatcat:eu4qe4mrunfgvexamau7elhbki

Executable Specifications of Fully General Attribute Grammars with Ambiguity and Left-Recursion [chapter]

Rahmatullah Hafiz
2009 Lecture Notes in Computer Science  
A memoization technique is used with this non-strict method for efficiently processing ambiguous input.  ...  A top-down parsing algorithm has been constructed to accommodate any form of ambiguous context-free grammar, augmented with semantic rules with arbitrary attribute dependencies.  ...  For a left-recursive parser, this count is increased on recursive descent, and the parser is curtailed whenever the condition "lef t − recursive count of parser at j > #input − j + 1" succeeds.  ... 
doi:10.1007/978-3-642-01818-3_41 fatcat:57yekqmfgvei3bl5wg6qam2dve

Practical, general parser combinators

Anastasia Izmaylova, Ali Afroozeh, Tijs van der Storm
2016 Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation - PEPM 2016  
However, conventional parser combinators do not support left recursion, and can have worst-case exponential runtime.  ...  We used the approach presented in this paper as the basis for Meerkat, a general parser combinator library for Scala.  ...  Acknowledgments We thank Jurgen Vinju, Paul Klint, and the anonymous reviewers for their constructive feedback on earlier versions of this paper.  ... 
doi:10.1145/2847538.2847539 dblp:conf/pepm/IzmaylovaAS16 fatcat:o52lti4rdrgfjpml6jw6skju7m

A new top-down parsing algorithm to accommodate ambiguity and left recursion in polynomial time

Richard A. Frost, Rahmatullah Hafiz
2006 SIGPLAN notices  
However, a widely-held, and incorrect, view is that top-down processors are inherently exponential for ambiguous grammars and cannot accommodate left-recursive productions.  ...  It has been known for many years that exponential complexity can be avoided by memoization, and that left-recursive productions can be accommodated through a variety of techniques.  ...  Overview The goal of this research is to develop a method by which top-down parsers can accommodate ambiguity and left recursive grammars and be efficient enough for prototyping natural-language processors  ... 
doi:10.1145/1149982.1149988 fatcat:mqycdu7pnjbbjg7petiith6aue

TOOL PAPER: ScalaBison Recursive Ascent-Descent Parser Generator

John Boyland, Daniel Spiewak
2010 Electronical Notes in Theoretical Computer Science  
The generated parser uses the idea of "recursive ascent-descent parsing," that is, directly encoded generalized left-corner parsing.  ...  ScalaBison is a parser generator accepting bison syntax and generating a parser in Scala.  ...  Parser combinators are an embedded DSL in Scala for expressing EBNF-like grammars.  ... 
doi:10.1016/j.entcs.2010.08.032 fatcat:rriucofobjgrncuyzypo366qxi

Adaptive LL(*) parsing

Terence Parr, Sam Harwell, Kathleen Fisher
2014 Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications - OOPSLA '14  
ANTLR 4 generates ALL(*) parsers and supports direct left-recursion through grammar rewriting.  ...  The critical innovation is to move grammar analysis to parsetime, which lets ALL(*) handle any non-left-recursive contextfree grammar.  ...  Eelco Visser and Jurgen Vinju provided code to test isolated parsers from JS-GLR and Rascal. Etienne Gagnon generated SableCC parsers.  ... 
doi:10.1145/2660193.2660202 dblp:conf/oopsla/ParrHF14 fatcat:qst6nncejvbcjbk7bjopzltfx4

Adaptive LL(*) parsing

Terence Parr, Sam Harwell, Kathleen Fisher
2014 SIGPLAN notices  
ANTLR 4 generates ALL(*) parsers and supports direct left-recursion through grammar rewriting.  ...  The critical innovation is to move grammar analysis to parsetime, which lets ALL(*) handle any non-left-recursive contextfree grammar.  ...  Eelco Visser and Jurgen Vinju provided code to test isolated parsers from JS-GLR and Rascal. Etienne Gagnon generated SableCC parsers.  ... 
doi:10.1145/2714064.2660202 fatcat:vgnx37nbtnejzbvqeit55daiaq

GLL parsing with flexible combinators

L. Thomas van Binsbergen, Elizabeth Scott, Adrian Johnstone
2018 Proceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering - SLE 2018  
At SLE in 2014, Ridge presented the P3 combinator library with which parsers can be developed for left-recursive, nondeterministic and ambiguous grammars.  ...  A combinator expression in P3 yields a binarised grammar reflecting the expression's structure. The grammar is given to an underlying, generalised parsing procedure computing all derivations.  ...  The first problem is often avoided by refactoring parsers to remove left-recursion. Parser combinators can also be defined to remove left-recursion automatically [2] .  ... 
doi:10.1145/3276604.3276618 dblp:conf/sle/BinsbergenSJ18 fatcat:4atklujhc5bqzdygxabmcm6dsi

Safe Specification of Operator Precedence Rules [chapter]

Ali Afroozeh, Mark van den Brand, Adrian Johnstone, Elizabeth Scott, Jurgen Vinju
2013 Lecture Notes in Computer Science  
We evaluate our new approach by specifying the precedence rules from the OCaml reference manual against the highly ambiguous reference grammar and validate the output of our generated parser.  ...  We identify a problem with existing generalized context-free parsing and disambiguation technology: generating a correct parser for a language such as OCaml using declarative precedence specification is  ...  This creates the potential for supporting deeper ambiguities, and indirectly recursive expression grammars.  ... 
doi:10.1007/978-3-319-02654-1_8 fatcat:mv3nubex4jherokwl2cyxwalru

Parsing Mixfix Operators [chapter]

Nils Anders Danielsson, Ulf Norell
2011 Lecture Notes in Computer Science  
Efficient and simple implementations of parsers for languages with user-defined mixfix operators, based on the grammar scheme, are also discussed.  ...  A simple grammar scheme for expressions containing mixfix operators is presented.  ...  Acknowledgements We would like to thank Graham Hutton, Wouter Swierstra and the anonymous reviewers for useful feedback.  ... 
doi:10.1007/978-3-642-24452-0_5 fatcat:k2g2ykjpbjdaxmggp42p2i2c2a

Pure and declarative syntax definition

Lennart C.L. Kats, Eelco Visser, Guido Wachsmuth
2010 Proceedings of the ACM international conference on Object oriented programming systems languages and applications - OOPSLA '10  
Syntax definitions are pervasive in modern software systems, and serve as the basis for language processing tools like parsers and compilers.  ...  Mainstream parser generators pose restrictions on syntax definitions that follow from their implementation algorithm.  ...  Acknowledgements We thank Glenn Vanderburg and the anonymous referees for providing valuable feedback to improve the presentation of this paper.  ... 
doi:10.1145/1869459.1869535 dblp:conf/oopsla/KatsVW10 fatcat:7aw33mllmjakpgf3bjgopblwty

Parsing Expression Grammar and Packrat Parsing – A Review

Nikhil Mangrulkar S, Department of Computer Technology, Yeshwantrao Chavan College of Engineering, Nagpur, Maharashtra, India., Kavita Singh R, Mukesh Raghuwanshi, Shashidhar R, Department of Computer Technology, Yeshwantrao Chavan College of Engineering, Nagpur, Maharashtra, India., Department of Computer Engineering, G. H. Raisoni College of Engineering and Management, Pune, Maharashtra, India., Department of Electronics and Communication Engineering, Sri Jayachamarajendra College of Engineering, Mysuru, Karnataka, India.
2020 Journal of University of Shanghai for Science and Technology  
Bryan Ford presented Parsing Expression Grammars (PEGs) as an alternative to specify rules for programming language, along with a Packrat parser, based on an idea of memoization.  ...  From the entire overview presented, it has been observed that PEGs address the issue of undesired ambiguity in grammar for computer-oriented programming language, by not allowing any ambiguity in rules  ...  ., made modifications in memoization technique implemented by Packrat parser, to make it support left-recursive rules in grammar [10] .  ... 
doi:10.51201/12368 fatcat:vbbxget2azd6ng2fal5bohg3pq

Combinators for parsing expressions

Steve Hill
1996 Journal of functional programming  
The new combinators embody the mechanical grammar manipulations typically employed to remove left-recursion and hence help to avoid the possibility of a non-terminating parser.  ...  In particular, it describes a set of combinators for parsing expressions described by ambiguous grammars with precedence and associativity rules.  ...  The source for the combinators and cparen tool are available via anonymous ftp from ftp.ukc.ac.uk in the directory /pub/sah.  ... 
doi:10.1017/s0956796800001799 fatcat:mu7ziogpyjaard6dep4io3gkuu

Program extraction applied to monadic parsing

Ulrich Berger, Alison Jones, Monika Seisenberger
2015 Journal of Logic and Computation  
In [17] , Lickman formally verifies another technique for implementing monadic combinator parsers that can handle left-recursion in arbitrary context-free grammars.  ...  As in Section 7, we translate left-recursive grammar rules into weakly equivalent ones that are not left-recursive.  ... 
doi:10.1093/logcom/exv078 fatcat:5dqhqwqbqnepnbed6tya7d7fsu
« Previous Showing results 1 — 15 out of 3,768 results