Pol  Revision:4b29d2b
userfunc.h
Go to the documentation of this file.
1 
7 #ifndef BSCRIPT_USERFUNC_H
8 #define BSCRIPT_USERFUNC_H
9 
10 #include <set>
11 #include <string>
12 #include <vector>
13 
14 #include "compctx.h"
15 #include "token.h"
16 
17 namespace Pol
18 {
19 namespace Bscript
20 {
21 class UserParam
22 {
23 public:
24  std::string name;
28  bool unused;
29 
30  UserParam() : name( "" ), have_default( false ), pass_by_reference( false ), unused( false ) {}
31 };
32 
34 {
35 public:
36  UserFunction();
37  ~UserFunction();
38 
39  std::string name;
40  typedef std::vector<UserParam> Parameters;
41  Parameters parameters;
42  unsigned position;
43  typedef std::vector<unsigned> Addresses;
44  Addresses forward_callers;
45 
47  char* function_body; // FIXME: this is leaked
48  bool exported;
49  bool emitted;
50  std::string declaration;
51 
52 public:
53  static unsigned int instances();
54  static void show_instances();
55 
56 protected:
57  static unsigned int _instances;
58  static std::set<UserFunction*> _instancelist;
59  void register_instance();
60  void unregister_instance();
61 };
62 }
63 }
64 #endif
static std::set< UserFunction * > _instancelist
Definition: userfunc.h:58
CompilerContext ctx
Definition: userfunc.h:46
std::string name
Definition: userfunc.h:24
std::string declaration
Definition: userfunc.h:50
std::vector< UserParam > Parameters
Definition: userfunc.h:40
static unsigned int _instances
Definition: userfunc.h:57
std::vector< unsigned > Addresses
Definition: userfunc.h:43
Definition: berror.cpp:12