Created
November 15, 2014 21:22
-
-
Save SimonDanisch/e493bc765b013b2d3bbd to your computer and use it in GitHub Desktop.
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
macro DSL(name, text) | |
tokens = dsltokenizer(DSLTokens{name}(), text)::DSLTokens{name} | |
dslast = generate_ast(tokens)::AST{name} | |
return dsl(dslast)::AST{:Julia} | |
end | |
#Overwrite any of these stages, to implement your own DSL | |
dsltokenizer(::DSLTokens, text) = ... | |
generate_ast(text::DSLTokens) = ... | |
dsl(ast::AST) = ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment