示例#1
0
文件: M_syn.c 项目: proffK/iLab
node* get_P(){
	node* val = node_new();

	if (syntax_errno) return 0;

	if (*cur_c == '(') {
		
		++cur_c;
		val = get_E();

		if (*cur_c != ')') {
			syntax_errno = cur_c;
			return 0;
		}
		
		++cur_c;

		return val;

	}
	else {
		val = get_N();
		return val;
	}

	return 0;

}
示例#2
0
void sync_const() {
	String s;
	Form2->Edit1->Text = get_nb();
	Form2->Edit2->Text = get_k();
	Form2->Edit3->Text = make_name(get_Pb());
	Form2->Edit4->Text = make_name(get_E());
	Form2->Edit5->Text = make_name(get_G());
}
示例#3
0
文件: M_syn.c 项目: proffK/iLab
node* get_G0(char* input_string){
	node* val = node_new();
	cur_c = input_string;
	val = get_E();
	
	if (*cur_c == '\0' && syntax_errno == 0) return val;
	
	return val;
}	
示例#4
0
文件: M_syn.c 项目: proffK/iLab
node* get_E(){

	node* val = node_new();
	val = get_T();

	if (syntax_errno) return 0;
	
	if (*cur_c == '+' || *cur_c == '-'){
		
		node* operation = node_new();
		operation -> data = *cur_c;
		
		++cur_c;
		
		operation -> left = val;
		operation -> right = get_E();
		
		return operation;
	}

	return val;

}