sinkuri256 / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

Add Jawk support #607

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I made Jawk (AWK for Java) Interpreter from Jawk(v0.14).
It can access to SL4A APIs.
If this would be accepted I will attach the source zip on here for commits.

Anyway,here is the .apk for AWK users.
The extension would be ".awk".
Don't use the SL4A menu and the SL4A editor,it might crash.
Create awk script from other editors or rename other script files
such as "filename.bsh" ==> "filename.awk".

This is the hello_world.awk sample script.

import com.googlecode.rpc.*;
BEGIN{
  droid = new Android();
  droid.call("makeToast","Hello, Android!");
  printf "Hello, Android!\n"
}

Original issue reported on code.google.com by tomcatalbino on 7 Mar 2012 at 2:00

Attachments:

GoogleCodeExporter commented 9 years ago
>Don't use the SL4A menu and the SL4A editor,it might crash.

This file would resolve this problem.

Original comment by tomcatalbino on 27 Mar 2012 at 4:16

Attachments:

GoogleCodeExporter commented 9 years ago
I forgot to write the path to add. It's below.

http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/language/

Original comment by tomcatalbino on 27 Mar 2012 at 4:19

GoogleCodeExporter commented 9 years ago
Actually, I think the latest unofficial build might fix the problem with the 
SL4A editor -- at least, there were similar problems with a scheme interpreter, 
due to a missing language class.

If you'd like to try without recompiling the SL4A code, you can get the latest 
copy at http://www.mithril.com.au/android/sl4a_r5x.apk -- should be r5x07.

Original comment by matthewc...@gmail.com on 27 Mar 2012 at 4:20

GoogleCodeExporter commented 9 years ago
Hi !
I never tried the unofficial build before.
It seems works good !!!
So the other unofficial language such as "Squirrel" "Sleep" "Jscheme" "Hecl" 
etc... won't crash anymore.

Thanks for your information.

Original comment by tomcatalbino on 27 Mar 2012 at 4:41

GoogleCodeExporter commented 9 years ago
This is what a Language looks like:
http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/language/PythonLanguage.java

Sl4a uses it to do some fine tuning on the editor. It provides the basic 
boilerplate when creating a new script, and the auto-close maps. 
If the language is not a "supported" language, then, as of sl4a_r5x07, the 
editor will use the base Language object:
http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/language/Language.java

... which provides basic parentheses and quote on autoclose, but nothing else.
Writers of new interpeter implementations are encouraged to submit a 
Language.java so that the built in editor can do nice things.

Original comment by rjmatthews62 on 28 Mar 2012 at 2:25

GoogleCodeExporter commented 9 years ago
... which I see you've already supplied. Nice.
Have you had any feedback?

Original comment by rjmatthews62 on 28 Mar 2012 at 2:31

GoogleCodeExporter commented 9 years ago
No feedbacks yet...
I think most of those who write scripts in android(SL4A) uses perl,python,ruby 
much more useful languages.
But maybe some "AWK" programmers could be happy to have the apk.
Adding one language has unlimited potential.
I wasn't familiar with the language until I made the interpreter.
But now I can write awk scripts with my android phone and learn it anytime.
Maybe awk masters would come out with great ideas and useful codes some day !

Original comment by tomcatalbino on 30 Mar 2012 at 4:54

GoogleCodeExporter commented 9 years ago
I will attach the interpreter sources zip for incase commits.

Original comment by tomcatalbino on 9 Apr 2012 at 3:57

Attachments:

GoogleCodeExporter commented 9 years ago
This zip would be better than the above in Comment 8.
The new file includes all the required change to support awk.

To Robbie
If Jawk is going to be support officialy I recommend to change the download 
path in "SleepDescriptor.java" like the other languages.

Original comment by tomcatalbino on 9 Apr 2012 at 10:34

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, not "SleepDescriptor.java".It's "JawkDescriptor.java"

Original comment by tomcatalbino on 9 Apr 2012 at 10:38

GoogleCodeExporter commented 9 years ago
Now the apk can be download from

http://code.google.com/p/jawk-for-android/

Original comment by tomcatalbino on 28 Jun 2012 at 11:28