Skip to content
hrj edited this page Jan 8, 2016 · 5 revisions

Prior reading

sbt project structure

The top level project is comprised of three sub-projects:

  1. base
  2. cli
  3. gui

base contains the main code where all processing is done. The cli and gui provide the respective frontends, and they depend on base.

There are three main functionalities that the base module provides:

  • Parsing (convert string into an AST)
  • Processing (accept AST as input and then balance the transactions)
  • Reporting (take the output of Processing and create reports)

To run unit tests in the base module, you can run the following sbt task: base/test

Frontend code flow

The frontend ensures that the following are done in order:

  • Parse the command line arguments to determine settings (list of configuration files and list of ledger files)
  • Parse the configuration files
  • Parse all the ledger files into ASTs
  • Process the entries in the AST
  • Check constraints (cash should never be negative, etc)
  • Output all exports
  • Output all reports

Most of the implementation for the above resides in base project. The frontend just enforces the flow and takes care of formatting.

Base code and data flow

TODO

Clone this wiki locally