File: bif_arg.h

package info (click to toggle)
bifcl 1.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 516 kB
  • sloc: yacc: 646; lex: 456; sh: 195; cpp: 146; makefile: 33; ansic: 8
file content (38 lines) | stat: -rw-r--r-- 890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include <stdio.h>

enum builtin_func_arg_type {
#define DEFINE_BIF_TYPE(id, bif_type, bro_type, c_type, c_type_smart, accessor, accessor_smart, cast_smart, constructor, ctor_smart) \
	id,
#include "bif_type.def"
#undef DEFINE_BIF_TYPE
};

extern const char* builtin_func_arg_type_bro_name[];

class BuiltinFuncArg {
public:
	BuiltinFuncArg(const char* arg_name, int arg_type);
	BuiltinFuncArg(const char* arg_name, const char* arg_type_str,
	               const char* arg_attr_str = "");

	void SetAttrStr(const char* arg_attr_str)
		{
		attr_str = arg_attr_str;
		};

	const char* Name() const	{ return name; }
	int Type() const		{ return type; }

	void PrintBro(FILE* fp);
	void PrintCDef(FILE* fp, int n);
	void PrintCArg(FILE* fp, int n);
	void PrintBroValConstructor(FILE* fp);

protected:
	const char* name;
	int type;
	const char* type_str;
	const char* attr_str;
};