Program structure (original) (raw)
Related papers
An Algorithmic Representation of the Syntax Diagram of a Computer Programming Language
2021
Every programming language has its own syntax rules. Such rules can be represented with either the Backus-Naur form (BNF) notation or with a Syntax diagram (also called a Railroad diagram). BNF uses text-based mathematical notations for defining those rules, while a Syntax diagram employs a graphical approach. Converting any of the two techniques to an algorithm or computer program is somewhat difficult for students due to the recursive expressions used by each of the techniques in defining the syntactic rules of a grammar. The aim of this work is therefore to showcase how an algorithm for one of such techniques (namely, a syntax diagram) can be written for easy understanding and implementation with a computer. A Finite State automata (FSA) approach was adopted by the researcher for modelling any given grammatical rule of a programming language for easy implementation with a computer. The grammatical rules for generating an integer number was arbitrarily selected by the researcher, ...
Implementation of Programming Languages Syntax and Semantics
2008
Unlike natural languages, programming languages are strictly stylized entities created to facilitate human communication with computers. In order to make programming languages recognizable by computers, one of the key challenges is to describe and implement language syntax and semantics such that the program can be translated into machine-readable code. This process is normally considered as the front-end of a compiler, which is mainly related to the programming language, but not the target machine.
Structure and Interpretation of Computer Programs
Structure and Interpretation of Computer Programs has had a dramatic impact on computer science curricula over the past decade. There are new implementations of most of the major programming systems in the book, including the interpreters and compilers, and the authors have incorporated many small changes that reflect their experience teaching the course at MIT since the first edition was published. A new theme has been introduced that emphasizes the central role played by different approaches to dealing with time in computational models: objects with state, concurrent programming, functional programming and lazy evaluation, and nondeterministic programming.
File Structures, Program Structures, and Attributed Grammars
IEEE Transactions on Software Engineering, 2000
A language for defining sequential file structures, characterized as nested sequences of records having in common certain keys and types, is presented. "Input schemata" are defined as program skeletons that contain all the necessary control structure to process a specified file. A method for obtaining an input schema from the corresponding file structure definition is given. The method is based on attributed grammars, and has been implemented in the programming language PROLOG. This constitutes a formalization of some aspects of the data-directed program design method of Jackson and Warnier. Examples of applications of this method to business data processing problems such as file updating and report generation are given. Index Terms-Attributed grammars, data-directed program design, data processing, logical construction of programs, logic programming, program generation, program structure, PROLOG, sequential file structures, software engineering.
An intermediate language to define dynamic semantics
Computer Languages, 1984
A~tract-An instruction set is given for an abstract machine which uses a pushdown stack as its principal memory. The proposed instructions serve the similar purposes of (1) defining the dynamic semantics of programming languages by describing the operations of programs on the abstract machine and (2) describing an intermediate language to be used in compiling programming languages into machine language. It is shown how the intermediate language can be used in the translation of the programming languages ADA, FORTRAN and PASCAL into IBM 360 assembly language and advantages over other intermediate languages such as three-address code and P-code.
Drawing execution graphs by parsing
In this paper we present an algorithm for drawing execution graphs. Such graphs represent the control flow in a program. The fact that a program is constructed according to a grammar is reflected in the corresponding execution graph. Therefore, we introduce graph production rules that are based on generally used programming language constructs. Each rule is applied to a certain class of topologies of the graph. By parsing an execution graph according to these rules a visually appealing layout of the graph can be generated. We take into account that the nodes in a graph can have variable sizes. Fonnalizing Process Algebraic Verifications in the Calculus of Constructions. p. 49. Concrete process algebra. p. 134.
Semantics of Programming Languages
2016
In these lecture notes we present a few basic approaches to the definition of the semantics of programming languages. In particular, we present: (i) the operational semantics and the axiomatic semantics for a simple imperative language, and (ii) the operational semantics and the denotational semantics for some first order and higher order, typed functional languages. We then present some basic techniques for proving properties of imperative, functional, and concurrent programs. We closely follow the presentation done in the book by Glynn Winskel [19]. I express my gratitude to my colleagues at the Department of Informatics, Systems, and Production of the University of Roma Tor Vergata, and to my students and my co-workers Fabio Fioravanti, Fulvio Forni, Maurizio Proietti, and Valerio Senni for their support and encouragement. Thanks to Michele Ranieri and Massimiliano Macchia for pointing out some imprecisions in a preliminary version of these lecture notes. Many thanks also to the Aracne Publishing Company for its helpful cooperation.
Dynamic Semantics for Language-Based Programming Environments Revisited
1999
Montages are a semi-visual language specification formalism recently proposed by some of the authors. This framework has been successfully used to give complete executable specifications of languages like C and Java. This paper compares Montages with action equations, both being paradigms for incorporating a means for specifying dynamic semantics in an environment generator using an attribute grammar framework. The major differences between the two lie in the way they specify the semantic processing at the nodes of the abstract syntax tree and how they specify control flow. Action equations use equations, similar in spirit to the semantic equations in attribute grammars, while Montages make use of Abstract State Machine rules to specify the semantic processing. Control flow in Montages is represented as state-transitions in a finite state machine which is specified using a graphical notation, while action equations specify control flow by propagating events from one node of the synt...