Пример #1
0
void eprime()
{
	int incoming= relop();
	if(incoming == 1)
		simple_expr();		
	else
		return;
}
Пример #2
0
void
sql::write_lexicographic_comparison(relation r, const vector<thunk> &lhs, const vector<thunk> &rhs) {
    const string op = relop(r);
    switch (r) {
        case relation::equal:       return write_flat_lexicographic_comparison(op, " AND ", lhs, rhs);
        case relation::not_equal:   return write_flat_lexicographic_comparison(op, " OR ", lhs, rhs);
        default:                    return write_nesting_lexicographic_comparison(op, strict_relop(r), lhs, rhs);
    }
}
Пример #3
0
int eprime()
{
 if(relop())
 {
  if(simexpn())
   return 1;
  else
   return 0;
 }
 else
  return 1;
}
Пример #4
0
void SyntaxAnalyzer::condition() {
	cout << "<Condition> -> <Expression> <Relop> <Expression>" << endl;
	expression();
	string op = currentToken.lexeme();
	relop();
	expression();
	if (op == "<") {
		instTable.genInstr("LES", NIL);
		instTable.pushJumpStack();
		instTable.genInstr("JUMPZ", NIL);
	}
	else if (op == ">") {
		instTable.genInstr("GRT", NIL);
		instTable.pushJumpStack();
		instTable.genInstr("JUMPZ", NIL);
	}
	else if (op == "<=") {
		instTable.genInstr("LET", NIL);
		instTable.pushJumpStack();
		instTable.genInstr("JUMPZ", NIL);
	}
	else if (op == "=>") {
		instTable.genInstr("GET", NIL);
		instTable.pushJumpStack();
		instTable.genInstr("JUMPZ", NIL);
	}
	else if (op == "=") {
		instTable.genInstr("EQU", NIL);
		instTable.pushJumpStack();
		instTable.genInstr("JUMPZ", NIL);
	}
	else { // op == "!="
		instTable.genInstr("EQU", NIL);
		instTable.genInstr("PUSHI", -1);
		instTable.genInstr("MUL", NIL);
		instTable.pushJumpStack();
		instTable.genInstr("JUMPZ", NIL);
	}
}