Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

melbourne-cpp/2019-04-16-simple-spreadsheet

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inspect

Overview

Inspect is a very simple spreadsheet application.

This project is essentially experimental code - I wrote it while learning how to use Ragel and Lemon to build a parser. The build system was hacked together pretty quickly so that it would work on Mac. It should compile cleanly on Linux systems, but I have not tested this recently.

Dependencies

Build dependencies (these can be installed using a package manager such as 'apt' or 'brew'):

Vendored:

  • googletest (for unit tests only, included in 'vendor' directory)

Build

Inspect can be built using CMake. The recommended approach is to create a build directory, and to run 'cmake' from there. For example:

mkdir build
cd build
cmake ..
make

For Windows... you're on your own.

Usage

This project includes a miniature REPL (inspect_console) for interacting with a sheet. A sheet is really just a collection of cells that can be identified using typical spreadsheet addresses (e.g. A1, B2, C12, etc).

If you followed the build instructions above, you can start the REPL using:

./inspect_console

You'll be greeted with a > prompt, where you can assign formulas to cells. After each assignment, the current state of the sheet will be printed out, e.g.:

> A1 = 1
[1,1]: 1
> A2 = A1
[1,1]: 1
[1,2]: 1
> B3 = A2 * 2
[1,1]: 1
[1,2]: 1
[2,3]: 2
> B4 = B3 + A1 * 2
[1,1]: 1
[1,2]: 1
[2,3]: 2
[2,4]: 4
>

You can force the parser to treat a formula as a literal value, using an apostrophe ' instead of equals =:

> A1 'This is my literal
[1,1]: This is my literal
>

And you can inspect the formula and value of an individual cell:

> A1 = 2
[1,1]: 2
> A2 = A1 + 1
[1,1]: 2
[1,2]: 3
> A2
A2 = A1 + 1 = 3
>

The REPL will tell you if your input is invalid:

> Some invalid input
Error: Invalid input.
>

Project structure

  * etc          Contains lemon parser template
  * src          Source files
  * test         Test source files
  * vendor       Third party library dependencies

License

Inspect is licensed under the Simplified BSD License. See the LICENSE file for more information.

About

Simple spreadsheet formula parser / REPL, written in C++, using Ragel and Lemon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 49.9%
  • C++ 28.1%
  • Ragel 14.7%
  • CMake 3.8%
  • Yacc 3.5%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.