Package org.opengrok.indexer.analysis
Class JFlexSymbolMatcher
java.lang.Object
org.opengrok.indexer.analysis.JFlexStateStacker
org.opengrok.indexer.analysis.JFlexSymbolMatcher
- All Implemented Interfaces:
 JFlexLexer,JFlexStackingLexer,Resettable,ScanningSymbolMatcher,SymbolMatchedPublisher
- Direct Known Subclasses:
 AdaSymbolTokenizer,AdaXref,AsmSymbolTokenizer,AsmXref,ClojureSymbolTokenizer,ClojureXref,CSharpSymbolTokenizer,CSharpXref,CSymbolTokenizer,CXref,CxxSymbolTokenizer,CxxXref,EiffelSymbolTokenizer,EiffelXref,ErlangSymbolTokenizer,ErlangXref,FortranSymbolTokenizer,FortranXref,GolangSymbolTokenizer,GolangXref,HaskellSymbolTokenizer,HaskellXref,HCLLexer,JavaScriptLexer,JavaSymbolTokenizer,JavaXref,JsonSymbolTokenizer,JsonXref,KotlinSymbolTokenizer,KotlinXref,LispSymbolTokenizer,LispXref,LuaSymbolTokenizer,LuaXref,OCamlSymbolTokenizer,OCamlXref,PascalSymbolTokenizer,PascalXref,PerlSymbolTokenizer,PerlXref,PhpSymbolTokenizer,PhpXref,PlainFullTokenizer,PlainSymbolTokenizer,PlainXref,PLSQLSymbolTokenizer,PLSQLXref,PoshSymbolTokenizer,PoshXref,PythonSymbolTokenizer,PythonXref,RLexer,RubySymbolTokenizer,RubyXref,RustSymbolTokenizer,RustXref,ScalaSymbolTokenizer,ScalaXref,ShSymbolTokenizer,ShXref,SQLSymbolTokenizer,SQLXref,SwiftSymbolTokenizer,SwiftXref,TclSymbolTokenizer,TclXref,TroffFullTokenizer,UuencodeFullTokenizer,UuencodeXref,VBSymbolTokenizer,VBXref,VerilogSymbolTokenizer,VerilogXref,XMLXref,YamlSymbolTokenizer,YamlXref
Represents an abstract base class for subclasses of
 
JFlexStateStacker that can publish as ScanningSymbolMatcher.- 
Field Summary
Fields inherited from class org.opengrok.indexer.analysis.JFlexStateStacker
lineNumber, stack - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidClears any association to a listener.voidClears any association to a listener.protected StringGets the class name value from the last call toonDisjointSpanChanged(String, long).protected voidonDisjointSpanChanged(String className, long position) RaisesNonSymbolMatchedListener.disjointSpanChanged(org.opengrok.indexer.analysis.DisjointSpanChangedEvent)for a subscribed listener.protected voidonEmailAddressMatched(String str, long start) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.EMAILfor a subscribed listener.protected voidonEndOfLineMatched(String str, long start) CallsJFlexStateStacker.setLineNumber(int)with the sum ofJFlexStateStacker.getLineNumber()and the number of LFs instr, and then raisesNonSymbolMatchedListener.endOfLineMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.protected voidonFilelikeMatched(String str, long start) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.FILELIKEfor a subscribed listener.protected booleanonFilteredSymbolMatched(String str, long start, Set<String> keywords) protected booleanonFilteredSymbolMatched(String str, long start, Set<String> keywords, boolean caseSensitive) RaisesonKeywordMatched(String, long)ifkeywordsis not null andstris found as a member (in a case-sensitive or case-less search percaseSensitive); otherwise raisesonSymbolMatched(String, long).protected voidonKeywordMatched(String str, long start) RaisesNonSymbolMatchedListener.keywordMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.protected voidonLabelDefMatched(String str, long start) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.LABELDEFfor a subscribed listener.protected voidonLabelMatched(String str, long start, String lstr) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.LABELfor a subscribed listener.protected voidonNonSymbolMatched(char c, long start) protected voidonNonSymbolMatched(String str, long start) RaisesNonSymbolMatchedListener.nonSymbolMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.protected voidonNonSymbolMatched(String str, EmphasisHint hint, long start) RaisesNonSymbolMatchedListener.nonSymbolMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.protected voidonPathlikeMatched(String str, char sep, boolean canonicalize, long start) RaisesNonSymbolMatchedListener.pathlikeMatched(org.opengrok.indexer.analysis.PathlikeMatchedEvent)for a subscribed listener.protected voidonQueryTermMatched(String str, long start) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.QUERYfor a subscribed listener.protected voidonRefsTermMatched(String str, long start) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.REFSfor a subscribed listener.protected voidonScopeChanged(ScopeAction action, String str, long start) RaisesNonSymbolMatchedListener.scopeChanged(org.opengrok.indexer.analysis.ScopeChangedEvent)for a subscribed listener.protected voidonSourceCodeSeen(long start) RaisesSymbolMatchedListener.sourceCodeSeen(org.opengrok.indexer.analysis.SourceCodeSeenEvent)for all subscribed listeners in turn.protected voidonSymbolMatched(String str, long start) RaisesSymbolMatchedListener.symbolMatched(org.opengrok.indexer.analysis.SymbolMatchedEvent)for a subscribed listener.protected voidonUriMatched(String uri, long start) protected voidonUriMatched(String uri, long start, Pattern collateralCapture) RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.URIfor a subscribed listener.voidAssociates the specified listener, replacing the former one.voidAssociates the specified listener, replacing the former one.Methods inherited from class org.opengrok.indexer.analysis.JFlexStateStacker
clearStack, emptyStack, getLineNumber, getYYEOF, reset, setLineNumber, yyjump, yypop, yypushMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opengrok.indexer.analysis.JFlexLexer
yybegin, yycharat, yyclose, yylength, yylex, yypushback, yyreset, yystate, yytextMethods inherited from interface org.opengrok.indexer.analysis.JFlexStackingLexer
emptyStack, getLineNumber, getYYCHAR, getYYEOF, yypop, yypushMethods inherited from interface org.opengrok.indexer.analysis.Resettable
reset 
- 
Constructor Details
- 
JFlexSymbolMatcher
public JFlexSymbolMatcher() 
 - 
 - 
Method Details
- 
setSymbolMatchedListener
Associates the specified listener, replacing the former one.- Specified by:
 setSymbolMatchedListenerin interfaceSymbolMatchedPublisher- Parameters:
 l- defined instance
 - 
clearSymbolMatchedListener
public void clearSymbolMatchedListener()Clears any association to a listener.- Specified by:
 clearSymbolMatchedListenerin interfaceSymbolMatchedPublisher
 - 
setNonSymbolMatchedListener
Associates the specified listener, replacing the former one.- Specified by:
 setNonSymbolMatchedListenerin interfaceSymbolMatchedPublisher- Parameters:
 l- defined instance
 - 
clearNonSymbolMatchedListener
public void clearNonSymbolMatchedListener()Clears any association to a listener.- Specified by:
 clearNonSymbolMatchedListenerin interfaceSymbolMatchedPublisher
 - 
getDisjointSpanClassName
Gets the class name value from the last call toonDisjointSpanChanged(String, long).- Returns:
 - a defined value or null
 
 - 
onSymbolMatched
RaisesSymbolMatchedListener.symbolMatched(org.opengrok.indexer.analysis.SymbolMatchedEvent)for a subscribed listener.- Parameters:
 str- the symbol stringstart- the symbol start position
 - 
onSourceCodeSeen
protected void onSourceCodeSeen(long start) RaisesSymbolMatchedListener.sourceCodeSeen(org.opengrok.indexer.analysis.SourceCodeSeenEvent)for all subscribed listeners in turn.- Parameters:
 start- the source code start position
 - 
