![]() |
linc 0.7
Linc is a general-purpose programming language inspired by C
|
Token representation of operators, operator precedence and associativity mapping. More...
#include <Operators.hpp>
Public Types | |
enum class | Associativity : bool { Left , Right } |
using | OperatorMap = std::vector<std::pair<std::string, Token::Type>> |
using | OperatorPrecedenceMap = std::unordered_map<Token::Type, std::uint16_t> |
using | OperatorAssociativityMap = std::unordered_map<Token::Type, Associativity> |
Static Public Member Functions | |
static Token::Type | getToken (const std::string &operator_string) |
Get the corresponding token-type representation of an operator in string representation (or invalid). | |
static std::string | getString (Token::Type operator_token_type) |
Get the corresponding string representation of an operator in token representation. | |
static Associativity | getAssociativity (Token::Type operator_token_type) |
Get the associativity of a specified operator token type (left or right associative). Otherwise, report an error. | |
static uint16_t | getBinaryPrecedence (Token::Type operator_token_type) |
Get the precedence of a specified binary operator token type. | |
static uint16_t | getUnaryPrecedence (Token::Type operator_token_type) |
Get the precedence of a specified unary operator token type. | |
Token representation of operators, operator precedence and associativity mapping.