Class JavaScriptLexer
java.lang.Object
org.opengrok.indexer.analysis.JFlexStateStacker
org.opengrok.indexer.analysis.JFlexSymbolMatcher
org.opengrok.indexer.analysis.javascript.JavaScriptLexer
- All Implemented Interfaces:
JFlexJointLexer
,JFlexLexer
,JFlexStackingLexer
,Resettable
,ScanningSymbolMatcher
,SymbolMatchedPublisher
- Direct Known Subclasses:
JavaScriptSymbolTokenizer
,JavaScriptXref
,TypeScriptSymbolTokenizer
,TypeScriptXref
public abstract class JavaScriptLexer
extends JFlexSymbolMatcher
implements JFlexJointLexer, Resettable
Represents an abstract base class for JavaScript lexers.
-
Field Summary
Fields inherited from class org.opengrok.indexer.analysis.JFlexStateStacker
lineNumber, stack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
chkLOC()
CallsJFlexJointLexer.phLOC()
if the yystate is not COMMENT or SCOMMENT.protected abstract int
COMMENT()
Subclasses must override to get the constant value created by JFlex to represent COMMENT.protected boolean
Determine if template substitution should end based on the first character ofcapture
, and also recognizing tokens that increase the nesting level alternatively.protected void
pushData()
void
reset()
Resets the instance to an initial state.protected abstract int
SCOMMENT()
Subclasses must override to get the constant value created by JFlex to represent SCOMMENT.protected void
Resets the substitution brace counter to 1.Methods inherited from class org.opengrok.indexer.analysis.JFlexSymbolMatcher
clearNonSymbolMatchedListener, clearSymbolMatchedListener, getDisjointSpanClassName, onDisjointSpanChanged, onEmailAddressMatched, onEndOfLineMatched, onFilelikeMatched, onFilteredSymbolMatched, onFilteredSymbolMatched, onKeywordMatched, onLabelDefMatched, onLabelMatched, onNonSymbolMatched, onNonSymbolMatched, onNonSymbolMatched, onPathlikeMatched, onQueryTermMatched, onRefsTermMatched, onScopeChanged, onSourceCodeSeen, onSymbolMatched, onUriMatched, onUriMatched, setNonSymbolMatchedListener, setSymbolMatchedListener
Methods inherited from class org.opengrok.indexer.analysis.JFlexStateStacker
clearStack, emptyStack, getLineNumber, getYYEOF, setLineNumber, yyjump, yypop, yypush
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opengrok.indexer.analysis.JFlexJointLexer
disjointSpan, offer, offerKeyword, offerSymbol, phLOC, skipSymbol, startNewLine
Methods inherited from interface org.opengrok.indexer.analysis.JFlexLexer
yybegin, yycharat, yyclose, yylength, yylex, yypushback, yyreset, yystate, yytext
Methods inherited from interface org.opengrok.indexer.analysis.JFlexStackingLexer
emptyStack, getLineNumber, getYYCHAR, getYYEOF, yypop, yypush
-
Constructor Details
-
JavaScriptLexer
public JavaScriptLexer()
-
-
Method Details
-
reset
public void reset()Resets the instance to an initial state.- Specified by:
reset
in interfaceResettable
- Overrides:
reset
in classJFlexStateStacker
-
chkLOC
public void chkLOC()CallsJFlexJointLexer.phLOC()
if the yystate is not COMMENT or SCOMMENT. -
substitutionOp
protected void substitutionOp()Resets the substitution brace counter to 1. -
notInTemplateOrSubstitutionDoesNotEnd
Determine if template substitution should end based on the first character ofcapture
, and also recognizing tokens that increase the nesting level alternatively.Calling this method has side effects to possibly modify
nEndBrace
.- Returns:
true
if the substitution state does not end- Throws:
IOException
-
pushData
protected void pushData() -
COMMENT
protected abstract int COMMENT()Subclasses must override to get the constant value created by JFlex to represent COMMENT. -
SCOMMENT
protected abstract int SCOMMENT()Subclasses must override to get the constant value created by JFlex to represent SCOMMENT.
-