Skip to content

Instantly share code, notes, and snippets.

@API-Beast
Last active August 29, 2015 14:07
Show Gist options
  • Save API-Beast/7cc624b5f4dcbe19bdd4 to your computer and use it in GitHub Desktop.
Save API-Beast/7cc624b5f4dcbe19bdd4 to your computer and use it in GitHub Desktop.
New ModC Configuration.
ScriptManager modc;
// Environment and Configuration can still be modified by accessing the public member variables in modc.
modc.compileAndLinkFile("script.modc");
VirtualMachine vm = modc.prepareVM();
vm.callFunction("Main");
// The basic profile of the language
// One could for example add additional operators by modifiying it.
Config config = BaseConfiguration();
// The script envionment, e.g. which variables/functions are defined?
// This is seperate because so we can link different script fragments together.
Environment env;
// The parser, it only needs to know about the configuration.
Parser parser = Parser(&config);
Fragment script = p.loadFile(script);
env.merge(script.locals());
VirtualMachine vm = VirtualMachine(&config, &env);
vm.callFunction("main");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment