Shlex

A lexical analyzer class for simple shell-like syntaxes

Constructors

this
this()
Undocumented in source.
this
this(ShlexStream instream, Nullable!string infile, Posix posix, PunctuationChars punctuationCharsFlag, bool whitespaceSplit)

We don't support implicit stdin as instream as in Python.

this
this(Stream instream, Nullable!string infile, Posix posix, PunctuationChars punctuationChars, bool whitespaceSplit)
Undocumented in source.

Members

Aliases

Comments
alias Comments = Flag!"comments"
Undocumented in source.
Posix
alias Posix = Flag!"posix"
Undocumented in source.
PunctuationChars
alias PunctuationChars = Flag!"PunctuationChars"
Undocumented in source.

Functions

dump
void dump()
Undocumented in source. Be warned that the author may not have intended to support it.
errorLeader
string errorLeader(Nullable!string infile, Nullable!uint lineno)

Emit a C-compiler-like, Emacs-friendly error-message leader.

getToken
Nullable!string getToken()

Get a token from the input stream (or from stack if it's nonempty). Returns null value on eof.

opApply
int opApply(int delegate(ref string) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
popSource
void popSource()

Pop the input source stack.

pushSource
void pushSource(Stream newstream, Nullable!string newfile)

Push an input source onto the lexer's input source stack.

pushSource
void pushSource(ShlexStream newstream, Nullable!string newfile)

Push an input source onto the lexer's input source stack.

pushToken
void pushToken(string tok)

Push a token onto the stack popped by the getToken method

readToken
Nullable!string readToken()
Undocumented in source. Be warned that the author may not have intended to support it.
sourcehook
auto sourcehook(string newfile)

Hook called on a filename to be sourced.

Meta