Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

how can i parse Script functions, variables, etc


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 brightening-eyes   Members   -  Reputation: 174

Like
0Likes
Like

Posted 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


when you can't see well like me, you can't test your applications and you can't read something

AmirOS: an Open Source Operating system

Audio Game Kit: an open source game engine to develop audio games


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3366

Like
1Likes
Like

Posted 15 June 2014 - 08:23 AM

This is what the parser is made for :)

 

You can see the implementation I have for AngelScript in the as_parser.cpp file.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 brightening-eyes   Members   -  Reputation: 174

Like
0Likes
Like

Posted 15 June 2014 - 12:52 PM

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


when you can't see well like me, you can't test your applications and you can't read something

AmirOS: an Open Source Operating system

Audio Game Kit: an open source game engine to develop audio games


#4 Andreas Jonsson   Moderators   -  Reputation: 3366

Like
0Likes
Like

Posted 15 June 2014 - 01:32 PM

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.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#5 brightening-eyes   Members   -  Reputation: 174

Like
0Likes
Like

Posted 17 June 2014 - 01:41 AM

well, thanks for these,but if i dont know the parameters, then what i should i do?


when you can't see well like me, you can't test your applications and you can't read something

AmirOS: an Open Source Operating system

Audio Game Kit: an open source game engine to develop audio games


#6 Andreas Jonsson   Moderators   -  Reputation: 3366

Like
0Likes
Like

Posted 17 June 2014 - 10:13 AM

Please give an example of what you're trying to do so I can better understand what you're asking for and thus provide better help.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#7 brightening-eyes   Members   -  Reputation: 174

Like
0Likes
Like

Posted 17 June 2014 - 08:32 PM

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!


when you can't see well like me, you can't test your applications and you can't read something

AmirOS: an Open Source Operating system

Audio Game Kit: an open source game engine to develop audio games


#8 Andreas Jonsson   Moderators   -  Reputation: 3366

Like
0Likes
Like

Posted 19 June 2014 - 09:37 AM

So you want to access the bytecode and interpret it?

 

That is best done by following the instructions for how to build a JIT compiler


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#9 brightening-eyes   Members   -  Reputation: 174

Like
0Likes
Like

Posted 20 June 2014 - 11:45 AM

thanks, i think i have found my answer, i didn't read ByteCode instructions


when you can't see well like me, you can't test your applications and you can't read something

AmirOS: an Open Source Operating system

Audio Game Kit: an open source game engine to develop audio games





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS