Struct semantic_analyzer::semantic::BlockState
source · pub struct BlockState {
pub values: HashMap<ValueName, Value>,
pub inner_values_name: HashSet<InnerValueName>,
pub labels: HashSet<LabelName>,
pub last_register_number: u64,
pub manual_return: bool,
pub parent: Option<Rc<RefCell<BlockState>>>,
pub children: Vec<Rc<RefCell<BlockState>>>,
pub context: SemanticStack,
}Expand description
Block state
values- contains unique values map for current state but not unique for parent states. The map contains key-value:value_name(unique only for current state); andValueitself - value parameters.inner_values_name- is entity that represent inner value name - it can be different fromValuename because it should be unique for all parent states. For example, of 3 values with namex, inner value name will be: [x,x.0,x.1]. It mean, inner value name can containvalue counteras end of the name.labels- labels set, for conditional operation. Unique for current and all paren states.last_register_number- represent register counter for current and all parent states forCodegen. Register represented asu64and should be linearly incremented.manual_return- flag indicated, that return was invoked from other state, for example: if-flow, loop-flowparent- represent parent states.
Fields§
§values: HashMap<ValueName, Value>State values
inner_values_name: HashSet<InnerValueName>Used to keep all names in the block state (and parent) as unique
labels: HashSet<LabelName>State labels for conditional operations
last_register_number: u64Last register for unique register representation
manual_return: boolManual return from other states
parent: Option<Rc<RefCell<BlockState>>>Parent state
children: Vec<Rc<RefCell<BlockState>>>children states
context: SemanticStackSemantic stack context for Block state
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BlockState
impl !Send for BlockState
impl !Sync for BlockState
impl Unpin for BlockState
impl !UnwindSafe for BlockState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more