1 /*
2  * The contents of this file are subject to the Mozilla Public License
3  * Version 1.0 (the "License"); you may not use this file except in
4  * compliance with the License. You may obtain a copy of the License at
5  * http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9  * License for the specific language governing rights and limitations
10  * under the License.
11  *
12  * The Initial Developer of this code is David Baum.
13  * Portions created by David Baum are Copyright (C) 2000 David Baum.
14  * All Rights Reserved.
15  *
16  * Portions created by John Hansen are Copyright (C) 2005 John Hansen.
17  * All Rights Reserved.
18  *
19  */
20 
21 #ifndef __ShiftExpr_h
22 #define __ShiftExpr_h
23 
24 #include "NodeExpr.h"
25 
26 class ShiftExpr : public NodeExpr
27 {
28 public:
29 	enum {
30 		kRight = 0,
31 		kLeft
32 	};
33 
ShiftExpr(Expr * lhs,Expr * rhs,int direction)34 			ShiftExpr(Expr *lhs, Expr *rhs, int direction) : NodeExpr(lhs, rhs), fDirection(direction) {};
35 
36 	virtual bool		Evaluate(int &value) const;
37 	virtual Expr*		Clone(Mapping *b) const;
38 
39 	virtual RCX_Value	EmitAny_(Bytecode &b) const;
40 	virtual bool		EmitTo_(Bytecode &b, int dst) const;
41 
42 private:
43 	int		fDirection;
44 };
45 
46 
47 #endif
48