summaryrefslogtreecommitdiff
path: root/chapter03/README.md
Commit message (Collapse)AuthorAgeFilesLines
* Backport some of the code refactoring to previous chapters (#50)Dibyendu Majumdar2023-12-071-10/+10
| | | | | | | | | | | * #44 Revise docs and comments * #44 Add starting scope to xScopes * #44 back some of the code refactoring port to previous chapters * #44 add_def should not be public * #44 add_def should not be public. Rename method names so that they are camelcase
* Applied fix for #12 to chapter 3 (#15)Dibyendu Majumdar2023-10-271-2/+22
| | | | ScopeNode added to chapter 3 Revised the description for Chapter 3 and 4 to include ScopeNode.
* Chapter 3 - add vars and lexical scope. (#7)Dibyendu Majumdar2023-10-011-0/+98
* Chapter 3 - add vars and lexical scope. * Fix typo * Overhaul graph viz Makes the scopes pointing into the graph being build more visually appealing. Constants are a printed with just the constant value. * Fix control edge color * Fix missing grouping operator parse Add a parens test. Shorten names 'Identifier' to 'Id' _lexer.match -> match require() passes a Node thru, so can be flow-coded. Uniform syntax error messages. Handy Lexer.toString for debugging. Drop Optional for null returns; less total code; less objects; less confusion. camelCase some fcns. * All parser helpers return Node, not void. Drop _ret. parseBlock and parseStatement now the same. * CLosely align chap2 and chap3 parsers Mostly whitespace aligned; dragged a few functions around to make more sense. I think the diff from Ch2 and Ch3 is down a few differences about what is a statement, plus all the symbol stuff for scopes and variables. * Add examples illustrating the symbol table creation. * Update docs and comments --------- Co-authored-by: Cliff Click <cliffc@acm.org>