Skip to main content

Program

Struct Program 

Source
pub struct Program {
Show 31 fields pub id: String, pub pos: Pos, pub options: Vec<String>, pub initial: bool, pub recursive: bool, pub common: bool, pub working_storage: Vec<DataEntry>, pub local_storage: Vec<DataEntry>, pub linkage: Vec<DataEntry>, pub screens: Vec<ScreenEntry>, pub using: Vec<Param>, pub returning: Option<String>, pub paragraphs: Vec<Paragraph>, pub files: Vec<FileDecl>, pub sources: Vec<String>, pub exec_declarations: Vec<ExecBlock>, pub report_writer: ReportWriter, pub declaratives: Declaratives, pub oo: Option<Box<Oo>>, pub environment: Environment, pub nested: Vec<String>, pub registers: Vec<String>, pub callable: Vec<String>, pub hidden: Vec<String>, pub duplicates: Vec<(String, Pos)>, pub linked: Vec<String>, pub containers: Vec<Container>, pub messages: Vec<Error>, pub function: Option<Function>, pub prototypes: Vec<Prototype>, pub repository_functions: Vec<String>,
}

Fields§

§id: String§pos: Pos

Where its PROGRAM-ID names it.

§options: Vec<String>

Options from CBL and PROCESS cards, in the order written.

§initial: bool

PROGRAM-ID … IS INITIAL, or once compiled the INITIAL option: WORKING-STORAGE starts afresh on every CALL.

§recursive: bool§common: bool

PROGRAM-ID … IS COMMON, for a program another contains.

§working_storage: Vec<DataEntry>§local_storage: Vec<DataEntry>

LOCAL-STORAGE: fresh for every activation of the program.

§linkage: Vec<DataEntry>§screens: Vec<ScreenEntry>

The SCREEN SECTION’s entries, as written.

§using: Vec<Param>

PROCEDURE DIVISION USING: the LINKAGE items the caller’s arguments address.

§returning: Option<String>§paragraphs: Vec<Paragraph>§files: Vec<FileDecl>

Files declared by SELECT and described by FD, with their record descriptions.

§sources: Vec<String>

The program’s source file, then each COPY member, as positions index them.

§exec_declarations: Vec<ExecBlock>

EXEC blocks in the DATA DIVISION: SQL declarations, cursors and DECLARE SECTION markers.

§report_writer: ReportWriter

The REPORT SECTION, and the DECLARATIVES that serve it.

§declaratives: Declaratives

The DECLARATIVES’ USE AFTER EXCEPTION/ERROR and USE FOR DEBUGGING procedures.

§oo: Option<Box<Oo>>

The REPOSITORY’s classes, and for a class definition or a method what it is.

§environment: Environment§nested: Vec<String>

The PROGRAM-IDs of the programs it directly contains.

§registers: Vec<String>

Special registers the PROCEDURE DIVISION names and no entry declares, which the compiler declares: WHEN-COMPILED.

§callable: Vec<String>

The contained programs of its compilation a CALL from it reaches (Language Reference, Conventions for program-names): those it directly contains, and each COMMON one that a program containing it directly contains, but itself and those that contain it.

§hidden: Vec<String>

The other contained programs of its compilation, and those containing it, which a CALL from it does not reach.

§duplicates: Vec<(String, Pos)>

For a separately compiled program, each name two of its programs share, where the second’s PROGRAM-ID is.

§linked: Vec<String>

The names a static CALL from it finds in its compilation: its source’s separately compiled programs and their ENTRY names, and in a bundle the other sources’ programs.

§containers: Vec<Container>

The programs that contain it, innermost first, with the names each declares GLOBAL.

§messages: Vec<Error>

The messages reading its source gave that did not stop the parse, in the order found.

§function: Option<Function>

FUNCTION-ID in place of PROGRAM-ID: a user-defined function, or a prototype of one.

§prototypes: Vec<Prototype>

The user-defined functions it may invoke: those defined or prototyped before it in its source, and a function itself.

§repository_functions: Vec<String>

The user-defined functions its REPOSITORY paragraph, or its outermost program’s, names. One with an intrinsic function’s name is invoked by that name only where it is named here.

Implementations§

Source§

impl Program

Source

pub fn intrinsic(&self, name: &str) -> bool

Whether FUNCTION name invokes an intrinsic function rather than a user-defined one.

Source§

impl Program

Source

pub fn load_name(&self) -> &str

The name a CALL or a function invocation loads it by: a function’s external name.

Source

pub fn is_prototype(&self) -> bool

Trait Implementations§

Source§

impl Clone for Program

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Program

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Program

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Program

Source§

impl PartialEq for Program

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Program

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.