2019-11-06 03:40:26 +08:00
|
|
|
include "spec/spec.td"
|
|
|
|
|
|
|
|
class TypeDecl<string name> {
|
|
|
|
string Name = name;
|
|
|
|
string Decl = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
class MacroDef<string name> {
|
|
|
|
string Name = name;
|
|
|
|
string Defn = "";
|
|
|
|
}
|
|
|
|
|
2019-12-06 04:09:24 +08:00
|
|
|
class SimpleMacroDef<string name, string value> : MacroDef<name> {
|
|
|
|
let Defn = !strconcat("#define ", name, " ", value);
|
|
|
|
}
|
|
|
|
|
|
|
|
class MacroDefineIfNot<string name, string value> : MacroDef<name> {
|
|
|
|
let Defn = !strconcat("#ifndef ", name, "\n",
|
|
|
|
"#define " , name, " ", value, "\n",
|
|
|
|
"#endif // ", name);
|
|
|
|
}
|
|
|
|
|
2019-11-06 03:40:26 +08:00
|
|
|
class PublicAPI<string name> {
|
|
|
|
string HeaderName = name;
|
|
|
|
list<MacroDef> Macros = [];
|
|
|
|
list<TypeDecl> TypeDeclarations = [];
|
2020-02-28 06:30:24 +08:00
|
|
|
list<string> Enumerations = [];
|
2019-11-06 03:40:26 +08:00
|
|
|
list<string> Structs = [];
|
|
|
|
list<string> Functions = [];
|
|
|
|
}
|