Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / StyleSheet / PathQualifier.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: PathQualifier.h /main/5 1996/08/21 15:50:33 drk $ */
24 #ifndef _PathQualifier_h
25 #define _PathQualifier_h
26
27 #ifndef CDE_NEXT
28
29 #else
30 #include "dti_cc/CC_String.h"
31 #endif
32
33 #include "SymTab.h"
34
35 // PathEXPR = PathTERM | PathTERM log PathTERM
36
37 // PathTERM = position | attribute-selector
38
39 // position = posn eqop number
40 // attribute-selector = attribute eqop string
41
42 // log = and | or 
43
44
45 class Element;
46 class Symbol ;
47
48 enum PQEqOp { PQEqual, PQNotEqual };
49 enum PQBoolean { PQFalse, PQTrue };
50 enum PQLogOp { PQand, PQor };
51
52 class PQExpr
53 {
54 public:
55   virtual ~PQExpr();
56   virtual PQBoolean evaluate(const Element &) = 0;
57 };
58
59 class PQNot : public PQExpr
60 {
61 public:
62   PQNot(PQExpr *);
63   ~PQNot();
64   virtual PQBoolean evaluate(const Element &);
65 private:
66   PQExpr        *f_expr;
67 };
68
69
70 class PQPosition : public PQExpr
71 {
72 public:
73   PQPosition(PQEqOp optype, int position);
74   virtual PQBoolean evaluate(const Element &);
75
76 private:
77   PQEqOp        f_optype;
78   int   f_position ;
79 };
80
81 class PQSibling: public PQExpr
82 {
83 public:
84   PQSibling(PQEqOp optype, int sibling);
85   virtual PQBoolean evaluate(const Element &);
86
87 private:
88   PQEqOp        f_optype;
89   int   f_sibling;
90 };
91
92 class PQAttributeSelector : public PQExpr
93 {
94 public:
95   PQAttributeSelector(const Symbol &attrname, PQEqOp, const CC_String &string);
96   ~PQAttributeSelector();
97   virtual PQBoolean evaluate(const Element &);
98 private:
99   PQEqOp        f_optype ;
100   Symbol        f_attribute;
101   CC_String     f_string ;
102 };
103
104 class PQLogExpr : public PQExpr
105 {
106 public:
107
108   PQLogExpr(PQExpr *left, PQLogOp op, PQExpr *right);
109   ~PQLogExpr();
110
111   virtual PQBoolean evaluate(const Element &);
112
113 private:
114
115   PQLogOp        f_optype ;
116   PQExpr        *f_left ;
117   PQExpr        *f_right ;
118 };
119
120
121
122
123 #endif /* _PathQualifier_h */
124 /* DO NOT ADD ANY LINES AFTER THIS #endif */
125
126