picceler
Loading...
Searching...
No Matches
picceler::Lexer Class Reference

Lexical analyzer for the picceler programming language. More...

#include <lexer.h>

Public Member Functions

 Lexer ()
 Constructs a Lexer.
Result< void > setSource (const std::string &source)
 Sets the source file for the lexer.
Result< TokennextToken ()
 Returns the next token from the input.
Result< TokenpeekToken ()
 Returns the next token without advancing the input.
void skipWhitespace ()
 Skips whitespace characters in the input.
Result< std::vector< Token > > tokenizeAll ()
 Tokenizes the entire input.

Detailed Description

Lexical analyzer for the picceler programming language.

Constructor & Destructor Documentation

◆ Lexer()

picceler::Lexer::Lexer ( )

Constructs a Lexer.

Member Function Documentation

◆ nextToken()

Result< Token > picceler::Lexer::nextToken ( )

Returns the next token from the input.

Returns
The next token.

◆ peekToken()

Result< Token > picceler::Lexer::peekToken ( )

Returns the next token without advancing the input.

Returns
The next token.

◆ setSource()

Result< void > picceler::Lexer::setSource ( const std::string & source)

Sets the source file for the lexer.

Parameters
sourceThe source file to read from.

◆ skipWhitespace()

void picceler::Lexer::skipWhitespace ( )

Skips whitespace characters in the input.

◆ tokenizeAll()

Result< std::vector< Token > > picceler::Lexer::tokenizeAll ( )

Tokenizes the entire input.

Returns
A vector of all tokens.

The documentation for this class was generated from the following files: