Class SourceVisitor<R>

    • Field Detail

      • cycle

        protected volatile int cycle
    • Constructor Detail

      • SourceVisitor

        public SourceVisitor()
    • Method Detail

      • getTags

        public java.lang.Iterable<io.micrometer.core.instrument.Tag> getTags()
      • setCursoringOn

        protected void setCursoringOn()
      • andThen

        public java.util.List<SourceVisitor<R>> andThen()
        Used to build up pipelines of visitors.
        Returns:
        Other visitors that are run after this one.
      • isIdempotent

        public boolean isIdempotent()
        Determines whether this visitor can be run multiple times as a top-level rule. In the case of a visitor which mutates the underlying tree, indicates that running once or N times will yield the same mutation.
        Returns:
        If true, this visitor can be run multiple times.
      • getName

        public java.lang.String getName()
      • getCursor

        public Cursor getCursor()
      • nextCycle

        public void nextCycle()
      • reduce

        public R reduce​(R r1,
                        R r2)
        Some sensible defaults for reduce (boolean OR, list concatenation, or else just the value of r1). Override if your particular visitor needs to reduce values in a different way.
        Parameters:
        r1 - The left side to reduce.
        r2 - The right side to reduce.
        Returns:
        The reduced value.
      • visit

        public R visit​(@Nullable
                       java.util.List<? extends Tree> trees)
      • visitTree

        public R visitTree​(Tree tree)
      • visitAfter

        public final R visitAfter​(R r,
                                  @Nullable
                                  java.util.List<? extends Tree> trees)