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

So

i may or may not make an full art of some person or i may just leave this like that-

Enemies can also suddenly spawn through Realm Rifts. These Rift Spawns are going to be stronger than the ones wandering around. TBD on the enemies... #screenshotsaturday #godstear #madewithunity

Runestones: from concept to in-game model🗿

Heya! I wanted to show some gameplay progress i made so far. I hope you like it ^^

Update 2.627

New challenges & new effects!

a drawing I did because I was bored😪. But I love how it turned out.😊

Very ambitious construction going on in Planet Zoo on Plays today. We're tryin'. LIVE: www.twitch.tv/dreamhackplays

A few screenshots of the places you'll cross in the Demo of Blu. You can play it today on #gamejolt !

:] me sigue sin gustar

:] I still don't like it

Distrust - HUMERUS (with dirty shade) Papyrus isn`t small. It's possible that I didn't draw him well, but he crouched down and bent towards us. I'm still bad at moments like this