Package org.sonar.java.regex.ast
Class RegexBaseVisitor
- java.lang.Object
-
- org.sonar.java.regex.ast.RegexBaseVisitor
-
- All Implemented Interfaces:
RegexVisitor
public class RegexBaseVisitor extends Object implements RegexVisitor
-
-
Constructor Summary
Constructors Constructor Description RegexBaseVisitor()
-
Method Summary
-
-
-
Method Detail
-
getActiveFlags
protected int getActiveFlags()
-
flagActive
protected boolean flagActive(int flag)
-
getJavaCharacterForFlag
@CheckForNull protected JavaCharacter getJavaCharacterForFlag(int flag)
Returns the character inside the regex that was used to set the given flag. This will return null if the flag is not set or if the flag has been set from outside of the regex (i.e. as an argument to Pattern.compile). Therefore this should not be used to check whether a flag is set.
-
visit
protected void visit(RegexTree tree)
-
visit
public void visit(RegexParseResult regexParseResult)
- Specified by:
visitin interfaceRegexVisitor
-
before
protected void before(RegexParseResult regexParseResult)
Override to perform an action before any part of the regex is visited.
-
after
protected void after(RegexParseResult regexParseResult)
Override to perform an action after the entire regex has been visited.
-
visitPlainCharacter
public void visitPlainCharacter(PlainCharacterTree tree)
- Specified by:
visitPlainCharacterin interfaceRegexVisitor
-
visitUnicodeCodePoint
public void visitUnicodeCodePoint(UnicodeCodePointTree tree)
- Specified by:
visitUnicodeCodePointin interfaceRegexVisitor
-
visitCharacter
protected void visitCharacter(CharacterTree tree)
Override to visit both PlainCharacterTrees and UnicodeCodePointTrees
-
visitSequence
public void visitSequence(SequenceTree tree)
- Specified by:
visitSequencein interfaceRegexVisitor
-
visitDisjunction
public void visitDisjunction(DisjunctionTree tree)
- Specified by:
visitDisjunctionin interfaceRegexVisitor
-
visitCapturingGroup
public void visitCapturingGroup(CapturingGroupTree tree)
- Specified by:
visitCapturingGroupin interfaceRegexVisitor
-
visitNonCapturingGroup
public final void visitNonCapturingGroup(NonCapturingGroupTree tree)
- Specified by:
visitNonCapturingGroupin interfaceRegexVisitor
-
doVisitNonCapturingGroup
protected void doVisitNonCapturingGroup(NonCapturingGroupTree tree)
-
visitAtomicGroup
public void visitAtomicGroup(AtomicGroupTree tree)
- Specified by:
visitAtomicGroupin interfaceRegexVisitor
-
visitLookAround
public void visitLookAround(LookAroundTree tree)
- Specified by:
visitLookAroundin interfaceRegexVisitor
-
visitBackReference
public void visitBackReference(BackReferenceTree tree)
- Specified by:
visitBackReferencein interfaceRegexVisitor
-
visitRepetition
public void visitRepetition(RepetitionTree tree)
- Specified by:
visitRepetitionin interfaceRegexVisitor
-
visitCharacterClass
public void visitCharacterClass(CharacterClassTree tree)
- Specified by:
visitCharacterClassin interfaceRegexVisitor
-
visitCharacterRange
public void visitCharacterRange(CharacterRangeTree tree)
- Specified by:
visitCharacterRangein interfaceRegexVisitor
-
visitCharacterClassUnion
public void visitCharacterClassUnion(CharacterClassUnionTree tree)
- Specified by:
visitCharacterClassUnionin interfaceRegexVisitor
-
visitCharacterClassIntersection
public void visitCharacterClassIntersection(CharacterClassIntersectionTree tree)
- Specified by:
visitCharacterClassIntersectionin interfaceRegexVisitor
-
visitDot
public void visitDot(DotTree tree)
- Specified by:
visitDotin interfaceRegexVisitor
-
visitEscapedCharacterClass
public void visitEscapedCharacterClass(EscapedCharacterClassTree tree)
- Specified by:
visitEscapedCharacterClassin interfaceRegexVisitor
-
visitBoundary
public void visitBoundary(BoundaryTree boundaryTree)
- Specified by:
visitBoundaryin interfaceRegexVisitor
-
visitMiscEscapeSequence
public void visitMiscEscapeSequence(MiscEscapeSequenceTree tree)
- Specified by:
visitMiscEscapeSequencein interfaceRegexVisitor
-
-