Class LocationBoundingVisitor
- java.lang.Object
-
- com.google.common.css.compiler.passes.LocationBoundingVisitor
-
- All Implemented Interfaces:
UniformVisitor
public class LocationBoundingVisitor extends java.lang.Object implements UniformVisitor
A pass for finding an approximation to a minimum-size SourceCodeLocation interval that contains a given node.In typical CssTrees c. April 2013, most nodes do not have SourceCodeLocations, but suppose we have such a node A with descendent nodes D_0, ... D_n that do have locations:
A / \ ----- | \ D_0 D_1Then we know that the subtree rooted at A includes markup beginning by min_0^n(beginLocation(D_i)) and ending by max_0^n(endLocation(D_i)). Concretely, let
node getBeginCharacterIndex getEndCharacterIndex --- --- --- A ? ? D_0 5 15 D_1 17 19
Then we can estimate for A:
A 5 19
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.common.css.compiler.passes.UniformVisitor
UniformVisitor.Adapters
-
-
Constructor Summary
Constructors Constructor Description LocationBoundingVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SourceCodeLocationbound(CssNode n)voidenter(CssNode n)voidleave(CssNode node)
-
-
-
Method Detail
-
enter
public void enter(CssNode n)
- Specified by:
enterin interfaceUniformVisitor
-
leave
public void leave(CssNode node)
- Specified by:
leavein interfaceUniformVisitor
-
bound
public static SourceCodeLocation bound(CssNode n)
-
-