Expand description
rast, the resolved AST: the program as written, with every name an
id.
Every reference names the node it denotes: a channel its endpoint PDs,
a mapping its region, a call its foreign function, a variable its
declaration. Duplicates are rejected, and the vaddrs allocated once
every program is resolved. Types stay as written (TypeRef), and
constants unevaluated.
rast defines a node only where resolution changes its content and
typing changes it again (one typing leaves as resolved is base’s); a
declaration that names nothing (a memory region, a protection domain) is
the AST’s own node, cloned into its arena. rast owns all its data, so
the AST can be dropped once it is built.
Re-exports§
pub use body::Bodies;pub use body::Body;pub use body::BodyVar;pub use body::Comm;pub use body::Event;pub use body::EventBody;pub use body::Proc;pub use body::ProcBody;pub use body::Stmt;pub use env::build;pub use env::build_data;pub use env::build_programs;pub use env::build_system;pub use env::lay_out;pub use env::Channel;pub use env::Const;pub use env::Env;pub use env::Field;pub use env::ForeignFn;pub use env::LocalVar;pub use env::LocalVars;pub use env::Rast;pub use env::Struct;pub use expr::Expr;pub use expr::ExprKind;
Modules§
- body
- Process and event bodies, resolved, and their variables:
Bodies, whichrast::buildreturns beside the declarations and typing consumes. - env
- The resolved AST,
Rast, and its environment,Env: the declarations resolution builds and typing changes again (Channel,Structand itsFields,Const,LocalVar), andbuild, which builds them from a checked AST. What typing leaves as resolved isbase’s. - expr
- Expressions, resolved: a variable is the declaration it denotes, a call
the foreign function it reaches,
m.vaddrandm.paddrthe mapping. - program
- Resolving one
.fiprogram: its imports (each alias to the file the store read, in scope while its bodies are resolved), mappings (intoEnv::mappings), locals, events, processes and entry points, each in its own arena. A called foreign function joinsEnv::ffisat its first call, its signature lowered to fic’s types, and the store records where it is. - scope
- What a name in a body denotes: the body’s frames, innermost first,
then the program’s locals, then the system’s consts (
BodyScope); and the program’s and system’s declarations a body can name (Outer). The scope rules themselves arebody.rs’s walk. - system
- Resolving the
.fisdeclarations: channels, structs, consts and theSystem =composition, into theEnv. Memory regions and protection domains name nothing, soEnvholds the AST’s own nodes for them.