Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Compiler_Operator.H File Reference

Reusable operator vocabulary shared by HIR, IR, and backend layers. More...

#include <cassert>
#include <limits>
#include <Compiler_Token.H>
Include dependency graph for Compiler_Operator.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::Compiler_Integer_Result
 Result of compiler_integer_binary() and compiler_integer_negate(). More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Enumerations

enum class  Aleph::Compiler_Operator_Kind {
  Aleph::Invalid , Aleph::Assign , Aleph::Plus , Aleph::Minus ,
  Aleph::Star , Aleph::Slash , Aleph::Percent , Aleph::EqEq ,
  Aleph::NotEq , Aleph::Less , Aleph::LessEq , Aleph::Greater ,
  Aleph::GreaterEq , Aleph::AndAnd , Aleph::OrOr , Aleph::Bang ,
  Aleph::Amp , Aleph::Pipe , Aleph::Caret , Aleph::Tilde ,
  Aleph::PlusEq , Aleph::MinusEq , Aleph::StarEq , Aleph::SlashEq ,
  Aleph::PercentEq , Aleph::PlusPlus , Aleph::MinusMinus
}
 Stable operator kinds shared by reusable compiler layers. More...
 
enum class  Aleph::Compiler_Integer_Status { Aleph::Ok , Aleph::Overflow , Aleph::Division_By_Zero , Aleph::Modulo_By_Zero }
 Outcome of one integer operation of the language. More...
 

Functions

const char * Aleph::compiler_operator_name (const Compiler_Operator_Kind kind) noexcept
 Returns a stable debug name for one operator kind.
 
Compiler_Operator_Kind Aleph::compiler_operator_from_token_kind (const Compiler_Token_Kind kind) noexcept
 Maps one reference-frontend token kind into a reusable operator kind.
 
Compiler_Token_Kind Aleph::compiler_operator_to_token_kind (const Compiler_Operator_Kind kind) noexcept
 Maps one reusable operator kind back into the MVP token kind.
 
bool Aleph::compiler_operator_is_compound_assignment (const Compiler_Operator_Kind kind) noexcept
 Returns whether kind is one compound-assignment operator.
 
Compiler_Operator_Kind Aleph::compiler_operator_compound_base (const Compiler_Operator_Kind kind) noexcept
 Returns the arithmetic operator underlying one compound assignment.
 
Compiler_Integer_Result Aleph::compiler_integer_binary (const Compiler_Operator_Kind op, const long long lhs, const long long rhs) noexcept
 Applies one integer operator of the language to two values.
 
Compiler_Integer_Result Aleph::compiler_integer_negate (const long long operand) noexcept
 Negates one integer of the language.
 

Detailed Description

Reusable operator vocabulary shared by HIR, IR, and backend layers.

The reference frontend still parses operators from Compiler_Token.H, but middle-end and backend layers should not need to model operators in terms of lexer token categories. This header provides a stable operator enum plus compatibility helpers to translate to and from the current token kinds.

Definition in file Compiler_Operator.H.