7a3063db71c916c6861f65e08a791872bccf31c1
1 /************************************************************************
2 ************************************************************************
4 Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
5 ---------------------------------------------------------------------
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 ************************************************************************
20 ************************************************************************/
26 static bool noNtrl(const Node
& n
) { return false; }
28 BinOp
* gBinOpTable
[] = {
30 new BinOp("+","add_vec","add_scal", &addNode
, &isZero
, &isZero
, 6),
31 new BinOp("-","sub_vec","sub_scal", &subNode
, &noNtrl
, &isZero
, 7),
32 new BinOp("*","mul_vec","mul_scal", &mulNode
, &isOne
, &isOne
, 8),
33 new BinOp("/","div_vec","div_scal", &divNode
, &noNtrl
, &isOne
, 10),
34 new BinOp("%","mod_vec","mod_scal", &remNode
, &noNtrl
, &noNtrl
, 9),
36 new BinOp("<<","shift_left_vec","shift_left_scal", &lshNode
, &noNtrl
, &isZero
, 8),
37 new BinOp(">>","shift_right_vec","shift_right_scal", &rshNode
, &noNtrl
, &isZero
, 8),
39 new BinOp(">","gt_vec","gt_scal", >Node
, &noNtrl
, &noNtrl
, 5),
40 new BinOp("<","lt_vec","lt_scal", <Node
, &noNtrl
, &noNtrl
, 5),
41 new BinOp(">=","ge_vec","ge_scal", &geNode
, &noNtrl
, &noNtrl
, 5),
42 new BinOp("<=","le_vec","le_scal", &leNode
, &noNtrl
, &noNtrl
, 5),
43 new BinOp("==","eq_vec","eq_scal", &eqNode
, &noNtrl
, &noNtrl
, 5),
44 new BinOp("!=","neq_vec","neq_scal", &neNode
, &noNtrl
, &noNtrl
, 5),
46 new BinOp("&","and_vec","and_scal", &andNode
, &isMinusOne
, &isMinusOne
, 8),
47 new BinOp("|","or_vec","or_scal", &orNode
, &isZero
, &isZero
, 7),
48 new BinOp("^","xor_vec","xor_scal", &xorNode
, &noNtrl
, &noNtrl
, 8)
52 BinOp
* gBinOpLateqTable
[] = {
54 new BinOp("+","add_vec","add_scal", &addNode
, &isZero
, &isZero
, 6),
55 new BinOp("-","sub_vec","sub_scal", &subNode
, &noNtrl
, &isZero
, 7),
56 new BinOp("*","mul_vec","mul_scal", &mulNode
, &isOne
, &isOne
, 8), // \DeclareMathSymbol{*}{\mathbin}{symbols}{"01}
57 new BinOp("/","div_vec","div_scal", &divNode
, &noNtrl
, &isOne
, 10), // \frac{}{} used in generateBinOp
58 new BinOp("\\bmod","mod_vec","mod_scal", &remNode
, &noNtrl
, &noNtrl
, 9),
60 new BinOp("\\hiderel{\\ll}","shift_left_vec","shift_left_scal", &lshNode
, &noNtrl
, &isZero
, 8),
61 new BinOp("\\hiderel{\\gg}","shift_right_vec","shift_right_scal", &rshNode
, &noNtrl
, &isZero
, 8),
63 new BinOp("\\hiderel{>}","gt_vec","gt_scal", >Node
, &noNtrl
, &noNtrl
, 5),
64 new BinOp("\\hiderel{<}","lt_vec","lt_scal", <Node
, &noNtrl
, &noNtrl
, 5),
65 new BinOp("\\hiderel{\\geq}","ge_vec","ge_scal", &geNode
, &noNtrl
, &noNtrl
, 5),
66 new BinOp("\\hiderel{\\leq}","le_vec","le_scal", &leNode
, &noNtrl
, &noNtrl
, 5),
67 new BinOp("\\hiderel{\\equiv}","eq_vec","eq_scal", &eqNode
, &noNtrl
, &noNtrl
, 5),
68 new BinOp("\\hiderel{\\neq}","neq_vec","neq_scal", &neNode
, &noNtrl
, &noNtrl
, 5),
70 new BinOp("\\wedge","and_vec","and_scal", &andNode
, &isMinusOne
, &isMinusOne
, 8),
71 new BinOp("\\vee","or_vec","or_scal", &orNode
, &isZero
, &isZero
, 7),
72 new BinOp("\\veebar","xor_vec","xor_scal", &xorNode
, &noNtrl
, &noNtrl
, 8)