Game
Robot Unlock
13 years ago

The long journey from character to AST... begins elsewhere


Since we’re in full compiler-compiler season I thought it would be appropriate for me to also provide a more educational example. This example illustrates how a very rudimentary* compiler works. In more detail, it shows what happens to your code after it’s been chopped into nice tokens. Then, it shows how, based on these tokens and the language’s grammar an AST is built and then decorated and, finally, how this tree is fed to an interpreter and results start popping up.

By rudimentary I mean that the language consists of simple arithmetic expressions. Below, you can find the compiler-demo. Just type stuff and be amazed!

If you want to find out more about the inner workings of this nifty thing, check this very nicely written article on CodeProject.

<div> Your input code:
7 + pi * (x - 10)
The environment:
{ “x” : 5, “pi” : 3 }
Output:
</div>



0 comments

Loading...

Next up

Here's a peaceful little forest scene for this #screenshotsaturday, from the beginning of the game.

Horror WIP A track that will be featured in a future horror game soundtrack! Stay tuned!

Likes appreciated ✌️

#gamedev #composer #horrorgame #indiegame #IndieGameDev #soundtrack

I worked so hard to get all four of them to the end safely, but then...

I mostly build 3D First Person Shooter game mechanics in Unity, and in this I'm just showing C4 mechanics I made for a little side project I am working on! :)

Out of boredom and curiosity, I coded Sailor Jupiter's Argentine Backbreaker.

Coming Soon...

I made a small jungle house.

Super Sonic Pixel art.

Art made for my friend @ungerbibs . Much love for this <3

Magic staffs created especially for each sign

#moba #zodiac #magic #staff #signs #gamedev #3Dart