MCPcopy Create free account
hub / github.com/GPUOpen-Tools/GPU-Reshape / Parse

Method Parse

Source/Test/Device/Generator/Source/Parser.cpp:35–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35bool Parser::Parse(const char *code) {
36 // Tokenize the stream
37 if (!Tokenize(code)) {
38 return false;
39 }
40
41 for (const TokenBucket& bucket : buckets) {
42 Context context(bucket.tokens);
43
44 // Try to parse as statement
45 if (!ParseStatement(context)) {
46 return false;
47 }
48
49 // Must be end of statement
50 if (!context.IsEOS()) {
51 context.Error("Expected end of statement");
52 return false;
53 }
54 }
55
56 // OK
57 return true;
58}
59
60bool Parser::Tokenize(const char *code) {
61 constexpr const char* kStatement = "//!";

Callers 1

mainFunction · 0.45

Calls 2

IsEOSMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected