souffle
2.0.2-371-g6315b36
|
#include <NumericConstant.h>
Public Types | |
enum | Type { Type::Int, Type::Uint, Type::Float } |
Public Member Functions | |
NumericConstant * | clone () const override |
Create clone. More... | |
std::optional< Type > | getFinalType () const |
const std::optional< Type > & | getFixedType () const |
NumericConstant (RamSigned value) | |
NumericConstant (std::string constant, SrcLocation loc) | |
NumericConstant (std::string constant, std::optional< Type > fixedType=std::nullopt, SrcLocation loc={}) | |
void | setFinalType (Type newType) |
Public Member Functions inherited from souffle::ast::Constant | |
const std::string & | getConstant () const |
Get string representation of Constant. More... | |
Public Member Functions inherited from souffle::ast::Argument | |
Node (SrcLocation loc={}) | |
Public Member Functions inherited from souffle::ast::Node | |
virtual void | apply (const NodeMapper &) |
Apply the mapper to all child nodes. More... | |
std::string | extloc () const |
Return source location of the syntactic element. More... | |
virtual std::vector< const Node * > | getChildNodes () const |
Obtain a list of all embedded AST child nodes. More... | |
const SrcLocation & | getSrcLoc () const |
Return source location of the Node. More... | |
Node (SrcLocation loc={}) | |
bool | operator!= (const Node &other) const |
Inequality check for two AST nodes. More... | |
bool | operator== (const Node &other) const |
Equivalence check for two AST nodes. More... | |
void | setSrcLoc (SrcLocation l) |
Set source location for the Node. More... | |
virtual | ~Node ()=default |
Protected Member Functions | |
bool | equal (const Node &node) const override |
Abstract equality check for two AST nodes. More... | |
Protected Member Functions inherited from souffle::ast::Constant | |
Constant (std::string value, SrcLocation loc={}) | |
void | print (std::ostream &os) const override |
Output to a given output stream. More... | |
Private Attributes | |
std::optional< Type > | finalTranslatorType |
std::optional< Type > | fixedType |
Numeric Constant.
The constant can be initialized with type. If this is the case, the typesystem will be forced to use it. Otherwise the type is inferred from context.
Definition at line 43 of file NumericConstant.h.
|
strong |
|
inline |
Definition at line 53 of file NumericConstant.h.
|
inline |
Definition at line 55 of file NumericConstant.h.
References souffle::detail::brie::copy(), and finalTranslatorType.
|
inline |
Definition at line 59 of file NumericConstant.h.
|
inlineoverridevirtual |
Create clone.
Implements souffle::ast::Constant.
Definition at line 64 of file NumericConstant.h.
References finalTranslatorType.
|
inlineoverrideprotectedvirtual |
Abstract equality check for two AST nodes.
Reimplemented from souffle::ast::Constant.
Definition at line 86 of file NumericConstant.h.
|
inline |
Definition at line 81 of file NumericConstant.h.
|
inline |
Definition at line 73 of file NumericConstant.h.
References souffle::ast::Constant::equal(), and fixedType.
Referenced by souffle::ast::analysis::TypeConstraintsAnalysis::visitNumericConstant().
|
inline |
Definition at line 77 of file NumericConstant.h.
|
private |
Definition at line 95 of file NumericConstant.h.
Referenced by clone(), and NumericConstant().
|
private |
Definition at line 92 of file NumericConstant.h.
Referenced by getFixedType().