Script Interpreter Attachment for Android Application

I am trying to create an Android application that reads a txt file written in Java syntax and compiles it using another language.

Skip java -> script, I want to know how I can embed a script interpreter or something to compile the script code.

So, the main functionality: read the script code, compile it, give the result. for example, show the Hello World screen.

I know that there is an โ€œofficialโ€ sl4a application, but I just want to compile it and embed it in my application. Is it possible?

Btw is there any parser that translates Java code into Python code or another script language? If so, how should I read in java code, like a string from txt or html or?

Thank you very much.


Thanks everyone! Sorry, I donโ€™t know how I should edit my own post, so just do it like this.

I have explained in detail why I am trying to do this in my Femi answer below so you can check it out.

In short, I just want my application to read in Java code and compile it. Since there is no java interpreter or compiler in Java, I have to use a different language. Do not know how.

Thanks!

0
source share
2 answers

Well, this is an odd task choice, but you can always insert an expression language such as MVEL (http://mvel.codehaus.org/) into your application. I would be very curious how this works and what you want to use it for. Are you looking for patterns or trying to do a titanium thing where you can manipulate everything in an application using a script interpreter?

0
source

There is a SnapScript interpreter that will run on Android out of the box. You do not need to compile the code, it has a parallel compiler that can quickly compile scripts and have minimal overhead when running on Android.

0
source

Source: https://habr.com/ru/post/1433464/


All Articles