70a3118a99
'Minor' bug fix for the StatementList, forgot to set the capacity.
refactor
glm942022-04-04 19:44:13 +00:00
842473742e
Begun refactoring the Parser to generate a list of Stmt which the Interpreter will then execute (to be done).
glm942022-04-04 19:22:59 +00:00
73067fcc1f
Added statements to the Parser, currently just the Print and Expression statements. 8.1 isn't quite done yet, maybe half way there.
main
glm942022-03-23 19:43:46 +00:00
bf59a98628
Updated the Makefile, set debug option for the compiler, and fixed all the warnings generated by gcc with O2 optimization option for release builds.
interpreter
glm942022-03-18 17:01:15 +00:00
1e6bbb87d4
Cleaned up the Makefile, added the framework for checking for runtime errrors in the Interpreter and fixed a bug where I didn't close out the 'va_list' in the Match function in the Parser.
glm942022-03-17 18:58:23 +00:00
34557c92c3
Setup the Makefile to allow me to produce a release build and to create some directories if they're not there already.
glm942022-03-16 18:23:11 +00:00
b3693f17df
Updated the project structure, and modified the Makefile to hopefully be future proof so I can freely make sub-folders in the src/ folder and not have to worry about breaking the Makefile.
glm942022-03-16 18:07:37 +00:00
6daaaae7c2
Fixed a bug when the scanner parses a number and creates the token.
glm942022-03-16 00:00:17 -05:00
b072921304
Touched up the Scanner. Refactored the Interpreter some more, this time it's able to be run on simple expressions. String concatenation can be performed by the Interpreter however, numbers and Booleans are not being stored correctly in the Object structures.
glm942022-03-15 20:45:06 +00:00
d4dd459389
Fixed a bug with string parsing in the Scanner.
glm942022-03-15 18:37:25 +00:00
1ded68ddee
Fixed a bug in the IsTruthy function. The VisitBinaryExpression now processes more operations.
glm942022-03-14 19:20:03 +00:00
3044f23bcc
Creating an object of type Boolean should work correctly, as long as the Boolean value being passed is done so as a double*.
glm942022-03-14 16:52:47 +00:00
f666585f5f
More refactoring trying to get this cleaned up while trying to keep it easy(ish) to extend for later chapters. I'll never take namespaces for granted again...
glm942022-03-09 21:13:52 +00:00
e802c57a93
Trying a more object oriented approach and created an 'Object' struct to have metadata for the values the interpreter works with.
glm942022-03-08 22:08:06 +00:00
2d587e75b1
Extemely broken, but all the code up to 7.3 should be here, now the refactoring begins to make it C code and not Java code.
glm942022-03-07 19:22:39 +00:00
d39d20aa6e
Added a reminder in the Parser in the event of bad syntax.
glm942022-03-07 18:13:35 +00:00
5ea8079090
Updated the token to more reflect what was implemented in the book. Maybe not the right way to handle it but perhaps this setup will come in handy in later chapters.
glm942022-03-03 19:39:12 +00:00
d039a26c16
Fixed some bugs with the Scanner and Parser.
glm942022-03-02 22:30:53 -06:00
7bf7304bd4
Attempting to print the expression tree. I think the printing code is fine but the Parser is bugged and not building the tree correctly.
glm942022-03-02 21:43:22 +00:00
221d575c16
Further refactoring done. The Parser runs without crashing, however it's output is still to be checked and verified.
glm942022-03-02 21:24:58 +00:00
e20ccb8cfb
The Scanner has been refactored and some responsibilities were pulled from it. Confirmed working, the Parser still needs to be touched on however.
glm942022-03-02 20:52:40 +00:00
1b33468343
Added a Makefile, removed the build script and had to modify the function names for either the scanner or parser so they didn't collide. Refactoring should be the next step here.
glm942022-03-01 18:03:57 +00:00
41a04094e2
Added untested parser code, meaning most of chapter 6 has been implemented (but most likely, very poorly).
glm942022-02-28 20:13:59 +00:00
b72645aed0
Did a bit of refactoring and fixed the syntax so the union structs all have proper names.
glm942022-02-22 20:12:12 +00:00
693519a248
Starting chapter 5 now. This is the first part needed to start implementing the syntax tree.
glm942022-02-22 19:30:44 +00:00
227d566261
Not the cleanest way to do this but added in keyword detection.
glm942022-02-17 21:52:26 +00:00
c55a3434de
Implemented identifier detection but keywords in the programming language aren't detected yet.
glm942022-02-15 16:32:35 +00:00
aa7dff31ff
Implemented number parsing.
glm942022-02-15 15:59:17 +00:00
f1a468aebc
Added support for string literals.
glm942022-02-14 19:38:49 +00:00
5b90c98123
Fixed the '!=' detection bug.
glm942022-02-14 17:21:35 +00:00
db54e8f888
Added Peek() and Match() as well as a bugged '!=' detection.
glm942022-02-14 17:06:30 +00:00
7bdbb9f53a
Refactored the scanner and updated the Token struct to store the length of its lexeme to avoid malloc()ing new strings for every token.
glm942022-02-10 17:17:33 +00:00
2d84019e58
Created the list structure for the tokens to be stored and some helper functions.
glm942022-02-09 21:47:54 +00:00
d6a3935588
Setup a skeleton for the scanner.
glm942022-02-09 19:53:57 +00:00
68882d05a3
Added an interactive shell, well the start of one.
glm942022-02-07 19:53:29 +00:00
8dbd655c43
Implemented the file reading routine and added the skeleton for the interpreter.
glm942022-02-07 19:25:08 +00:00