This commit is contained in:
parent
588a0e6693
commit
d74c9d2874
@ -28,6 +28,31 @@ function resize()
|
|||||||
document.AseAwkApplet.height = height - 80;
|
document.AseAwkApplet.height = height - 80;
|
||||||
window.scroll (0, 0);
|
window.scroll (0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function load_sample1()
|
||||||
|
{
|
||||||
|
document.AseAwkApplet.clear ();
|
||||||
|
|
||||||
|
document.AseAwkApplet.setSourceInput (
|
||||||
|
'# wordfreq.awk --- print list of word frequencies\n' +
|
||||||
|
'{\n' +
|
||||||
|
' $0 = tolower($0); # remove case distinctions\n' +
|
||||||
|
'\n' +
|
||||||
|
' # remove punctuation\n' +
|
||||||
|
' gsub(/[^[:alnum:]_[:blank:]]/, " ");\n' +
|
||||||
|
'\n' +
|
||||||
|
' for (i = 1; i <= NF; i++) freq[$i]++;\n' +
|
||||||
|
'}\n' +
|
||||||
|
'\n' +
|
||||||
|
'END {\n' +
|
||||||
|
' for (word in freq)\n' +
|
||||||
|
' print word, freq[word];\n' +
|
||||||
|
'}\n');
|
||||||
|
|
||||||
|
document.AseAwkApplet.setConsoleInput (
|
||||||
|
'ASE aims to produce a script engine framework to ease the burden of creating a proprietary scripting language.\n' +
|
||||||
|
'It allows a hosting application to access various aspects of the embedded script engine and vice versa.');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -42,7 +67,7 @@ function resize()
|
|||||||
</td>
|
</td>
|
||||||
<td valign=top>
|
<td valign=top>
|
||||||
<p>
|
<p>
|
||||||
This applet is a test program for JNI binding to the <a href='http://kldp.net/projects/ase/'>ASE</a> AWK interpreter. The AWK language supported is slightly different from the standard in that all statements must end with a semicolon. You may enter a valid AWK program into the source input window and click on the <b>Run Awk</b> button. You may enter arbitrary text into the console input window if the AWK program entered contains an action-pattern block.
|
This applet is a test program for JNI binding to the <a href='http://kldp.net/projects/ase/'>ASE</a> AWK interpreter. The AWK language supported is slightly different from the standard in that all statements must end with a semicolon. You may enter a valid AWK program into the source input window and click on the <b>Run Awk</b> button. You can enter arbitrary text into the console input window if the AWK program entered contains an action-pattern block. You may click <a href='#' onClick='load_sample1(); return true;'>here</a> to load a sample program instead.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Note</b>: This java applet has been signed with a self-signed certificate. If you allow the program to run, it will download a JNI file into your home directory. Currently, it supports Linux(i386) and Microsoft Windows(x86). If you decide to clean your system later, don't forget to delete the local JNI file downloaded.
|
<b>Note</b>: This java applet has been signed with a self-signed certificate. If you allow the program to run, it will download a JNI file into your home directory. Currently, it supports Linux(i386) and Microsoft Windows(x86). If you decide to clean your system later, don't forget to delete the local JNI file downloaded.
|
||||||
|
@ -20,4 +20,19 @@ public class AseAwkApplet extends Applet
|
|||||||
|
|
||||||
public void stop () {}
|
public void stop () {}
|
||||||
public void paint (Graphics g) {}
|
public void paint (Graphics g) {}
|
||||||
|
|
||||||
|
public void setConsoleInput (String str)
|
||||||
|
{
|
||||||
|
awkPanel.setConsoleInput (str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSourceInput (String str)
|
||||||
|
{
|
||||||
|
awkPanel.setSourceInput (str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear ()
|
||||||
|
{
|
||||||
|
awkPanel.clear ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -926,4 +926,22 @@ public class AseAwkPanel extends Panel implements DropTargetListener
|
|||||||
textArea.setText (fb.toString());
|
textArea.setText (fb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear ()
|
||||||
|
{
|
||||||
|
conIn.setText ("");
|
||||||
|
srcIn.setText ("");
|
||||||
|
conOut.setText ("");
|
||||||
|
srcOut.setText ("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void setConsoleInput (String str)
|
||||||
|
{
|
||||||
|
conIn.setText (str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setSourceInput (String str)
|
||||||
|
{
|
||||||
|
srcIn.setText (str);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user