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

A class that represents the type of a Mir language token. More...

#include <omScriptingMirTokenType.h>

Public Types

enum  Enum {
  IMPORT, NAMESPACE, CLASS, INTERFACE,
  ENUM, TYPE, ALIAS, PUBLIC,
  PRIVATE, PROTECTED, STATIC, VIRTUAL,
  FINAL, OPERATOR, THIS, SUPER,
  IF, ELSE, WHILE, DO,
  FOR, RETURN, BREAK, CONTINUE,
  SWITCH, CASE, THROW, TRY,
  CATCH, CHAR, BYTE, UBYTE,
  SHORT, USHORT, INT, UINT,
  LONG, ULONG, FLOAT, DOUBLE,
  BOOL, VOID, AUTO, DYNAMIC,
  CONST, ISA, CAST, COPY,
  NEW, ADD, INCREMENT, ADD_ASSIGN,
  SUBTRACT, DECREMENT, SUBTRACT_ASSIGN, MULTIPLY,
  MULTIPLY_ASSIGN, DIVIDE, DIVIDE_ASSIGN, MODULUS,
  MODULUS_ASSIGN, POWER, ASSIGN, AND,
  AND_ASSIGN, OR, OR_ASSIGN, XOR,
  XOR_ASSIGN, IDENTICAL, NOT_IDENTICAL, EQUAL,
  NOT_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, GREATER_THAN,
  GREATER_THAN_OR_EQUAL, NOT, HASH, STRINGIFY,
  OPEN_PARENTHESIS, CLOSE_PARENTHESIS, OPEN_BRACE, CLOSE_BRACE,
  OPEN_BRACKET, CLOSE_BRACKET, SEMICOLON, COLON,
  DOT, COMMA, INTEGER_LITERAL, FLOAT_LITERAL,
  STRING_LITERAL, TRUE_LITERAL, FALSE_LITERAL, NULL_LITERAL,
  IDENTIFIER, SINGLE_LINE_COMMENT, MULTI_LINE_COMMENT, UNDEFINED
}
 An enum that specifies the different kinds of tokens. More...
 

Public Member Functions

 TokenType (Enum newType)
 Create a new token type with the specified token type enum value. More...
 
 operator Enum () const
 Convert this token type to an enum value. More...
 
UTF8String toString () const
 Return a basic string representation of the token type. More...
 
 operator UTF8String () const
 Convert this token type into a string representation. More...
 
UTF8String getSpelling () const
 Return a string representation of the token type's spelling in the source code. More...
 
Bool hasSpelling () const
 Return whether or not this token type has a standard spelling. More...
 

Detailed Description

A class that represents the type of a Mir language token.

Member Enumeration Documentation

An enum that specifies the different kinds of tokens.

Enumerator
IMPORT 

A keyword used to include external code from a different namespace into the current context.

NAMESPACE 

A keyword used to declare or define the namespace to use for a code context.

CLASS 

A keyword used to declare a new class type.

INTERFACE 

A keyword used to declare a new interface type.

ENUM 

A keyword used to declare a new enum type.

TYPE 

A keyword used to declare a new type from an existing type.

ALIAS 

A keyword used to alias an existing type.

PUBLIC 

A keyword used to declare a scope member to have public access visibility.

This means that any code has full access to the member associated with the visibility declaration, regardless of whether or not it is part of the enclosing scope.

PRIVATE 

A keyword used to declare a scope member to have private access visibility.

This means that only code within the same scope can access the member associated with the visibility declaration.

PROTECTED 

A keyword used to declare a scope member to have protected access visibility.

This means that only code in the same scope or in child class scopes can access the member associated with the visibility declaration.

STATIC 

A keyword used to declare that a member is part of the enclosing class, not instances of that class.

VIRTUAL 

A keyword used to declare that a function can be overridden.

Virtual functions allow subclasses to provide their own implementation for these functions, allowing polymorphism.

FINAL 

A keyword used to declare that a class cannot be inherited from.

OPERATOR 

A keyword used to declare an overridden operator.

THIS 

A keyword used to access the current class instance.

SUPER 

A keyword used to access the superclass of the 'this' object.

IF 

A keyword used to test if a condition is true and then modify control flow.

ELSE 

A keyword used to introduce an alternate case for an IF statement.

WHILE 

A keyword used to begin a loop that continues while a certain condition is true.

DO 

A keyword used to begin a loop that must execute at least once.

FOR 

A keyword used to begin a loop that performs an iteration.

RETURN 

A keyword used to exit from a function.

BREAK 

A keyword used to break from a loop or switch statement.

CONTINUE 

A keyword used to continue to the next iteration of a loop.

SWITCH 

A keyword used to begin a switch statement.

CASE 

A keyword used to declare a case within a switch statement.

THROW 

A keyword that is used to throw a value as an exception.

TRY 

A keyword that beings an exception try clause.

CATCH 

A keyword that begins an exception catch clause.

CHAR 

A keyword used to represent a character type.

BYTE 

A keyword used to represent an 8-bit integer numerical type.

UBYTE 

A keyword used to represent an 8-bit unsigned integer numerical type.

SHORT 

A keyword used to represent a 16-bit integer numerical type.

USHORT 

A keyword used to represent a 16-bit unsigned integer numerical type.

INT 

A keyword used to represent a 32-bit integer numerical type.

UINT 

A keyword used to represent a 32-bit unsigned integer numerical type.

