-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfunction.h
66 lines (54 loc) · 1.5 KB
/
function.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include "../include/type_t.h"
#include "../include/statement_t.h"
#include "../include/function_t.h"
#include "primula.h"
class function_parser;
class function_overload_parser : public function_overload_t
{
public:
/*
std::string mangle; // Without parent name
function_parser * function;
arg_list_t arguments;
class namespace_t * space;
linkage_t linkage;
bool read_only_members;
Code::statement_list_t * source_code; // For second pass
*/
void MangleArguments();
void ParseArgunentDefinition(namespace_t * parent_space, SourcePtr source);
statement_t * CallParser(Code::lexem_list_t args_sequence);
function_overload_parser(function_parser * parent, linkage_t * linkage)
{
function = parent;
this->linkage = *linkage;
space = nullptr;
source_code = nullptr;
}
};
class function_parser : public function_t// public type_t
{
public:
/*
std::string name;
type_t * type;
function_overload_list_t overload_list;
enum { method, constructor, destructor } method_type;
*/
function_parser(
type_t * type,
std::string name)
:
function_t(type, name)
// : type_t((char*)type->name.data(), funct_ptr_type, type->bitsize)
{
//this->name = name;
//this->type = type;
//method_type = method;
}
void RegisterFunctionOverload(function_overload_t * overload);
void FindBestFunctionOverload(call_t * call);
function_overload_t * FindOverload(call_t * call);
call_t * TryCallFunction(namespace_t * space, SourcePtr & arg);
};