Public Types | Public Member Functions | Public Attributes
Aseba::Compiler::Token Struct Reference

A token is a parsed element of inputs. More...

#include <compiler.h>

List of all members.

Public Types

enum  Type {
  TOKEN_END_OF_STREAM = 0, TOKEN_STR_when, TOKEN_STR_emit, TOKEN_STR_for,
  TOKEN_STR_in, TOKEN_STR_step, TOKEN_STR_while, TOKEN_STR_do,
  TOKEN_STR_if, TOKEN_STR_then, TOKEN_STR_else, TOKEN_STR_elseif,
  TOKEN_STR_end, TOKEN_STR_var, TOKEN_STR_call, TOKEN_STR_sub,
  TOKEN_STR_callsub, TOKEN_STR_onevent, TOKEN_STR_abs, TOKEN_STR_return,
  TOKEN_STRING_LITERAL, TOKEN_INT_LITERAL, TOKEN_PAR_OPEN, TOKEN_PAR_CLOSE,
  TOKEN_BRACKET_OPEN, TOKEN_BRACKET_CLOSE, TOKEN_COLON, TOKEN_COMMA,
  TOKEN_ASSIGN, TOKEN_OP_OR, TOKEN_OP_AND, TOKEN_OP_NOT,
  TOKEN_OP_EQUAL, TOKEN_OP_NOT_EQUAL, TOKEN_OP_BIGGER, TOKEN_OP_BIGGER_EQUAL,
  TOKEN_OP_SMALLER, TOKEN_OP_SMALLER_EQUAL, TOKEN_OP_ADD, TOKEN_OP_NEG,
  TOKEN_OP_MULT, TOKEN_OP_DIV, TOKEN_OP_MOD, TOKEN_OP_SHIFT_LEFT,
  TOKEN_OP_SHIFT_RIGHT, TOKEN_OP_BIT_OR, TOKEN_OP_BIT_XOR, TOKEN_OP_BIT_AND,
  TOKEN_OP_BIT_NOT, TOKEN_OP_ADD_EQUAL, TOKEN_OP_NEG_EQUAL, TOKEN_OP_MULT_EQUAL,
  TOKEN_OP_DIV_EQUAL, TOKEN_OP_MOD_EQUAL, TOKEN_OP_SHIFT_LEFT_EQUAL, TOKEN_OP_SHIFT_RIGHT_EQUAL,
  TOKEN_OP_BIT_OR_EQUAL, TOKEN_OP_BIT_XOR_EQUAL, TOKEN_OP_BIT_AND_EQUAL, TOKEN_OP_PLUS_PLUS,
  TOKEN_OP_MINUS_MINUS
}

Public Member Functions

 operator Type () const
 Token ()
 Token (Type type, SourcePos pos=SourcePos(), const std::wstring &value=L"")
 Construct a new token of given type and value.
std::wstring toWString () const
 Return a string representation of the token.
const std::wstring typeName () const
 Return the name of the type of this token.

Public Attributes

int iValue
 int version of the value, 0 if not applicable
SourcePos pos
 position of token in source code
std::wstring sValue
 string version of the value
enum Aseba::Compiler::Token::Type type
 type of this token

Detailed Description

A token is a parsed element of inputs.

Definition at line 254 of file compiler.h.


Member Enumeration Documentation

Enumerator:
TOKEN_END_OF_STREAM 
TOKEN_STR_when 
TOKEN_STR_emit 
TOKEN_STR_for 
TOKEN_STR_in 
TOKEN_STR_step 
TOKEN_STR_while 
TOKEN_STR_do 
TOKEN_STR_if 
TOKEN_STR_then 
TOKEN_STR_else 
TOKEN_STR_elseif 
TOKEN_STR_end 
TOKEN_STR_var 
TOKEN_STR_call 
TOKEN_STR_sub 
TOKEN_STR_callsub 
TOKEN_STR_onevent 
TOKEN_STR_abs 
TOKEN_STR_return 
TOKEN_STRING_LITERAL 
TOKEN_INT_LITERAL 
TOKEN_PAR_OPEN 
TOKEN_PAR_CLOSE 
TOKEN_BRACKET_OPEN 
TOKEN_BRACKET_CLOSE 
TOKEN_COLON 
TOKEN_COMMA 
TOKEN_ASSIGN 
TOKEN_OP_OR 
TOKEN_OP_AND 
TOKEN_OP_NOT 
TOKEN_OP_EQUAL 
TOKEN_OP_NOT_EQUAL 
TOKEN_OP_BIGGER 
TOKEN_OP_BIGGER_EQUAL 
TOKEN_OP_SMALLER 
TOKEN_OP_SMALLER_EQUAL 
TOKEN_OP_ADD 
TOKEN_OP_NEG 
TOKEN_OP_MULT 
TOKEN_OP_DIV 
TOKEN_OP_MOD 
TOKEN_OP_SHIFT_LEFT 
TOKEN_OP_SHIFT_RIGHT 
TOKEN_OP_BIT_OR 
TOKEN_OP_BIT_XOR 
TOKEN_OP_BIT_AND 
TOKEN_OP_BIT_NOT 
TOKEN_OP_ADD_EQUAL 
TOKEN_OP_NEG_EQUAL 
TOKEN_OP_MULT_EQUAL 
TOKEN_OP_DIV_EQUAL 
TOKEN_OP_MOD_EQUAL 
TOKEN_OP_SHIFT_LEFT_EQUAL 
TOKEN_OP_SHIFT_RIGHT_EQUAL 
TOKEN_OP_BIT_OR_EQUAL 
TOKEN_OP_BIT_XOR_EQUAL 
TOKEN_OP_BIT_AND_EQUAL 
TOKEN_OP_PLUS_PLUS 
TOKEN_OP_MINUS_MINUS 

Definition at line 256 of file compiler.h.


Constructor & Destructor Documentation

Definition at line 329 of file compiler.h.

Aseba::Compiler::Token::Token ( Type  type,
SourcePos  pos = SourcePos(),
const std::wstring &  value = L"" 
)

Construct a new token of given type and value.

Definition at line 32 of file lexer.cpp.


Member Function Documentation

Aseba::Compiler::Token::operator Type ( ) const [inline]

Definition at line 333 of file compiler.h.

std::wstring Aseba::Compiler::Token::toWString ( ) const

Return a string representation of the token.

Definition at line 129 of file lexer.cpp.

const std::wstring Aseba::Compiler::Token::typeName ( ) const

Return the name of the type of this token.

Definition at line 59 of file lexer.cpp.


Member Data Documentation

int version of the value, 0 if not applicable

Definition at line 326 of file compiler.h.

position of token in source code

Definition at line 327 of file compiler.h.

string version of the value

Definition at line 325 of file compiler.h.

type of this token


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


aseba
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:39