rego-cpp 0.4.5
A C++ implementation of the Rego language and runtime
|
#include <rego.hh>
Public Member Functions | |
BigInt (const Location &value) | |
BigInt (std::int64_t value) | |
BigInt (std::size_t value) | |
const Location & | loc () const |
std::int64_t | to_int () const |
std::size_t | to_size () const |
bool | is_negative () const |
bool | is_zero () const |
BigInt | increment () const |
BigInt | decrement () const |
BigInt | negate () const |
Static Public Member Functions | |
static bool | is_int (const Location &loc) |
Friends | |
BigInt | operator+ (const BigInt &lhs, const BigInt &rhs) |
BigInt | operator- (const BigInt &lhs, const BigInt &rhs) |
BigInt | operator* (const BigInt &lhs, const BigInt &rhs) |
BigInt | operator/ (const BigInt &lhs, const BigInt &rhs) |
BigInt | operator% (const BigInt &lhs, const BigInt &rhs) |
bool | operator> (const BigInt &lhs, const BigInt &rhs) |
bool | operator< (const BigInt &lhs, const BigInt &rhs) |
bool | operator<= (const BigInt &lhs, const BigInt &rhs) |
bool | operator>= (const BigInt &lhs, const BigInt &rhs) |
bool | operator== (const BigInt &lhs, const BigInt &rhs) |
bool | operator!= (const BigInt &lhs, const BigInt &rhs) |
std::ostream & | operator<< (std::ostream &os, const BigInt &value) |
This is a basic, non-optimized implementation of a big integer using strings. In most circumstances this would be considerably slower than other approaches, but given the way in which Trieste nodes store their content as Location objects into a source document, and this class operates over those Locations, it is actual quite efficient when compared to parsing and serializing the Location into a vector of unsigned longs.