MCPcopy Create free account
hub / github.com/GateNLP/gate-core / doState3

Method doState3

src/main/java/gate/sgml/Sgml2Xml.java:169–199  ·  view source on GitHub ↗

Just read the first char from the element's name and now analize the next char. If '>' the elem name was a single char -> state 1 IF is WhiteSpaces -> state 4 Otherwise stay in state 3 and read the elemnt's name

(char currChar)

Source from the content-addressed store, hash-verified

167 * Otherwise stay in state 3 and read the elemnt's name
168 */
169 private void doState3(char currChar){
170 if ( '>' == currChar ){
171
172 // save the pos where the element's name ends
173 elemNameEnd = m_cursor - 1;
174
175 // this is also the pos where to insert '/' for empty elements.
176 // In this case we have this situation <w> sau < w>
177 closePos = m_cursor - 1;
178
179 // get the name of the element
180 elemName = m_modifier.substring(elemNameStart,elemNameEnd);
181
182 // we put the element into stack
183 // we think in this point that the element is empty...
184 performFinalAction(elemName, closePos);
185
186 // go to state 1
187 m_currState = 1;
188 }
189 if (isWhiteSpace(currChar)){
190 // go to state 4
191 m_currState = 4;
192
193 // save the pos where the element's name ends
194 elemNameEnd = m_cursor - 1;
195
196 // get the name of the element
197 elemName = m_modifier.substring(elemNameStart,elemNameEnd);
198 }
199 }// doState3
200
201 /**
202 * We read the name of the element and we prepare for '>' or attributes

Callers 1

convertMethod · 0.95

Calls 2

performFinalActionMethod · 0.95
isWhiteSpaceMethod · 0.95

Tested by

no test coverage detected