summaryrefslogtreecommitdiff
path: root/chapter03/src/main/java
Commit message (Collapse)AuthorAgeFilesLines
* Fix div-by-0, some javadocCliff Click2023-11-012-3/+7
| | | | | higher level parsers can return null, but their return is ignored anycase. div-by-0 is defined to be 0, backported to ch2,3,4,5
* Backport fix for set_def killing new_def (#21)XmiliaH2023-10-291-3/+5
|
* Applied fix for #12 to chapter 3 (#15)Dibyendu Majumdar2023-10-274-67/+169
| | | | 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-0115-0/+1106
* 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>