LONG 

A keyword used to represent a 64-bit integer numerical type.

ULONG 

A keyword used to represent a 64-bit unsigned integer numerical type.

FLOAT 

A keyword used to represent a 32-bit floating point numerical type.

DOUBLE 

A keyword used to represent a 64-bit floating point numerical type.

BOOL 

A keyword used to represent a boolean type.

VOID 

A keyword used to represent a void (no) type.

AUTO 

A keyword used to represent a compile-time determined automatic type.

DYNAMIC 

A keyword used to represent a run-time dynamic type which supports any operation.

CONST 

A keyword used to mark a type as read-only.

ISA 

A keyword used to assign an interface to a class or as an operator to determine inheritance relationships.

CAST 

A keyword used as an operator when casting from one type to another.

COPY 

A keyword used as an operator when copying objects.

NEW 

A keyword used as an operator when creating new objects.

ADD 

The + operator, used when adding two operands.

INCREMENT 

The ++ operator, used when incrementing an operand by one.

ADD_ASSIGN 

The += operator, used when adding an operand to another and overwriting the first operand.

SUBTRACT 

The - operator, used when subtracting two operands.

DECREMENT 

The – operator, used when decrementing an operand by one.

SUBTRACT_ASSIGN 

The -= operator, used when subtracting an operand from another and overwriting the first operand.

MULTIPLY 

The * operator, used when multiplying two operands.

MULTIPLY_ASSIGN 

The *= operator, used when multiplying an operand with another and overwriting the first operand.

DIVIDE 

The * operator, used when dividing two operands.

DIVIDE_ASSIGN 

The *= operator, used when dividing an operand with another and overwriting the first operand.

MODULUS 

The % operator, used when computing the modulus two operands.

MODULUS_ASSIGN 

The %= operator, used when computing the modulus two operands and overwriting the first operand.

POWER 

The ^ operator, used when raising one operand to the power of another.

ASSIGN 

The = operator, used when assigning one operand to another.

AND 

The && operator, used when computing the logical AND of two operands.

AND_ASSIGN 

The &= operator, used when computing the logical AND of two operands and overwriting the first operand.

OR 

The || operator, used when computing the logical OR of two operands.

OR_ASSIGN 

The |= operator, used when computing the logical OR of two operands and overwriting the first operand.

XOR 

The ^^ operator, used when computing the logical XOR of two operands.

XOR_ASSIGN 

The ^= operator, used when computing the logical XOR of two operands and overwriting the first operand.

IDENTICAL 

The === operator, used when comparing to see if two operands are the same object.

NOT_IDENTICAL 

The !== operator, used when comparing to see if two operands are not the same object.

EQUAL 

The == operator, used when comparing to see if two operands are logically the same.

NOT_EQUAL 

The != operator, used when comparing to see if two operands are not logically the same.

LESS_THAN 

The < operator, used when comparing to see if one operand is less than another.

LESS_THAN_OR_EQUAL 

The <= operator, used when comparing to see if one operand is less than or equal to another.

GREATER_THAN 

The > operator, used when comparing to see if one operand is greater than another.

GREATER_THAN_OR_EQUAL 

The >= operator, used when comparing to see if one operand is greater than or equal to another.

NOT 

The unary ! operator, used when computing the logical not of an operand.

HASH 

The unary # operator, used when computing a hash code for an operand.

STRINGIFY 

The unary $ operator, used when computing a string representation for an operand.

OPEN_PARENTHESIS 

An open parenthesis, used to group operations within expressions and declare parameter lists.

CLOSE_PARENTHESIS 

A close parenthesis, used to group operations within expressions and declare parameter lists.

OPEN_BRACE 

An open brace, used to start a scope.

CLOSE_BRACE 

A close brace, used to close a scope.

OPEN_BRACKET 

An open bracket, used to begin an array index.

CLOSE_BRACKET 

A close bracket, used to end an array index.

SEMICOLON 

A semicolon, used to end a statement.

COLON 

A colon, used to modify attributes of following declarations.

DOT 

A period, used to access members.

COMMA 

A comma, used as a separator in argument lists.

INTEGER_LITERAL 

An integer constant value.

FLOAT_LITERAL 

A floating-point constant value.

STRING_LITERAL 

A string constant value.

TRUE_LITERAL 

A boolean true literal.

FALSE_LITERAL 

A boolean false literal.

NULL_LITERAL 

A NULL object reference value.

IDENTIFIER 

An identifier literal.

SINGLE_LINE_COMMENT 

A single-line comment.

MULTI_LINE_COMMENT 

A multi-line comment.

UNDEFINED 

An error or unsupported token.

Constructor & Destructor Documentation

om::scripting::mir::lang::TokenType::TokenType ( Enum  newType)
inline

Create a new token type with the specified token type enum value.

Member Function Documentation

om::scripting::mir::lang::TokenType::operator Enum ( ) const
inline

Convert this token type to an enum value.

UTF8String om::scripting::mir::lang::TokenType::toString ( ) const

Return a basic string representation of the token type.

om::scripting::mir::lang::TokenType::operator UTF8String ( ) const
inline

Convert this token type into a string representation.

UTF8String om::scripting::mir::lang::TokenType::getSpelling ( ) const

Return a string representation of the token type's spelling in the source code.

Bool om::scripting::mir::lang::TokenType::hasSpelling ( ) const

Return whether or not this token type has a standard spelling.


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