void Relation() { Expression(); if(IsRelop(Look)) { Push(); switch(Look) { case '=': Equals();break; case '#': NotEquals();break; case '<': Less();break; case '>': Greater();break; } } }
void Relation() { Expression(); if (IsRelop(Look)) { EmitLn("push rax"); switch(Look) { case '=': Equals(); break; case '#': NotEquals(); break; case '<': Less(); break; case '>': Greater(); break; } EmitLn("add rsp, 8"); EmitLn("cmp rax, 0"); } }
void Relation(void) { message("Relation..."); Expression(); if (IsRelop(Token[0]) ) { message(" (Relation \'%c\')", Token[0]); Push(); switch (Token[0]) { case '=': Equals(); break; case '#': NotEquals(); break; case '<': Less(); break; case '>': Greater(); break; } } }
/* Parse and Translate a Relation */ void Relation() { Expression(); if (IsRelop(Token)) { Push(); switch (Token) { case '=': Equals(); break; case '<': Less(); break; case '>': Greater(); break; default: break; } } }
void Relation() { Expression(); if (IsRelop(Look)) { EmitLn("pushl %eax"); switch (Look) { case '=': Equals(); break; case '#': NotEquals(); break; case '<': Less(); break; case '>': Greater(); break; } } EmitLn("test %eax, %eax"); }