Jump to content
  • Advertisement
Sign in to follow this  
wilberolive

Registering Types

This topic is 2073 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to register a new type for void, like this for example.

engine->RegisterTypedef( "vd", "void" );

What about for the const keyword, like this for example.

engine->RegisterTypedef( "cn", "const" );

These code snippets fail of course, I'm just showing them as examples of what I would like to do. I'm integrating with third party libraries that use other keywords for these things and it would be great if I could match the script code up to the c++ code used when working with these libraries.

Share this post


Link to post
Share on other sites
Advertisement

No, it is not possible to register this. 

 

You'd be best off doing a replacement of the tokens in a pre-processing pass. The CScriptBuilder add-on can easily be enhanced to do this replacement, as it already tokenizes the script in order to do some processing, it's just a matter of checking whether the tokens matches the ones that needs to be replaced and then modify the script before passing it to the script engine.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!