forked from xxq250/Nasal-Interpreter
Delete nasal_functional.h
This commit is contained in:
@@ -1,101 +0,0 @@
|
||||
#ifndef __NASAL_FUNCTIONAL_H__
|
||||
#define __NASAL_FUNCTIONAL_H__
|
||||
|
||||
#include "nasal_var.h"
|
||||
|
||||
//for function
|
||||
#define FUNC_BEGIN 0
|
||||
#define FUNC_OPERATOR 1
|
||||
#define FUNC_IDENTIFIER 2
|
||||
#define FUNC_NUMBER 3
|
||||
#define FUNC_RESERVEWORD 4
|
||||
#define FUNC_STRING 5
|
||||
|
||||
//for token and lexer
|
||||
#define OPERATOR 1 //<2F><><EFBFBD><EFBFBD> or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define IDENTIFIER 2 //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6>
|
||||
#define NUMBER 3 //<2F><><EFBFBD><EFBFBD>
|
||||
#define RESERVEWORD 4 //<2F>ؼ<EFBFBD><D8BC><EFBFBD>
|
||||
#define STRING 5 //<2F>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
struct token_unit
|
||||
{
|
||||
int type;
|
||||
std::string content;
|
||||
int line;
|
||||
token_unit *next;
|
||||
};
|
||||
|
||||
struct parameter
|
||||
{
|
||||
std::string var_name;
|
||||
var param_var;
|
||||
parameter *next;
|
||||
};
|
||||
|
||||
class func
|
||||
{
|
||||
private:
|
||||
token_unit *statement_head;
|
||||
parameter *parameter_head;
|
||||
public:
|
||||
func();
|
||||
func(const func&);
|
||||
~func();
|
||||
func& operator=(const func&);
|
||||
void append_var(std::string&,var&);
|
||||
void append_token(const int,const int,std::string &);
|
||||
void print_info();
|
||||
};
|
||||
|
||||
class token_list
|
||||
{
|
||||
private:
|
||||
token_unit *head;
|
||||
int list_range;
|
||||
public:
|
||||
token_list();
|
||||
~token_list();
|
||||
token_unit* get_head();
|
||||
int get_list_range();
|
||||
void print_line_token(const int);
|
||||
void delete_all();
|
||||
void append(const int,const int,std::string&);
|
||||
void print();
|
||||
};
|
||||
|
||||
token_list nasal_lexer;
|
||||
|
||||
struct parse_unit
|
||||
{
|
||||
int type;
|
||||
std::string content;
|
||||
int line;
|
||||
};
|
||||
|
||||
class parse
|
||||
{
|
||||
private:
|
||||
parse_unit *content_array;
|
||||
parse_unit *statement;
|
||||
int len;
|
||||
public:
|
||||
parse();
|
||||
~parse();
|
||||
void content_array_set_empty();
|
||||
void statement_set_empty();
|
||||
void brace_check();
|
||||
bool def_function();
|
||||
bool def_array();
|
||||
bool def_hash();
|
||||
bool def_scalar();
|
||||
bool asi_function();
|
||||
bool asi_array();
|
||||
bool asi_hash();
|
||||
bool asi_scalar();
|
||||
void definition();
|
||||
void assignment();
|
||||
void total_run(token_list&);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user