Sign in to follow this  
dkx187

making of a language

Recommended Posts

dkx187    100
I am currently making a language with xml but sometimes I wan't to make commands in other languages.Is there any way I could do this?If you know a web page I could visit then please link. Thank you

Share this post


Link to post
Share on other sites
rip-off    10979
Why XML? It is terribly verbose for such a task.

If by "make commands in other languages" you mean use types or functions defined by other languages, then it is possible. How is pretty much up to you, after all you are writing the language.

Share this post


Link to post
Share on other sites
ToohrVyk    1596
You can do this pretty easily. For instance, I could do like XSLT does and use:
<xsl:value-of select="php:frobnicate(@content)"/>
This calls the "frobnicate" PHP function.

Of course, the hard part is getting your compiler or interpreter to actually handle this. For instance, when running XSLT from PHP, you can register PHP functions to be run from XSLT. In the general case, you can use any technique available to the interpreter (or compiler target) for calling external functions.

But there are so many possible interpreters or compiler targets that I'm not going to give you a complete list of how to do it, nor will you find a complete list online. However, if you told us your interpreter technology or compiler target technology, we would be able to help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this