Struct oxischeme::environment::Environment [-]  [+] [src]

pub struct Environment {
    // some fields omitted
}

The Environment represents what we know about bindings statically, during syntactic analysis.

Methods

impl Environment

fn new() -> Environment

Create a new Environemnt.

fn extend(&mut self, names: Vec<String>)

Extend the environment with a new lexical block with the given set of variables.

fn pop(&mut self)

Pop off the youngest lexical block.

fn define(&mut self, name: String) -> (u32, u32)

Define a variable in the youngest block and return the coordinates to get its value from an activation at runtime.

fn define_global(&mut self, name: String) -> (u32, u32)

Define a global variable and return its activation coordinates.

fn lookup(&self, name: &String) -> Option<(u32, u32)>

Get the activation coordinates associated with the given variable name.