1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*78bc99aaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*78bc99aaSAndrew Rist * distributed with this work for additional information
6*78bc99aaSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*78bc99aaSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist * with the License. You may obtain a copy of the License at
10*78bc99aaSAndrew Rist *
11*78bc99aaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist *
13*78bc99aaSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist * KIND, either express or implied. See the License for the
17*78bc99aaSAndrew Rist * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist * under the License.
19*78bc99aaSAndrew Rist *
20*78bc99aaSAndrew Rist *************************************************************/
21cdf0e10cSrcweir
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <s2_luidl/cx_sub.hxx>
24cdf0e10cSrcweir
25cdf0e10cSrcweir
26cdf0e10cSrcweir
27cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
28cdf0e10cSrcweir #include <s2_luidl/tokrecv.hxx>
29cdf0e10cSrcweir #include <../../parser/inc/tokens/parseinc.hxx>
30cdf0e10cSrcweir #include <x_parse2.hxx>
31cdf0e10cSrcweir #include <s2_luidl/tk_const.hxx>
32cdf0e10cSrcweir
33cdf0e10cSrcweir
34cdf0e10cSrcweir
35cdf0e10cSrcweir namespace csi
36cdf0e10cSrcweir {
37cdf0e10cSrcweir namespace uidl
38cdf0e10cSrcweir {
39cdf0e10cSrcweir
40cdf0e10cSrcweir bool
PassNewToken()41cdf0e10cSrcweir Cx_Base::PassNewToken()
42cdf0e10cSrcweir {
43cdf0e10cSrcweir if (pNewToken)
44cdf0e10cSrcweir {
45cdf0e10cSrcweir rReceiver.Receive(*pNewToken.Release());
46cdf0e10cSrcweir return true;
47cdf0e10cSrcweir }
48cdf0e10cSrcweir return false;
49cdf0e10cSrcweir }
50cdf0e10cSrcweir
51cdf0e10cSrcweir TkpContext &
FollowUpContext()52cdf0e10cSrcweir Cx_Base::FollowUpContext()
53cdf0e10cSrcweir {
54cdf0e10cSrcweir csv_assert(pFollowUpContext != 0);
55cdf0e10cSrcweir return *pFollowUpContext;
56cdf0e10cSrcweir }
57cdf0e10cSrcweir
58cdf0e10cSrcweir void
ReadCharChain(CharacterSource & io_rText)59cdf0e10cSrcweir Context_MLComment::ReadCharChain( CharacterSource & io_rText )
60cdf0e10cSrcweir {
61cdf0e10cSrcweir char cNext = NULCH;
62cdf0e10cSrcweir
63cdf0e10cSrcweir do {
64cdf0e10cSrcweir do {
65cdf0e10cSrcweir cNext = jumpTo(io_rText,'*','\n');
66cdf0e10cSrcweir if (cNext == '\n')
67cdf0e10cSrcweir {
68cdf0e10cSrcweir Receiver().Increment_CurLine();
69cdf0e10cSrcweir cNext = io_rText.MoveOn();
70cdf0e10cSrcweir }
71cdf0e10cSrcweir else if (cNext == NULCH)
72cdf0e10cSrcweir throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF);
73cdf0e10cSrcweir } while (cNext != '*');
74cdf0e10cSrcweir
75cdf0e10cSrcweir cNext = jumpOver(io_rText,'*');
76cdf0e10cSrcweir if (cNext == NULCH)
77cdf0e10cSrcweir throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF);
78cdf0e10cSrcweir } while (cNext != '/');
79cdf0e10cSrcweir io_rText.MoveOn();
80cdf0e10cSrcweir io_rText.CutToken();
81cdf0e10cSrcweir SetToken(0);
82cdf0e10cSrcweir }
83cdf0e10cSrcweir
84cdf0e10cSrcweir void
ReadCharChain(CharacterSource & io_rText)85cdf0e10cSrcweir Context_SLComment::ReadCharChain( CharacterSource & io_rText )
86cdf0e10cSrcweir {
87cdf0e10cSrcweir jumpToEol(io_rText);
88cdf0e10cSrcweir if (io_rText.CurChar() != NULCH)
89cdf0e10cSrcweir jumpOverEol(io_rText);
90cdf0e10cSrcweir io_rText.CutToken();
91cdf0e10cSrcweir SetToken(0);
92cdf0e10cSrcweir
93cdf0e10cSrcweir Receiver().Increment_CurLine();
94cdf0e10cSrcweir }
95cdf0e10cSrcweir
96cdf0e10cSrcweir void
ReadCharChain(CharacterSource & io_rText)97cdf0e10cSrcweir Context_Praeprocessor::ReadCharChain( CharacterSource & io_rText )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir jumpToEol(io_rText);
100cdf0e10cSrcweir if (io_rText.CurChar() != NULCH)
101cdf0e10cSrcweir jumpOverEol(io_rText);
102cdf0e10cSrcweir io_rText.CutToken();
103cdf0e10cSrcweir SetToken(0);
104cdf0e10cSrcweir
105cdf0e10cSrcweir Receiver().Increment_CurLine();
106cdf0e10cSrcweir }
107cdf0e10cSrcweir
108cdf0e10cSrcweir void
ReadCharChain(CharacterSource & io_rText)109cdf0e10cSrcweir Context_Assignment::ReadCharChain( CharacterSource & io_rText )
110cdf0e10cSrcweir {
111cdf0e10cSrcweir // KORR_FUTURE
112cdf0e10cSrcweir // How to handle new lines within this, so he y get realised by
113cdf0e10cSrcweir // ParserInfo?
114cdf0e10cSrcweir
115cdf0e10cSrcweir char cNext = NULCH;
116cdf0e10cSrcweir do {
117cdf0e10cSrcweir if ( (cNext = jumpTo(io_rText,';',',','"','}')) == NULCH )
118cdf0e10cSrcweir throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF);
119cdf0e10cSrcweir if (cNext == '"')
120cdf0e10cSrcweir {
121cdf0e10cSrcweir cNext = io_rText.MoveOn();
122cdf0e10cSrcweir while (cNext != '"')
123cdf0e10cSrcweir {
124cdf0e10cSrcweir if ( (cNext = jumpTo(io_rText,'"','\\')) == NULCH )
125cdf0e10cSrcweir throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF);
126cdf0e10cSrcweir if (cNext == '\\')
127cdf0e10cSrcweir io_rText.MoveOn();
128cdf0e10cSrcweir }
129cdf0e10cSrcweir cNext = io_rText.MoveOn();
130cdf0e10cSrcweir } // endif (cNext == '"')
131cdf0e10cSrcweir } while (cNext != ';' AND cNext != ',' AND cNext != '}');
132cdf0e10cSrcweir
133cdf0e10cSrcweir if (cNext == ',' OR cNext == ';')
134cdf0e10cSrcweir io_rText.MoveOn();
135cdf0e10cSrcweir SetToken(new TokAssignment(io_rText.CutToken()));
136cdf0e10cSrcweir }
137cdf0e10cSrcweir
138cdf0e10cSrcweir
139cdf0e10cSrcweir } // namespace uidl
140cdf0e10cSrcweir } // namespace csi
141