-
Take file as argument:
fleck test.md
-
if enabled the preprocessor takes over and replaces macros, writes the result to a temporary
test.md.fleck
file -
Lexer takes over and transforms the contents of the
test.md.fleck
file into a list of token -
Parser takes over and transforms the list of token into an abstract syntax tree
-
Code generator takes over and transforms the ast into a test.html file
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
The lexer iterates over every character of every line in the input file. It transforms characters into tokens and returns them, read more here
The parser creates an ast and allows the generator to write the resulting html to the file.