ITracingService

public interface ITracingService<P extends IParseUnit, A extends IAnalyzeUnit, T extends ITransformUnit<?>, F>

Interface for tracing between parsed, analyzed, and transformed fragments and results, and their region in source files.

Parameters:
  • <P> – Type of parse units
  • <A> – Type of analyze units.
  • <T> – Type of transform units.
  • <F> – Type of fragments.

Methods

fragments

Iterable<F> fragments(P result, ISourceRegion region)

Finds a fragment and its ancestors that contain given region, in given parse result.

Parameters:
  • result – Parsed result to get fragments from.
  • region – Region inside the result to get fragments for.
Returns:

Fragment and its ancestors that contain given region. The returned iterable iterates from deepest (leaf) fragment to outermost (root) fragment. An empty iterable is returned when no fragments could be found.

fragments

Iterable<F> fragments(A result, ISourceRegion region)

Finds a fragment and its ancestors that contain given region, in given analysis file result.

Parameters:
  • result – Analyzed result to get fragments from.
  • region – Region inside the result to get fragments for.
Returns:

Fragment and its ancestors that contain given region. The returned iterable iterates from deepest (leaf) fragment to outermost (root) fragment. An empty iterable is returned when no fragments could be found.

fragments

Iterable<F> fragments(T result, ISourceRegion region)

Finds a fragment and its ancestors that contain given region, in given transform result.

Parameters:
  • result – Transformed result to get fragments from.
  • region – Region inside the to get fragments for.
Returns:

Fragment and its ancestors that contain given region. The returned iterable iterates from deepest (leaf) fragment to outermost (root) fragment. An empty iterable is returned when no fragments could be found.

fragmentsWithin

Iterable<F> fragmentsWithin(P result, ISourceRegion region)

Finds all fragments contained within the given region. This only returns the outermost fragments that are contained in the region. Their children are trivially also contained in the region and will not be added separately to the returned result.

Parameters:
  • result – Parsed result to get fragments from.
  • region – Region inside the result to get fragments for.
Returns:

Fragments contained within the given region. An empty iterable is returned when no fragments could be found.

fragmentsWithin

Iterable<F> fragmentsWithin(A result, ISourceRegion region)

Finds all fragments contained within the given region. This only returns the outermost fragments that are contained in the region. Their children are trivially also contained in the region and will not be added separately to the returned result.

Parameters:
  • result – Analyzed result to get fragments from.
  • region – Region inside the result to get fragments for.
Returns:

Fragments contained within the given region. An empty iterable is returned when no fragments could be found.

fragmentsWithin

Iterable<F> fragmentsWithin(T result, ISourceRegion region)

Finds all fragments contained within the given region. This only returns the outermost fragments that are contained in the region. Their children are trivially also contained in the region and will not be added separately to the returned result.

Parameters:
  • result – Transformed result to get fragments from.
  • region – Region inside the result to get fragments for.
Returns:

Fragments contained within the given region. An empty iterable is returned when no fragments could be found.

location

ISourceLocation location(F fragment)

Retrieves the source location of given fragment.

Parameters:
  • fragment – Fragment to get source location for.
Returns:

Source location, or null if it could not be determined.

origin

F origin(F fragment)

Retrieves the originating fragment of given fragment.

Parameters:
  • fragment – Fragment to get origin for.
Returns:

Originating fragment, or null if it could not be determined.