Support Forum       G3D Web Page     
Public Types | Public Member Functions | Friends | List of all members
G3D::Token Class Reference


For use with TextInput. More...

Public Types

enum  ExtendedType {
  DOUBLE_QUOTED_TYPE,
  SINGLE_QUOTED_TYPE,
  SYMBOL_TYPE,
  FLOATING_POINT_TYPE,
  INTEGER_TYPE,
  HEX_INTEGER_TYPE,
  BOOLEAN_TYPE,
  LINE_COMMENT_TYPE,
  BLOCK_COMMENT_TYPE,
  NEWLINE_TYPE,
  END_TYPE
}
 
More detailed type information than Type. More...
 
enum  Type {
  STRING = DOUBLE_QUOTED_TYPE,
  SYMBOL = SYMBOL_TYPE,
  NUMBER = FLOATING_POINT_TYPE,
  BOOLEAN = BOOLEAN_TYPE,
  COMMENT = LINE_COMMENT_TYPE,
  NEWLINE = NEWLINE_TYPE,
  END = END_TYPE
}
 
Strings are enclosed in quotes, symbols are not. More...
 

Public Member Functions

 Token ()
 
 Token (Type t, ExtendedType e, const String &s, int L, int c, uint64 byte)
 
 Token (Type t, ExtendedType e, const String &s, bool b, int L, int c, uint64 byte)
 
bool boolean () const
 
uint64 bytePosition () const
 Number of bytes from the beginning of the buffer that this token was parsed from. More...
 
int character () const
 
Starting character position in the input line from which this token was parsed. More...
 
ExtendedType extendedType () const
 
int line () const
 
Starting line of the input from which this token was parsed. More...
 
double number () const
 Return the numeric value for a number type, or zero if this is not a number type. More...
 
const Stringstring () const
 
The value of a single or double quote string (not including the quotes), the name of a symbol, or the exact textual representation of a number as parsed from the input. More...
 
Type type () const
 

Friends

class TextInput
 

Detailed Description


For use with TextInput.

Member Enumeration Documentation

◆ ExtendedType


More detailed type information than Type.

Enumerator
DOUBLE_QUOTED_TYPE 
SINGLE_QUOTED_TYPE 
SYMBOL_TYPE 
FLOATING_POINT_TYPE 
INTEGER_TYPE 
HEX_INTEGER_TYPE 
BOOLEAN_TYPE 
LINE_COMMENT_TYPE 
BLOCK_COMMENT_TYPE 
NEWLINE_TYPE 
END_TYPE 

◆ Type


Strings are enclosed in quotes, symbols are not.

Enumerator
STRING 
SYMBOL 
NUMBER 
BOOLEAN 
COMMENT 
NEWLINE 
END 

Constructor & Destructor Documentation

◆ Token() [1/3]

G3D::Token::Token ( )
inline

◆ Token() [2/3]

G3D::Token::Token ( Type  t,
ExtendedType  e,
const String s,
int  L,
int  c,
uint64  byte 
)
inline

◆ Token() [3/3]

G3D::Token::Token ( Type  t,
ExtendedType  e,
const String s,
bool  b,
int  L,
int  c,
uint64  byte 
)
inline

Member Function Documentation

◆ boolean()

bool G3D::Token::boolean ( ) const
inline

◆ bytePosition()

uint64 G3D::Token::bytePosition ( ) const
inline

Number of bytes from the beginning of the buffer that this token was parsed from.

Begins at 0

◆ character()

int G3D::Token::character ( ) const
inline


Starting character position in the input line from which this token was parsed.

Starts at 1.

◆ extendedType()

ExtendedType G3D::Token::extendedType ( ) const
inline

◆ line()

int G3D::Token::line ( ) const
inline


Starting line of the input from which this token was parsed.

Starts at 1.

◆ number()

double G3D::Token::number ( ) const

Return the numeric value for a number type, or zero if this is not a number type.

◆ string()

const String& G3D::Token::string ( ) const
inline


The value of a single or double quote string (not including the quotes), the name of a symbol, or the exact textual representation of a number as parsed from the input.

◆ type()

Type G3D::Token::type ( ) const
inline

Friends And Related Function Documentation

◆ TextInput

friend class TextInput
friend

documentation generated on Wed Nov 24 2021 08:02:01 using doxygen 1.8.15