2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 // $XConsortium: testparser.C /main/4 1996/08/21 15:51:08 drk $
25 #include "PathTable.h"
28 #include "StyleSheetExceptions.h"
29 #include "VariableTable.h"
30 #include "StyleSheet.h"
33 Renderer* gRenderer = 0;
35 extern int styleparse();
36 extern int stylerestart(FILE*);
47 v1.shiftRightOneBit();
53 MESSAGE(cerr, "v2 | v1");
61 MESSAGE(cerr, "v3 & v1");
69 MESSAGE(cerr, "v4 ^ v1");
76 SSPath t(argv[1], false);
78 SSPath p(argv[2], true);
82 EncodedPath ep(&p, true);
84 debug(cerr, ep.match(et, 0, 0));
87 test3( int argc, char* argv[] )
93 for ( int i=1; i<argc-1; i++ ) {
94 px = new SSPath(argv[i], (FeatureSet*)i);
95 pt.addPathFeatureSet(px);
99 SSPath pq(argv[argc-2], false);
101 debug(cerr, int(pt.getFeatureSet(pq)));
105 test4( int argc, char* argv[] )
108 stylein = fopen(argv[1], "r");
109 if ( stylein == 0 ) {
110 MESSAGE(cerr, "open file failed");
115 debug(cerr, *gVariableTable);
117 debug(cerr, *gPathTab);
121 MESSAGE(cerr, "no file argument");
124 struct XmappingTable_t {
126 char* SubFeatureNameList;
127 char Value; // d: directly from the value()
128 // i: indrectly from the value()
129 char* Source; // l: local FeatureSet
130 // p: parent FeatureSet
131 // c: Combined FeatureSet
132 // can be a list of l, p, c
136 main( int argc, char* argv[] )
143 if ( strcmp(argv[1], "test1") == 0 )
146 if ( strcmp(argv[1], "test2") == 0 )
149 if ( strcmp(argv[1], "test3") == 0 )
150 test3(argc-1, &argv[1]);
152 if ( strcmp(argv[1], "test4") == 0 )
153 test4(argc-1, &argv[1]);
156 void styleerror( char* errorstr )
158 MESSAGE(cerr, errorstr);