/************************************************************************* * * HTCd - Copyright (C) 1998-2006 Henrik Rydberg * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include OP1_IMPL(exp) { out<>atoi(R));} OP1_IMPL(bitnot) {out<<~atoi(a);} OP2_IMPL(bitand) {out<<(atoi(L)&atoi(R)); } OP2_IMPL(bitor) {out<<(atoi(L)|atoi(R)); } OP2_IMPL(bitxor) {out<<(atoi(L)^atoi(R)); } OP2_IMPL(SP) {out<>, "C style\n" "Shift right\n" "Syntax: (int) >> (int)\n" "Returns: (int)\n" ); OP_ADD(18,eq, "Lexicographic equal\n" "Syntax: (string) eq (string)\n" "Returns: (int)\n" ); OP_ADD(18,eqn, "Lexicographic equal, case insensitive\n" "Syntax: (string) eqn (string)\n" "Returns: (int)\n" ); OP_ADDN(18,eqf,==, "Arithmetic equal\n" "Syntax: (real) == (real)\n" "Returns: (int)\n" ); OP_ADD(18,ne, "Lexicographic not equal\n" "Syntax: (string) ne (string)\n" "Returns: (int)\n" ); OP_ADD(18,nen, "Lexicographic not equal, case insensitive\n" "Syntax: (string) nen (string)\n" "Returns: (int)\n" ); OP_ADDN(18,nef,!=, "Arithmetic not equal\n" "Syntax: (real) != (real)\n" "Returns: (int)\n" ); OP_ADDN(16,bitand,&, "C style\n" "Bitwise AND\n" "Syntax: (int) & (int)\n" "Returns: (int)\n" ); OP_ADDN(14,bitxor,^, "C style\n" "Bitwise XOR\n" "Syntax: (int) ^ (int)\n" "Returns: (int)\n" ); OP_ADDN(12,bitor,|, "C style\n" "Bitwise OR\n" "Syntax: (int) | (int)\n" "Returns: (int)\n" ); OP_ADDN(10,and,&&, "C style\n" "Logical AND\n" "Syntax: (int) && (int)\n" "Returns: (int)\n" ); OP_ADDN(9,xor,^^, "Logical XOR\n" "Syntax: (int) ^^ (int)\n" "Returns: (int)\n" ); OP_ADDN(8,or,||, "C style\n" "Logical OR\n" "Syntax: (int) || (int)\n" "Returns: (int)\n" ); /* OP_ADD(3,SP, "Whitespace padding\n" "Syntax: a ws OR ws a OR a ws b\n" "Returns: a b\n" ); */ M.add(new op_t(",",2,impl_comma, "C style\n" "Separate expression\n" "Syntax: a , b\n" "Returns: b\n" )); OP_ADD2(1,1,semi,;, "C style\n" "End expression\n" "Syntax: a ; OR a ; b\n" "Returns: nothing\n" ); }