Skip to content

Support querying of srcSlice/Attributor output #2291

@Joshua2000B

Description

@Joshua2000B

We should support querying the attributed srcSlice srcML output that is being developed.

  • FIND USES OF - This would grab any slice IDs from the given query, then search the code over again for anything that has a slice:use attribute with the matching ID.
    • Example: FIND USES OF int $NAME[]; - this would find all of the uses of all int arrays.
  • FIND DEFS OF - This would grab any slice IDs from the given query, then search the code over again for anything that has a slice:def attribute with the matching ID.
    • Example: FIND DEFS OF $I WITHIN //src:while/src:condition - this would find all defs of any variables used within a while's condition.
  • FIND DECLS OF - This would grab any slice IDs from the given query, then search the code over again for anything that has a slice:decl attribute with the matching ID.
    • Example: FIND DECL OF $A.close() - this would find the declaration of anything that has a .close() function called on it.
  • FIND SLICE OF - This would grab any slice IDs from the given query, then search the code over again for anything that has any slice:* attribute with the matching ID.
    • Example: FIND SLICE OF int x; - this would grab the entire slice for any int x within the code.

We also discussed the possibility of doing "forward" and "backwards" slices. However, we need better terms for this, as this would actually be slicing that is limited to statements before/after the target in document order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions