MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / parseInterface

Method parseInterface

extern/cloop/src/cloop/Parser.cpp:129–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void Parser::parseInterface(bool exception)
130{
131 interface = new Interface();
132 interfaces.push_back(interface);
133
134 interface->name = getToken(token, Token::TYPE_IDENTIFIER).text;
135 typesByName.insert(pair<string, BaseType*>(interface->name, interface));
136
137 if (exception)
138 exceptionInterface = interface;
139
140 if (lexer->getToken(token).type == TOKEN(':'))
141 {
142 string superName = getToken(token, Token::TYPE_IDENTIFIER).text;
143 map<string, BaseType*>::iterator it = typesByName.find(superName);
144
145 if (it == typesByName.end() || it->second->type != BaseType::TYPE_INTERFACE)
146 error(token, string("Super interface '") + superName + "' not found.");
147
148 interface->super = static_cast<Interface*>(it->second);
149 interface->version = interface->super->version + 1;
150 }
151 else
152 lexer->pushToken(token);
153
154 getToken(token, TOKEN('{'));
155
156 while (lexer->getToken(token).type != TOKEN('}'))
157 {
158 if (token.type == Token::TYPE_VERSION)
159 {
160 getToken(token, TOKEN(':'));
161 ++interface->version;
162 }
163 else
164 lexer->pushToken(token);
165
166 parseItem();
167 }
168}
169
170void Parser::parseStruct()
171{

Callers

nothing calls this directly

Calls 7

pushTokenMethod · 0.80
getTokenFunction · 0.50
errorFunction · 0.50
push_backMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected