.gitignore added
Extract read values from reader object, store them.
addition works for integers
All operations work- rudimentary.
Refactored code for better abstraction
Empty cells are automatically set to 0
Regex for 0 updated. There are two major steps remaining: adding functionality for letter-number lookups and evaluating postfix expressions with multiple operators.
Tighten contraints on matching regexes. First step towards allowing for cell designators. Potential errors because cell range is not restricted in any way.
able to take a number or a cell operand; return value if a number, do nothing just yet if a cell
at this point, the cell value is returned. Dependencies need to be handled!
Better debug output
Tests reorganised: Test1 for simple binary operations on constants; Test 2 for simple binary operations on spreadsheet cell variables
#Assumption: There are no circular dependencies that indefinitely prevent evaluation of an expression.
# e.g. b2 = b1, b1 = b2.
#So we shall assume that every cell will evaluate to an expression, given sufficient iterations
#What might be a more efficient way of solving this? We have a system of equations that could be of any order...
#consider the case where a1 = b1 b1 b1 b1 b1 b1 * + * * * , i.e.  (b1^2 + b1 ) * b1^3
#For now I shall implement a brute force approach wherein I iteratively evaluate the matrix until all values are
#either constants or #ERRs. A better and more complete solution would lie in building a dependency graph,
#checking that there are no circular dependencies, then evaluating upwards from the leaves.
Updated regexes for binary operations.
Fix bug with order of letter and number indices. Abstract away emptyToZero. At this stage, a single run over the matrix results in correct binary postfix substituions
binary operations seem to work for letter-number expressions. Postfix stack evaluation remains to be implemented.
# This regex expects the first token to be a valid atomic expression.
# The next token can be a valid atomic expression or an operator
# At least one sequence of two valid atomic expressions and one operator must exist for the postfix to be valid and reduce to a binary postfix primitive
# Finally, we may have any number of atomic expressions and operators... the expression might be found to be invalid at some point in the evaluation process
# It also shouldn't match simple binary expressions- that is left to the other functions. This implies atleast one more atomic expression, either before or after it.
# (Just an extra operator is obviously invalid).
We can now obtain binary sub-expressions of our postfix expression. The next step is to use the binary operators to evaluate them.
Evaluating those expressions is all that remains. Some refactoring of the operator functions might be useful.
Refactored binary operations, abstracttion added