artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
# JOURNAL-parse
|
||||
|
||||
## Design decisions
|
||||
|
||||
- **Grammar**: classic 3-level recursive descent:
|
||||
- `expr → term (('+' | '-') term)*` (lowest precedence)
|
||||
- `term → unary (('*' | '/') unary)*` (medium)
|
||||
- `unary → '-' unary | primary` (right-recursive for stacked unary)
|
||||
- `primary → NUMBER | '(' expr ')'`
|
||||
- Left associativity falls out naturally from the `while` loops in `_expr` and `_term`.
|
||||
- Unary is right-recursive (`-` `-` 5 → nested Unary) as is conventional.
|
||||
- Empty input detected early at `parse()` entry before any descent.
|
||||
- Trailing tokens detected after `_expr()` returns, before EOF check.
|
||||
|
||||
## Test count: 31 (20 parser + 11 existing lexer)
|
||||
Reference in New Issue
Block a user