onNonSymbolMatched
protected void onNonSymbolMatched(char c, long start) - Parameters:
 c- the text characterstart- the text start position
 - 
onNonSymbolMatched
RaisesNonSymbolMatchedListener.nonSymbolMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onNonSymbolMatched
RaisesNonSymbolMatchedListener.nonSymbolMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.- Parameters:
 str- the text stringhint- the text hintstart- the text start position
 - 
onKeywordMatched
RaisesNonSymbolMatchedListener.keywordMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onEndOfLineMatched
CallsJFlexStateStacker.setLineNumber(int)with the sum ofJFlexStateStacker.getLineNumber()and the number of LFs instr, and then raisesNonSymbolMatchedListener.endOfLineMatched(org.opengrok.indexer.analysis.TextMatchedEvent)for a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onDisjointSpanChanged
RaisesNonSymbolMatchedListener.disjointSpanChanged(org.opengrok.indexer.analysis.DisjointSpanChangedEvent)for a subscribed listener.- Parameters:
 className- the text stringposition- the text position
 - 
onUriMatched
- Parameters:
 uri- the URI stringstart- the URI start position
 - 
onUriMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.URIfor a subscribed listener.First, the end of
uriis possibly trimmed (with a corresponding call toJFlexLexer.yypushback(int)) based on the result ofStringUtils.countURIEndingPushback(java.lang.String)and optionallyStringUtils.countPushback(java.lang.String, java.util.regex.Pattern)ifcollateralCaptureis not null.If the pushback count is equal to the length of
url, then it is simply written -- and nothing is pushed back -- in order to avoid a never-endingyylex()loop.- Parameters:
 uri- the URI stringstart- the URI start positioncollateralCapture- optional pattern to indicate characters which may have been captured as valid URI characters but in a particular context should mark the start of a pushback
 - 
onFilelikeMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.FILELIKEfor a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onPathlikeMatched
RaisesNonSymbolMatchedListener.pathlikeMatched(org.opengrok.indexer.analysis.PathlikeMatchedEvent)for a subscribed listener.- Parameters:
 str- the path text stringsep- the path separatorcanonicalize- a value indicating whether the path should be canonicalizedstart- the text start position
 - 
onEmailAddressMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.EMAILfor a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onLabelMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.LABELfor a subscribed listener.- Parameters:
 str- the text string (literal capture)start- the text start positionlstr- the text link string
 - 
onLabelDefMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.LABELDEFfor a subscribed listener.- Parameters:
 str- the text string (literal capture)start- the text start position
 - 
onQueryTermMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.QUERYfor a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onRefsTermMatched
RaisesNonSymbolMatchedListener.linkageMatched(org.opengrok.indexer.analysis.LinkageMatchedEvent)ofLinkageType.REFSfor a subscribed listener.- Parameters:
 str- the text stringstart- the text start position
 - 
onScopeChanged
RaisesNonSymbolMatchedListener.scopeChanged(org.opengrok.indexer.analysis.ScopeChangedEvent)for a subscribed listener.- Parameters:
 action- the scope change actionstr- the text stringstart- the text start position
 - 
onFilteredSymbolMatched
- Parameters:
 str- the text stringstart- the text start positionkeywords- an optional set to search forstras a member to indicate a keyword- Returns:
 - true if the 
strwas not inkeywordsor ifkeywordswas null 
 - 
onFilteredSymbolMatched
protected boolean onFilteredSymbolMatched(String str, long start, Set<String> keywords, boolean caseSensitive) RaisesonKeywordMatched(String, long)ifkeywordsis not null andstris found as a member (in a case-sensitive or case-less search percaseSensitive); otherwise raisesonSymbolMatched(String, long).- Parameters:
 str- the text stringstart- the text start positionkeywords- an optional set to search forstras a member to indicate a keywordcaseSensitive- a value indicating ifkeywordsshould be searched forstras-is (true) or if the lower-case equivalent ofstrshould be used (false).- Returns:
 - true if the 
strwas not inkeywordsor ifkeywordswas null 
 
 -