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

Method parse

extern/cloop/src/cloop/Parser.cpp:45–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void Parser::parse()
46{
47 interface = NULL;
48
49 while (true)
50 {
51 bool exception = false;
52 lexer->getToken(token);
53
54 if (token.type == Token::TYPE_EOF)
55 break;
56 else if (token.type == TOKEN('['))
57 {
58 getToken(token, Token::TYPE_EXCEPTION); // This is the only attribute we allow now.
59 exception = true;
60 getToken(token, TOKEN(']'));
61 }
62 else
63 lexer->pushToken(token);
64
65 lexer->getToken(token);
66
67 switch (token.type)
68 {
69 case Token::TYPE_INTERFACE:
70 parseInterface(exception);
71 break;
72
73 case Token::TYPE_STRUCT:
74 if (exception)
75 error(token, "Cannot use attribute exception in struct.");
76 parseStruct();
77 break;
78
79 case Token::TYPE_TYPEDEF:
80 if (exception)
81 error(token, "Cannot use attribute exception in typedef.");
82 parseTypedef();
83 break;
84
85 case Token::TYPE_BOOLEAN:
86 if (exception)
87 error(token, "Cannot use attribute exception in boolean.");
88 parseBoolean();
89 break;
90
91 default:
92 syntaxError(token);
93 break;
94 }
95 }
96
97 // Check types, assign statusName to methods.
98
99 for (vector<Interface*>::iterator i = interfaces.begin(); i != interfaces.end(); ++i)
100 {
101 Interface* interface = *i;
102

Callers 1

runFunction · 0.45

Calls 9

parseBooleanFunction · 0.85
checkTypeFunction · 0.85
pushTokenMethod · 0.80
getTokenFunction · 0.50
errorFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45

Tested by

no test coverage detected