Results 1 
6 of
6
Efficient Combinator Parsers
 In Implementation of Functional Languages, LNCS
, 1998
"... . Parser combinators enable the construction of recursive descent parsers in a very clear and simple way. Unfortunately, the resulting parsers have a polynomial complexity and are far too slow for realistic inputs. We show how the speed of these parsers can be improved by one order of magnitude usin ..."
Abstract

Cited by 11 (0 self)
 Add to MetaCart
. Parser combinators enable the construction of recursive descent parsers in a very clear and simple way. Unfortunately, the resulting parsers have a polynomial complexity and are far too slow for realistic inputs. We show how the speed of these parsers can be improved by one order of magnitude using continuations. These continuations prevents the creation of intermediate data structures. Furthermore, by using an exclusive orcombinator instead of the ordinary orcombinator the complexity for deterministic parsers can be reduced from polynomial to linear. The combination of both improvements turn parser combinators from a beautiful toy to a practically applicable tool which can be used for real world applications. The improved parser combinators remain very easy to use and are still able to handle ambiguous grammars. 1 Introduction Parser combinators [3, 6, 5, 8] are a beautiful illustration of the use of higher order functions and currying. By using a small set of parser combinators ...
Bottomup Grammar Analysis  A Functional Formulation
 Proceedings Programming Languages and SystemsESOP '94
, 1994
"... This paper discusses bottomup grammar analysis problems such as the Empty problem and the First problem. It defines a general class of bottom up grammar analysis problems, and from this definition it derives a functional program for performing bottomup grammar analysis. The derivation is purely ..."
Abstract

Cited by 7 (3 self)
 Add to MetaCart
This paper discusses bottomup grammar analysis problems such as the Empty problem and the First problem. It defines a general class of bottom up grammar analysis problems, and from this definition it derives a functional program for performing bottomup grammar analysis. The derivation is purely calculational, using theorems from lattice theory, the BirdMeertens calculus, and laws for listcomprehensions. Sufficient conditions guaranteeing the existence of a solution emerge as a byproduct of the calculation. The resulting program is used to construct programs for the Empty problem and the First problem. 1 Introduction Grammar analysis is performed in many different situations: Yacc tests whether or not its input grammar is LALR(1), parser generators contain functions for determining whether or not a nonterminal can derive the empty string (Empty) as part of determining the set of all symbols that can appear as the first symbol of a derived string (First), and for determining the ...
Constructing Functional Programs for Grammar Analysis Problems
 In Conference Record of FPCA '95, SIGPLANSIGARCHWG2.8 Conference on Functional Programming Languages and Computer Architecture
, 1995
"... This paper discusses the derivation of functional programs for grammar analysis problems, such as the Empty problem and the Reachable problem. Grammar analysis problems can be divided into two classes: topdown problems such as Follow and Reachable, which are described in terms of the contexts of n ..."
Abstract

Cited by 7 (3 self)
 Add to MetaCart
This paper discusses the derivation of functional programs for grammar analysis problems, such as the Empty problem and the Reachable problem. Grammar analysis problems can be divided into two classes: topdown problems such as Follow and Reachable, which are described in terms of the contexts of nonterminals, and bottomup problems such as Empty and First, which do not refer to contexts. In a previous paper we derive a program for bottomup grammar analysis problems. In this paper we derive a program for topdown grammar analysis problems by transforming the specification of an arbitrary topdown problem into a program. The existence of a solution is guaranteed provided some natural conditions are satisfied. Furthermore, we describe a general transformation that applies to both classes of grammar analysis problems. The result of this transformation is a program that avoids unnecessary computations in the computation of a fixed point. Constructor classes, which are used to abstract fr...
TIP in Haskell  another exercise in functional programming
 Proc. Glasgow Workshop on Functional Programming 1991
, 1991
"... Requests and Responses Working from the CTIP routine headers of Figure 1, it is a straightforward exercise to write most of the corresponding definitions of TipRequest and TipResponse shown in Figure 2. The introduction of the type YX for screen coordinates is perhaps the most immediately appare ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
Requests and Responses Working from the CTIP routine headers of Figure 1, it is a straightforward exercise to write most of the corresponding definitions of TipRequest and TipResponse shown in Figure 2. The introduction of the type YX for screen coordinates is perhaps the most immediately apparent change, but other less obvious changes are more significant. The new relationship of function and argument between TIP and the application means, first, that there is no need for requests Tstart or Tstop: tip simply wraps the evaluation of its argument in an appropriate context. Secondly, data TipRequest = data TipResponse = Tbell Tkey Char  Tbox YX YX  Tres Response  Tnobox YX YX  Tvoid  Ttitle String YX YX  Tyx YX  Tclear  Tmove YX  Trelmove YX  Tprintf YX Int String [String]  Tputc Char  Tputs String  Tread  Trefresh type YX = (Int,Int)  Treq Request  Tmax  Tpos Figure 2: Level 1 HTIP Interface. since tip controls all I/O on behalf...
A Trace Browser for a Lazy Functional Language
 In Proceedings of the Twentieth Australian Computer Science Conference
, 1997
"... This paper describes how to construct a tool that enables a programmer to view the evaluation behaviour of a lazy functional program. In the system presented, the program is first transformed so that on execution it produces a trace of expression evaluation, and this trace is passed to a browser whi ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
This paper describes how to construct a tool that enables a programmer to view the evaluation behaviour of a lazy functional program. In the system presented, the program is first transformed so that on execution it produces a trace of expression evaluation, and this trace is passed to a browser which provides facilities for the user to navigate over the trace. We concentrate on issues around browser design, namely the identification of suitable functionality for effective navigation, and a suitable architecture for its construction. A prototype browser is presented. Keywords Lazy functional languages, debugging. 1 Introduction Over the last decade or so lazy functional languages have become increasingly popular [7, 9], with modern languages such as Miranda 1 [25] and Haskell [8] being adopted as vehicles for teaching programming and formal reasoning techniques to computer science students [23]. Despite their growing popularity, programmers can find lazy functional languages challe...