Results

**11 - 17**of**17**### Abstract Towards efficient, typed LR parsers

"... The LR parser generators that are bundled with many functional programming language implementations produce code that is untyped, needlessly inefficient, or both. We show that, using generalized algebraic data types, it is possible to produce parsers that are well-typed (so they cannot unexpectedly ..."

Abstract
- Add to MetaCart

(Show Context)
The LR parser generators that are bundled with many functional programming language implementations produce code that is untyped, needlessly inefficient, or both. We show that, using generalized algebraic data types, it is possible to produce parsers that are well-typed (so they cannot unexpectedly crash or fail) and nevertheless efficient. This is a pleasing result as well as an illustration of the new expressiveness offered by generalized algebraic data types. Key words: parsing, type safety, generalized algebraic data types 1

### On Hardcoding Finite State Automata Processing

"... Abstract. In this paper, we present various experiments in hardcod-ing the transition table of a finite state machine directly into string-recognizing code. Measurements are provided to show the time efficiency gains by various hardcoded versions over the traditional table-driven ap-proach. ..."

Abstract
- Add to MetaCart

(Show Context)
Abstract. In this paper, we present various experiments in hardcod-ing the transition table of a finite state machine directly into string-recognizing code. Measurements are provided to show the time efficiency gains by various hardcoded versions over the traditional table-driven ap-proach.

### Locating Free Positions in LR(k) Grammars*

"... LR(k) is the most general category of linear-time parsing. Before a symbol is recognized in LR parsing, it is difficult to invoke the semantic action associated with the symbol. Adding semantic actions to an LR(k) grammar may result in a non-LR(k) grammar. There are two straightforward approaches ad ..."

Abstract
- Add to MetaCart

LR(k) is the most general category of linear-time parsing. Before a symbol is recognized in LR parsing, it is difficult to invoke the semantic action associated with the symbol. Adding semantic actions to an LR(k) grammar may result in a non-LR(k) grammar. There are two straightforward approaches adopted by practitioners of parser generators. The first approach is to delay all semantic actions until the whole parse tree is constructed. The second is to add semantic actions to the grammar by chance. This paper presents an efficient algorithm for finding positions (called free positions) that can freely put semantic actions into an LR(k) grammar. The speedups of our method range from 2.23 to 15.50 times for the eight tested grammars. Keywords: parser generators, LR(k) grammars, semantic actions, parse tree, free positions 1.

### Hardcoding Finite Automata By

, 2003

"... ii The so-called conventional approach to implement finite automata is by mean of a matrix to represent the transition function. Of course, if the transition table is very sparse, linked lists might be used as an alternative. Such approaches therefore depend on the computer’s main memory capabilitie ..."

Abstract
- Add to MetaCart

(Show Context)
ii The so-called conventional approach to implement finite automata is by mean of a matrix to represent the transition function. Of course, if the transition table is very sparse, linked lists might be used as an alternative. Such approaches therefore depend on the computer’s main memory capabilities to optimally hold the table for better processing. For various computational problems using finite automata as a basic solution-model, the processing may be an important factor to be considered. This work aims to investigate a relatively new implementation approach that relies on hardcoding. A hardcoded algorithm uses simple instructions to represent the transition table. The algorithm is written in such a way that the transition matrix is part of its instructions as opposed to the traditional table-driven approach in which the table is external data that is to be accessed by the algorithm. This work includes a general performance analysis of both approaches through an empirical study. We firstly investigate the processing speed required to accept or reject a symbol by some randomly generated single states of some automata. Then, a more advanced experiment is performed based on the previous, for the test of acceptance of randomly generated strings by randomly generated finite automata. The main result of this work is that the hardcoded implementations of finite automata outperform the table-driven implementation up to some threshold. This therefore empha-sizes that many applications using finite automata as basic model may be optimized by replacing the table-driven implementation with a hardcoded implementation, resulting to better performances.