mirror of
https://github.com/github/codeql.git
synced 2026-02-19 08:23:45 +01:00
Make union-wrapping classes abstract to fix results for toString/describeQlClass
This commit is contained in:
@@ -178,8 +178,8 @@ fn create_token_class() -> ql::Class {
|
||||
],
|
||||
),
|
||||
};
|
||||
let describe_ql_class = ql::Predicate {
|
||||
name: "describeQlClass".to_owned(),
|
||||
let to_string = ql::Predicate {
|
||||
name: "toString".to_owned(),
|
||||
overridden: true,
|
||||
return_type: Some(ql::Type::String),
|
||||
formal_parameters: vec![],
|
||||
@@ -196,7 +196,12 @@ fn create_token_class() -> ql::Class {
|
||||
ql::Type::Normal("AstNode".to_owned()),
|
||||
],
|
||||
characteristic_predicate: None,
|
||||
predicates: vec![get_value, get_location, describe_ql_class],
|
||||
predicates: vec![
|
||||
get_value,
|
||||
get_location,
|
||||
to_string,
|
||||
create_describe_ql_class("Token"),
|
||||
],
|
||||
}
|
||||
}
|
||||
/// Creates a predicate whose body is `none()`.
|
||||
@@ -242,7 +247,7 @@ fn create_field_class(
|
||||
let class_name = dbscheme_name_to_class_name(&field_union_name);
|
||||
classes.push(ql::TopLevel::Class(ql::Class {
|
||||
name: class_name.clone(),
|
||||
is_abstract: false,
|
||||
is_abstract: true,
|
||||
supertypes: [
|
||||
vec![ql::Type::AtType(field_union_name.clone())],
|
||||
get_base_classes(&class_name, &supertype_map),
|
||||
@@ -505,7 +510,7 @@ pub fn convert_nodes(nodes: &Vec<node_types::Entry>) -> Vec<ql::TopLevel> {
|
||||
let class_name = dbscheme_name_to_class_name(&union_name);
|
||||
classes.push(ql::TopLevel::Class(ql::Class {
|
||||
name: class_name.clone(),
|
||||
is_abstract: false,
|
||||
is_abstract: true,
|
||||
supertypes: [
|
||||
vec![ql::Type::AtType(union_name)],
|
||||
get_base_classes(&class_name, &supertype_map),
|
||||
|
||||
@@ -21,31 +21,34 @@ class Token extends @token, AstNode {
|
||||
|
||||
override Location getLocation() { tokeninfo(this, _, _, _, _, result) }
|
||||
|
||||
override string describeQlClass() { result = getValue() }
|
||||
override string toString() { result = getValue() }
|
||||
|
||||
override string describeQlClass() { result = "Token" }
|
||||
}
|
||||
|
||||
class UnderscoreArg extends @underscore_arg, AstNode, ArgumentListChildType, ArrayChildType,
|
||||
AssignmentRightType, BinaryLeftType, BinaryRightType, ElementReferenceChildType,
|
||||
abstract class UnderscoreArg extends @underscore_arg, AstNode, ArgumentListChildType,
|
||||
ArrayChildType, AssignmentRightType, BinaryLeftType, BinaryRightType, ElementReferenceChildType,
|
||||
ExceptionsChildType, IfModifierConditionType, OperatorAssignmentRightType, PairKeyType,
|
||||
PatternChildType, RescueModifierHandlerType, RightAssignmentListChildType,
|
||||
SingletonMethodObjectType, SuperclassChildType, UnaryChildType, UnderscoreStatement,
|
||||
UnlessModifierConditionType, UntilModifierConditionType, WhileModifierConditionType { }
|
||||
|
||||
class UnderscoreLhs extends @underscore_lhs, AstNode, AssignmentLeftType,
|
||||
abstract class UnderscoreLhs extends @underscore_lhs, AstNode, AssignmentLeftType,
|
||||
DestructuredLeftAssignmentChildType, ForPatternType, LeftAssignmentListChildType,
|
||||
UnderscorePrimary { }
|
||||
|
||||
class UnderscoreMethodName extends @underscore_method_name, AstNode { }
|
||||
abstract class UnderscoreMethodName extends @underscore_method_name, AstNode { }
|
||||
|
||||
class UnderscorePrimary extends @underscore_primary, AstNode, CallReceiverType, UnderscoreArg { }
|
||||
abstract class UnderscorePrimary extends @underscore_primary, AstNode, CallReceiverType,
|
||||
UnderscoreArg { }
|
||||
|
||||
class UnderscoreStatement extends @underscore_statement, AstNode, BeginBlockChildType,
|
||||
abstract class UnderscoreStatement extends @underscore_statement, AstNode, BeginBlockChildType,
|
||||
BeginChildType, BlockChildType, ClassChildType, DoBlockChildType, DoChildType, ElseChildType,
|
||||
EndBlockChildType, EnsureChildType, MethodChildType, ModuleChildType,
|
||||
ParenthesizedStatementsChildType, ProgramChildType, SingletonClassChildType,
|
||||
SingletonMethodChildType, ThenChildType { }
|
||||
|
||||
class UnderscoreVariable extends @underscore_variable, AstNode, MethodCallMethodType,
|
||||
abstract class UnderscoreVariable extends @underscore_variable, AstNode, MethodCallMethodType,
|
||||
SingletonMethodObjectType, UnderscoreLhs { }
|
||||
|
||||
class Alias extends @alias, AstNode, UnderscoreStatement {
|
||||
@@ -62,7 +65,7 @@ class Alias extends @alias, AstNode, UnderscoreStatement {
|
||||
}
|
||||
}
|
||||
|
||||
class ArgumentListChildType extends @argument_list_child_type, AstNode { }
|
||||
abstract class ArgumentListChildType extends @argument_list_child_type, AstNode { }
|
||||
|
||||
class ArgumentList extends @argument_list, AstNode, CallMethodType {
|
||||
override string describeQlClass() { result = "ArgumentList" }
|
||||
@@ -74,7 +77,7 @@ class ArgumentList extends @argument_list, AstNode, CallMethodType {
|
||||
override AstNode getAFieldOrChild() { argument_list_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ArrayChildType extends @array_child_type, AstNode { }
|
||||
abstract class ArrayChildType extends @array_child_type, AstNode { }
|
||||
|
||||
class Array extends @array, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Array" }
|
||||
@@ -86,9 +89,9 @@ class Array extends @array, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { array_child(this, _, result) }
|
||||
}
|
||||
|
||||
class AssignmentLeftType extends @assignment_left_type, AstNode { }
|
||||
abstract class AssignmentLeftType extends @assignment_left_type, AstNode { }
|
||||
|
||||
class AssignmentRightType extends @assignment_right_type, AstNode { }
|
||||
abstract class AssignmentRightType extends @assignment_right_type, AstNode { }
|
||||
|
||||
class Assignment extends @assignment, AstNode, UnderscoreArg, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "Assignment" }
|
||||
@@ -104,7 +107,7 @@ class Assignment extends @assignment, AstNode, UnderscoreArg, UnderscoreStatemen
|
||||
}
|
||||
}
|
||||
|
||||
class BareStringChildType extends @bare_string_child_type, AstNode { }
|
||||
abstract class BareStringChildType extends @bare_string_child_type, AstNode { }
|
||||
|
||||
class BareString extends @bare_string, AstNode {
|
||||
override string describeQlClass() { result = "BareString" }
|
||||
@@ -116,7 +119,7 @@ class BareString extends @bare_string, AstNode {
|
||||
override AstNode getAFieldOrChild() { bare_string_child(this, _, result) }
|
||||
}
|
||||
|
||||
class BareSymbolChildType extends @bare_symbol_child_type, AstNode { }
|
||||
abstract class BareSymbolChildType extends @bare_symbol_child_type, AstNode { }
|
||||
|
||||
class BareSymbol extends @bare_symbol, AstNode {
|
||||
override string describeQlClass() { result = "BareSymbol" }
|
||||
@@ -128,7 +131,7 @@ class BareSymbol extends @bare_symbol, AstNode {
|
||||
override AstNode getAFieldOrChild() { bare_symbol_child(this, _, result) }
|
||||
}
|
||||
|
||||
class BeginChildType extends @begin_child_type, AstNode { }
|
||||
abstract class BeginChildType extends @begin_child_type, AstNode { }
|
||||
|
||||
class Begin extends @begin, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Begin" }
|
||||
@@ -140,7 +143,7 @@ class Begin extends @begin, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { begin_child(this, _, result) }
|
||||
}
|
||||
|
||||
class BeginBlockChildType extends @begin_block_child_type, AstNode { }
|
||||
abstract class BeginBlockChildType extends @begin_block_child_type, AstNode { }
|
||||
|
||||
class BeginBlock extends @begin_block, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "BeginBlock" }
|
||||
@@ -152,11 +155,11 @@ class BeginBlock extends @begin_block, AstNode, UnderscoreStatement {
|
||||
override AstNode getAFieldOrChild() { begin_block_child(this, _, result) }
|
||||
}
|
||||
|
||||
class BinaryLeftType extends @binary_left_type, AstNode { }
|
||||
abstract class BinaryLeftType extends @binary_left_type, AstNode { }
|
||||
|
||||
class BinaryOperatorType extends @binary_operator_type, AstNode { }
|
||||
abstract class BinaryOperatorType extends @binary_operator_type, AstNode { }
|
||||
|
||||
class BinaryRightType extends @binary_right_type, AstNode { }
|
||||
abstract class BinaryRightType extends @binary_right_type, AstNode { }
|
||||
|
||||
class Binary extends @binary, AstNode, UnderscoreArg, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "Binary" }
|
||||
@@ -176,7 +179,7 @@ class Binary extends @binary, AstNode, UnderscoreArg, UnderscoreStatement {
|
||||
}
|
||||
}
|
||||
|
||||
class BlockChildType extends @block_child_type, AstNode { }
|
||||
abstract class BlockChildType extends @block_child_type, AstNode { }
|
||||
|
||||
class Block extends @block, AstNode, LambdaBodyType, MethodCallBlockType {
|
||||
override string describeQlClass() { result = "Block" }
|
||||
@@ -210,7 +213,7 @@ class BlockParameter extends @block_parameter, AstNode, BlockParametersChildType
|
||||
override AstNode getAFieldOrChild() { block_parameter_def(this, result, _) }
|
||||
}
|
||||
|
||||
class BlockParametersChildType extends @block_parameters_child_type, AstNode { }
|
||||
abstract class BlockParametersChildType extends @block_parameters_child_type, AstNode { }
|
||||
|
||||
class BlockParameters extends @block_parameters, AstNode, BlockChildType, DoBlockChildType {
|
||||
override string describeQlClass() { result = "BlockParameters" }
|
||||
@@ -236,9 +239,9 @@ class Break extends @break, AstNode, ArgumentListChildType, ArrayChildType, Assi
|
||||
override AstNode getAFieldOrChild() { break_child(this, result) }
|
||||
}
|
||||
|
||||
class CallMethodType extends @call_method_type, AstNode { }
|
||||
abstract class CallMethodType extends @call_method_type, AstNode { }
|
||||
|
||||
class CallReceiverType extends @call_receiver_type, AstNode { }
|
||||
abstract class CallReceiverType extends @call_receiver_type, AstNode { }
|
||||
|
||||
class Call extends @call, AstNode, ArgumentListChildType, ArrayChildType, AssignmentRightType,
|
||||
BinaryLeftType, BinaryRightType, ElementReferenceChildType, IfModifierConditionType,
|
||||
@@ -258,7 +261,7 @@ class Call extends @call, AstNode, ArgumentListChildType, ArrayChildType, Assign
|
||||
}
|
||||
}
|
||||
|
||||
class CaseChildType extends @case_child_type, AstNode { }
|
||||
abstract class CaseChildType extends @case_child_type, AstNode { }
|
||||
|
||||
class Case extends @case__, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Case" }
|
||||
@@ -282,9 +285,9 @@ class ChainedString extends @chained_string, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { chained_string_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ClassNameType extends @class_name_type, AstNode { }
|
||||
abstract class ClassNameType extends @class_name_type, AstNode { }
|
||||
|
||||
class ClassChildType extends @class_child_type, AstNode { }
|
||||
abstract class ClassChildType extends @class_child_type, AstNode { }
|
||||
|
||||
class Class extends @class, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Class" }
|
||||
@@ -316,8 +319,8 @@ class Conditional extends @conditional, AstNode, UnderscoreArg {
|
||||
}
|
||||
}
|
||||
|
||||
class DestructuredLeftAssignmentChildType extends @destructured_left_assignment_child_type, AstNode {
|
||||
}
|
||||
abstract class DestructuredLeftAssignmentChildType extends @destructured_left_assignment_child_type,
|
||||
AstNode { }
|
||||
|
||||
class DestructuredLeftAssignment extends @destructured_left_assignment, AstNode,
|
||||
DestructuredLeftAssignmentChildType, ForPatternType, LeftAssignmentListChildType {
|
||||
@@ -332,7 +335,8 @@ class DestructuredLeftAssignment extends @destructured_left_assignment, AstNode,
|
||||
override AstNode getAFieldOrChild() { destructured_left_assignment_child(this, _, result) }
|
||||
}
|
||||
|
||||
class DestructuredParameterChildType extends @destructured_parameter_child_type, AstNode { }
|
||||
abstract class DestructuredParameterChildType extends @destructured_parameter_child_type, AstNode {
|
||||
}
|
||||
|
||||
class DestructuredParameter extends @destructured_parameter, AstNode, BlockParametersChildType,
|
||||
DestructuredParameterChildType, LambdaParametersChildType, MethodParametersChildType {
|
||||
@@ -345,7 +349,7 @@ class DestructuredParameter extends @destructured_parameter, AstNode, BlockParam
|
||||
override AstNode getAFieldOrChild() { destructured_parameter_child(this, _, result) }
|
||||
}
|
||||
|
||||
class DoChildType extends @do_child_type, AstNode { }
|
||||
abstract class DoChildType extends @do_child_type, AstNode { }
|
||||
|
||||
class Do extends @do, AstNode {
|
||||
override string describeQlClass() { result = "Do" }
|
||||
@@ -357,7 +361,7 @@ class Do extends @do, AstNode {
|
||||
override AstNode getAFieldOrChild() { do_child(this, _, result) }
|
||||
}
|
||||
|
||||
class DoBlockChildType extends @do_block_child_type, AstNode { }
|
||||
abstract class DoBlockChildType extends @do_block_child_type, AstNode { }
|
||||
|
||||
class DoBlock extends @do_block, AstNode, LambdaBodyType, MethodCallBlockType {
|
||||
override string describeQlClass() { result = "DoBlock" }
|
||||
@@ -369,7 +373,7 @@ class DoBlock extends @do_block, AstNode, LambdaBodyType, MethodCallBlockType {
|
||||
override AstNode getAFieldOrChild() { do_block_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ElementReferenceChildType extends @element_reference_child_type, AstNode { }
|
||||
abstract class ElementReferenceChildType extends @element_reference_child_type, AstNode { }
|
||||
|
||||
class ElementReference extends @element_reference, AstNode, UnderscoreLhs {
|
||||
override string describeQlClass() { result = "ElementReference" }
|
||||
@@ -385,7 +389,7 @@ class ElementReference extends @element_reference, AstNode, UnderscoreLhs {
|
||||
}
|
||||
}
|
||||
|
||||
class ElseChildType extends @else_child_type, AstNode { }
|
||||
abstract class ElseChildType extends @else_child_type, AstNode { }
|
||||
|
||||
class Else extends @else, AstNode, BeginChildType, CaseChildType, ClassChildType, DoBlockChildType,
|
||||
ElsifAlternativeType, IfAlternativeType, MethodChildType, ModuleChildType,
|
||||
@@ -403,7 +407,7 @@ class Else extends @else, AstNode, BeginChildType, CaseChildType, ClassChildType
|
||||
}
|
||||
}
|
||||
|
||||
class ElsifAlternativeType extends @elsif_alternative_type, AstNode { }
|
||||
abstract class ElsifAlternativeType extends @elsif_alternative_type, AstNode { }
|
||||
|
||||
class Elsif extends @elsif, AstNode, ElsifAlternativeType, IfAlternativeType, UnlessAlternativeType {
|
||||
override string describeQlClass() { result = "Elsif" }
|
||||
@@ -421,7 +425,7 @@ class Elsif extends @elsif, AstNode, ElsifAlternativeType, IfAlternativeType, Un
|
||||
}
|
||||
}
|
||||
|
||||
class EndBlockChildType extends @end_block_child_type, AstNode { }
|
||||
abstract class EndBlockChildType extends @end_block_child_type, AstNode { }
|
||||
|
||||
class EndBlock extends @end_block, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "EndBlock" }
|
||||
@@ -433,7 +437,7 @@ class EndBlock extends @end_block, AstNode, UnderscoreStatement {
|
||||
override AstNode getAFieldOrChild() { end_block_child(this, _, result) }
|
||||
}
|
||||
|
||||
class EnsureChildType extends @ensure_child_type, AstNode { }
|
||||
abstract class EnsureChildType extends @ensure_child_type, AstNode { }
|
||||
|
||||
class Ensure extends @ensure, AstNode, BeginChildType, ClassChildType, DoBlockChildType,
|
||||
MethodChildType, ModuleChildType, SingletonClassChildType, SingletonMethodChildType {
|
||||
@@ -456,7 +460,7 @@ class ExceptionVariable extends @exception_variable, AstNode {
|
||||
override AstNode getAFieldOrChild() { exception_variable_def(this, result, _) }
|
||||
}
|
||||
|
||||
class ExceptionsChildType extends @exceptions_child_type, AstNode { }
|
||||
abstract class ExceptionsChildType extends @exceptions_child_type, AstNode { }
|
||||
|
||||
class Exceptions extends @exceptions, AstNode {
|
||||
override string describeQlClass() { result = "Exceptions" }
|
||||
@@ -468,7 +472,7 @@ class Exceptions extends @exceptions, AstNode {
|
||||
override AstNode getAFieldOrChild() { exceptions_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ForPatternType extends @for_pattern_type, AstNode { }
|
||||
abstract class ForPatternType extends @for_pattern_type, AstNode { }
|
||||
|
||||
class For extends @for, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "For" }
|
||||
@@ -486,7 +490,7 @@ class For extends @for, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class HashChildType extends @hash_child_type, AstNode { }
|
||||
abstract class HashChildType extends @hash_child_type, AstNode { }
|
||||
|
||||
class Hash extends @hash, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Hash" }
|
||||
@@ -520,7 +524,7 @@ class HashSplatParameter extends @hash_splat_parameter, AstNode, BlockParameters
|
||||
override AstNode getAFieldOrChild() { hash_splat_parameter_name(this, result) }
|
||||
}
|
||||
|
||||
class HeredocBodyChildType extends @heredoc_body_child_type, AstNode { }
|
||||
abstract class HeredocBodyChildType extends @heredoc_body_child_type, AstNode { }
|
||||
|
||||
class HeredocBody extends @heredoc_body, AstNode {
|
||||
override string describeQlClass() { result = "HeredocBody" }
|
||||
@@ -532,7 +536,7 @@ class HeredocBody extends @heredoc_body, AstNode {
|
||||
override AstNode getAFieldOrChild() { heredoc_body_child(this, _, result) }
|
||||
}
|
||||
|
||||
class IfAlternativeType extends @if_alternative_type, AstNode { }
|
||||
abstract class IfAlternativeType extends @if_alternative_type, AstNode { }
|
||||
|
||||
class If extends @if, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "If" }
|
||||
@@ -550,7 +554,7 @@ class If extends @if, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class IfModifierConditionType extends @if_modifier_condition_type, AstNode { }
|
||||
abstract class IfModifierConditionType extends @if_modifier_condition_type, AstNode { }
|
||||
|
||||
class IfModifier extends @if_modifier, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "IfModifier" }
|
||||
@@ -602,7 +606,7 @@ class KeywordParameter extends @keyword_parameter, AstNode, BlockParametersChild
|
||||
}
|
||||
}
|
||||
|
||||
class LambdaBodyType extends @lambda_body_type, AstNode { }
|
||||
abstract class LambdaBodyType extends @lambda_body_type, AstNode { }
|
||||
|
||||
class Lambda extends @lambda, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Lambda" }
|
||||
@@ -618,7 +622,7 @@ class Lambda extends @lambda, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class LambdaParametersChildType extends @lambda_parameters_child_type, AstNode { }
|
||||
abstract class LambdaParametersChildType extends @lambda_parameters_child_type, AstNode { }
|
||||
|
||||
class LambdaParameters extends @lambda_parameters, AstNode {
|
||||
override string describeQlClass() { result = "LambdaParameters" }
|
||||
@@ -630,7 +634,7 @@ class LambdaParameters extends @lambda_parameters, AstNode {
|
||||
override AstNode getAFieldOrChild() { lambda_parameters_child(this, _, result) }
|
||||
}
|
||||
|
||||
class LeftAssignmentListChildType extends @left_assignment_list_child_type, AstNode { }
|
||||
abstract class LeftAssignmentListChildType extends @left_assignment_list_child_type, AstNode { }
|
||||
|
||||
class LeftAssignmentList extends @left_assignment_list, AstNode, AssignmentLeftType {
|
||||
override string describeQlClass() { result = "LeftAssignmentList" }
|
||||
@@ -642,7 +646,7 @@ class LeftAssignmentList extends @left_assignment_list, AstNode, AssignmentLeftT
|
||||
override AstNode getAFieldOrChild() { left_assignment_list_child(this, _, result) }
|
||||
}
|
||||
|
||||
class MethodChildType extends @method_child_type, AstNode { }
|
||||
abstract class MethodChildType extends @method_child_type, AstNode { }
|
||||
|
||||
class Method extends @method, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Method" }
|
||||
@@ -660,9 +664,9 @@ class Method extends @method, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class MethodCallBlockType extends @method_call_block_type, AstNode { }
|
||||
abstract class MethodCallBlockType extends @method_call_block_type, AstNode { }
|
||||
|
||||
class MethodCallMethodType extends @method_call_method_type, AstNode { }
|
||||
abstract class MethodCallMethodType extends @method_call_method_type, AstNode { }
|
||||
|
||||
class MethodCall extends @method_call, AstNode, ArgumentListChildType, ArrayChildType,
|
||||
AssignmentRightType, BinaryLeftType, BinaryRightType, CallReceiverType, ElementReferenceChildType,
|
||||
@@ -686,7 +690,7 @@ class MethodCall extends @method_call, AstNode, ArgumentListChildType, ArrayChil
|
||||
}
|
||||
}
|
||||
|
||||
class MethodParametersChildType extends @method_parameters_child_type, AstNode { }
|
||||
abstract class MethodParametersChildType extends @method_parameters_child_type, AstNode { }
|
||||
|
||||
class MethodParameters extends @method_parameters, AstNode {
|
||||
override string describeQlClass() { result = "MethodParameters" }
|
||||
@@ -698,9 +702,9 @@ class MethodParameters extends @method_parameters, AstNode {
|
||||
override AstNode getAFieldOrChild() { method_parameters_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ModuleNameType extends @module_name_type, AstNode { }
|
||||
abstract class ModuleNameType extends @module_name_type, AstNode { }
|
||||
|
||||
class ModuleChildType extends @module_child_type, AstNode { }
|
||||
abstract class ModuleChildType extends @module_child_type, AstNode { }
|
||||
|
||||
class Module extends @module, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Module" }
|
||||
@@ -730,7 +734,7 @@ class Next extends @next, AstNode, ArgumentListChildType, ArrayChildType, Assign
|
||||
override AstNode getAFieldOrChild() { next_child(this, result) }
|
||||
}
|
||||
|
||||
class OperatorAssignmentRightType extends @operator_assignment_right_type, AstNode { }
|
||||
abstract class OperatorAssignmentRightType extends @operator_assignment_right_type, AstNode { }
|
||||
|
||||
class OperatorAssignment extends @operator_assignment, AstNode, UnderscoreArg, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "OperatorAssignment" }
|
||||
@@ -761,7 +765,7 @@ class OptionalParameter extends @optional_parameter, AstNode, BlockParametersChi
|
||||
}
|
||||
}
|
||||
|
||||
class PairKeyType extends @pair_key_type, AstNode { }
|
||||
abstract class PairKeyType extends @pair_key_type, AstNode { }
|
||||
|
||||
class Pair extends @pair, AstNode, ArgumentListChildType, ArrayChildType, ElementReferenceChildType,
|
||||
HashChildType {
|
||||
@@ -778,7 +782,8 @@ class Pair extends @pair, AstNode, ArgumentListChildType, ArrayChildType, Elemen
|
||||
}
|
||||
}
|
||||
|
||||
class ParenthesizedStatementsChildType extends @parenthesized_statements_child_type, AstNode { }
|
||||
abstract class ParenthesizedStatementsChildType extends @parenthesized_statements_child_type,
|
||||
AstNode { }
|
||||
|
||||
class ParenthesizedStatements extends @parenthesized_statements, AstNode, UnaryChildType,
|
||||
UnderscorePrimary {
|
||||
@@ -793,7 +798,7 @@ class ParenthesizedStatements extends @parenthesized_statements, AstNode, UnaryC
|
||||
override AstNode getAFieldOrChild() { parenthesized_statements_child(this, _, result) }
|
||||
}
|
||||
|
||||
class PatternChildType extends @pattern_child_type, AstNode { }
|
||||
abstract class PatternChildType extends @pattern_child_type, AstNode { }
|
||||
|
||||
class Pattern extends @pattern, AstNode, WhenPatternType {
|
||||
override string describeQlClass() { result = "Pattern" }
|
||||
@@ -805,7 +810,7 @@ class Pattern extends @pattern, AstNode, WhenPatternType {
|
||||
override AstNode getAFieldOrChild() { pattern_def(this, result, _) }
|
||||
}
|
||||
|
||||
class ProgramChildType extends @program_child_type, AstNode { }
|
||||
abstract class ProgramChildType extends @program_child_type, AstNode { }
|
||||
|
||||
class Program extends @program, AstNode {
|
||||
override string describeQlClass() { result = "Program" }
|
||||
@@ -847,7 +852,7 @@ class Redo extends @redo, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { redo_child(this, result) }
|
||||
}
|
||||
|
||||
class RegexChildType extends @regex_child_type, AstNode { }
|
||||
abstract class RegexChildType extends @regex_child_type, AstNode { }
|
||||
|
||||
class Regex extends @regex, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Regex" }
|
||||
@@ -876,7 +881,7 @@ class Rescue extends @rescue, AstNode, BeginChildType, ClassChildType, DoBlockCh
|
||||
}
|
||||
}
|
||||
|
||||
class RescueModifierHandlerType extends @rescue_modifier_handler_type, AstNode { }
|
||||
abstract class RescueModifierHandlerType extends @rescue_modifier_handler_type, AstNode { }
|
||||
|
||||
class RescueModifier extends @rescue_modifier, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "RescueModifier" }
|
||||
@@ -927,7 +932,7 @@ class Return extends @return, AstNode, ArgumentListChildType, ArrayChildType, As
|
||||
override AstNode getAFieldOrChild() { return_child(this, result) }
|
||||
}
|
||||
|
||||
class RightAssignmentListChildType extends @right_assignment_list_child_type, AstNode { }
|
||||
abstract class RightAssignmentListChildType extends @right_assignment_list_child_type, AstNode { }
|
||||
|
||||
class RightAssignmentList extends @right_assignment_list, AstNode, AssignmentRightType {
|
||||
override string describeQlClass() { result = "RightAssignmentList" }
|
||||
@@ -939,7 +944,7 @@ class RightAssignmentList extends @right_assignment_list, AstNode, AssignmentRig
|
||||
override AstNode getAFieldOrChild() { right_assignment_list_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ScopeResolutionNameType extends @scope_resolution_name_type, AstNode { }
|
||||
abstract class ScopeResolutionNameType extends @scope_resolution_name_type, AstNode { }
|
||||
|
||||
class ScopeResolution extends @scope_resolution, AstNode, ClassNameType, MethodCallMethodType,
|
||||
ModuleNameType, UnderscoreLhs {
|
||||
@@ -966,7 +971,7 @@ class Setter extends @setter, AstNode, UnderscoreMethodName {
|
||||
override AstNode getAFieldOrChild() { setter_def(this, result, _) }
|
||||
}
|
||||
|
||||
class SingletonClassChildType extends @singleton_class_child_type, AstNode { }
|
||||
abstract class SingletonClassChildType extends @singleton_class_child_type, AstNode { }
|
||||
|
||||
class SingletonClass extends @singleton_class, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "SingletonClass" }
|
||||
@@ -982,9 +987,9 @@ class SingletonClass extends @singleton_class, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class SingletonMethodObjectType extends @singleton_method_object_type, AstNode { }
|
||||
abstract class SingletonMethodObjectType extends @singleton_method_object_type, AstNode { }
|
||||
|
||||
class SingletonMethodChildType extends @singleton_method_child_type, AstNode { }
|
||||
abstract class SingletonMethodChildType extends @singleton_method_child_type, AstNode { }
|
||||
|
||||
class SingletonMethod extends @singleton_method, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "SingletonMethod" }
|
||||
@@ -1030,7 +1035,7 @@ class SplatParameter extends @splat_parameter, AstNode, BlockParametersChildType
|
||||
override AstNode getAFieldOrChild() { splat_parameter_name(this, result) }
|
||||
}
|
||||
|
||||
class StringChildType extends @string_child_type, AstNode { }
|
||||
abstract class StringChildType extends @string_child_type, AstNode { }
|
||||
|
||||
class String extends @string__, AstNode, PairKeyType, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "String" }
|
||||
@@ -1052,7 +1057,7 @@ class StringArray extends @string_array, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { string_array_child(this, _, result) }
|
||||
}
|
||||
|
||||
class SubshellChildType extends @subshell_child_type, AstNode { }
|
||||
abstract class SubshellChildType extends @subshell_child_type, AstNode { }
|
||||
|
||||
class Subshell extends @subshell, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Subshell" }
|
||||
@@ -1064,7 +1069,7 @@ class Subshell extends @subshell, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { subshell_child(this, _, result) }
|
||||
}
|
||||
|
||||
class SuperclassChildType extends @superclass_child_type, AstNode { }
|
||||
abstract class SuperclassChildType extends @superclass_child_type, AstNode { }
|
||||
|
||||
class Superclass extends @superclass, AstNode, ClassChildType {
|
||||
override string describeQlClass() { result = "Superclass" }
|
||||
@@ -1076,7 +1081,7 @@ class Superclass extends @superclass, AstNode, ClassChildType {
|
||||
override AstNode getAFieldOrChild() { superclass_def(this, result, _) }
|
||||
}
|
||||
|
||||
class SymbolChildType extends @symbol_child_type, AstNode { }
|
||||
abstract class SymbolChildType extends @symbol_child_type, AstNode { }
|
||||
|
||||
class Symbol extends @symbol, AstNode, PairKeyType, UnderscoreMethodName, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Symbol" }
|
||||
@@ -1098,7 +1103,7 @@ class SymbolArray extends @symbol_array, AstNode, UnderscorePrimary {
|
||||
override AstNode getAFieldOrChild() { symbol_array_child(this, _, result) }
|
||||
}
|
||||
|
||||
class ThenChildType extends @then_child_type, AstNode { }
|
||||
abstract class ThenChildType extends @then_child_type, AstNode { }
|
||||
|
||||
class Then extends @then, AstNode {
|
||||
override string describeQlClass() { result = "Then" }
|
||||
@@ -1110,7 +1115,7 @@ class Then extends @then, AstNode {
|
||||
override AstNode getAFieldOrChild() { then_child(this, _, result) }
|
||||
}
|
||||
|
||||
class UnaryChildType extends @unary_child_type, AstNode { }
|
||||
abstract class UnaryChildType extends @unary_child_type, AstNode { }
|
||||
|
||||
class Unary extends @unary, AstNode, UnderscoreArg, UnderscorePrimary, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "Unary" }
|
||||
@@ -1132,7 +1137,7 @@ class Undef extends @undef, AstNode, UnderscoreStatement {
|
||||
override AstNode getAFieldOrChild() { undef_child(this, _, result) }
|
||||
}
|
||||
|
||||
class UnlessAlternativeType extends @unless_alternative_type, AstNode { }
|
||||
abstract class UnlessAlternativeType extends @unless_alternative_type, AstNode { }
|
||||
|
||||
class Unless extends @unless, AstNode, UnderscorePrimary {
|
||||
override string describeQlClass() { result = "Unless" }
|
||||
@@ -1152,7 +1157,7 @@ class Unless extends @unless, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class UnlessModifierConditionType extends @unless_modifier_condition_type, AstNode { }
|
||||
abstract class UnlessModifierConditionType extends @unless_modifier_condition_type, AstNode { }
|
||||
|
||||
class UnlessModifier extends @unless_modifier, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "UnlessModifier" }
|
||||
@@ -1182,7 +1187,7 @@ class Until extends @until, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class UntilModifierConditionType extends @until_modifier_condition_type, AstNode { }
|
||||
abstract class UntilModifierConditionType extends @until_modifier_condition_type, AstNode { }
|
||||
|
||||
class UntilModifier extends @until_modifier, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "UntilModifier" }
|
||||
@@ -1198,7 +1203,7 @@ class UntilModifier extends @until_modifier, AstNode, UnderscoreStatement {
|
||||
}
|
||||
}
|
||||
|
||||
class WhenPatternType extends @when_pattern_type, AstNode { }
|
||||
abstract class WhenPatternType extends @when_pattern_type, AstNode { }
|
||||
|
||||
class When extends @when, AstNode, CaseChildType {
|
||||
override string describeQlClass() { result = "When" }
|
||||
@@ -1226,7 +1231,7 @@ class While extends @while, AstNode, UnderscorePrimary {
|
||||
}
|
||||
}
|
||||
|
||||
class WhileModifierConditionType extends @while_modifier_condition_type, AstNode { }
|
||||
abstract class WhileModifierConditionType extends @while_modifier_condition_type, AstNode { }
|
||||
|
||||
class WhileModifier extends @while_modifier, AstNode, UnderscoreStatement {
|
||||
override string describeQlClass() { result = "WhileModifier" }
|
||||
|
||||
@@ -26,14 +26,9 @@ class PrintAstConfiguration extends string {
|
||||
class PrintAstNode extends AstNode {
|
||||
string getProperty(string key) {
|
||||
key = "semmle.label" and
|
||||
result = this.toString()
|
||||
result = "[" + this.describeQlClass() + "] " + this.toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a textual representation of this node in the PrintAST output tree.
|
||||
*/
|
||||
override string toString() { result = "[" + this.describeQlClass() + "] " + super.toString() }
|
||||
|
||||
/**
|
||||
* Holds if this node should be printed in the output. By default, all nodes
|
||||
* are printed, but the query can override
|
||||
|
||||
Reference in New Issue
Block a user