donet_core

Module parser

source
Expand description

Module of libdonet that contains the Context Free Grammar definition of the DC file language, the process of generating the DC file Abstract Syntax Tree, and the process of converting the AST into the final DC file class hierarchy structure that is used by the Donet daemon at runtime to be able to interpret network messages that follow the network contract defined in the DC file(s).

Modulesยง

  • ast ๐Ÿ”’
    Enum and Struct definitions that are used to build the DC File AST. Used by crate::parser::parser.
  • Errors that can be returned by the DC parser pipeline.
  • lexer ๐Ÿ”’
    Definition of the Lexer machine to process raw DC file string data into a stream of lexical tokens for the DC parser.
  • parser ๐Ÿ”’
    Definition of the DC language Context Free Grammar for the LALR(1) parser processing the stream of lexical tokens.
  • pipeline ๐Ÿ”’
    Defines the PipelineStage structure, which manages data stored in memory throughout the DC parser pipeline.
  • semantics ๐Ÿ”’
    The DC parser outputs an Abstract Syntax Tree, which is just a big nested structure that defines the declarations in the DC file. At runtime, the Donet daemon (and its services) need a class hierarchy structure in memory to access while processing network messages.

Functionsยง

  • dcparse_pipeline ๐Ÿ”’
    Runs the entire DC parser pipeline. The input is an array of strings that represent the input DC files in UTF-8, and the output is the final DC element tree data structure to be used by Donet.

Type Aliasesยง

  • InputFile ๐Ÿ”’
    Tuple that represents an input file for the DC parser. The first item is the filename, the second item is the file content.