public class BashLexer extends BashLexerBase implements ShellLexer
S_ARITH, S_ARITH_ARRAY_MODE, S_ARITH_SQUARE_MODE, S_ARRAY, S_ASSIGNMENT_LIST, S_BACKQUOTE, S_CASE, S_CASE_PATTERN, S_DOLLAR_PREFIXED, S_PARAM_EXPANSION, S_PARAM_EXPANSION_DELIMITER, S_PARAM_EXPANSION_PATTERN, S_PARAM_EXPANSION_REPLACEMENT, S_SUBSHELL, S_TEST, S_TEST_COMMAND, X_HERE_STRING, X_HEREDOC, X_HEREDOC_MARKER, X_HEREDOC_MARKER_IGNORE_TABS, X_STRINGMODE, YYEOF, YYINITIAL| Constructor and Description |
|---|
BashLexer(boolean isBash4,
Reader in)
Constructs a new Bash lexer for the passed Shell script
|
BashLexer(Reader in)
Constructs a new Bash lexer for the passed Shell script supposed to be a Bash 4 script
|
| Modifier and Type | Method and Description |
|---|---|
Token |
getToken()
Returns the token just read with
ShellLexer.next() or null if no token read yet, ShellLexer.scan() was called or
the last token was reached (i.e. |
Token |
next()
Contrary to the
ShellLexer.scan() method, the tokens are returned one by one by this method: it resumes scanning
until the next regular expression is matched, the end of input is encountered or an I/O error occurs |
List<Token> |
scan()
Returns all non-overlapping found tokens for each recognized token in the stream set by the constructor.
|
closeHereStringIfAvailable, yybegin, yychar, yycharat, yyclose, yycolumn, yylength, yylex, yyline, yypushback, yyreset, yystate, yytextbackToPreviousState, decOpenParenthesisCount, enterHereStringContent, goToState, heredocState, incOpenParenthesisCount, isBash4, isEmptyConditionalCommand, isInCaseBody, isInHereStringContent, isInState, isParamExpansionHash, isParamExpansionOther, isParamExpansionWord, leaveHereStringContent, openParenthesisCount, popStates, setEmptyConditionalCommand, setInCaseBody, setParamExpansionHash, setParamExpansionOther, setParamExpansionWord, stringParsingState, token, tokenpublic BashLexer(Reader in)
in - a reader to the Bash script to be scannedpublic BashLexer(boolean isBash4,
Reader in)
isBash4 - true if in is a Bash 4 scriptin - a reader to the Bash script to be scannedpublic List<Token> scan() throws IOException
ShellLexerscan in interface ShellLexerIOException - if an error occurred reading the input scriptpublic Token next() throws IOException
ShellLexerShellLexer.scan() method, the tokens are returned one by one by this method: it resumes scanning
until the next regular expression is matched, the end of input is encountered or an I/O error occursnext in interface ShellLexerIOException - if any I/O error occurspublic Token getToken()
ShellLexerShellLexer.next() or null if no token read yet, ShellLexer.scan() was called or
the last token was reached (i.e. no more token left)getToken in interface ShellLexerShellLexer.next() or null if no token read yet, ShellLexer.scan() was called or
the last token was reached (i.e. no more token left)Copyright © 2018–2019. All rights reserved.