1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cx_sub.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #include <s2_luidl/cx_sub.hxx>
36 // NOT FULLY DECLARED SERVICES
37 #include <s2_luidl/tokrecv.hxx>
38 #include <../../parser/inc/tokens/parseinc.hxx>
39 #include <x_parse2.hxx>
40 #include <s2_luidl/tk_const.hxx>
50 Cx_Base::PassNewToken()
54 rReceiver
.Receive(*pNewToken
.Release());
61 Cx_Base::FollowUpContext()
63 csv_assert(pFollowUpContext
!= 0);
64 return *pFollowUpContext
;
68 Context_MLComment::ReadCharChain( CharacterSource
& io_rText
)
74 cNext
= jumpTo(io_rText
,'*','\n');
77 Receiver().Increment_CurLine();
78 cNext
= io_rText
.MoveOn();
80 else if (cNext
== NULCH
)
81 throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF
);
82 } while (cNext
!= '*');
84 cNext
= jumpOver(io_rText
,'*');
86 throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF
);
87 } while (cNext
!= '/');
94 Context_SLComment::ReadCharChain( CharacterSource
& io_rText
)
97 if (io_rText
.CurChar() != NULCH
)
98 jumpOverEol(io_rText
);
102 Receiver().Increment_CurLine();
106 Context_Praeprocessor::ReadCharChain( CharacterSource
& io_rText
)
109 if (io_rText
.CurChar() != NULCH
)
110 jumpOverEol(io_rText
);
114 Receiver().Increment_CurLine();
118 Context_Assignment::ReadCharChain( CharacterSource
& io_rText
)
121 // How to handle new lines within this, so he y get realised by
126 if ( (cNext
= jumpTo(io_rText
,';',',','"','}')) == NULCH
)
127 throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF
);
130 cNext
= io_rText
.MoveOn();
133 if ( (cNext
= jumpTo(io_rText
,'"','\\')) == NULCH
)
134 throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF
);
138 cNext
= io_rText
.MoveOn();
139 } // endif (cNext == '"')
140 } while (cNext
!= ';' AND cNext
!= ',' AND cNext
!= '}');
142 if (cNext
== ',' OR cNext
== ';')
144 SetToken(new TokAssignment(io_rText
.CutToken()));