Compiler - Avans Hogeschool
jeroenegelmeers / compiler_designpatterns Goto Github PK
View Code? Open in Web Editor NEWCompiler - Avans Hogeschool
Compiler - Avans Hogeschool
Als er in een IfStatement write(); wordt geplaatst gaat er nog iets mis.
Laat dit maar want is toch niet persé nodig voor de beoordeling.
de tokenstack is niet leeg als er een enkele if statement staat zonder een else.
De if word alleen gepopped als een else in het script staat
Een voorbeeld van hoe de "directFunctions" erin zouden moeten komen. Dit zou de return moeten zijn van de compiler op ons testscript:
DoNothing
Direct: [ setConstantToReturnValue 3 ]
Direct: [ getFromReturnValue $1 ]
Direct: [ setConstantToReturnValue 2 ]
Direct: [ getFromReturnValue $2 ]
Function: [ equals $1 $2 ]
ConditionalJump
DoNothing
Direct: [ setConstantToReturnValue Hello world ]
Direct: [ getFromReturnValue $3 ]
Function: [ write $3 ]
Jump
DoNothing
Direct: [ setConstantToReturnValue Hello world 2 ]
Direct: [ getFromReturnValue $4 ]
Function: [ write $4 ]
DoNothing
bij bijvoorbeeld if(x == y) of if(x != y) wordt de middelste token in de conditie niet meegenomen. dit staat nog hardcoded als 'AreEqual'
tokenizer zet deze om naar een identifier
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.