Thursday | 21 NOV 2024
[ previous ]
[ next ]

Started Work on PHP BASIC

Title:
Date: 2024-09-18
Tags:  php-basic

I've done the first part of setting up a web server to simply execute a template file and return the output.

This means that I can create template files with the keys being the path I want to handle and my server will get that template and execute it.


I immediately realized that my OPEN statement doesn't work properly as it doesn't build the blocks. I also need a RETURN function to short circuit a template on an error.

Note: I think my OPEN statement is now fixed after some work. I need to learn more about parsing and languages because I'm having trouble intuiting what the struture should look like for the blocks. When building a block, there are options to use an ELSE without a THEN and this results in some hacky behavior. I fixed it by having a rewrite step that will make sure there is always a THEN clause if its missing. I can't automatically add a missing ELSE clause however as I only have the current line at the time. I'm hoping this doesn't become an issue but I don't think it will be.

Note: I've added 2 new keywords now, STOP and NULL which both let me hard stop the rendering if there is an error and NULL is a noop so I can create THEN blocks that contain null and do nothing but exist.


I am going to need to implement the SELECT statement and EXECUTE statement before I can start working on my porting my blog over to this style of thinking.

Note: The select statement has been implemented and with the way I let EXECUTES happen means I can do sorted selections without adding extra code. Though it would probably be a good idea to add EXECUTE explicitly.


I'm not sure yet if this a useful path to go down. Writing two files isn't terrible but I would really like to write everything in a single file.

I think this is going to ultimately be a cool path but a slow one.