Skip to content

Commit 8d7ca9e

Browse files
committed
C++: add dbscheme fragment headers
1 parent b31131d commit 8d7ca9e

File tree

2 files changed

+74
-68
lines changed

2 files changed

+74
-68
lines changed

config/dbscheme-fragments.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"files": [
3+
"cpp/ql/lib/semmlecode.cpp.dbscheme",
34
"javascript/ql/lib/semmlecode.javascript.dbscheme",
45
"python/ql/lib/semmlecode.python.dbscheme",
56
"ruby/ql/lib/ruby.dbscheme",
67
"ql/ql/src/ql.dbscheme"
78
],
89
"fragments": [
10+
"/*- Compilations -*/",
911
"/*- External data -*/",
1012
"/*- Files and folders -*/",
1113
"/*- Diagnostic messages -*/",
@@ -20,6 +22,7 @@
2022
"/*- DEPRECATED: Snapshot date -*/",
2123
"/*- DEPRECATED: Duplicate code -*/",
2224
"/*- DEPRECATED: Version control data -*/",
25+
"/*- C++ dbscheme -*/",
2326
"/*- JavaScript-specific part -*/",
2427
"/*- Ruby dbscheme -*/",
2528
"/*- Erb dbscheme -*/",

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 71 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*- Compilations -*/
12

23
/**
34
* An invocation of the compiler. Note that more than one file may be
@@ -122,6 +123,7 @@ compilation_finished(
122123
float elapsed_seconds : float ref
123124
);
124125

126+
/*- External data -*/
125127

126128
/**
127129
* External data, loaded from CSV files during snapshot creation. See
@@ -135,37 +137,11 @@ externalData(
135137
string value : string ref
136138
);
137139

138-
/**
139-
* The source location of the snapshot.
140-
*/
141-
sourceLocationPrefix(string prefix : string ref);
142-
143-
/**
144-
* Information about packages that provide code used during compilation.
145-
* The `id` is just a unique identifier.
146-
* The `namespace` is typically the name of the package manager that
147-
* provided the package (e.g. "dpkg" or "yum").
148-
* The `package_name` is the name of the package, and `version` is its
149-
* version (as a string).
150-
*/
151-
external_packages(
152-
unique int id: @external_package,
153-
string namespace : string ref,
154-
string package_name : string ref,
155-
string version : string ref
156-
);
140+
/*- Source location prefix -*/
157141

158-
/**
159-
* Holds if File `fileid` was provided by package `package`.
160-
*/
161-
header_to_external_package(
162-
int fileid : @file ref,
163-
int package : @external_package ref
164-
);
142+
sourceLocationPrefix(string prefix : string ref);
165143

166-
/*
167-
* Version history
168-
*/
144+
/*- DEPRECATED: Version control data -*/
169145

170146
svnentries(
171147
unique int id : @svnentry,
@@ -193,11 +169,7 @@ svnchurn(
193169
int deletedLines : int ref
194170
)
195171

196-
/*
197-
* C++ dbscheme
198-
*/
199-
200-
@location = @location_stmt | @location_expr | @location_default ;
172+
/*- Files and folders -*/
201173

202174
/**
203175
* The location of an element that is not an expression or a statement.
@@ -216,6 +188,70 @@ locations_default(
216188
int endColumn: int ref
217189
);
218190

191+
files(
192+
unique int id: @file,
193+
string name: string ref
194+
);
195+
196+
folders(
197+
unique int id: @folder,
198+
string name: string ref
199+
);
200+
201+
@container = @folder | @file
202+
203+
containerparent(
204+
int parent: @container ref,
205+
unique int child: @container ref
206+
);
207+
208+
/*- Lines of code -*/
209+
210+
numlines(
211+
int element_id: @sourceline ref,
212+
int num_lines: int ref,
213+
int num_code: int ref,
214+
int num_comment: int ref
215+
);
216+
217+
/*- Diagnostic messages -*/
218+
219+
diagnostics(
220+
unique int id: @diagnostic,
221+
int severity: int ref,
222+
string error_tag: string ref,
223+
string error_message: string ref,
224+
string full_error_message: string ref,
225+
int location: @location_default ref
226+
);
227+
228+
/*- C++ dbscheme -*/
229+
230+
/**
231+
* Information about packages that provide code used during compilation.
232+
* The `id` is just a unique identifier.
233+
* The `namespace` is typically the name of the package manager that
234+
* provided the package (e.g. "dpkg" or "yum").
235+
* The `package_name` is the name of the package, and `version` is its
236+
* version (as a string).
237+
*/
238+
external_packages(
239+
unique int id: @external_package,
240+
string namespace : string ref,
241+
string package_name : string ref,
242+
string version : string ref
243+
);
244+
245+
/**
246+
* Holds if File `fileid` was provided by package `package`.
247+
*/
248+
header_to_external_package(
249+
int fileid : @file ref,
250+
int package : @external_package ref
251+
);
252+
253+
@location = @location_stmt | @location_expr | @location_default ;
254+
219255
/**
220256
* The location of a statement.
221257
* The location spans column `startcolumn` of line `startline` to
@@ -253,39 +289,6 @@ locations_expr(
253289
/** An element for which line-count information is available. */
254290
@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable;
255291

256-
numlines(
257-
int element_id: @sourceline ref,
258-
int num_lines: int ref,
259-
int num_code: int ref,
260-
int num_comment: int ref
261-
);
262-
263-
diagnostics(
264-
unique int id: @diagnostic,
265-
int severity: int ref,
266-
string error_tag: string ref,
267-
string error_message: string ref,
268-
string full_error_message: string ref,
269-
int location: @location_default ref
270-
);
271-
272-
files(
273-
unique int id: @file,
274-
string name: string ref
275-
);
276-
277-
folders(
278-
unique int id: @folder,
279-
string name: string ref
280-
);
281-
282-
@container = @folder | @file
283-
284-
containerparent(
285-
int parent: @container ref,
286-
unique int child: @container ref
287-
);
288-
289292
fileannotations(
290293
int id: @file ref,
291294
int kind: int ref,
@@ -2137,7 +2140,7 @@ link_parent(
21372140
int link_target : @link_target ref
21382141
);
21392142

2140-
/* XML Files */
2143+
/*- XML Files -*/
21412144

21422145
xmlEncoding(unique int id: @file ref, string encoding: string ref);
21432146

0 commit comments

Comments
 (0)