Code Map
module volta.token.writer;
//! Small container class for tokens, used by the lexer to write tokens
//! to.
class TokenWriter
{
public:
errors: LexerError[];
noDoc: bool;
magicFlagD: bool;
public:
//! Create a new TokenWriter and initialize the first token to
//! TokenType.Begin.
this(source: Source) { }
//! Create a new TokenWriter that doesn't have a Source reference.
this() { }
//! Return the current source.
fn source() Source { }
//! Add the Return the last added token.
fn addToken(token: Token) { }
fn addEnd() { }
//! Remove the last token from the token list. No checking is performed,
//! assumes you know that you can remove a token.
fn pop() { }
//! Return the last added token.
fn lastAdded() Token { }
//! Returns this writer's tokens.
fn getTokens() Token[] { }
}
Small container class for tokens, used by the lexer to write tokens to.
Create a new TokenWriter and initialize the first token to TokenType.Begin.
Create a new TokenWriter that doesn't have a Source reference.
Return the current source.
Side-effects: None.
Add the Return the last added token.
Side-effects: None.
Remove the last token from the token list. No checking is performed, assumes you know that you can remove a token.
Side-effects: mTokens is shortened by one.
Return the last added token.
Side-effects: None.
Returns this writer's tokens.
TODO: Currently this function will leave the writer in a bit of a odd state. Since it resets the tokens but not the source.
Side-effects: Remove all tokens from this writer, and reinitializes the writer.
Create a Begin token add set the token array to single array only containing it.
Side-effects: mTokens is replaced, current source is left untouched.