blob: e009df242248e45c35320fbd2e2ed514ca9f3885 (
plain)
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
|
/*
* SenchaFunction.h
*
* Created on: Dec 30, 2012
* Author: att
*/
#ifndef SENCHAFUNCTION_H_
#define SENCHAFUNCTION_H_
#include <string>
#include <iostream>
#include <vector>
#include "SenchaObject.h"
#include "Element.h"
#include "../Utils/to_string.h"
#include "../AST/ASTNode.h"
/**
* SenchaFunction is a class which is an abstraction of function written in SenchaLang.
* It stores name of the function, its body, and provides () call operator.
*/
class SenchaFunction : public Element
{
public:
SenchaFunction(std::string name, std::vector<std::string> names_of_arguments, ASTNode * body);
SenchaObject operator()();
std::string name;
std::vector<std::string> names_of_arguments;
virtual ~SenchaFunction();
private:
ASTNode * body;
};
#endif /* SENCHAFUNCTION_H_ */
|