ExC v0.2.0 Filter View Source

Filters the outputs of Lexer.tokenize/1 and Parser.parse/2.

Link to this section Summary

Functions

Specs

Given the output of the Lexer, it prints any lexing errors or continues with the compilation if there are none.

Specs

Given the output of the Parser, it prints any parsing errors or continues with the compilation if there are none.

Link to this section Functions

Link to this function

filter_lexer_output(arg, source_code_path, verbose)

View Source

Specs

Given the output of the Lexer, it prints any lexing errors or continues with the compilation if there are none.

arg is a tuple that contains the following elements:

  • output_token_list: list of all the tokens found in the source code. Refer to Structs.Token for more information.
  • status: atom indicating if there was an invalid token in the source code.

source_code_path is the path to the file to be compiled.

verbose a boolean value indicating if the compiler should output all of its steps.

Link to this function

filter_parser_output(arg, source_code_path, verbose)

View Source

Specs

Given the output of the Parser, it prints any parsing errors or continues with the compilation if there are none.

arg is a tuple that contains the following elements:

  • status: atom indicating if there was an invalid token in the source code.
  • output_abstract_syntax_tree: Abstract Syntax Tree (OAST) generated given Output Token List (OTL).
  • token_list: list of all the bad tokens found in the source code
  • error_cause: string containing the cause of the bad tokens.

source_code_path is the path to the file to be compiled.

verbose a boolean value indicating if the compiler should output all of its steps.