MCPcopy Create free account
hub / github.com/OpenSteam001/OpenSteamTool / parse

Method parse

tools/ipc_codegen/ipc_codegen.cpp:222–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220 explicit Parser(Lexer& lexer) : lexer_(lexer), token_(lexer.next()) {}
221
222 File parse() {
223 File file;
224 while (token_.kind != Tok::End) {
225 const Token kind = expect(Tok::Ident, "declaration");
226 if (kind.text == "enum") {
227 file.enums.push_back(parseEnum());
228 } else if (kind.text == "struct") {
229 file.structs.push_back(parseStruct());
230 } else if (kind.text == "protocol") {
231 file.protocols.push_back(parseProtocol());
232 } else if (kind.text == "interface") {
233 file.interfaces.push_back(parseInterface());
234 } else {
235 fail(kind.line, "unknown declaration '" + kind.text + "'");
236 }
237 }
238 validate(file);
239 return file;
240 }
241
242private:
243 EnumDecl parseEnum() {

Callers 2

generateFunction · 0.80
FetchActiveFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected