1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22 #include <precomp.h>
23 #include "pe_ignor.hxx"
24
25
26 // NOT FULLY DECLARED SERVICES
27
28
29 namespace cpp {
30
31
32
PE_Ignore(Cpp_PE * i_pParent)33 PE_Ignore::PE_Ignore( Cpp_PE * i_pParent )
34 : Cpp_PE(i_pParent),
35 nBracketCounter(0),
36 bBlockOpened(false)
37 {
38 Setup_StatusFunctions();
39 }
40
41
~PE_Ignore()42 PE_Ignore::~PE_Ignore()
43 {
44 }
45
46 void
Call_Handler(const cpp::Token & i_rTok)47 PE_Ignore::Call_Handler( const cpp::Token & i_rTok )
48 {
49 if ( NOT bBlockOpened )
50 {
51 switch (i_rTok.TypeId())
52 {
53 case Tid_SwBracket_Left: SetTokenResult(done, stay);
54 nBracketCounter++;
55 bBlockOpened = true;
56 break;
57 case Tid_Semicolon: SetTokenResult(done, pop_success);
58 break;
59 default:
60 SetTokenResult(done, stay);
61 } // end switch
62 }
63 else if ( nBracketCounter > 0 )
64 {
65 SetTokenResult(done, stay);
66
67 switch (i_rTok.TypeId())
68 {
69 case Tid_SwBracket_Left: nBracketCounter++;
70 break;
71 case Tid_SwBracket_Right: nBracketCounter--;
72 break;
73 } // end switch
74 }
75 else if ( i_rTok.TypeId() == Tid_Semicolon )
76 {
77 SetTokenResult(done, pop_success);
78 }
79 else
80 {
81 SetTokenResult(not_done, pop_success);
82 }
83 }
84
85 void
Setup_StatusFunctions()86 PE_Ignore::Setup_StatusFunctions()
87 {
88 // Does nothing.
89 }
90
91 void
InitData()92 PE_Ignore::InitData()
93 {
94 nBracketCounter = 0;
95 bBlockOpened = false;
96 }
97
98 void
TransferData()99 PE_Ignore::TransferData()
100 {
101 // Does nothing.
102 }
103
104
105 } // namespace cpp
106
107
108
109
110
111