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_a_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 <adoc/cx_a_sub.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <tokens/parseinc.hxx>
37 #include <x_parse.hxx>
38 #include <adoc/tk_docw.hxx>
43 //************************ Cx_LineStart ************************//
45 Cx_LineStart::Cx_LineStart( TkpContext
& i_rFollowUpContext
)
47 pFollowUpContext(&i_rFollowUpContext
)
52 Cx_LineStart::ReadCharChain( CharacterSource
& io_rText
)
55 for ( char cNext
= io_rText
.CurChar(); cNext
== 32 OR cNext
== 9; cNext
= io_rText
.MoveOn() )
65 pNewToken
= new Tok_LineStart(UINT8(nCount
));
67 pNewToken
= new Tok_LineStart(0);
71 Cx_LineStart::PassNewToken()
75 pNewToken
.Release()->DealOut(*pDealer
);
82 Cx_LineStart::FollowUpContext()
84 return *pFollowUpContext
;
88 //************************ Cx_CheckStar ************************//
90 Cx_CheckStar::Cx_CheckStar( TkpContext
& i_rFollowUpContext
)
92 pFollowUpContext(&i_rFollowUpContext
),
93 pEnd_FollowUpContext(0),
101 Cx_CheckStar::ReadCharChain( CharacterSource
& io_rText
)
103 bEndTokenFound
= false;
106 char cNext
= jumpOver(io_rText
,'*');
107 if ( NULCH
== cNext
)
108 throw X_Parser(X_Parser::x_UnexpectedEOF
, "", String::Null_(), 0);
112 pNewToken
= new Tok_EoDocu
;
113 bEndTokenFound
= true;
117 pNewToken
= new Tok_DocWord(io_rText
.CutToken());
122 jumpToWhite(io_rText
);
123 pNewToken
= new Tok_DocWord(io_rText
.CutToken());
128 Cx_CheckStar::PassNewToken()
132 pNewToken
.Release()->DealOut(*pDealer
);
139 Cx_CheckStar::FollowUpContext()
142 return *pEnd_FollowUpContext
;
144 return *pFollowUpContext
;
148 //************************ Cx_AtTagCompletion ************************//
150 Cx_AtTagCompletion::Cx_AtTagCompletion( TkpContext
& i_rFollowUpContext
)
152 pFollowUpContext(&i_rFollowUpContext
)
157 Cx_AtTagCompletion::ReadCharChain( CharacterSource
& io_rText
)
159 jumpToWhite(io_rText
);
160 csv_assert(fCur_TokenCreateFunction
!= 0);
161 pNewToken
= (*fCur_TokenCreateFunction
)(io_rText
.CutToken());
165 Cx_AtTagCompletion::PassNewToken()
169 pNewToken
.Release()->DealOut(*pDealer
);
176 Cx_AtTagCompletion::FollowUpContext()
178 return *pFollowUpContext
;