Functional-like imperative language based on attribute grammarsfor Exploiting Lazy Evaluation for the Grammar Attributes of Non-Terminals Elegant started as a compiler generator based on attributed grammars and has grown into a full programming language. Although it has been inspired by the abstraction mechanisms found in modern functional languages, Elegant is an imperative language that does not discourage side-effects. Structures: Related languages
References: Elegant oers the facility to specify a compiler by means of an attribute grammar. Any non-cyclic attribute dependency relation is allowed. Attributes are implemented by lazy evaluation. Local as well as global attributes are available as user friendly extensions of the attribute grammar formalism. Context conditions can be defined as (condition, message) pairs. Elegant can generate LL(1), LALR(1) and back-tracking parsers. Elegant is an imperative language, ordering a modern type system, which incorporates sub-typing, parameterized types, polymorphic functions and a powerful novel technique for the analysis of types by means of pattern matching. Moreover, the paradigm of lazy evaluation is supported by the ability to handle unevaluated expressions explicitly and by the notion of a relation, which is a generalization of an attribute grammar. An Elegant specification can be compiled into C modules. The Elegant tool is part of the Elegant compiler generator system, which is a software package consisting of several tools 1. A scanner definition. 2. A static semantics. This is a set of type declarations that model the structure of the language described. 3. An attribute grammar. This grammar maps an input text onto a data structure as described in the static semantics. As input it accepts type declarations augmented with syntax annotations. These annotations list for each type its syntactic representation. In addition, there are annotation for scope rules and symbol-table handling. An example of the use of the Front tool is the Elegant syntax diagram generator Diagrams. The front-end of this tool is fully generated from an EBNF specification. Front being a compiler, it is also generated with itself, so is the Elegant scanner generator ScanGen. Resources |