Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Type extends @type {
string toString() { none() }
}

class Expr extends @expr {
string toString() { none() }
}

from Type decltype, Expr expr, Type basetype, boolean parentheses
where decltypes(decltype, expr, _, basetype, parentheses)
select decltype, expr, basetype, parentheses
Comment on lines +1 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this kind of projection can be written directly in the properties file by means of the reorder operator, without writing a ql file:

decltypes.rel: reorder decltypes.rel (int id, int expr, int kind, int basetype, boolean paren) id expr basetype paren

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as is, but I'll keep this in mind when it ever comes up again.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class Type extends @type {
string toString() { none() }
}

predicate derivedType(Type type, string name, int kind, Type type_id) {
derivedtypes(type, name, kind, type_id)
}

predicate typeTransformation(Type type, string name, int kind, Type type_id) {
type_operators(type, _, _, type_id) and
name = "" and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this name = "" means losing some information, but we're accepting that, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I'm just projecting all the rows of the type_operators table on the derivedtypes table, to make sure I have some kind of type, but the derivedtypes table requires me to make up some kind of name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could compute something based on the two columns of type_operators that I ignore here, but that doesn't seem to be worth the trouble.

kind = 3 // @type_with_specifiers
}

from Type type, string name, int kind, Type type_id
where
derivedType(type, name, kind, type_id) or
typeTransformation(type, name, kind, type_id)
select type, name, kind, type_id
Loading