35 lines
620 B
Awk
35 lines
620 B
Awk
#
|
|
# generrcode-java.awk
|
|
#
|
|
# aseawk -f generrcode-java.awk awk.h
|
|
#
|
|
|
|
BEGIN {
|
|
collect=0;
|
|
tab2="\t";
|
|
tab3="\t\t";
|
|
count=0;
|
|
}
|
|
|
|
/^[[:space:]]*enum[[:space:]]+ase_awk_errnum_t[[:space:]]*$/ {
|
|
collect=1;
|
|
print tab2 "// generated by generrcode-java.awk";
|
|
#print tab2 "enum ErrorCode";
|
|
#print tab2 "{";
|
|
}
|
|
|
|
collect && /^[[:space:]]*};[[:space:]]*$/ {
|
|
#print tab2 "};";
|
|
print tab2 "// end of error codes";
|
|
print "";
|
|
collect=0;
|
|
}
|
|
|
|
collect && /^[[:space:]]*ASE_AWK_E[[:alnum:]]+/ {
|
|
split ($1, flds, ",");
|
|
name=flds[1];
|
|
|
|
print tab2 "public static final int " substr (name,10,length(name)-9) " = " count++ ";";
|
|
}
|
|
|