Sign in to follow this  
brightening-eyes

how can i parse Script functions, variables, etc

Recommended Posts

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

Share this post


Link to post
Share on other sites

thanks for your reply, but i want to know how can i parse these

for example, the library is compiled, how can i parse them? how can i know this line is a function, how many parameter does it have, what is the return type and anything else that may a compiler has

if you can, give a minimal example

thanks in advance

Share this post


Link to post
Share on other sites

I'm not quite sure what you're asking for, but perhaps you can use the asIScriptModule interface to enumerate the functions that were compiled, and then use the asIScriptFunction interface to get the information about the parameters and return types for each of the functions.

 

The manual gives an overview of how all the entities are enumerated and inspected.

Share this post


Link to post
Share on other sites

i want to know what is executing, what function, what is the code, how many parameter does the function have, what is the variable name, what operation is currently is the script is doing, i want to plase them on the CPU registers and turn them into executables!

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