2014-01-10 14:54:46 +00:00
|
|
|
# This script requires QSEAWK.
|
|
|
|
|
2014-01-09 15:32:36 +00:00
|
|
|
BEGIN {
|
|
|
|
printf ("-- Generated with ascii.txt and ascii.awk\n");
|
|
|
|
printf ("-- Run qseawk -f ascii.awk ascii.txt > h2-ascii.ads for regeneration\n\n");
|
2014-06-21 16:31:49 +00:00
|
|
|
printf ("generic\n");
|
|
|
|
printf ("\ttype Slim_Character is (<>);\n");
|
|
|
|
printf ("\ttype Wide_Character is (<>);\n");
|
|
|
|
printf ("package H2.Ascii is\n\n");
|
|
|
|
#printf ("\tpragma Preelaborate (Ascii);\n\n");
|
|
|
|
printf ("\tpackage Code is\n");
|
2014-01-09 15:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
t = sprintf ("%c", NR - 1);
|
|
|
|
if (str::isprint(t)) t = " -- " t;
|
|
|
|
else t="";
|
2014-01-10 08:12:40 +00:00
|
|
|
printf ("\t\t%-20s: constant := %d;%s\n", $1, NR-1, t);
|
|
|
|
X[NR - 1] = $1;
|
2014-01-09 15:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
END {
|
2014-06-21 16:31:49 +00:00
|
|
|
printf ("\tend Code;\n\n");
|
|
|
|
|
|
|
|
printf ("\tpackage Slim is\n");
|
2014-01-10 08:12:40 +00:00
|
|
|
for (i = 0; i < length(X); i++)
|
|
|
|
{
|
2014-06-21 16:31:49 +00:00
|
|
|
printf ("\t\t%-20s: constant Slim_Character := Slim_Character'Val(Code.%s);\n", X[i], X[i]);
|
2014-01-10 08:12:40 +00:00
|
|
|
}
|
2014-06-21 16:31:49 +00:00
|
|
|
printf ("\tend Slim;\n");
|
|
|
|
|
|
|
|
printf ("\n");
|
|
|
|
|
|
|
|
printf ("\tpackage Wide is\n");
|
|
|
|
for (i = 0; i < length(X); i++)
|
|
|
|
{
|
|
|
|
printf ("\t\t%-20s: constant Wide_Character := Wide_Character'Val(Code.%s);\n", X[i], X[i]);
|
|
|
|
}
|
|
|
|
printf ("\tend Wide;\n");
|
|
|
|
|
2014-01-09 15:32:36 +00:00
|
|
|
printf ("\nend H2.Ascii;\n");
|
|
|
|
}
|