Academia.edu no longer supports Internet Explorer.
To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to upgrade your browser.
2000, Computer Languages
Associative Language Descriptions are a recent grammar model, theoretically less powerful than Context Free grammars, but adequate for describing the syntax of programming languages. ALD do not use nonterminal symbols, but rely on permissible contexts for specifying valid syntax trees. In order to assess ALD adequacy, we analyze the descriptional complexity of structurally equivalent CF and ALD grammars, finding comparable measures. The compression obtained using CF copy rules is matched by context inheritance in ALD. The family of hierarchical parentheses languages, an abstract paradigm of HTML, and of expressions with operator precedences is studied. A complete ALD grammar of Pascal testifies of the practicality of the ALD approach.
Theoretical Computer Science, 2002
The new Associative Language Description (ALD) model, a combination of locally testable and constituent structure ideas, is proposed, arguing that in practice it equals context-free (CF) grammars in explanatory adequacy, yet it provides a simple description and it excludes mathematical sets based on counting properties, which are rarely (if ever) used in compiler construction or in computational linguistics. The ALD model has been recently proposed as an approach consistent with current views on brain organization. ALD is a "pure", i.e., nonterminal-free definition. The strict inclusion of ALD languages in CF languages is proved, based on a lemma which strengthens the Pumping Lemma for CF languages. Basic nonclosure and undecidability properties are considered and compared with those of CF languages. It is shown that the hardest context-free language is in ALD, that there exists a hierarchy of ALD languages and that each ALD tree language enjoys the noncounting property of parenthesized CF languages. Typical technical languages (Pascal, HTML) can be rather conveniently described by ALD rules.
Informatica, 2000
We consider in this paper so called simple bracketed languages having special limita- tions. They are sometimes used for the definitions of some grammatical structures of programming languages. Generally speaking, these languages are context-free, but not deterministic context- free, i.e., they cannot be defined by deterministic push-down automata. For the simple bracketed languages having special limitations, the equivalence problem is decidable. We obtain the sufficient conditions for the representation some language by special sequences of simple bracketed languages. We also consider the examples of grammatical structures as the simple bracketed languages. Therefore, we can decide equivalence problem for some grammatical structures of programming languages, and such structures define neither regular, nor deterministic context-free languages.
2021
The article specifies the definitions of a Concrete Syntax Tree and an Abstract Syntax Tree. The different types of knowledge that are shared between a parser and builder modules in a parsing machine, about the syntax tree building, are discussed. For the building of the syntax tree, various Syntax Structure Construction Commands are presented. They are transmitted from the parser to the builder, depending on the type of tree. Template grammars and a computer program (Parser Generator Profiler) that performs parser tests on their basis are described. The empirical results from the different tests (for different combinations of grammar elements), performed with different types of syntax trees, for different parsers generated by different parser generators, are shown. The measurements are based on different criteria such as the time for the tree building, its traversal time, its destruction time, and the memory used by it.
Lecture Notes in Computer Science, 2007
An understandable concrete syntax and a comprehensible abstract syntax are two central aspects of defining a modeling language. Both representations of a language significantly overlap in their structure and also information, but may also differ in parts of the information. To avoid discrepancies and problems while handling the language, concrete and abstract syntax need to be consistently defined. This will become an even bigger problem, when domain specific languages will become used to a larger extent. In this paper we present an extended grammar format that avoids redundancy between concrete and abstract syntax by allowing an integrated definition of both for textual modeling languages. For an amendment of the usability of the abstract syntax it furthermore integrates meta-modeling concepts like associations and inheritance into a well-understood grammar-based approach. This forms a sound foundation for an extensible grammar and therefore language definition.
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, ...
Traditional formal methods of syntax description for programming languages (e.g. context free grammars) are not always convenient for practical applications. In some cases the language has quite weak syntactic structure and it is better to describe the correct programs using semantics of operations instead. There exists a class of widespread languages in practice that use stack machines for interpretation of programs , the so called stack based languages (Java virtual machine language 2], Forth, Postscript, etc.). Semantics of stack operations determines the language of correct programs in sense of parameter passing through the stack (see 4], 5], 6] and 7] for the details). This is one alternative method to deene the syntax of a stack based language. The main question is whether there exists a better way of deening the same language. In this paper we investigate systems of syntactic equations (general rewriting rules) on sequences of stack operations. Stack operations have certain eeect on the stack that can be described using input and output parameters. Stack eeect calculus allows to deene the language of correct sequences of stack operations (programs). It is important to know under which conditions the system of syntactic equations and the set of stack eeects deene the same language, because both methods seem to work better for stack based languages than context free grammars.
Theoretical Computer Science, 1994
Science 135 (I 994) 267-288 Elsevier 267
Acta Polytechnica Hungarica, 2021
A distinctive feature of concatenative languages is that a concatenation of their programs corresponds to a composition of meaning functions of these programs. At first programming in such languages may resemble assembly language programming. In spite of this, they also exhibit many similarities to high-level functional programming languages. We start our presentation with the definition of the language syntax. The main part of the paper consists of the definition of a meaning of programs in the language. To do this we employ a well-known method based on denotational semantics. We also informally introduce the language and its meaning as well as present its background and provide motivation for the work. Our exposition is accompanied by many examples and in the last part of the paper, we also discuss various language extensions and identify several proposals for further research.
1981
: A language's structures are some of its most important characteristics. These include the data structures -- those mechanisms that the language provides for organizing elementary data values. They also include the control structures, which organize the control flow. Less obviously, they include the same structures, which partition and organize the name space. Languages can be compared relative to their structures in the data, control, and name domains. This report describes a syntax-independent method of representing the structures of a language which facilitates visual complexity comparisons and is amenable to measurement. The data, control, and name structures of a number of languages are analyzed, including Pascal, LISP, Algol-60, Algol-68, the lambda calculus, FORTRAN, and Basic. (Author)
Lecture Notes in Computer Science, 1980
Research in progress is reported regarding a variation on attribute and affix grammars intended for describing the "static semantic" or "context-sensitive syntactic" constraints on programming languages. The grammars are oriented toward aDstract-syntax trees, rather than concrete-syntax strings. Attributes are also trees (only) and predicates are simply nonterminals, defined just as other nonterminals are, NOT in some extra-grammatical way. Moreover, trees are allowed as decorations on trees. Thus, the formalism is completely self-contained. The grammars are proposed for language specifications in reference manuals and for the automatic generation of practical compiler modules. Such a module is given an abstract-syntax tree, analyses it, and produces the checked, decorated tree as its result.
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.
Learning how to be programmer and uralitize the programming languages are the crucial point in computer science education. Programming languages are used by the students to write the program. Any machine needs a program to behave artificially intelligent or to perform any specific task. Any computing device is a useless without these programs. As every program is written in some specific programming language. Researchers are putting efforts in devising new languages to meets the goals and requirements of the specific domain of the programs that is going to be written in that language. Every programming language has its own semantics, nuances, and syntax with its pros and cons. For the early stage programmers these language specific details including semantics and syntax are hard to memorize or to familiar with it. Teachers often witness that these language specific barriers e.g., tough and confusing syntax of the language give hard time to students. Students generally stuck in learning the syntax and unconsciously learning programming skills go in back ground. This paper is going to present a Context-Free Grammar of a new programming language for early stage programing learners. In this language the hard part of syntax is relaxed by bring it to something that is close to their day to day communication so that they concentrate on logic and not on syntax.
ACM SIGPLAN Notices, 1989
SDF is a formalism for the definition of syntax which is comparable to BNF in some respects, but has a wider scope in that it also covers the definition of lexical and abstract syntax. Its design and implementation are tailored towards the language designer who wants to develop new languages as well as implement existing ones in a highly interactive manner. It emphasizes compactness of syntax definitions by offering (a) a standard interface between lexical and context-free syntax; (b) a standard correspondence between context-free and abstract syntax; (c) powerful disambiguation and list constructs; and (d) an efficient incremental implementation which accepts arbitrary context-free syntax definitions. SDF can be combined with a variety of programming and specification languages. In this way these obtain fully general user-definable syntax.
In our earlier research [9] an area of consistent and systematic application of software metrics was explored. Strong dependency of applicability of software metrics on input programming language was recognized as one of the main weaknesses in this field. Introducing enriched Concrete Syntax Tree (eCST) for internal and intermediate representation of the source code resulted with step forward over this weakness. In this paper we explain innovation made by introducing eCST and provide idea for broader applicability of eCST in some other fields of software engineering.
Journal of Computer and System Sciences, 1977
The paper introduces two new concepts, namely C-grammar and tree-codification, based on the theory of formal languages, by means of which we try to exhibit a new aspect of general coding theory. Both linear algebraic coding and convolutional coding are presented here as a particular case of tree-codification. The main result of the paper gathers the two new concepts mentioned above. Thus, Theorem 10 establishes that to each tree-codification corresponds a C-grammar in which that tree-codification can be achieved, and vice versa. Some examples are given justifying both the concepts and the assertion that any algebraic coding (linear or convolutional) can be looked upon as a treecodification.
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.
The Art, Science, and Engineering of Programming, 2019
Context: Meta programming consists for a large part of matching, analyzing, and transforming syntax trees. Many meta programming systems process abstract syntax trees, but this requires intimate knowledge of the structure of the data type describing the abstract syntax. As a result, meta programming is errorprone, and meta programs are not resilient to evolution of the structure of such ASTs, requiring invasive, fault-prone change to these programs. Inquiry: Concrete syntax patterns alleviate this problem by allowing the meta programmer to match and create syntax trees using the actual syntax of the object language. Systems supporting concrete syntax patterns, however, require a concrete grammar of the object language in their own formalism. Creating such grammars is a costly and error-prone process, especially for realistic languages such as Java and C++. Approach: In this paper we present Concretely, a technique to extend meta programming systems with pluggable concrete syntax patterns, based on external, black box parsers. We illustrate Concretely in the context of Rascal, an open-source meta programming system and language workbench, and show how to reuse existing parsers for Java, JavaScript, and C++. Furthermore, we propose Tympanic, a DSL to declaratively map external AST structures to Rascal's internal data structures. Tympanic allows implementors of Concretely to solve the impedance mismatch between object-oriented class hierarchies in Java and Rascal's algebraic data types. Both the algebraic data type and AST marshalling code is automatically generated. Knowledge: The conceptual architecture of Concretely and Tympanic supports the reuse of pre-existing, external parsers, and their AST representation in meta programming systems that feature concrete syntax patterns for matching and constructing syntax trees. As such this opens up concrete syntax pattern matching for a host of realistic languages for which writing a grammar from scratch is time consuming and error-prone, but for which industry-strength parsers exist in the wild. Grounding: We evaluate Concretely in terms of source lines of code (SLOC), relative to the size of the AST data type and marshalling code. We show that for real programming languages such as C++ and Java, adding support for concrete syntax patterns takes an effort only in the order of dozens of SLOC. Similarly, we evaluate Tympanic in terms of SLOC, showing an order of magnitude of reduction in SLOC compared to manual implementation of the AST data types and marshalling code. Importance: Meta programming has applications in reverse engineering, reengineering, source code analysis, static analysis, software renovation, domain-specific language engineering, and many others. Processing of syntax trees is central to all of these tasks. Concrete syntax patterns improve the practice of constructing meta programs. The combination of Concretely and Tympanic has the potential to make concrete syntax patterns available with very little effort, thereby improving and promoting the application of meta programming in the general software engineering context.
Transactions on Programming Languages and Systems, 1994
While a compiler produces low-level object code from high-level source code, a decompiler produces high-level code from low-level code and has applications in the testing and validation of safety-critical software. The decompilation of an object code provides an independent demonstration of correctness that is hard to better for industrial purposes (an alternative is to prove the compiler correct). But, although compiler compilers are in common use in the software industry, a decompiler compiler is much more unusual.It turns out that a data type specification for a programming-language grammar can be remolded into a functional program that enumerates all of the abstract syntax trees of the grammar. This observation is the springboard for a general method for compiling decompilers from the specifications of (non-optimizing) compilers.This paper deals with methods and theory, together with an application of the technique. The correctness of a decompiler generated from a simple occam-like compiler specification is demonstrated. The basic problem of enumerating the syntax trees of grammars, and then stopping, is shown to have no recursive solution, but methods of abstract interpretation can be used to guarantee the adequacy and completeness of our technique in practical instances, including the decompiler for the language presented here.
Lecture Notes in Computer Science, 2006
Metamodeling is raising more and more interest in the field of language engineering. While this approach is now well understood for defining abstract syntaxes, formally defining concrete syntaxes with metamodels is still a challenge. Concrete syntaxes are traditionally expressed with rules, conforming to EBNF-like grammars, which can be processed by compiler compilers to generate parsers. Unfortunately, these generated parsers produce concrete syntax trees, leaving a gap with the abstract syntax defined by metamodels, and further ad-hoc hand-coding is required. In this paper we propose a new kind of specification for concrete syntaxes, which takes advantage of metamodels to generate fully operational tools (such as parsers or text generators). The principle is to map abstract syntaxes to concrete syntaxes via bidirectional mapping-models with support for both model-to-text, and textto-model transformations.
Journal of Logic, Language and Information, 2009
Loading Preview
Sorry, preview is currently unavailable. You can download the paper by clicking the button above.