Compiler Writing

PROGRAMMING LANGUAGES Interactions involving humans are most effectively carried out through the medium of language. Language permits the expression of thoughts and ideas, and without it, communication as we know it would be very difficult indeed. In computer programming, a programming language serves as a means of communication between the person with a problem and […]

Programming-Language Design (Compiler Writing) Part 1

A significant factor in the process of programming is the programming language being used. The language shapes the very thought processes of the programmer, and the quality of the language can greatly influence the quality of the programs produced. The importance of good language design cannot be understated. It is regrettable that many existing programming […]

Programming-Language Design (Compiler Writing) Part 2

Programming Effectiveness This topic is distinguished from the previous one, usability, by a rather fuzzy boundary. Roughly speaking, this subsection is concerned with the software- engineering aspects of language use rather than the convenience to the individual programmer. A major concern in software engineering is the recording of the decisions made during program development. The […]

Programming-Language Design (Compiler Writing) Part 3

Data Structure Four aspects of data structure will be considered in this subsection. First, a discussion of the alternative forms for data declarations is presented. Next, an overview of the variety of data types that are available in programming languages today and that should be considered if a new-language design is undertaken. The effects of […]

Programming-Language Design (Compiler Writing) Part 4

Control Structure There has been a great deal of controversy regarding the best choice for control-structure primitives. Much of the discussion centers around the inclusion or exclusion of the GOTO. It is almost universally agreed that it is better to use high-level control constructs rather than the unrestricted GOTO. It is equally widely accepted that […]

Programming-Language Design (Compiler Writing) Part 5

PRAGMATICS This section is concerned with certain aspects of the practice of programming-language design. In particular, we discuss a number of tools which can be used to specify a language, the problem of evaluating a language design, and language-implementation considerations. In any discussion of language-design tools, a few words should be said about terminology. Good, […]

Programming-Language Design (Compiler Writing) Part 6

Ada Programming Support Environment The original goals that led to the definition of the Ada language included the following: 1. Handle software throughout its life cycle. 2. Improve program reliability. 3. Promote the development of portable software. 4. Promote the development of software development tools. It became apparent from the beginning that these objectives could […]

Scanners (Compiler Writing) Part 1

The analysis of a source program during compilation is often complex. The construction of a compiler can often be made easier if the analysis of the source program is separated into two parts, with one part identifying the low-level language constructs (tokens) such as variable names, keywords, labels, and operators, and the second part determining […]

Scanners (Compiler Writing) Part 2

REGULAR GRAMMARS AND REGULAR EXPRESSIONS In Sec. 2-3, the grammar classification of Chomsky was introduced. In this section, one class of these grammars, the 7"3 or regular grammars, is discussed. Regular expressions are also described in this section, and an algorithm for converting a regular grammar to a regular expression is given. Both formalisms can […]

Scanners (Compiler Writing) Part 3

Nondeterministic Finite-State Acceptors Nondeterministic finite-state acceptors (NFA), or nondeterministic finite automata, are similar to deterministic finite-state acceptors except that there may be more than one possible state that is attainable from a given state for the same input character. Table 4-1 State Input 0 1 S B A A C S B S C C […]