C#: Add getAPrimaryQlClass overrides

This commit is contained in:
Michael Nebel 2021-11-12 09:04:59 +01:00
Родитель 40ad88ba53
Коммит 6b937a939b
7 изменённых файлов: 54 добавлений и 1 удалений

Просмотреть файл

@ -277,6 +277,9 @@ class TypeParameterConstraints extends Element, @type_parameter_constraints {
/** Gets a textual representation of these constraints. */
override string toString() { result = "where " + this.getTypeParameter().getName() + ": ..." }
/** Gets a textual representation of the class */
override string getAPrimaryQlClass() { result = "TypeParameterConstraints" }
}
/**

Просмотреть файл

@ -13,6 +13,8 @@ class Modifier extends Element, @modifier {
predicate hasName(string name) { name = this.getName() }
override string toString() { result = this.getName() }
override string getAPrimaryQlClass() { result = "Modifier" }
}
/**
@ -20,4 +22,6 @@ class Modifier extends Element, @modifier {
*/
class AccessModifier extends Modifier {
AccessModifier() { this.hasName(["public", "private", "internal", "protected"]) }
override string getAPrimaryQlClass() { result = "AccessModifier" }
}

Просмотреть файл

@ -413,6 +413,8 @@ class VoidType extends DotNet::ValueOrRefType, Type, @void_type {
final override string getUndecoratedName() { result = "Void" }
override SystemNamespace getDeclaringNamespace() { any() }
override string getAPrimaryQlClass() { result = "VoidType" }
}
/**
@ -454,6 +456,8 @@ class BoolType extends SimpleType, @bool_type {
override string toStringWithTypes() { result = "bool" }
override int getSize() { result = 1 }
override string getAPrimaryQlClass() { result = "BoolType" }
}
/**
@ -467,6 +471,8 @@ class CharType extends SimpleType, @char_type {
override int minValue() { result = 0 }
override int maxValue() { result = 65535 }
override string getAPrimaryQlClass() { result = "CharType" }
}
/**
@ -506,6 +512,8 @@ class SByteType extends SignedIntegralType, @sbyte_type {
override int minValue() { result = -128 }
override int maxValue() { result = 127 }
override string getAPrimaryQlClass() { result = "SByteType" }
}
/**
@ -519,6 +527,8 @@ class ShortType extends SignedIntegralType, @short_type {
override int minValue() { result = -32768 }
override int maxValue() { result = 32767 }
override string getAPrimaryQlClass() { result = "ShortType" }
}
/**
@ -532,6 +542,8 @@ class IntType extends SignedIntegralType, @int_type {
override int minValue() { result = -2147483647 - 1 }
override int maxValue() { result = 2147483647 }
override string getAPrimaryQlClass() { result = "IntType" }
}
/**
@ -541,6 +553,8 @@ class LongType extends SignedIntegralType, @long_type {
override string toStringWithTypes() { result = "long" }
override int getSize() { result = 8 }
override string getAPrimaryQlClass() { result = "LongType" }
}
/**
@ -552,6 +566,8 @@ class ByteType extends UnsignedIntegralType, @byte_type {
override int getSize() { result = 1 }
override int maxValue() { result = 255 }
override string getAPrimaryQlClass() { result = "ByteType" }
}
/**
@ -563,6 +579,8 @@ class UShortType extends UnsignedIntegralType, @ushort_type {
override int getSize() { result = 2 }
override int maxValue() { result = 65535 }
override string getAPrimaryQlClass() { result = "UShortType" }
}
/**
@ -572,6 +590,8 @@ class UIntType extends UnsignedIntegralType, @uint_type {
override string toStringWithTypes() { result = "uint" }
override int getSize() { result = 4 }
override string getAPrimaryQlClass() { result = "UIntType" }
}
/**
@ -581,6 +601,8 @@ class ULongType extends UnsignedIntegralType, @ulong_type {
override string toStringWithTypes() { result = "ulong" }
override int getSize() { result = 8 }
override string getAPrimaryQlClass() { result = "ULongType" }
}
/**
@ -597,6 +619,8 @@ class FloatType extends FloatingPointType, @float_type {
override string toStringWithTypes() { result = "float" }
override int getSize() { result = 4 }
override string getAPrimaryQlClass() { result = "FloatType" }
}
/**
@ -606,6 +630,8 @@ class DoubleType extends FloatingPointType, @double_type {
override string toStringWithTypes() { result = "double" }
override int getSize() { result = 8 }
override string getAPrimaryQlClass() { result = "DoubleType" }
}
/**
@ -615,6 +641,8 @@ class DecimalType extends SimpleType, @decimal_type {
override string toStringWithTypes() { result = "decimal" }
override int getSize() { result = 16 }
override string getAPrimaryQlClass() { result = "DecimalType" }
}
/**
@ -775,6 +803,8 @@ class ObjectType extends Class {
ObjectType() { this.hasQualifiedName("System.Object") }
override string toStringWithTypes() { result = "object" }
override string getAPrimaryQlClass() { result = "ObjectType" }
}
/**
@ -784,6 +814,8 @@ class StringType extends Class {
StringType() { this.hasQualifiedName("System.String") }
override string toStringWithTypes() { result = "string" }
override string getAPrimaryQlClass() { result = "StringType" }
}
/**
@ -910,7 +942,9 @@ class FunctionPointerType extends Type, Parameterizable, @function_pointer_type
/**
* The `null` type. The type of the `null` literal.
*/
class NullType extends RefType, @null_type { }
class NullType extends RefType, @null_type {
override string getAPrimaryQlClass() { result = "NullType" }
}
/**
* A nullable type, for example `int?`.
@ -1124,6 +1158,8 @@ class TupleType extends ValueType, @tuple_type {
final override predicate hasQualifiedName(string qualifier, string name) {
this.getUnderlyingType().hasQualifiedName(qualifier, name)
}
override string getAPrimaryQlClass() { result = "TupleType" }
}
/**

Просмотреть файл

@ -338,6 +338,8 @@ class LocalVariable extends LocalScopeVariable, @local_variable {
override Type getType() { localvars(this, _, _, _, getTypeRef(result), _) }
override Location getALocation() { localvar_location(this, result) }
override string getAPrimaryQlClass() { result = "LocalVariable" }
}
/**

Просмотреть файл

@ -112,6 +112,8 @@ class SystemBooleanStruct extends BoolType {
result.getParameter(1).getType() instanceof BoolType and
result.getReturnType() instanceof BoolType
}
override string getAPrimaryQlClass() { result = "SystemBooleanStruct" }
}
/** Data flow for `System.Boolean`. */
@ -1092,6 +1094,8 @@ class SystemIntPtrType extends ValueType {
this = any(SystemNamespace n).getATypeDeclaration() and
this.hasName("IntPtr")
}
override string getAPrimaryQlClass() { result = "SystemIntPtrType" }
}
/** The `System.IDisposable` interface. */

Просмотреть файл

@ -39,6 +39,8 @@ class Namespace extends Declaration, @namespace {
final override string getName() { namespaces(this, result) }
final override string getUndecoratedName() { namespaces(this, result) }
override string getAPrimaryQlClass() { result = "Namespace" }
}
/** The global namespace. */

Просмотреть файл

@ -89,4 +89,6 @@ class ArrayType extends ValueOrRefType, @dotnet_array_type {
final override string getLabel() { result = this.getElementType().getLabel() + "[]" }
override string toStringWithTypes() { result = this.getElementType().toStringWithTypes() + "[]" }
override string getAPrimaryQlClass() { result = "ArrayType" }
}