scispace - formally typeset
Journal ArticleDOI

The cost of lexical analysis

Reads0
Chats0
TLDR
This paper examines a common design for a lexical analyser and its supporting modules and recommends several specific design and optimization strategies that are also valid for software other than lexical analyseers.
Abstract
This paper examines a common design for a lexical analyser and its supporting modules. An implementation of the design was tuned to produce the best possible performance. In effect, many of the optimizations that one would expect of a production-quality compiler were carried out by hand. After measuring the cost of tokenizing two large programs with this version, the code was ‘detuned’ to remove specific optimizations and the measurements were repeated. In all cases, the basic algorithm was unchanged, so that the difference in cost is an indication of the effectiveness of the optimization. Comparisons were also made with a tool-generated lexical analyser for the same task. On the basis of the measurements, several specific design and optimization strategies are recommended. These recommendations are also valid for software other than lexical analysers.

read more

Citations
More filters
Book

Information Retrieval: Data Structures and Algorithms

TL;DR: For programmers and students interested in parsing text, automated indexing, its the first collection in book form of the basic data structures and algorithms that are critical to the storage and retrieval of documents.

Program Analysis and Specialization for the C Programming Language

TL;DR: This thesis presents an automatic partial evaluator for the Ansi C programming language, and proves that partial evaluation at most can accomplish linear speedup, and develops an automatic speedup analysis.
Journal ArticleDOI

A retargetable compiler for ANSI C

TL;DR: al. as mentioned in this paper developed a retargetable compiler for ANSI C, called lcc, which implements target-independent function tracing and expression-level profiling, simulating register declarations and partitioning switch statement cases into dense tables.
Journal ArticleDOI

The text editor Sam

TL;DR: Sam is an interactive multi‐file text editor intended for bitmap displays where a textual command language supplements the mouse‐driven, cut‐and‐paste interface to make complex or repetitive editing tasks easy to specify.

Practical algorithms for incremental software development environments

TL;DR: An integrated collection of algorithms and data structures to serve as the basis for a practical incremental software development environment and provides the first known method for handling C, C++, COBOL, and FORTRAN in an incremental framework derived from formal specifications.
References
More filters
Book

The C++ Programming Language

TL;DR: Bjarne Stroustrup makes C even more accessible to those new to the language, while adding advanced information and techniques that even expert C programmers will find invaluable.
Journal ArticleDOI

Efficient string matching: an aid to bibliographic search

TL;DR: A simple, efficient algorithm to locate all occurrences of any of a finite number of keywords in a string of text that has been used to improve the speed of a library bibliographic search program by a factor of 5 to 10.
Journal ArticleDOI

Minimal perfect hash functions made simple

TL;DR: In this article, a method for computing machine independent, minimal perfect hash functions of the form: hash value ← key length + the associated value of the key's first character + the corresponding value of a key's last character is presented.
Journal ArticleDOI

Automatic generation of efficient lexical processors using finite state techniques

TL;DR: The practical application of the theory of finite-state automata to automatically generate lexical processors is dealt with in this tutorial article by the use of the AED RWORD system, developed at M.I.T. as part ofThe AED-1 system.
Journal ArticleDOI

A Compaction Procedure for Variable-Length Storage Elements

TL;DR: A procedure for compacting the store such that all of the free space forms a single element large enough to satisfy the request of a dynamic storage allocation scheme.