|
MIXAL
|
#include <expression.h>
Public Member Functions | |
| Atomic (AtomicType _type=AtomicType::INTEGER, bool _negative=false) | |
| Atomic (AtomicType _type, int32_t _value, bool _negative=false) | |
| Atomic (AtomicType _type, const std::string &_value, bool _negative=false) | |
| Atomic (const Atomic &atomic) | |
| bool | operator== (const Atomic &atomic) |
| bool | operator!= (const Atomic &atomic) |
| bool | isLocalSymbol () const |
| void | replaceSymbol (const std::string &symbol) |
Static Public Member Functions | |
| static bool | isLocalSymbol (const std::string &symbol) |
Public Attributes | |
| AtomicType | type |
| bool | negative |
| int32_t | integer |
| std::string | symbol |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Atomic &atomic) |
Store the information about an atomic.
Definition at line 25 of file expression.h.
|
explicit |
| mixal::Atomic::Atomic | ( | AtomicType | _type, |
| int32_t | _value, | ||
| bool | _negative = false |
||
| ) |
| mixal::Atomic::Atomic | ( | AtomicType | _type, |
| const std::string & | _value, | ||
| bool | _negative = false |
||
| ) |
| mixal::Atomic::Atomic | ( | const Atomic & | atomic | ) |
| bool mixal::Atomic::isLocalSymbol | ( | ) | const |
Whether the atomic is a local symbol.
Definition at line 50 of file atomic.cpp.
Referenced by mixal::Computer::loadCodes().
|
static |
Whether the symbol is a local symbol.
A local symbol has the form [0-9][HFB] (here, forward, backward).
Definition at line 44 of file atomic.cpp.
References symbol.
| bool mixal::Atomic::operator!= | ( | const Atomic & | atomic | ) |
Whether two atomics are different.
Definition at line 31 of file atomic.cpp.
| bool mixal::Atomic::operator== | ( | const Atomic & | atomic | ) |
| void mixal::Atomic::replaceSymbol | ( | const std::string & | symbol | ) |
Replace the symbol with the actual location.
If the symbol is 2B, it should be replaced with the location of the nearest 2H before the current location.
If the symbol is 4F, it should be replaced with the location of the nearest 4H after the current location.
| symbol | A temporary name representing the location that should be replaced to. |
Definition at line 54 of file atomic.cpp.
References symbol.
|
friend |
Outputs the integer or the symbol based on the atomic type.
Definition at line 35 of file atomic.cpp.
| int32_t mixal::Atomic::integer |
The absolute value part of the integer.
Definition at line 28 of file expression.h.
Referenced by Atomic(), mixal::Expression::evaluate(), and operator==().
| bool mixal::Atomic::negative |
The sign for the integer value.
Definition at line 27 of file expression.h.
Referenced by mixal::Expression::evaluate(), and operator==().
| std::string mixal::Atomic::symbol |
The named symbol for the symbol and the current location.
Definition at line 29 of file expression.h.
Referenced by Atomic(), mixal::Expression::evaluate(), isLocalSymbol(), operator==(), and replaceSymbol().
| AtomicType mixal::Atomic::type |
The type of the atomic.
Definition at line 26 of file expression.h.
Referenced by Atomic(), mixal::Expression::evaluate(), isLocalSymbol(), and operator==().