Recovered from cvs revision 2007-04-30 05:47:00
This commit is contained in:
@ -1,134 +0,0 @@
|
||||
/*
|
||||
* $Id: Awk.java,v 1.1.1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
public class Awk extends ase.awk.StdAwk
|
||||
{
|
||||
public Awk () throws ase.awk.Exception
|
||||
{
|
||||
super ();
|
||||
|
||||
addBuiltinFunction ("sin", 1, 1);
|
||||
addBuiltinFunction ("cos", 1, 1);
|
||||
addBuiltinFunction ("tan", 1, 1);
|
||||
addBuiltinFunction ("srand", 0, 1);
|
||||
addBuiltinFunction ("rand", 0, 0);
|
||||
|
||||
addBuiltinFunction ("system", 1, 1);
|
||||
|
||||
addBuiltinFunction ("xxx", 1, 10);
|
||||
//addBuiltinFunction ("xxx", 1, 1);
|
||||
//deleteBuiltinFunction ("sin");
|
||||
//deleteBuiltinFunction ("sin");
|
||||
}
|
||||
|
||||
public Object xxx (long runid, Object[] args)
|
||||
{
|
||||
System.out.println ("<<BFN_XXX>>");
|
||||
for (int i = 0; i < args.length; i++)
|
||||
{
|
||||
System.out.print ("ARG #" + i);
|
||||
System.out.print (": ");
|
||||
if (args[i] == null) System.out.println ("nil");
|
||||
else System.out.println (args[i].toString());
|
||||
}
|
||||
return null;
|
||||
//return new String ("return value");
|
||||
//return new Double (1.234);
|
||||
//return new Float (1.234);
|
||||
//return new Integer (1001);
|
||||
//return new Long (1001);
|
||||
//return new Short ((short)1001);
|
||||
}
|
||||
|
||||
protected String[] consoleInputNames ()
|
||||
{
|
||||
String[] cin = new String[3];
|
||||
cin[0] = "c1.txt";
|
||||
cin[1] = "c2.txt";
|
||||
cin[2] = "c3.txt";
|
||||
return cin;
|
||||
}
|
||||
|
||||
protected String[] consoleOutputNames ()
|
||||
{
|
||||
String[] cout = new String[1];
|
||||
cout[0] = "";
|
||||
return cout;
|
||||
/*
|
||||
String[] cout = new String[3];
|
||||
cout[0] = "c4.txt";
|
||||
cout[1] = "c5.txt";
|
||||
cout[2] = "";
|
||||
return cout;
|
||||
*/
|
||||
}
|
||||
|
||||
protected String[] sourceInputNames ()
|
||||
{
|
||||
String[] sin = new String[1];
|
||||
sin[0] = "c:/projects/ase/test/awk/t.awk";
|
||||
return sin;
|
||||
}
|
||||
|
||||
/*
|
||||
protected String sourceOutputName ()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
*/
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
Awk awk = null;
|
||||
|
||||
URL url = ase.awk.Awk.class.getResource ("aseawk_jni.dll");
|
||||
if (url == null) url = ase.awk.Awk.class.getResource ("aseawk_jni.so");
|
||||
if (url != null) System.load (url.getFile());
|
||||
|
||||
try
|
||||
{
|
||||
awk = new Awk ();
|
||||
awk.setMaxDepth (Awk.DEPTH_BLOCK_PARSE, 30);
|
||||
awk.setDebug (true);
|
||||
//awk.setDebug (false);
|
||||
|
||||
//awk.setOption (awk.getOption() | OPTION_STRBASEONE);
|
||||
System.out.println ("Option: [" + awk.getOption() + "]");
|
||||
|
||||
awk.parse ();
|
||||
|
||||
System.out.println ("about to run");
|
||||
String[] aaa = new String[3];
|
||||
aaa[0] = "abcdefg";
|
||||
aaa[1] = "qwerty";
|
||||
aaa[2] = "awk is bad";
|
||||
awk.run ("main", aaa);
|
||||
}
|
||||
catch (ase.awk.Exception e)
|
||||
{
|
||||
if (e.getLine() == 0)
|
||||
{
|
||||
System.out.println ("ase.awk.Exception - " + e.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println (
|
||||
"ase.awk.Exception at line " +
|
||||
e.getLine() + " - " + e.getMessage());
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (awk != null)
|
||||
{
|
||||
awk.close ();
|
||||
awk = null;
|
||||
}
|
||||
}
|
||||
System.out.println ("==== end of awk ====");
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<!--
|
||||
<applet code="ase.test.awk.AwkApplet" codebase="../../.." width="200" height="200"></applet>
|
||||
-->
|
||||
<applet code="AwkApplet" archive="AwkApplet.jar" codebase="." codebase="../../.." width="200" height="200">
|
||||
</applet>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* $Id: AwkApplet.java,v 1.1.1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
import java.applet.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.net.URL;
|
||||
|
||||
public class AwkApplet extends Applet
|
||||
{
|
||||
public void init ()
|
||||
{
|
||||
Button btn_run;
|
||||
btn_run = new Button ("Run Awk");
|
||||
|
||||
btn_run.addActionListener (new ActionListener ()
|
||||
{
|
||||
public void actionPerformed (ActionEvent e)
|
||||
{
|
||||
run_awk ();
|
||||
}
|
||||
});
|
||||
add (btn_run);
|
||||
}
|
||||
|
||||
public void stop () {}
|
||||
public void paint (Graphics g) {}
|
||||
|
||||
private void run_awk ()
|
||||
{
|
||||
Awk awk = null;
|
||||
|
||||
try
|
||||
{
|
||||
/*
|
||||
URL url = ase.awk.Awk.class.getResource ("aseawk_jni.dll");
|
||||
if (url == null) url = ase.awk.Awk.class.getResource ("aseawk_jni.so");
|
||||
|
||||
if (url != null) System.load (url.getFile()); */
|
||||
|
||||
try
|
||||
{
|
||||
System.load ("c:/projects/ase/test/awk/aseawk_jni.dll");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println ("fuck you");
|
||||
}
|
||||
|
||||
|
||||
awk = new Awk ();
|
||||
awk.parse ();
|
||||
awk.run ();
|
||||
}
|
||||
catch (ase.awk.Exception e)
|
||||
{
|
||||
System.out.println ("ase.awk.Exception - " + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (awk != null) awk.close ();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
BEGIN {
|
||||
print "ARGC=", ARGC;
|
||||
for (i in ARGV)
|
||||
{
|
||||
print "ARGV[" i "]", ARGV[i];
|
||||
}
|
||||
|
||||
print "----------------------";
|
||||
print "ARGC=", ARGC;
|
||||
split ("111 22 333 555 666 777", ARGV);
|
||||
for (i in ARGV)
|
||||
{
|
||||
print "ARGV[" i "]", ARGV[i];
|
||||
}
|
||||
|
||||
#for (i = 0
|
||||
# i < 20
|
||||
# i;;) print "[" i "]";
|
||||
#for (i = 0
|
||||
# (i < 20)
|
||||
# i;;) print "[" i "]";
|
||||
|
||||
#printf 10, 20, 30;
|
||||
if (ARGC >= 0) printf ("ARGC [%++#10.10i] is positive\n", 10);
|
||||
if (ARGC >= 0) printf ("ARGC [%++#10.10f] is positive\n", 10);
|
||||
if (ARGC >= 0) printf ("ARGC [%++#10.10E] is positive\n", 10124.1123);
|
||||
if (ARGC >= 0) printf ("ARGC [%++#10.10G] is positive\n", 10124.1123);
|
||||
if (ARGC >= 0) printf ("ARGC [%++#10.10g] is positive\n", 10124.1123);
|
||||
if (ARGC >= 0) printf ("ARGC [%++#10.10f] is positive\n", 10124.1123);
|
||||
printf ("[%d], [%f], [%s]\n", 10124.1123, 10124.1123, 10124.1123);
|
||||
printf ("[%-10c] [% 0*.*d]\n", 65, 45, 48, -1);
|
||||
|
||||
print sprintf ("abc%d %*.*d %c %s %c", 10, 20, 30, 40, "good", "good", 75.34);
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
BEGIN {
|
||||
a[1,2,3] = 20;
|
||||
a[4,5,6] = 30;
|
||||
|
||||
for (i in a)
|
||||
{
|
||||
n = split (i, k, SUBSEP);
|
||||
for (j = 1; j < n; j++)
|
||||
{
|
||||
print k[j]
|
||||
}
|
||||
}
|
||||
|
||||
if ((1,2,3) in a)
|
||||
{
|
||||
print a[1,2,3];
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="asetestawk" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=asetestawk - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "asetestawk.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "asetestawk.mak" CFG="asetestawk - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "asetestawk - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "asetestawk - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "asetestawk - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../../release/bin"
|
||||
# PROP Intermediate_Dir "release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D _WIN32_WINNT=0x0400 /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 asecmn.lib aseawk.lib aseutl.lib user32.lib kernel32.lib /nologo /subsystem:console /machine:I386 /out:"$(OutDir)/aseawk.exe" /libpath:"$(OutDir)\..\lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "asetestawk - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../../debug/bin"
|
||||
# PROP Intermediate_Dir "debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D _WIN32_WINNT=0x0400 /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 asecmn.lib aseawk.lib aseutl.lib user32.lib kernel32.lib /nologo /subsystem:console /debug /machine:I386 /out:"$(OutDir)/aseawk.exe" /pdbtype:sept /libpath:"$(OutDir)\..\lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "asetestawk - Win32 Release"
|
||||
# Name "asetestawk - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\awk.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
1081
ase/test/awk/awk.c
1081
ase/test/awk/awk.c
File diff suppressed because it is too large
Load Diff
@ -1,121 +0,0 @@
|
||||
BEGIN {
|
||||
OFS="\t\t";
|
||||
|
||||
print "1==1 :", (1 == 1);
|
||||
print "1==0 :", (1 == 0);
|
||||
|
||||
print "1.0==1 :", (1.0 == 1);
|
||||
print "1.1==1 :", (1.1 == 1);
|
||||
|
||||
print "1.0!=1 :", (1.0 != 1);
|
||||
print "1.1!=1 :", (1.1 != 1);
|
||||
|
||||
print "\"abc\" == \"abc\"", ("abc" == "abc");
|
||||
print "\"abc\" != \"abc\"", ("abc" != "abc");
|
||||
|
||||
print "--------------------------";
|
||||
print "a == \"\" :", (a == "");
|
||||
print "a >= \"\" :", (a >= "");
|
||||
print "a <= \"\" :", (a <= "");
|
||||
print "a > \"\" :", (a > "");
|
||||
print "a < \"\" :", (a < "");
|
||||
|
||||
print "--------------------------";
|
||||
print "a == \" \" :", (a == " ");
|
||||
print "a >= \" \" :", (a >= " ");
|
||||
print "a <= \" \" :", (a <= " ");
|
||||
print "a > \" \" :", (a > " ");
|
||||
print "a < \" \" :", (a < " ");
|
||||
|
||||
print "--------------------------";
|
||||
print "\"\" == a :", ("" == a);
|
||||
print "\"\" >= a:", ("" >= a);
|
||||
print "\"\" <= a:", ("" <= a);
|
||||
print "\"\" > a:", ("" > a);
|
||||
print "\"\" < a:", ("" < a);
|
||||
|
||||
print "--------------------------";
|
||||
print "\" \" == a :", (" " == a);
|
||||
print "\" \" >= a:", (" " >= a);
|
||||
print "\" \" <= a:", (" " <= a);
|
||||
print "\" \" > a:", (" " > a);
|
||||
print "\" \" < a:", (" " < a);
|
||||
|
||||
print "--------------------------";
|
||||
print "10 == \"10\"", (10 == "10");
|
||||
print "10 != \"10\"", (10 != "10");
|
||||
print "10 >= \"10\"", (10 >= "10");
|
||||
print "10 <= \"10\"", (10 <= "10");
|
||||
print "10 > \"10\"", (10 > "10");
|
||||
print "10 < \"10\"", (10 < "10");
|
||||
|
||||
print "--------------------------";
|
||||
print "10 == \"11\"", (10 == "11");
|
||||
print "10 != \"11\"", (10 != "11");
|
||||
print "10 >= \"11\"", (10 >= "11");
|
||||
print "10 <= \"11\"", (10 <= "11");
|
||||
print "10 > \"11\"", (10 > "11");
|
||||
print "10 < \"11\"", (10 < "11");
|
||||
|
||||
print "--------------------------";
|
||||
print "11 == \"10\"", (11 == "10");
|
||||
print "11 != \"10\"", (11 != "10");
|
||||
print "11 >= \"10\"", (11 >= "10");
|
||||
print "11 <= \"10\"", (11 <= "10");
|
||||
print "11 > \"10\"", (11 > "10");
|
||||
print "11 < \"10\"", (11 < "10");
|
||||
|
||||
print "--------------------------";
|
||||
print "010 == \"8\"", (010 == "8");
|
||||
print "010 != \"8\"", (010 != "8");
|
||||
print "010 >= \"8\"", (010 >= "8");
|
||||
print "010 <= \"8\"", (010 <= "8");
|
||||
print "010 > \"8\"", (010 > "8");
|
||||
print "010 < \"8\"", (010 < "8");
|
||||
|
||||
print "--------------------------";
|
||||
print "10 == \"10.0\"", (10 == "10.0");
|
||||
print "10 != \"10.0\"", (10 != "10.0");
|
||||
print "10 >= \"10.0\"", (10 >= "10.0");
|
||||
print "10 <= \"10.0\"", (10 <= "10.0");
|
||||
print "10 > \"10.0\"", (10 > "10.0");
|
||||
print "10 < \"10.0\"", (10 < "10.0");
|
||||
|
||||
#OFMT="abc";
|
||||
print "--------------------------";
|
||||
print "10.0 == \"10\"", (10.0 == "10");
|
||||
print "10.0 != \"10\"", (10.0 != "10");
|
||||
print "10.0 >= \"10\"", (10.0 >= "10");
|
||||
print "10.0 <= \"10\"", (10.0 <= "10");
|
||||
print "10.0 > \"10\"", (10.0 > "10");
|
||||
print "10.0 < \"10\"", (10.0 < "10");
|
||||
|
||||
print "--------------------------";
|
||||
print "\"10\" == 10.0", ("10" == 10.0);
|
||||
print "\"10\" != 10.0", ("10" != 10.0);
|
||||
print "\"10\" >= 10.0", ("10" >= 10.0);
|
||||
print "\"10\" <= 10.0", ("10" <= 10.0);
|
||||
print "\"10\" > 10.0", ("10" > 10.0);
|
||||
print "\"10\" < 10.0", ("10" < 10.0);
|
||||
|
||||
print "--------------------------";
|
||||
print "\"10\" == 10.1", ("10" == 10.1);
|
||||
print "\"10\" != 10.1", ("10" != 10.1);
|
||||
print "\"10\" >= 10.1", ("10" >= 10.1);
|
||||
print "\"10\" <= 10.1", ("10" <= 10.1);
|
||||
print "\"10\" > 10.1", ("10" > 10.1);
|
||||
print "\"10\" < 10.1", ("10" < 10.1);
|
||||
|
||||
#a[10] = 2;
|
||||
#print a == 1;
|
||||
|
||||
print (0.234 + 1.01123);
|
||||
print 12345678901234567890E20;
|
||||
print .123;
|
||||
print +.123;
|
||||
print -.123;
|
||||
print .123E-;
|
||||
print +.123E-;
|
||||
print -.123E-;
|
||||
print -.123E- + "123";
|
||||
}
|
@ -1 +0,0 @@
|
||||
{ print $1, $3; } # print country name and population
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
print $1,$3;
|
||||
}
|
||||
|
||||
USSR 275
|
||||
Canada 25
|
||||
China 1032
|
||||
USA 237
|
||||
Brazil 134
|
||||
India 746
|
||||
Mexico 78
|
||||
France 55
|
||||
Japan 120
|
||||
Germany 61
|
||||
England 56
|
@ -1,15 +0,0 @@
|
||||
BEGIN {
|
||||
FS = "\t";
|
||||
printf ("%10s %6s %5s %s\n\n",
|
||||
"COUNTRY", "AREA", "POP", "CONTINENT");
|
||||
}
|
||||
|
||||
{
|
||||
printf ("%10s %6d %5d %s\n", $1, $2, $3, $4);
|
||||
area = area + $2;
|
||||
pop = pop + $3;
|
||||
}
|
||||
|
||||
END {
|
||||
printf ("\n%10s %6d %5d\n", "TOTAL", area, pop);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
BEGIN {
|
||||
FS = " ";
|
||||
printf ("%10s %6s %5s %s\n\n","COUNTRY","AREA","POP","CONTINENT");
|
||||
}
|
||||
|
||||
{
|
||||
printf ("%10s %6d %5d %s\n",$1,$2,$3,$4);
|
||||
area = (area + $2);
|
||||
pop = (pop + $3);
|
||||
}
|
||||
|
||||
END {
|
||||
printf ("\n%10s %6d %5d\n","TOTAL",area,pop);
|
||||
}
|
||||
COUNTRY AREA POP CONTINENT
|
||||
|
||||
USSR 8649 275 Asia
|
||||
Canada 3852 25 North America
|
||||
China 3705 1032 Asia
|
||||
USA 3615 237 North America
|
||||
Brazil 3286 134 South America
|
||||
India 1267 746 Asia
|
||||
Mexico 762 78 North America
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
||||
|
||||
TOTAL 25681 2819
|
@ -1 +0,0 @@
|
||||
$3/$2 >= 0.5
|
@ -1,6 +0,0 @@
|
||||
(($3 / $2) >= 0.5)
|
||||
|
||||
India 1267 746 Asia
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
$0 >= "M"
|
@ -1,5 +0,0 @@
|
||||
($0 >= "M")
|
||||
|
||||
USSR 8649 275 Asia
|
||||
USA 3615 237 North America
|
||||
Mexico 762 78 North America
|
@ -1 +0,0 @@
|
||||
$1 < $4
|
@ -1,6 +0,0 @@
|
||||
($1 < $4)
|
||||
|
||||
Canada 3852 25 North America
|
||||
Brazil 3286 134 South America
|
||||
Mexico 762 78 North America
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
$2 < $3
|
@ -1,5 +0,0 @@
|
||||
($2 < $3)
|
||||
|
||||
India 1267 746 Asia
|
||||
Mexico 762 78 North America
|
||||
France 211 55 Europe
|
@ -1 +0,0 @@
|
||||
/Asia/
|
@ -1,6 +0,0 @@
|
||||
/Asia/
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
Japan 144 120 Asia
|
@ -1 +0,0 @@
|
||||
$4 ~ /Asia/
|
@ -1,6 +0,0 @@
|
||||
($4 ~ /Asia/)
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
Japan 144 120 Asia
|
@ -1 +0,0 @@
|
||||
$4 !~ /Asia/
|
@ -1,9 +0,0 @@
|
||||
($4 !~ /Asia/)
|
||||
|
||||
Canada 3852 25 North America
|
||||
USA 3615 237 North America
|
||||
Brazil 3286 134 South America
|
||||
Mexico 762 78 North America
|
||||
France 211 55 Europe
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
$0 ~ /Asia/
|
@ -1,6 +0,0 @@
|
||||
($0 ~ /Asia/)
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
Japan 144 120 Asia
|
@ -1,3 +0,0 @@
|
||||
$2 !~ /^[0-9]+$/
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
($2 !~ /^[0-9]+$/)
|
||||
|
@ -1 +0,0 @@
|
||||
$4 == "Asia" && $3 > 500
|
@ -1,4 +0,0 @@
|
||||
(($4 == "Asia") && ($3 > 500))
|
||||
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
@ -1 +0,0 @@
|
||||
$4 == "Asia" || $4 == "Europe"
|
@ -1,9 +0,0 @@
|
||||
(($4 == "Asia") || ($4 == "Europe"))
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
$4 ~ /^(Asia|Europe)$/
|
@ -1,9 +0,0 @@
|
||||
($4 ~ /^(Asia|Europe)$/)
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
/Asia/ || /Europe/
|
@ -1,9 +0,0 @@
|
||||
(/Asia/ || /Europe/)
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
/Asia|Europe/
|
@ -1,9 +0,0 @@
|
||||
/Asia|Europe/
|
||||
|
||||
USSR 8649 275 Asia
|
||||
China 3705 1032 Asia
|
||||
India 1267 746 Asia
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
/Canada/, /USA/
|
@ -1,5 +0,0 @@
|
||||
/Canada/,/USA/
|
||||
|
||||
Canada 3852 25 North America
|
||||
China 3705 1032 Asia
|
||||
USA 3615 237 North America
|
@ -1 +0,0 @@
|
||||
/Eurpoe/, /Africa/
|
@ -1,2 +0,0 @@
|
||||
/Eurpoe/,/Africa/
|
||||
|
@ -1 +0,0 @@
|
||||
FNR == 1, FNR == 5 { print FILENAME ": " $0; }
|
@ -1,9 +0,0 @@
|
||||
(FNR == 1),(FNR == 5) {
|
||||
print ((FILENAME ": ") $0);
|
||||
}
|
||||
|
||||
cou-en.data: USSR 8649 275 Asia
|
||||
cou-en.data: Canada 3852 25 North America
|
||||
cou-en.data: China 3705 1032 Asia
|
||||
cou-en.data: USA 3615 237 North America
|
||||
cou-en.data: Brazil 3286 134 South America
|
@ -1 +0,0 @@
|
||||
FNR <= 5 { print FILENAME ": " $0; }
|
@ -1,9 +0,0 @@
|
||||
(FNR <= 5) {
|
||||
print ((FILENAME ": ") $0);
|
||||
}
|
||||
|
||||
cou-en.data: USSR 8649 275 Asia
|
||||
cou-en.data: Canada 3852 25 North America
|
||||
cou-en.data: China 3705 1032 Asia
|
||||
cou-en.data: USA 3615 237 North America
|
||||
cou-en.data: Brazil 3286 134 South America
|
@ -1 +0,0 @@
|
||||
$4 == "Asia" { print $1, 1000 * $2; }
|
@ -1,8 +0,0 @@
|
||||
($4 == "Asia") {
|
||||
print $1,(1000 * $2);
|
||||
}
|
||||
|
||||
USSR 8649000
|
||||
China 3705000
|
||||
India 1267000
|
||||
Japan 144000
|
@ -1,6 +0,0 @@
|
||||
#BEGIN { FS = "\t"; OFS = "\t"; }
|
||||
BEGIN { FS = OFS = "\t"; }
|
||||
$4 == "North America" { $4 = "NA"; }
|
||||
$4 == "South America" { $4 = "SA"; }
|
||||
{ print; }
|
||||
|
@ -1,27 +0,0 @@
|
||||
BEGIN {
|
||||
FS = OFS = " ";
|
||||
}
|
||||
|
||||
($4 == "North America") {
|
||||
$4 = "NA";
|
||||
}
|
||||
|
||||
($4 == "South America") {
|
||||
$4 = "SA";
|
||||
}
|
||||
|
||||
{
|
||||
print;
|
||||
}
|
||||
|
||||
USSR 8649 275 Asia
|
||||
Canada 3852 25 NA
|
||||
China 3705 1032 Asia
|
||||
USA 3615 237 NA
|
||||
Brazil 3286 134 SA
|
||||
India 1267 746 Asia
|
||||
Mexico 762 78 NA
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1,2 +0,0 @@
|
||||
BEGIN { FS = OFS = "\t"; }
|
||||
{ $5 = 1000 * $3 / $2; print; }
|
@ -1,20 +0,0 @@
|
||||
BEGIN {
|
||||
FS = OFS = " ";
|
||||
}
|
||||
|
||||
{
|
||||
$5 = ((1000 * $3) / $2);
|
||||
print;
|
||||
}
|
||||
|
||||
USSR 8649 275 Asia 31.7956
|
||||
Canada 3852 25 North America 6.49013
|
||||
China 3705 1032 Asia 278.543
|
||||
USA 3615 237 North America 65.5602
|
||||
Brazil 3286 134 South America 40.7791
|
||||
India 1267 746 Asia 588.792
|
||||
Mexico 762 78 North America 102.362
|
||||
France 211 55 Europe 260.664
|
||||
Japan 144 120 Asia 833.333
|
||||
Germany 96 61 Europe 635.417
|
||||
England 94 56 Europe 595.745
|
@ -1,4 +0,0 @@
|
||||
$4 == "Asia" { pop = pop + $3; n = n + 1; }
|
||||
END { print "Total population of the", n,
|
||||
"Asian countries is", pop, "million.";
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
($4 == "Asia") {
|
||||
pop = (pop + $3);
|
||||
n = (n + 1);
|
||||
}
|
||||
|
||||
END {
|
||||
print "Total population of the",n,"Asian countries is",pop,"million.";
|
||||
}
|
||||
Total population of the 4 Asian countries is 2173 million.
|
@ -1,6 +0,0 @@
|
||||
/Asia/ { pop["Asia"] += $3; }
|
||||
/Europe/ { pop["Europe"] += $3; }
|
||||
END { print "Asian population is", pop["Asia"], "million.";
|
||||
print "European population is", pop["Europe"], "million.";
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
/Asia/ {
|
||||
pop["Asia"] += $3;
|
||||
}
|
||||
|
||||
/Europe/ {
|
||||
pop["Europe"] += $3;
|
||||
}
|
||||
|
||||
END {
|
||||
print "Asian population is",pop["Asia"],"million.";
|
||||
print "European population is",pop["Europe"],"million.";
|
||||
}
|
||||
Asian population is 2173 million.
|
||||
European population is 172 million.
|
@ -1,3 +0,0 @@
|
||||
BEGIN { FS = "\t"; }
|
||||
{ pop[$4] += $3; }
|
||||
END { for (name in pop) print name, pop[name]; }
|
@ -1,16 +0,0 @@
|
||||
BEGIN {
|
||||
FS = " ";
|
||||
}
|
||||
|
||||
{
|
||||
pop[$4] += $3;
|
||||
}
|
||||
|
||||
END {
|
||||
for (name in pop)
|
||||
print name,pop[name];
|
||||
}
|
||||
Europe 172
|
||||
South America 134
|
||||
North America 340
|
||||
Asia 2173
|
@ -1,5 +0,0 @@
|
||||
BEGIN { FS = "\t"; }
|
||||
{ pop[$4] += $3; }
|
||||
END { for (c in pop)
|
||||
printf ("%15s\t%6d\n", c, pop[c]) | "sort -t'\t' +1rn";
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
BEGIN {
|
||||
FS = " ";
|
||||
}
|
||||
|
||||
{
|
||||
pop[$4] += $3;
|
||||
}
|
||||
|
||||
END {
|
||||
for (c in pop)
|
||||
printf ("%15s %6d\n",c,pop[c]) | "sort -t' ' +1rn";
|
||||
}
|
||||
Asia 2173
|
||||
North America 340
|
||||
Europe 172
|
||||
South America 134
|
@ -1,11 +0,0 @@
|
||||
USSR 8649 275 Asia
|
||||
Canada 3852 25 North America
|
||||
China 3705 1032 Asia
|
||||
USA 3615 237 North America
|
||||
Brazil 3286 134 South America
|
||||
India 1267 746 Asia
|
||||
Mexico 762 78 North America
|
||||
France 211 55 Europe
|
||||
Japan 144 120 Asia
|
||||
Germany 96 61 Europe
|
||||
England 94 56 Europe
|
@ -1 +0,0 @@
|
||||
BEGIN { CONVFMT="%s"; printf ("%s\n", 10.34); }
|
@ -1,9 +0,0 @@
|
||||
BEGIN {
|
||||
#CONVFMT="%s";
|
||||
#CONVFMT="%*.*s";
|
||||
#CONVFMT="%*.*f";
|
||||
printf "[[[[[%s]]]]\n", sprintf ("abc %s abc", sprintf ("def %s %s", sprintf ("%s %s %s", "xyz", 1.2342, "xyz"), sprintf ("ttt %s tttt", 123.12)));
|
||||
|
||||
printf "[[[[%s]]]]\n", sprintf ("ttt %s tttt", 123.12);
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
BEGIN {
|
||||
|
||||
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{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}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
|
||||
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
BEGIN {
|
||||
a = (((((10+20)))));
|
||||
b = (((((((((((((((((((10+20)))))))))))))))))));
|
||||
c = ((((((((((((((((((((((((((((10 + 20))))))))))))))))))))))))))));
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
function a()
|
||||
{
|
||||
print "aaaa";
|
||||
a();
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
a = (b = 20);
|
||||
print a; print b; for(i=j=1; i< 10; i++) print i, j;
|
||||
|
||||
a += b += 20;
|
||||
print a; print b; for(i=j=1; i< 10; i++) print i, j;
|
||||
|
||||
j = (a < 20)? k = 20: c = 30;
|
||||
print (a < 20)? k = 20: c = 30;
|
||||
print "j=" j;
|
||||
print "k=" k;
|
||||
print "c=" c;
|
||||
|
||||
a();
|
||||
}
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
#
|
||||
# OpenVMS MMS/MMK
|
||||
#
|
||||
|
||||
objects = awk.obj
|
||||
|
||||
CFLAGS = /include="../../.."
|
||||
#CFLAGS = /pointer_size=long /include="../../.."
|
||||
|
||||
aseawk.exe : $(objects)
|
||||
link /executable=aseawk.exe $(objects),[-.-.awk]aseawk/library,[-.-.utl]aseutl/library
|
||||
|
||||
awk.obj depends_on awk.c
|
@ -1 +0,0 @@
|
||||
$3 > 0 { print $1, $2 * $3; }
|
@ -1,8 +0,0 @@
|
||||
($3 > 0) {
|
||||
print $1,($2 * $3);
|
||||
}
|
||||
|
||||
Kathy 40
|
||||
Mark 100
|
||||
Mary 121
|
||||
Susie 76.5
|
@ -1 +0,0 @@
|
||||
$3 == 0 { print $1; }
|
@ -1,6 +0,0 @@
|
||||
($3 == 0) {
|
||||
print $1;
|
||||
}
|
||||
|
||||
Beth
|
||||
Dan
|
@ -1 +0,0 @@
|
||||
{ print NF, $1, $NF; }
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
print NF,$1,$NF;
|
||||
}
|
||||
|
||||
3 Beth 0
|
||||
3 Dan 0
|
||||
3 Kathy 10
|
||||
3 Mark 20
|
||||
3 Mary 22
|
||||
3 Susie 18
|
@ -1 +0,0 @@
|
||||
{ print NR, $0; }
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
print NR,$0;
|
||||
}
|
||||
|
||||
1 Beth 4.00 0
|
||||
2 Dan 3.74 0
|
||||
3 Kathy 4.00 10
|
||||
4 Mark 5.00 20
|
||||
5 Mary 5.50 22
|
||||
6 Susie 4.25 18
|
@ -1 +0,0 @@
|
||||
{ print "total pay for", $1, "is", $2 * $3; }
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
print "total pay for",$1,"is",($2 * $3);
|
||||
}
|
||||
|
||||
total pay for Beth is 0
|
||||
total pay for Dan is 0
|
||||
total pay for Kathy is 40
|
||||
total pay for Mark is 100
|
||||
total pay for Mary is 121
|
||||
total pay for Susie is 76.5
|
@ -1 +0,0 @@
|
||||
{ printf ("total pay for %s is $%.2f\n", $1, $2 * $3); }
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
printf ("total pay for %s is $%.2f\n",$1,($2 * $3));
|
||||
}
|
||||
|
||||
total pay for Beth is $0.00
|
||||
total pay for Dan is $0.00
|
||||
total pay for Kathy is $40.00
|
||||
total pay for Mark is $100.00
|
||||
total pay for Mary is $121.00
|
||||
total pay for Susie is $76.50
|
@ -1 +0,0 @@
|
||||
{ printf ("%-8s $%6.2f\n", $1, $2 * $3); }
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
printf ("%-8s $%6.2f\n",$1,($2 * $3));
|
||||
}
|
||||
|
||||
Beth $ 0.00
|
||||
Dan $ 0.00
|
||||
Kathy $ 40.00
|
||||
Mark $100.00
|
||||
Mary $121.00
|
||||
Susie $ 76.50
|
@ -1 +0,0 @@
|
||||
$2 >= 5
|
@ -1,4 +0,0 @@
|
||||
($2 >= 5)
|
||||
|
||||
Mark 5.00 20
|
||||
Mary 5.50 22
|
@ -1 +0,0 @@
|
||||
$2 * $3 > 50 { printf ("$%.2f for %s\n", $2 * $3, $1); }
|
@ -1,7 +0,0 @@
|
||||
(($2 * $3) > 50) {
|
||||
printf ("$%.2f for %s\n",($2 * $3),$1);
|
||||
}
|
||||
|
||||
$100.00 for Mark
|
||||
$121.00 for Mary
|
||||
$76.50 for Susie
|
@ -1 +0,0 @@
|
||||
$1 == "Susie"
|
@ -1,3 +0,0 @@
|
||||
($1 == "Susie")
|
||||
|
||||
Susie 4.25 18
|
@ -1 +0,0 @@
|
||||
/Susie/
|
@ -1,3 +0,0 @@
|
||||
/Susie/
|
||||
|
||||
Susie 4.25 18
|
@ -1 +0,0 @@
|
||||
$2 >= 4 || $3 >= 20
|
@ -1,7 +0,0 @@
|
||||
(($2 >= 4) || ($3 >= 20))
|
||||
|
||||
Beth 4.00 0
|
||||
Kathy 4.00 10
|
||||
Mark 5.00 20
|
||||
Mary 5.50 22
|
||||
Susie 4.25 18
|
@ -1,2 +0,0 @@
|
||||
$2 >= 4
|
||||
$3 >= 20
|
@ -1,11 +0,0 @@
|
||||
($2 >= 4)
|
||||
|
||||
($3 >= 20)
|
||||
|
||||
Beth 4.00 0
|
||||
Kathy 4.00 10
|
||||
Mark 5.00 20
|
||||
Mark 5.00 20
|
||||
Mary 5.50 22
|
||||
Mary 5.50 22
|
||||
Susie 4.25 18
|
@ -1 +0,0 @@
|
||||
!($2 < 4 && $3 < 20)
|
@ -1,7 +0,0 @@
|
||||
(!((($2 < 4) && ($3 < 20))))
|
||||
|
||||
Beth 4.00 0
|
||||
Kathy 4.00 10
|
||||
Mark 5.00 20
|
||||
Mary 5.50 22
|
||||
Susie 4.25 18
|
@ -1,5 +0,0 @@
|
||||
NF != 3 { print $0, "number of fields is not equal to 3"; }
|
||||
$2 < 3.35 { print $0, "rate is below minimum wage"; }
|
||||
$2 > 10 { print $0, "rate exceeds $10 per hour"; }
|
||||
$3 < 0 { print $0, "negative hours worked"; }
|
||||
$3 > 60 { print $0, "too many hours worked"; }
|
@ -1,20 +0,0 @@
|
||||
(NF != 3) {
|
||||
print $0,"number of fields is not equal to 3";
|
||||
}
|
||||
|
||||
($2 < 3.35) {
|
||||
print $0,"rate is below minimum wage";
|
||||
}
|
||||
|
||||
($2 > 10) {
|
||||
print $0,"rate exceeds $10 per hour";
|
||||
}
|
||||
|
||||
($3 < 0) {
|
||||
print $0,"negative hours worked";
|
||||
}
|
||||
|
||||
($3 > 60) {
|
||||
print $0,"too many hours worked";
|
||||
}
|
||||
|
@ -1,2 +0,0 @@
|
||||
BEGIN { print "NAME RATE HOURS"; print ""; }
|
||||
{ print; }
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user