Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::TokenCollection Class Reference

An ordered immutable collection of Tokens. More...

#include <bond/compiler/tokenstream.h>

Public Member Functions

 TokenCollection (const Token *tokens, int numTokens)
 Constructs a TokenCollection object.
TokenStream GetTokenStream () const
 Returns a TokenStream object to iterate over the contents of the collection.

Detailed Description

An ordered immutable collection of Tokens.

A TokenCollection is the output from a Lexer and can be used as the input to a Parser.

Constructor & Destructor Documentation

◆ TokenCollection()

Bond::TokenCollection::TokenCollection ( const Token * tokens,
int numTokens )
inline

Constructs a TokenCollection object.

Parameters
tokensA pointer to an array of Token objects that form the contents of the collection. It is not copied, so it must outlive the TokenCollection.
numTokensThe number of Tokens contained in the collection.

Member Function Documentation

◆ GetTokenStream()

TokenStream Bond::TokenCollection::GetTokenStream ( ) const
inline

Returns a TokenStream object to iterate over the contents of the collection.


The documentation for this class was generated from the following file:
  • include/bond/compiler/tokenstream.h