Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.38 KB

Architecture.md

File metadata and controls

33 lines (18 loc) · 1.38 KB

Architecture

Procedure:

overview overview

  1. Take file as argument: fleck test.md

  2. if enabled the preprocessor takes over and replaces macros, writes the result to a temporary test.md.fleck file

  3. Lexer takes over and transforms the contents of the test.md.fleck file into a list of token

  4. Parser takes over and transforms the list of token into an abstract syntax tree

  5. Code generator takes over and transforms the ast into a test.html file

Fleck's sequences in depth

Preprocessor

The preprocessor iterates over every charachter of every line of the input file, looking for an '@' and a macro name after it. If it finds a macro it knows, it replaces / expands the macro with its contents.

The preprocessor has to be enabled via the --preprocessor-enabled flag, this is due to performance reasons, see e021abc

Lexer

The lexer iterates over every character of every line in the input file. It transforms characters into tokens and returns them, read more here

Parser

The parser creates an ast and allows the generator to write the resulting html to the file.