source: icXML/icXML-devel/src/xercesc/util/regx/Op.cpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 7.0 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: Op.cpp 678879 2008-07-22 20:05:05Z amassari $
20 */
21
22// ---------------------------------------------------------------------------
23//  Includes
24// ---------------------------------------------------------------------------
25#include <xercesc/util/regx/Op.hpp>
26#include <icxercesc/util/XMLString.hpp>
27
28XERCES_CPP_NAMESPACE_BEGIN
29
30// ---------------------------------------------------------------------------
31//  Op: Constructors and Destructors
32// ---------------------------------------------------------------------------
33Op::Op(const Op::opType type, MemoryManager* const manager) 
34    : fMemoryManager(manager)
35    , fOpType(type)
36    , fNextOp(0)
37{
38}
39
40// ---------------------------------------------------------------------------
41//  Op: Getter methods
42// ---------------------------------------------------------------------------
43XMLSize_t Op::getSize() const {
44
45    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
46    return 0; // for compilers that complain about no return value
47}
48
49XMLInt32 Op::getData() const {
50
51    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
52    return 0; // for compilers that complain about no return value
53}
54
55XMLInt32 Op::getData2() const {
56
57    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
58    return 0; // for compilers that complain about no return value
59}
60
61const Op* Op::elementAt(XMLSize_t) const {
62
63    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
64    return 0; // for compilers that complain about no return value
65}
66
67const Op* Op::getChild() const {
68
69    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
70    return 0; // for compilers that complain about no return value
71}
72
73const XMLCh* Op::getLiteral() const {
74
75    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
76    return 0; // for compilers that complain about no return value
77}
78   
79const Token* Op::getToken() const {
80
81    ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
82    return 0; // for compilers that complain about no return value
83}
84
85
86// ---------------------------------------------------------------------------
87//  CharOp: Constructors and Destuctors
88// ---------------------------------------------------------------------------
89CharOp::CharOp(const Op::opType type, const XMLInt32 charData
90               , MemoryManager* const manager)
91    : Op(type, manager)
92      , fCharData(charData) {
93}
94
95// ---------------------------------------------------------------------------
96//  CharOp: Getter methods
97// ---------------------------------------------------------------------------
98XMLInt32 CharOp::getData() const {
99
100    return fCharData;
101}
102
103// ---------------------------------------------------------------------------
104//  UnionOp: Constructors and Destuctors
105// ---------------------------------------------------------------------------
106UnionOp::UnionOp(const Op::opType type, const XMLSize_t size, MemoryManager* const manager)
107    : Op(type, manager)
108      , fBranches(new (manager) RefVectorOf<Op> (size, false, manager)) {
109
110}
111
112// ---------------------------------------------------------------------------
113//  UnionOp: Getter/Setter methods
114// ---------------------------------------------------------------------------
115XMLSize_t UnionOp::getSize() const {
116
117    return fBranches->size();
118}
119
120const Op* UnionOp::elementAt(XMLSize_t index) const {
121
122    return fBranches->elementAt(index);
123}
124
125void UnionOp::addElement(Op* const op) {
126
127    fBranches->addElement(op);
128}
129
130// ---------------------------------------------------------------------------
131//  ChildOp: Constructors and Destuctors
132// ---------------------------------------------------------------------------
133ChildOp::ChildOp(const Op::opType type, MemoryManager* const manager)
134    : Op(type, manager)
135      , fChild(0) {
136
137}
138
139// ---------------------------------------------------------------------------
140//  ChildOp: Getter/Setter methods
141// ---------------------------------------------------------------------------
142const Op* ChildOp::getChild() const {
143
144    return fChild;
145}
146
147void ChildOp::setChild(const Op* const child) {
148
149    fChild = child;
150}
151
152// ---------------------------------------------------------------------------
153//  ModifierOp: Constructors and Destuctors
154// ---------------------------------------------------------------------------
155ModifierOp::ModifierOp(const Op::opType type, const XMLInt32 v1, const XMLInt32 v2
156                       , MemoryManager* const manager)
157    : ChildOp(type, manager)
158      , fVal1(v1)
159      , fVal2(v2) {
160
161}
162
163// ---------------------------------------------------------------------------
164//  ModifierOp: Getter methods
165// ---------------------------------------------------------------------------
166XMLInt32 ModifierOp::getData() const {
167
168    return fVal1;
169}
170
171XMLInt32 ModifierOp::getData2() const {
172
173    return fVal2;
174}
175
176// ---------------------------------------------------------------------------
177//  RangeOp: Constructors and Destuctors
178// ---------------------------------------------------------------------------
179RangeOp::RangeOp(const Op::opType type, const Token* const token, MemoryManager* const manager)
180    : Op (type, manager)
181      , fToken(token) {
182
183}
184
185// ---------------------------------------------------------------------------
186//  RangeOp: Getter methods
187// ---------------------------------------------------------------------------
188const Token* RangeOp::getToken() const {
189
190    return fToken;
191}
192
193
194// ---------------------------------------------------------------------------
195//  StringOp: Constructors and Destuctors
196// ---------------------------------------------------------------------------
197StringOp::StringOp(const Op::opType type, const XMLCh* const literal
198                   , MemoryManager* const manager)
199    : Op (type, manager)
200      , fLiteral(XMLString::replicate(literal, manager)) {
201
202}
203
204// ---------------------------------------------------------------------------
205//  StringOp: Getter methods
206// ---------------------------------------------------------------------------
207const XMLCh* StringOp::getLiteral() const {
208
209    return fLiteral;
210}
211
212XERCES_CPP_NAMESPACE_END
213
214/**
215  * End file Op.cpp
216  */
Note: See TracBrowser for help on using the repository browser.