MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / ParseInterfaceDeclarationStatement

Function ParseInterfaceDeclarationStatement

InterfaceCompiler/main.cpp:291–311  ·  view source on GitHub ↗

interface IDENTIFIER {

Source from the content-addressed store, hash-verified

289
290// interface IDENTIFIER {
291std::shared_ptr<InterfaceDeclarationStatement> ParseInterfaceDeclarationStatement(std::vector<Token>::iterator& it){
292 std::string ifName = "";
293
294 Token& nameTok = *it;
295
296 if(nameTok.type != TokenIdentifier){
297 printf("error: [line %d:%d] Invalid token '%s'\n", nameTok.lineNum, nameTok.linePos, tokenNames[nameTok.type]);
298 exit(4);
299 }
300
301 ifName = nameTok.value;
302
303 Token& enterTok = *(++it);
304
305 if(enterTok.type != TokenLeftBrace){
306 printf("error: [line %d:%d] Invalid token '%s'\n", nameTok.lineNum, nameTok.linePos, tokenNames[nameTok.type]);
307 exit(4);
308 }
309
310 return std::shared_ptr<InterfaceDeclarationStatement>(new InterfaceDeclarationStatement(ifName));
311}
312
313// (TYPE IDENTIFIER, ...)
314ParameterList ParseParameterListStatement(const std::vector<Token>::iterator& end, std::vector<Token>::iterator& it){

Callers 1

ParseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected