Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1.         if (expr[i].type == "op") {
  2.  
  3.             if (expr[i].specifier == "+" ||
  4.                 expr[i].specifier == "-" ||
  5.                 expr[i].specifier == "*" ||
  6.                 expr[i].specifier == "/")
  7.             {
  8.                 if ((expr[i - 1].type == "int" ||
  9.                     expr[i - 1].type == "float" ||
  10.                     expr[i - 1].type == "string" ||
  11.                     expr[i - 1].type == "var_int" ||
  12.                     expr[i - 1].type == "var_float" ||
  13.                     expr[i - 1].type == "var_string" ||
  14.                     expr[i - 1].type == "func" ||
  15.                     expr[i - 1].type == "user_func" ||
  16.                     expr[i - 1].specifier == ")")
  17.                     &&
  18.                     (expr[i + 1].type == "int" ||
  19.                         expr[i + 1].type == "float" ||
  20.                         expr[i + 1].type == "string" ||
  21.                         expr[i + 1].type == "var_int" ||
  22.                         expr[i + 1].type == "var_float" ||
  23.                         expr[i + 1].type == "var_string" ||
  24.                         expr[i + 1].type == "func" ||
  25.                         expr[i + 1].type == "user_func" ||
  26.                         expr[i + 1].specifier == "("))
  27.                 {
  28.                 }
  29.                 else {
  30.                     std::cout << ">>> SYNTAX ERROR: invalid operator placement. (Operator)" << std::endl;
  31.                     return false;
  32.                 }
  33.             }
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement