1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #include <precomp.h> 29 #include "pe_ignor.hxx" 30 31 32 // NOT FULLY DECLARED SERVICES 33 34 35 namespace cpp { 36 37 38 39 PE_Ignore::PE_Ignore( Cpp_PE * i_pParent ) 40 : Cpp_PE(i_pParent), 41 nBracketCounter(0), 42 bBlockOpened(false) 43 { 44 Setup_StatusFunctions(); 45 } 46 47 48 PE_Ignore::~PE_Ignore() 49 { 50 } 51 52 void 53 PE_Ignore::Call_Handler( const cpp::Token & i_rTok ) 54 { 55 if ( NOT bBlockOpened ) 56 { 57 switch (i_rTok.TypeId()) 58 { 59 case Tid_SwBracket_Left: SetTokenResult(done, stay); 60 nBracketCounter++; 61 bBlockOpened = true; 62 break; 63 case Tid_Semicolon: SetTokenResult(done, pop_success); 64 break; 65 default: 66 SetTokenResult(done, stay); 67 } // end switch 68 } 69 else if ( nBracketCounter > 0 ) 70 { 71 SetTokenResult(done, stay); 72 73 switch (i_rTok.TypeId()) 74 { 75 case Tid_SwBracket_Left: nBracketCounter++; 76 break; 77 case Tid_SwBracket_Right: nBracketCounter--; 78 break; 79 } // end switch 80 } 81 else if ( i_rTok.TypeId() == Tid_Semicolon ) 82 { 83 SetTokenResult(done, pop_success); 84 } 85 else 86 { 87 SetTokenResult(not_done, pop_success); 88 } 89 } 90 91 void 92 PE_Ignore::Setup_StatusFunctions() 93 { 94 // Does nothing. 95 } 96 97 void 98 PE_Ignore::InitData() 99 { 100 nBracketCounter = 0; 101 bBlockOpened = false; 102 } 103 104 void 105 PE_Ignore::TransferData() 106 { 107 // Does nothing. 108 } 109 110 111 } // namespace cpp 112 113 114 115 116 117