2007-05-21 01:22:00 +00:00
|
|
|
#
|
|
|
|
# generrcode.awk
|
|
|
|
#
|
2008-12-21 21:35:07 +00:00
|
|
|
# qseawk -f generrcode.awk awk.h
|
2007-05-21 01:22:00 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
collect=0;
|
|
|
|
tab3="\t\t";
|
|
|
|
tab4="\t\t\t";
|
|
|
|
}
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/^[[:space:]]*enum[[:space:]]+qse_awk_errnum_t[[:space:]]*$/ {
|
2007-05-21 01:22:00 +00:00
|
|
|
collect=1;
|
|
|
|
print tab3 "// generated by generrcode.awk";
|
2009-06-02 07:33:01 +00:00
|
|
|
print tab3 "enum ErrorNumber";
|
2007-05-21 01:22:00 +00:00
|
|
|
print tab3 "{";
|
|
|
|
}
|
|
|
|
|
|
|
|
collect && /^[[:space:]]*};[[:space:]]*$/ {
|
|
|
|
print tab3 "};";
|
2009-06-02 07:33:01 +00:00
|
|
|
print tab3 "// end of enum ErrorNumber";
|
2007-05-21 01:22:00 +00:00
|
|
|
print "";
|
|
|
|
collect=0;
|
|
|
|
}
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
collect && /^[[:space:]]*QSE_AWK_E[[:alnum:]]+/ {
|
2007-05-21 01:22:00 +00:00
|
|
|
split ($1, flds, ",");
|
|
|
|
name=flds[1];
|
|
|
|
|
2007-06-28 00:27:00 +00:00
|
|
|
print tab4 "ERR_" substr (name,10,length(name)-9) " = " name ",";
|
2007-05-21 01:22:00 +00:00
|
|
|
}
|
|
|
|
|