renamed ase to qse
This commit is contained in:
33
qse/lib/awk/generrcode.awk
Normal file
33
qse/lib/awk/generrcode.awk
Normal file
@ -0,0 +1,33 @@
|
||||
#
|
||||
# generrcode.awk
|
||||
#
|
||||
# aseawk -f generrcode.awk awk.h
|
||||
#
|
||||
|
||||
BEGIN {
|
||||
collect=0;
|
||||
tab3="\t\t";
|
||||
tab4="\t\t\t";
|
||||
}
|
||||
|
||||
/^[[:space:]]*enum[[:space:]]+ase_awk_errnum_t[[:space:]]*$/ {
|
||||
collect=1;
|
||||
print tab3 "// generated by generrcode.awk";
|
||||
print tab3 "enum ErrorCode";
|
||||
print tab3 "{";
|
||||
}
|
||||
|
||||
collect && /^[[:space:]]*};[[:space:]]*$/ {
|
||||
print tab3 "};";
|
||||
print tab3 "// end of enum ErrorCode";
|
||||
print "";
|
||||
collect=0;
|
||||
}
|
||||
|
||||
collect && /^[[:space:]]*ASE_AWK_E[[:alnum:]]+/ {
|
||||
split ($1, flds, ",");
|
||||
name=flds[1];
|
||||
|
||||
print tab4 "ERR_" substr (name,10,length(name)-9) " = " name ",";
|
||||
}
|
||||
|
Reference in New Issue
Block a user