Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


brightening-eyes

Member Since 20 Oct 2013
Offline Last Active Sep 24 2014 04:32 AM

Topics I've Started

creating a compiler for my engine using LLVM

31 July 2014 - 01:48 AM

hi all

as my topic title says,

i want to create a compiler for my game engine

but, i dont know how can i parse AngelScript's scripts and provide instructions for compilation with llvm

now, what you recommend to me?

what should i do?


how can i parse Script functions, variables, etc

14 June 2014 - 11:49 AM

hi all,

i'm developing a compiler for AngelScript using LLVM frontend

i have some questions:

how can i know what is the current line, it is a function? it is a variable, an expression, a statement, ETC!

and how can i know how many parameters does my function have, in order for LLVM to parse?

how can i know what is the return type?

how can i know the types of parameters?

how can i get a pointer to the script functions and objects?

thanks in advance


how can i compile a script to an executable?

17 May 2014 - 11:11 AM

hi everyone, i'm developping a game engine for visually impaired users (firstly myself) i haven't any problem dirring the registration of the script functions and classes! now when i want to compile the script, i dont know how can i say to my engine to load main() and compile it firstly and set it as the entrypoint! and run it? this is my run and compile functions:
void run(const char* script)
{
CScriptBuilder builder;
int r;
r=builder.StartNewModule(engine, "build");
if(rWriteMessage(script, 0, 0, asMSGTYPE_ERROR, "can't run the script");
}
r=builder.AddSectionFromFile(script);
if(rWriteMessage(script, 0, 0, asMSGTYPE_ERROR, "the file can not be loaded");
return ;
}
asIScriptFunction *mainfunc=engine->GetModule("build", asGM_ONLY_IF_EXISTS)->GetFunctionByDecl("void main()");
asIScriptContext *ctx=engine->CreateContext();
if(mainfunc==nullptr)
{
engine->WriteMessage(script, 0, 0, asMSGTYPE_ERROR, "the function void main() has not been declared");
return ;
}
ctx->Prepare(mainfunc);
ctx->Execute();
}

void compile(const char *script, const char *output, bool debug)
{
	engine->SetEngineProperty(asEP_INIT_GLOBAL_VARS_AFTER_BUILD, false);
CScriptBuilder builder;
int r;
r=builder.StartNewModule(engine, "build");
if(rWriteMessage(script, 0, 0, asMSGTYPE_ERROR, "can't compile the script");
}
r=builder.AddSectionFromFile(script);
if(rWriteMessage(script, 0, 0, asMSGTYPE_ERROR, "the file can not be loaded");
return ;
}
r=builder.BuildModule();
if(rGetModule("build", asGM_ONLY_IF_EXISTS);
compilerstream comp;
r=comp.open(output);
if(rWriteMessage(output, 0, 0, asMSGTYPE_ERROR, "the file can not be loaded for compilation");
return ;
}
compiler->finalizePages();
mod->SaveByteCode(&comp, !debug);
}
the problem is, i dont know how to load main() and set it as my executables main function! my mean is, when user run the executable, the game runs and executes main() and this happens when user runs the script from the engine! what should i do? thanks so much!

the compiler doesn't compile the script

29 November 2013 - 04:08 AM

hi

i'm making a game engine and i want to test my compiler

previously, it crashed

but with getting help, i fixed it

now, when i want to compile my script, it load's the file, and don't write's to it

the run function also crashed

now when i'm trying to run my application, it doesn't show anything

also when i'm trying to compile my application, it load's the file and it doesn't write to it

i've uploaded the code here

Attached File  AGC.zip   427.48KB   16 downloads

thanks in advance


a question about SFML and ogre

24 November 2013 - 01:10 PM

hi, i started to make game with SFML because it is easy to use and ogre because it is very good for 3D now a question is in my mind: can i use SFML and ogre together? for example, create a window from SFML and draw with ogre is it possible to do this? i didn't try this thanks in advance

PARTNERS