Last active
March 6, 2017 15:31
-
-
Save kosamari/6c610165c0f48c699679bc5a8bab6327 to your computer and use it in GitHub Desktop.
final compiler object for sbn compiler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sbn = {} | |
sbn.VERSION = '0.0.1' | |
sbn.lexer = lexer | |
sbn.parser = parser | |
sbn.transformer = transformer | |
sbn.generator = generator | |
sbn.compile = function (code) { | |
return this.generator(this.transformer(this.parser(this.lexer(code)))) | |
} | |
// call sbn compiler | |
var code = 'Paper 0 Pen 100 Line 0 50 100 50' | |
var svg = sbn.compile(code) | |
document.body.innerHTML = svg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment