Files @ e7977aeccd2e
Branch filter:

Location: CSY/reowolf/docs/spec/overview.md

mh
make assert() and put() statements, test all statementlike expressions
# Protocol Description Language Specification

The Protocol Description Language (PDL) will be specified in this document. There are several levels to the specification. To simplify the specification we will roughly follow the manner in which the language is lexed and parsed by the compiler. We begin by assuming a set of source code streams/files. The specification here assumes that the source file is ASCII-encoded, but the lexer will throw human-readable errors in case it isn't. The source file is lexed into tokens. Where each token has a specific meaning within the language. Although the compiler has tokens for line- and block-comments, these are not important for the parsing. Likewise, apart from the fact that it might serve as a separator between tokens, whitespace will be ignored in the tokenizer.

Having defined the possible tokens, we will assume that comments and whitespace no longer factor into the interpretation of the source code, and continue defining the layout of a single source file. Such a source file consists of pragmas, imports, type, and procedure definitions. These are all specified in terms of tokens. Procedure definitions may contain statements, which will be specified next. Finally we will specify the expressions that may appear within these statements.

Note that the entire language is not yet fully set in stone. Parts of the syntax and it's interpretation may change.

Please view the following documents (in roughly this order):

1. tokens.md
2. definitions.md
3. statements.md
4. expressions.md
5. validation.md