Language grammar #2
dr-orlovsky
started this conversation in
Languague Design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A top-level structure of the contractum file consists of sections in form of
Keywords for sections are:
use
imports*.ses
with symbol file*.sem
)*.con
source file or a compiled contractum library*.conlib
)*.ald
compiled librarytypes
defines new data typesschema
defines new schemasubschema
defines new subschemainterface
defines new interfaceimplement
provides an implementation of interface for a schemacontract
defines new contract genesistransition
defines new state transitionextension
defines new state extensionapplication
defines application-level code for the schemaEach section content consists of a list of declarations, each of which starts with a newline and may occupy multiple lines. Each declatation has the following form:
Thus, declaration consists of:
Seal
for theowned
declaration in theschema
section and()
for all other sectionsArgument declaration lists one or more arguments consisting of variable name and type name separated with non-line-breaking whitespace; the variable name can be omitted if the variable is not used in the declaration content.
Argument type name must be a valid strict encoding data type, or other declaration ident introduced in the same section.
Examples:
Reserved words (keywords) include section names and all declaration terms for all sections.
Case conventions:
schema
etc);SomeName
) with abbreviations written in caps (RGBName
);someVariable
)Beta Was this translation helpful? Give feedback.
All reactions