The Cecil Language: Specification and Rationale, Version 2.1
Each Cecil implementation defines how programs are put together. The UW Cecil implementation defines a program to be a sequence of declaration blocks and statements, optionally interspersed with pragmas:
program ::= top_level_file top_level_file ::= { top_decl_block | stmt | pragma }Declaration blocks are comprised of a set of declarations that are introduced simultaneously; names introduced as part of the declarations in the declaration block are visible throughout the declaration block and also for the remainder of the scope containing the declaration block; the names go out of scope once the scope exits. Because the name of an object is visible throughout its declaration block, objects can inherit from objects defined later within the declaration block and methods can be specialized on objects defined later in the declaration block. In environments where the top-level declaration comprising the program is spread across multiple files, the ability to attach methods to objects defined in some other file is important.
The syntax of declarations is as follows:[1]
top_decl_block ::= { decl | pragma }The next four subsections describe objects, methods, fields, and predicate objects. Subsection 2.5 describes variables, statements, and expressions, and subsection 2.6 explains precedence declarations. Subsections 2.7 and 2.8 detail the semantics of message passing in Cecil. Subsection 2.9 describes include declarations and file structure in the UW Cecil implementation, and subsection 2.10 discusses pragmas.decl ::= object_decl | obj_ext_decl
| predicate_decl |method_decl | field_decl | let_decl | precedence_decl | include_decl
Generated with Harlequin WebMaker