summaryrefslogtreecommitdiff
path: root/chapter01/src/main/java
Commit message (Collapse)AuthorAgeFilesLines
* Parse standalone 0 as integerdibyendumajumdar2023-09-192-31/+13
|
* Overhaul LexerCliff Click2023-09-191-78/+67
| | | | | | | | | | | | Switched to bytes from chars, since we'll be parsing files eventually and typically compilers parse bytes from files (and not Java chars). Added a 'peek' to handle bad leading `--123` numbers. Used simpler number parsing; doesn't do doubles (yet). Added a filter for punctuation. Prior setup didn't handle multi-char punctuation like relation tests "<=". Switched the "EOF" marker char from 0 to Char.MAX_VALUE; harder to make mistakes, and simplifies the WS test. Switch javadoc comments to plain comments on private functions. Added tests for broken keyword, broken numbers, negative numbers.
* Merge branch 'main' of https://github.com/dibyendumajumdar/Simple into pr/2Cliff Click2023-09-181-1/+5
|\
| * Remove opcodesdibyendumajumdar2023-09-186-34/+18
| | | | | | | | Make the IdGenerator an input to the Parser
* | More edits to Chpt 1Cliff Click2023-09-186-90/+47
|/ | | | | | | | Add the Evil static global var, with appriopriate comments. Drop the singleton class, and every place it had to be passed. Much smaller code now, and will be a LOT smaller as the project grows. Drop the opcode; minor usages in prior implementations for performance, not needed here. Use the preview pattern match in test code to simplify.
* Chapter 01 implementationdibyendumajumdar2023-09-185-104/+183
|
* Start on parserdibyendumajumdar2023-09-176-30/+263
|
* Initial definition of nodes that will be relevant for chapter 1.dibyendumajumdar2023-09-177-0/+171
|
* Drop AST and parser and lexerdibyendumajumdar2023-09-075-714/+0
|
* Renamed Ast to AST.dibyendumajumdar2023-09-072-42/+42
|
* Removed all external code.dibyendumajumdar2023-09-075-82/+330
| | | | | | Removed the common chapter. Reimplemented Lexer. Revised the list of chapters to something more accurate.
* Avoid using Node as a type as the IR will need thisdibyendumajumdar2023-08-262-125/+124
| | | | | So just extends the top level Ast class in all the subtypes. Also avoid holding reference to lexer in parser.
* Update the lexer, parser and AST to match the language definition.dibyendumajumdar2023-08-262-63/+139
| | | | | | Add toString() method on AST nodes so that we can easily check the results of parsing. Remove AA lexer Move the Ecstasy lexer classes to one package, except Handy
* Reorganized the project as multi-maven moduledibyendumajumdar2023-08-252-0/+391
Updated README Added language module with grammar Split the code into common and chapter01 modules. Removed a number of utility classes that were imported from AA. Added github workflow file.