OpenCoverage

qqmljs.g #1

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/parser/qqmljs.g
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5namespace QQmlJS {-
6-
7class Engine;-
8-
9class __attribute__((visibility("default"))) Parser: protected QQmlJSGrammar-
10{-
11public:-
12 union Value {-
13 int ival;-
14 double dval;-
15 AST::VariableScope scope;-
16 AST::ForEachType forEachType;-
17 AST::ArgumentList *ArgumentList;-
18 AST::CaseBlock *CaseBlock;-
19 AST::CaseClause *CaseClause;-
20 AST::CaseClauses *CaseClauses;-
21 AST::Catch *Catch;-
22 AST::DefaultClause *DefaultClause;-
23 AST::Elision *Elision;-
24 AST::ExpressionNode *Expression;-
25 AST::TemplateLiteral *Template;-
26 AST::Finally *Finally;-
27 AST::FormalParameterList *FormalParameterList;-
28 AST::FunctionDeclaration *FunctionDeclaration;-
29 AST::Node *Node;-
30 AST::PropertyName *PropertyName;-
31 AST::Statement *Statement;-
32 AST::StatementList *StatementList;-
33 AST::Block *Block;-
34 AST::VariableDeclarationList *VariableDeclarationList;-
35 AST::Pattern *Pattern;-
36 AST::PatternElement *PatternElement;-
37 AST::PatternElementList *PatternElementList;-
38 AST::PatternProperty *PatternProperty;-
39 AST::PatternPropertyList *PatternPropertyList;-
40 AST::ClassElementList *ClassElementList;-
41-
42 AST::UiProgram *UiProgram;-
43 AST::UiHeaderItemList *UiHeaderItemList;-
44 AST::UiPragma *UiPragma;-
45 AST::UiImport *UiImport;-
46 AST::UiParameterList *UiParameterList;-
47 AST::UiPublicMember *UiPublicMember;-
48 AST::UiObjectDefinition *UiObjectDefinition;-
49 AST::UiObjectInitializer *UiObjectInitializer;-
50 AST::UiObjectBinding *UiObjectBinding;-
51 AST::UiScriptBinding *UiScriptBinding;-
52 AST::UiArrayBinding *UiArrayBinding;-
53 AST::UiObjectMember *UiObjectMember;-
54 AST::UiObjectMemberList *UiObjectMemberList;-
55 AST::UiArrayMemberList *UiArrayMemberList;-
56 AST::UiQualifiedId *UiQualifiedId;-
57 AST::UiQualifiedPragmaId *UiQualifiedPragmaId;-
58 AST::UiEnumMemberList *UiEnumMemberList;-
59 };-
60-
61public:-
62 Parser(Engine *engine);-
63 ~Parser();-
64-
65-
66 bool parse() { ++functionNestingLevel; bool r = parse(T_FEED_UI_PROGRAM); --functionNestingLevel; return
never executed: return r;
r;
never executed: return r;
}
0
67 bool parseStatement() { return
never executed: return parse(T_FEED_JS_STATEMENT);
parse(T_FEED_JS_STATEMENT);
never executed: return parse(T_FEED_JS_STATEMENT);
}
0
68 bool parseExpression() { return
executed 985 times by 2 tests: return parse(T_FEED_JS_EXPRESSION);
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
parse(T_FEED_JS_EXPRESSION);
executed 985 times by 2 tests: return parse(T_FEED_JS_EXPRESSION);
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
}
985
69 bool parseUiObjectMember() { ++functionNestingLevel; bool r = parse(T_FEED_UI_OBJECT_MEMBER); --functionNestingLevel; return
never executed: return r;
r;
never executed: return r;
}
0
70 bool parseProgram() { return
executed 2818020 times by 40 tests: return parse(T_FEED_JS_SCRIPT);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • ...
parse(T_FEED_JS_SCRIPT);
executed 2818020 times by 40 tests: return parse(T_FEED_JS_SCRIPT);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • ...
}
2818020
71 bool parseScript() { return
never executed: return parse(T_FEED_JS_SCRIPT);
parse(T_FEED_JS_SCRIPT);
never executed: return parse(T_FEED_JS_SCRIPT);
}
0
72 bool parseModule() { return
never executed: return parse(T_FEED_JS_MODULE);
parse(T_FEED_JS_MODULE);
never executed: return parse(T_FEED_JS_MODULE);
}
0
73-
74 AST::UiProgram *ast() const-
75 { return
never executed: return AST::cast<AST::UiProgram *>(program);
AST::cast<AST::UiProgram *>(program);
never executed: return AST::cast<AST::UiProgram *>(program);
}
0
76-
77 AST::Statement *statement() const-
78 {-
79 if (! program
! programDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
80 return
never executed: return 0;
0;
never executed: return 0;
0
81-
82 return
never executed: return program->statementCast();
program->statementCast();
never executed: return program->statementCast();
0
83 }-
84-
85 AST::ExpressionNode *expression() const-
86 {-
87 if (! program
! programDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
88 return
never executed: return 0;
0;
never executed: return 0;
0
89-
90 return
never executed: return program->expressionCast();
program->expressionCast();
never executed: return program->expressionCast();
0
91 }-
92-
93 AST::UiObjectMember *uiObjectMember() const-
94 {-
95 if (! program
! programDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
96 return
never executed: return 0;
0;
never executed: return 0;
0
97-
98 return
never executed: return program->uiObjectMemberCast();
program->uiObjectMemberCast();
never executed: return program->uiObjectMemberCast();
0
99 }-
100-
101 AST::Node *rootNode() const-
102 { return
executed 2813969 times by 40 tests: return program;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • ...
program;
executed 2813969 times by 40 tests: return program;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • ...
}
2813969
103-
104 QList<DiagnosticMessage> diagnosticMessages() const-
105 { return
executed 2816740 times by 40 tests: return diagnostic_messages;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • ...
diagnostic_messages;
executed 2816740 times by 40 tests: return diagnostic_messages;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • ...
}
2816740
106-
107 inline DiagnosticMessage diagnosticMessage() const-
108 {-
109 for (const DiagnosticMessage &d : diagnostic_messages) {-
110 if (d.kind != DiagnosticMessage::Warning
d.kind != Diag...ssage::WarningDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
111 return
never executed: return d;
d;
never executed: return d;
0
112 }
never executed: end of block
0
113-
114 return
never executed: return DiagnosticMessage();
DiagnosticMessage();
never executed: return DiagnosticMessage();
0
115 }-
116-
117 inline QString errorMessage() const-
118 { return
never executed: return diagnosticMessage().message;
diagnosticMessage().message;
never executed: return diagnosticMessage().message;
}
0
119-
120 inline int errorLineNumber() const-
121 { return
never executed: return diagnosticMessage().loc.startLine;
diagnosticMessage().loc.startLine;
never executed: return diagnosticMessage().loc.startLine;
}
0
122-
123 inline int errorColumnNumber() const-
124 { return
never executed: return diagnosticMessage().loc.startColumn;
diagnosticMessage().loc.startColumn;
never executed: return diagnosticMessage().loc.startColumn;
}
0
125-
126protected:-
127 bool parse(int startToken);-
128-
129 void reallocateStack();-
130-
131 inline Value &sym(int index)-
132 { return
executed 297713653 times by 147 tests: return sym_stack [tos + index - 1];
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
sym_stack [tos + index - 1];
executed 297713653 times by 147 tests: return sym_stack [tos + index - 1];
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
}
297713653
133-
134 inline QStringRef &stringRef(int index)-
135 { return
executed 103079572 times by 147 tests: return string_stack [tos + index - 1];
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
string_stack [tos + index - 1];
executed 103079572 times by 147 tests: return string_stack [tos + index - 1];
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
}
103079572
136-
137 inline AST::SourceLocation &loc(int index)-
138 { return
executed 153093373 times by 147 tests: return location_stack [tos + index - 1];
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
location_stack [tos + index - 1];
executed 153093373 times by 147 tests: return location_stack [tos + index - 1];
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
}
153093373
139-
140 AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);-
141 AST::UiQualifiedPragmaId *reparseAsQualifiedPragmaId(AST::ExpressionNode *expr);-
142-
143 void pushToken(int token);-
144 int lookaheadToken(Lexer *lexer);-
145-
146 void syntaxError(const AST::SourceLocation &location, const char *message) {-
147 diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location, QLatin1String(message)));-
148 }
executed 272 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlparser
272
149 void syntaxError(const AST::SourceLocation &location, const QString &message) {-
150 diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location, message));-
151 }
executed 158 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlparser
158
152-
153protected:-
154 Engine *driver;-
155 MemoryPool *pool;-
156 int tos = 0;-
157 int stack_size = 0;-
158 Value *sym_stack = nullptr;-
159 int *state_stack = nullptr;-
160 AST::SourceLocation *location_stack = nullptr;-
161 QVector<QStringRef> string_stack;-
162-
163 AST::Node *program = nullptr;-
164-
165-
166 enum { TOKEN_BUFFER_SIZE = 5 };-
167-
168 struct SavedToken {-
169 int token;-
170 double dval;-
171 AST::SourceLocation loc;-
172 QStringRef spell;-
173 };-
174-
175 int yytoken = -1;-
176 double yylval = 0.;-
177 QStringRef yytokenspell;-
178 AST::SourceLocation yylloc;-
179 AST::SourceLocation yyprevlloc;-
180-
181 SavedToken token_buffer[TOKEN_BUFFER_SIZE];-
182 SavedToken *first_token = nullptr;-
183 SavedToken *last_token = nullptr;-
184-
185 int functionNestingLevel = 0;-
186-
187 enum CoverExpressionType {-
188 CE_Invalid,-
189 CE_ParenthesizedExpression,-
190 CE_FormalParameterList-
191 };-
192 AST::SourceLocation coverExpressionErrorLocation;-
193 CoverExpressionType coverExpressionType = CE_Invalid;-
194-
195 QList<DiagnosticMessage> diagnostic_messages;-
196};-
197-
198}-
199-
200-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0