This message (https://gcc.gnu.org/ml/gcc/2018-07/msg00233.html) just reminder
me about my idea to allow using JavaScript with regular expression with
connection to C preprocessor to make things easier in C? For example - define
macro-definition, with adds builds structure definition based on information
gained before structure definition. Currently it's quite umplesant. It will
allow to do in C things like with usage of Class/Function templates from C++.
For example:
/* File a.h */
#js generate-struct(name) {
let output = "struct " + name + '}';
if (definied(name # "_is_list") {
output += "struct " + name + " *next;";
list_types[list_types.length] = "struct " + name;
}
return output;
}
/* Another file */
#include "a.h"
#js put_all_list_procedure {
let output = '';
for (a in list_types) {
// We now create prepend, append, get_next, etc. functions, for example
output += list_types[a] + "*get_next(" + list_types[a] +"*prev) { return
prev->next; }";
}
return output;
}
I can work on it, but I'm lack of free time, resources and good hardware. I
have downloaded gcc sources previousle and there's too many files - compiling
it will take eras! And of course - somebody should give me a free hand.
--
Pozdrawiam,
Lach Sławomir.