use super::{BlockId, Chars, Operand, ParaId, PlaceId, SymId};
use crate::{codec_enum, codec_struct};
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CallPlan<P = PlaceId, O = Operand> {
pub target: CallTarget<P, O>,
pub args: Vec<CallArg<P, O>>,
pub returning: Option<P>,
pub on_exception: bool,
pub not_on_exception: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CallTarget<P = PlaceId, O = Operand> {
Named { name: SymId, le: Option<LeService> },
Dynamic(O),
Pointer(P),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum CallArg<P = PlaceId, O = Operand> {
Reference(P),
Content(Chars<P, O>),
Value(O),
Omitted,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct EntryPoint {
pub name: SymId,
pub paragraph: ParaId,
pub block: BlockId,
pub using: Vec<u16>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LeService {
Cee3abd,
Cee3dmp,
Ceedate,
Ceedatm,
Ceedays,
Ceedywk,
Ceefrst,
Ceegmt,
Ceegmto,
Ceegtst,
Ceeloct,
Ceemout,
Ceesecs,
Ceeutc,
}
codec_struct!(CallPlan { target, args, returning, on_exception, not_on_exception });
codec_enum!(CallTarget { Named { name, le } = 0, Dynamic(name) = 1, Pointer(place) = 2 });
codec_enum!(CallArg { Reference(place) = 0, Content(chars) = 1, Value(value) = 2, Omitted = 3 });
codec_struct!(EntryPoint { name, paragraph, block, using });
codec_enum!(LeService {
Cee3abd = 0,
Cee3dmp = 1,
Ceedate = 2,
Ceedatm = 3,
Ceedays = 4,
Ceedywk = 5,
Ceefrst = 6,
Ceegmt = 7,
Ceegmto = 8,
Ceegtst = 9,
Ceeloct = 10,
Ceemout = 11,
Ceesecs = 12,
Ceeutc = 13,
});