Analysis of Graphs by Ordering of Nodes
Journal of the ACM (JACM)
Tree-Manipulating Systems and Church-Rosser Theorems
Journal of the ACM (JACM)
Characterizations of Reducible Flow Graphs
Journal of the ACM (JACM)
Testing for the Church-Rosser Property
Journal of the ACM (JACM)
On the Composition of Well-Structured Programs
ACM Computing Surveys (CSUR)
Structured Programming with go to Statements
ACM Computing Surveys (CSUR)
Programming Style: Examples and Counterexamples
ACM Computing Surveys (CSUR)
BLISS: a language for systems programming
Communications of the ACM
Flow diagrams, turing machines and languages with only two formation rules
Communications of the ACM
A unified approach to global program optimization
POPL '73 Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Analysis of a simple algorithm for global data flow problems
POPL '73 Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Node listings applied to data flow analysis
POPL '75 Proceedings of the 2nd ACM SIGACT-SIGPLAN symposium on Principles of programming languages
A fast and usually linear algorithm for global flow analysis
POPL '75 Proceedings of the 2nd ACM SIGACT-SIGPLAN symposium on Principles of programming languages
The Elements of Programming Style
The Elements of Programming Style
The Theory of Parsing, Translation, and Compiling
The Theory of Parsing, Translation, and Compiling
Node listings for reducible flow graphs
STOC '75 Proceedings of seventh annual ACM symposium on Theory of computing
Structured programming and automatic program synthesis
Proceedings of the ACM SIGPLAN symposium on Very high level languages
Proceedings of a symposium on Compiler optimization
Automatic generation of efficient evaluators for attribute grammars
POPL '76 Proceedings of the 3rd ACM SIGACT-SIGPLAN symposium on Principles on programming languages
On attribute grammars and the semantic specification of programming languages.
On attribute grammars and the semantic specification of programming languages.
ACM SIGPLAN Notices
The scope of variable concept: the key to structured programming?
ACM SIGPLAN Notices
The chemistry of control structures
ACM SIGPLAN Notices
Control constructs for programming languages
ACM SIGPLAN Notices
The 'natural' set of basic control structures
ACM SIGPLAN Notices
Flowcharting loops without cycles
ACM SIGPLAN Notices
An unstructured view of structured programming
ACM SIGPLAN Notices
A mathematical theory of global program optimization (Prentice-Hall series in automatic computation)
A mathematical theory of global program optimization (Prentice-Hall series in automatic computation)
Programming languages and their compilers: Preliminary notes
Programming languages and their compilers: Preliminary notes
Elimination algorithms for data flow analysis
ACM Computing Surveys (CSUR)
A research environment for incremental data flow analysis
CSC '85 Proceedings of the 1985 ACM thirteenth annual conference on Computer Science
Implementing semantics of object oriented languages using attribute grammars
CSC '91 Proceedings of the 19th annual conference on Computer Science
Incremental data flow analysis
POPL '83 Proceedings of the 10th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
POPL '80 Proceedings of the 7th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
A comment on Chapin's and Denniston's "characteristics of a structured program"
ACM SIGPLAN Notices
Hi-index | 0.00 |
A standard approach to the analysis of program structure for the purpose of code optimization is to construct the "control flow graph" which models the possible execution paths through the program. Various graph algorithms can be applied to the control flow graph to produce data flow information, possible optimizations, etc. [A1,A2,AC,AU2,AU3,CS,HU1,HU2.HU3,Ke1,Ke2,Ke3,Ke4,Sc,U]. Studies of the form of typical control flow graphs indicate that such graphs tend to fall into a restricted subclass of general graphs. For example, empirical investigations have shown that the vast majority of program graphs have no multiple-entry loops [AC,HU2,HU3,Kn1].The recent work on "structured programming" has suggested that "good" programs fall into an even more restricted subclass. In fact, purists recommend that all programs be synthesized from three basic control structures: sequential statements, if-then-else statements, and single-entry single-exit loops [Di,Wi].Formal language theory [HoU] has given us a practical way to specify the set of strings which comprise a given language: via a grammar. It is then a natural idea to extend grammars from the strings to graphs in hopes of getting the same power of expression. Several researchers have used this approach [FKZ,J2,Ro].In this paper we study the applicability of a grammatical approach to describing the set of control flow graphs which arise from "good" programs in the sense proposed by many programming practitioners. The resulting flow graph language contains all those programs constructed according to the purists' rules and also admits programs with multiple-exit loops if such loops are constructed sensibly. The grammar we use is the "semi-structured flow graph" grammar GSSFG which was studied originally in [FKZ]. There are several appealing properties of this grammar; perhaps the most important, from the point-of-view of a compiler-writer, is the existence of a linear-time parsing algorithm which leads directly to a linear-time data flow analysis method [FKZ].In the present work we summarize the results from [FKZ] and address several new questions. First, how often do programs written by people with no knowledge of the SSFG rules fall into the language defined by GSSFG? In other words, is the language a natural one for programming? Second, once a program has been parsed according to GSSFG do benefits other than fast data flow analysis accrue?The paper is organized into three main sections. Section II introduces GSSFG and the parsing algorithm from [FKZ]. Section III is devoted to an empirical study conducted by the authors in an attempt to answer the question of naturalness, described above. Section IV discusses several applications of the graph parse in a "graph attribute grammar" framework. The summary at the end of the paper includes suggestions for further investigation.