Class HCLLexer
java.lang.Object
org.opengrok.indexer.analysis.JFlexStateStacker
org.opengrok.indexer.analysis.JFlexSymbolMatcher
org.opengrok.indexer.analysis.hcl.HCLLexer
- All Implemented Interfaces:
JFlexJointLexer
,JFlexLexer
,JFlexStackingLexer
,Resettable
,ScanningSymbolMatcher
,SymbolMatchedPublisher
- Direct Known Subclasses:
HCLSymbolTokenizer
,HCLXref
,TerraformSymbolTokenizer
,TerraformXref
Represents an abstract base class for HCL 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.abstract int
COMMENT()
Subclasses must override to get the constant value created by JFlex to represent COMMENT.abstract int
HERE()
Subclasses must override to get the constant value created by JFlex to represent HERE.abstract int
HEREin()
Subclasses must override to get the constant value created by JFlex to represent HEREin.void
Parses a Here-document declaration, and takes thecapture
usingJFlexJointLexer.offer(String)
.void
interpOp()
Resets the interpolation counter to 1.boolean
maybeHereEnd
(String capture) Process thecapture
, possibly ending the Here-document state just beforehand.boolean
Pushes the first Here-document state if any declarations were parsed, or else does nothing.boolean
maybeInterpolationEnd
(String capture) Determine if the interpolation should end based on the first character ofcapture
, recognizing tokens that increase the nesting level instead.void
popData()
Discard the current lexer state, and pop state off the stack.void
pushData()
Push the lexer state data on the stack, and initialize a new state.void
reset()
Resets the instance to an initial state.abstract int
SCOMMENT()
Subclasses must override to get the constant value created by JFlex to represent SCOMMENT.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
-
HCLLexer
protected HCLLexer()
-
-
Method Details
-
reset
public void reset()Resets the instance to an initial state.- Specified by:
reset
in interfaceResettable
- Overrides:
reset
in classJFlexStateStacker
-
hereOp
Parses a Here-document declaration, and takes thecapture
usingJFlexJointLexer.offer(String)
. If the declaration is valid,hereSettings
will have been appended.- Throws:
IOException
-
maybeHereStart
Pushes the first Here-document state if any declarations were parsed, or else does nothing.- Returns:
- true if a Here state was pushed
- Throws:
IOException
-
maybeHereEnd
Process thecapture
, possibly ending the Here-document state just beforehand.- Returns:
- true if the Here state ended
- Throws:
IOException
-
interpOp
public void interpOp()Resets the interpolation counter to 1. -
maybeInterpolationEnd
Determine if the interpolation should end based on the first character ofcapture
, recognizing tokens that increase the nesting level instead.Calling this method has side effects to possibly modify
numEndBrace
.- Returns:
- true if the interpolation state ended
- Throws:
IOException
-
chkLOC
public void chkLOC()CallsJFlexJointLexer.phLOC()
if the yystate is not COMMENT or SCOMMENT. -
pushData
public void pushData()Push the lexer state data on the stack, and initialize a new state. -
popData
public void popData()Discard the current lexer state, and pop state off the stack. -
COMMENT
public abstract int COMMENT()Subclasses must override to get the constant value created by JFlex to represent COMMENT. -
SCOMMENT
public abstract int SCOMMENT()Subclasses must override to get the constant value created by JFlex to represent SCOMMENT. -
HERE
public abstract int HERE()Subclasses must override to get the constant value created by JFlex to represent HERE. -
HEREin
public abstract int HEREin()Subclasses must override to get the constant value created by JFlex to represent HEREin.
-