Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::scripting::mir::lang::Token Class Reference

A class that represents a token for the Mir scripting language. More...

#include <omScriptingMirToken.h>

Public Member Functions

 Token (TokenType newType, const Position &newPosition, Size newLength)
 Create a new token with the specified type, code point start index, and code point length length. More...
 
TokenType getType () const
 Return an object representing the type of this token. More...
 
const PositiongetPosition () const
 Return the position within the source file of the start of this token. More...
 
Size getLength () const
 Return the length in code points of the token. More...
 
UTF8String getSpelling (const UTF8String &source) const
 Return the spelling of this token within the specified source code string. More...
 

Detailed Description

A class that represents a token for the Mir scripting language.

Constructor & Destructor Documentation

om::scripting::mir::lang::Token::Token ( TokenType  newType,
const Position newPosition,
Size  newLength 
)
inline

Create a new token with the specified type, code point start index, and code point length length.

Member Function Documentation

TokenType om::scripting::mir::lang::Token::getType ( ) const
inline

Return an object representing the type of this token.

const Position& om::scripting::mir::lang::Token::getPosition ( ) const
inline

Return the position within the source file of the start of this token.

Size om::scripting::mir::lang::Token::getLength ( ) const
inline

Return the length in code points of the token.

UTF8String om::scripting::mir::lang::Token::getSpelling ( const UTF8String &  source) const
inline

Return the spelling of this token within the specified source code string.

If for some reason the token is outside of the bounds of the given string, as much of the string is captured as possible (even if there is none) and returned.


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