artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
# JOURNAL-parse
|
||||
|
||||
## Session 1
|
||||
|
||||
Built `calc/parser.py` — recursive-descent parser with grammar:
|
||||
- `expr → term (('+' | '-') term)*`
|
||||
- `term → unary (('*' | '/') unary)*`
|
||||
- `unary → '-' unary | primary`
|
||||
- `primary → NUMBER | '(' expr ')'`
|
||||
|
||||
Left associativity achieved via iterative loops (not recursion) in `expr` and `term`.
|
||||
Unary minus handled in its own `unary` rule, which recurses right.
|
||||
|
||||
Built `calc/test_parser.py` with 19 tests (35 total including lex tests) covering D1–D5.
|
||||
|
||||
All DoD gates passed on first run.
|
||||
Reference in New Issue
Block a user