use crate::Pos;
mod oo;
pub use oo::*;
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Program {
pub id: String,
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 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: crate::report::ReportWriter,
pub declaratives: Declaratives,
pub oo: Option<Box<Oo>>,
pub environment: Environment,
pub nested: Vec<String>,
pub containers: Vec<Container>,
pub messages: Vec<crate::Error>,
pub function: Option<Function>,
pub prototypes: Vec<Prototype>,
}
impl Program {
pub fn load_name(&self) -> &str {
self.function.as_ref().map_or(&self.id, |f| &f.external)
}
pub fn is_prototype(&self) -> bool {
self.function.as_ref().is_some_and(|f| f.prototype)
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Function {
pub external: String,
pub prototype: bool,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Prototype {
pub name: String,
pub external: String,
pub using: Vec<Param>,
pub returning: Option<String>,
pub linkage: Vec<DataEntry>,
pub environment: Environment,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Param {
pub by_value: bool,
pub name: String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Organization {
Sequential,
LineSequential,
Indexed,
Relative,
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum Access {
#[default]
Sequential,
Random,
Dynamic,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct FileDecl {
pub name: String,
pub assign: String,
pub organization: Organization,
pub access: Access,
pub record_key: Option<Ref>,
pub alternate_keys: Vec<(Ref, bool)>,
pub relative_key: Option<Ref>,
pub optional: bool,
pub status: Option<Ref>,
pub vsam_status: Option<Ref>,
pub passwords: Vec<Ref>,
pub recording: Option<char>,
pub record_min: Option<u32>,
pub record_max: Option<u32>,
pub record_varying: bool,
pub record_depending: Option<Ref>,
pub records: Vec<DataEntry>,
pub reports: Vec<String>,
pub linage: Option<Linage>,
pub sort: bool,
pub external: bool,
pub global: bool,
pub declared_in: Option<String>,
pub pos: Pos,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Container {
pub id: String,
pub working_storage: Vec<DataEntry>,
pub local_storage: Vec<DataEntry>,
pub linkage: Vec<DataEntry>,
pub files: Vec<FileDecl>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Linage {
pub lines: LinageValue,
pub footing: Option<LinageValue>,
pub top: Option<LinageValue>,
pub bottom: Option<LinageValue>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum LinageValue {
Integer(String),
Data(Ref),
}
pub use rt::vocab::{Closing, OpenMode};
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Advancing {
Lines { before: bool, count: Expr },
Page { before: bool },
Mnemonic { before: bool, name: String, environment: String },
}
impl Advancing {
pub fn before(&self) -> bool {
match self {
Self::Lines { before, .. } | Self::Page { before } | Self::Mnemonic { before, .. } => *before,
}
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum Usage {
#[default]
Display,
Binary,
NativeBinary,
Packed,
Float1,
Float2,
National,
Dbcs,
Pointer,
Index,
ObjectReference,
ProgramPointer,
}
pub use rt::vocab::{SignClause, SignPosition};
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DataEntry {
pub level: u8,
pub name: Option<String>,
pub spelled: Option<String>,
pub picture: Option<String>,
pub usage: Option<Usage>,
pub value: Option<Literal>,
pub redefines: Option<String>,
pub occurs: Option<u32>,
pub occurs_min: Option<u32>,
pub depending_on: Option<Ref>,
pub sign: Option<SignClause>,
pub justified: bool,
pub sync: bool,
pub blank_when_zero: bool,
pub indexed_by: Vec<String>,
pub keys: Vec<(bool, Ref)>,
pub condition_values: Vec<(Literal, Option<Literal>)>,
pub false_value: Option<Literal>,
pub renames: Option<(Ref, Option<Ref>)>,
pub object_class: Option<String>,
pub external: bool,
pub global: bool,
pub pos: Pos,
}
pub use rt::vocab::Figurative;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Literal {
Alnum(String),
Hex(Vec<u8>),
National(String),
Dbcs(String),
Number(String),
Figurative(Figurative),
All(Box<Literal>),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Paragraph {
pub name: String,
pub statements: Vec<Stmt>,
pub section: Option<String>,
pub is_section: bool,
pub priority: u8,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ProcName {
pub name: String,
pub section: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Declaratives {
pub errors: Vec<UseAfterError>,
pub debugging: Vec<UseForDebugging>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UseAfterError {
pub section: usize,
pub global: bool,
pub on: ErrorUse,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ErrorUse {
Files(Vec<String>),
Mode(OpenMode),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UseForDebugging {
pub section: usize,
pub procedures: Vec<ProcName>,
pub pos: Pos,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ExitKind {
Plain,
Paragraph,
Section,
Perform,
PerformCycle,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Subject {
Bool(bool),
Expr(Expr),
Cond(Cond),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Object {
Any,
Bool(bool),
Cond(Cond),
Value { not: bool, from: Expr, thru: Option<Expr> },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct When {
pub alternatives: Vec<Vec<Object>>,
pub body: Vec<Stmt>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Ref {
pub name: String,
pub qualifiers: Vec<String>,
pub subscripts: Vec<Expr>,
pub refmod: Option<RefMod>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct RefMod {
pub start: Box<Expr>,
pub length: Option<Box<Expr>>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct FunctionCall {
pub name: String,
pub args: Vec<Expr>,
pub modifier: Option<String>,
pub refmod: Option<RefMod>,
pub all_subscripts: Vec<(usize, Vec<usize>)>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Operand {
Ref(Ref),
Literal(Literal),
Function(FunctionCall),
LengthOf(Ref),
AddressOf(Ref),
}
pub use rt::vocab::{AcceptFrom, BinOp, RelOp};
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Expr {
Operand(Operand),
Neg(Box<Expr>),
Bin(Box<Expr>, BinOp, Box<Expr>),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Class {
Numeric,
Alphabetic,
AlphabeticLower,
AlphabeticUpper,
Dbcs,
Kanji,
Positive,
Negative,
Zero,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Cond {
Rel(Expr, RelOp, Expr),
Class(Expr, Class),
Name(Ref),
NameOrRel { subject: Expr, op: RelOp, negated: bool, name: Ref },
Not(Box<Cond>),
And(Box<Cond>, Box<Cond>),
Or(Box<Cond>, Box<Cond>),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Target {
pub r: Ref,
pub rounded: bool,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Varying {
pub var: Ref,
pub from: Expr,
pub by: Expr,
pub until: Cond,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Loop {
Once,
Times(Expr),
Until { cond: Cond, test_after: bool },
Varying { varying: Box<Varying>, after: Vec<Varying>, test_after: bool },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Stmt {
Move { from: Operand, to: Vec<Ref>, pos: Pos },
Compute { targets: Vec<Target>, expr: Expr, size_error: Option<SizeError>, pos: Pos },
Arith(Box<Arith>),
Corresponding(Box<Corresponding>),
If { cond: Cond, then: Vec<Stmt>, otherwise: Vec<Stmt>, pos: Pos },
PerformInline { body: Vec<Stmt>, repeat: Loop, pos: Pos },
PerformProc { from: ProcName, thru: Option<ProcName>, repeat: Loop, pos: Pos },
Evaluate { subjects: Vec<Subject>, whens: Vec<When>, other: Vec<Stmt>, pos: Pos },
Display { items: Vec<Operand>, upon: Option<Upon>, no_advancing: bool, pos: Pos },
Open { files: Vec<(OpenMode, String)>, pos: Pos },
Close { files: Vec<(String, Option<Closing>)>, pos: Pos },
Read(Box<ReadStmt>),
Write { record: Ref, from: Option<Operand>, advancing: Option<Advancing>, invalid: Handlers, end_of_page: Handlers, pos: Pos },
Rewrite { record: Ref, from: Option<Operand>, invalid: Handlers, pos: Pos },
Delete { file: String, invalid: Handlers, pos: Pos },
Start { file: String, key: Option<(RelOp, Ref)>, invalid: Handlers, pos: Pos },
Initialize { targets: Vec<Ref>, with: Option<Box<InitializeWith>>, pos: Pos },
GoTo { target: Option<ProcName>, pos: Pos },
GoToDepending { targets: Vec<ProcName>, on: Ref, pos: Pos },
Alter { pairs: Vec<(ProcName, ProcName)>, pos: Pos },
Entry { name: String, using: Vec<Param>, pos: Pos },
Goback { pos: Pos },
ExitProgram { pos: Pos },
Call(Box<Call>),
Cancel { targets: Vec<Operand>, pos: Pos },
Set { set: SetStmt, pos: Pos },
Accept { target: Ref, from: AcceptFrom, pos: Pos },
String(Box<StringStmt>),
Unstring(Box<Unstring>),
Inspect(Box<Inspect>),
Search(Box<Search>),
NextSentence,
SentenceEnd,
Exec(Box<ExecBlock>),
Report(Box<crate::report::ReportStmt>),
Invoke(Box<Invoke>),
JsonGenerate(Box<JsonGenerate>),
JsonParse(Box<JsonParse>),
XmlParse(Box<XmlParse>),
XmlGenerate(Box<XmlGenerate>),
ExitMethod { pos: Pos },
Sorting(Box<Sorting>),
StopRun { pos: Pos },
Continue,
Exit { kind: ExitKind, pos: Pos },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SizeError {
pub on: Vec<Stmt>,
pub not_on: Vec<Stmt>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ArithVerb {
Add,
Subtract,
Multiply,
Divide,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Arith {
pub verb: ArithVerb,
pub computations: Vec<(Target, Expr)>,
pub remainder: Option<(Target, Expr, Expr)>,
pub size_error: Option<SizeError>,
pub pos: Pos,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CorrespondingVerb {
Move,
Add,
Subtract,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Corresponding {
pub verb: CorrespondingVerb,
pub from: Ref,
pub to: Ref,
pub rounded: bool,
pub size_error: Option<SizeError>,
pub pos: Pos,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ArgMode {
Reference,
Content,
Value,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Arg {
pub mode: ArgMode,
pub value: Option<Operand>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Call {
pub target: Operand,
pub using: Vec<Arg>,
pub returning: Option<Ref>,
pub on_exception: Option<Vec<Stmt>>,
pub not_on_exception: Option<Vec<Stmt>>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum SetStmt {
ConditionTrue(Vec<Ref>),
ConditionFalse(Vec<Ref>),
To { targets: Vec<Ref>, value: Operand },
Entry { targets: Vec<Ref>, entry: Operand },
AddressOf { targets: Vec<Ref>, value: Operand },
UpDown { targets: Vec<Ref>, down: bool, by: Expr },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Delimiter {
Size,
By(Operand),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct StringStmt {
pub sources: Vec<(Operand, Delimiter)>,
pub into: Ref,
pub pointer: Option<Ref>,
pub on_overflow: Option<Vec<Stmt>>,
pub not_on_overflow: Option<Vec<Stmt>>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UnstringInto {
pub target: Ref,
pub delimiter_in: Option<Ref>,
pub count_in: Option<Ref>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Unstring {
pub source: Ref,
pub delimiters: Vec<(bool, Operand)>,
pub into: Vec<UnstringInto>,
pub pointer: Option<Ref>,
pub tallying: Option<Ref>,
pub on_overflow: Option<Vec<Stmt>>,
pub not_on_overflow: Option<Vec<Stmt>>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Bound {
pub after: bool,
pub value: Operand,
}
pub use rt::vocab::InspectMode;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct InspectPhrase {
pub mode: InspectMode,
pub pattern: Option<Operand>,
pub by: Option<Operand>,
pub counter: Option<Ref>,
pub bounds: Vec<Bound>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DataCategory {
Alphabetic,
Alphanumeric,
AlphanumericEdited,
Dbcs,
National,
NationalEdited,
Numeric,
NumericEdited,
Utf8,
}
impl DataCategory {
pub const ALL: [Self; 9] = [
Self::Alphabetic,
Self::Alphanumeric,
Self::AlphanumericEdited,
Self::Dbcs,
Self::National,
Self::NationalEdited,
Self::Numeric,
Self::NumericEdited,
Self::Utf8,
];
pub fn from_word(word: &str) -> Option<Self> {
Some(match word {
"ALPHABETIC" => Self::Alphabetic,
"ALPHANUMERIC" => Self::Alphanumeric,
"ALPHANUMERIC-EDITED" => Self::AlphanumericEdited,
"DBCS" | "EGCS" => Self::Dbcs,
"NATIONAL" => Self::National,
"NATIONAL-EDITED" => Self::NationalEdited,
"NUMERIC" => Self::Numeric,
"NUMERIC-EDITED" => Self::NumericEdited,
"UTF-8" => Self::Utf8,
_ => return None,
})
}
pub fn word(self) -> &'static str {
match self {
Self::Alphabetic => "ALPHABETIC",
Self::Alphanumeric => "ALPHANUMERIC",
Self::AlphanumericEdited => "ALPHANUMERIC-EDITED",
Self::Dbcs => "DBCS",
Self::National => "NATIONAL",
Self::NationalEdited => "NATIONAL-EDITED",
Self::Numeric => "NUMERIC",
Self::NumericEdited => "NUMERIC-EDITED",
Self::Utf8 => "UTF-8",
}
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct InitializeWith {
pub filler: bool,
pub value: Vec<DataCategory>,
pub replacing: Vec<(DataCategory, Operand)>,
pub default: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum InitialValue<'a> {
Value,
Replacing(&'a Operand),
Default,
}
impl InitializeWith {
pub fn initial_value(&self, category: Option<DataCategory>, has_value: bool) -> Option<InitialValue<'_>> {
let named = |c: DataCategory| category == Some(c);
if has_value && self.value.iter().any(|&c| named(c)) {
return Some(InitialValue::Value);
}
if let Some((_, by)) = self.replacing.iter().find(|(c, _)| named(*c)) {
return Some(InitialValue::Replacing(by));
}
(self.default || self.value.is_empty() && self.replacing.is_empty()).then_some(InitialValue::Default)
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Inspect {
pub target: Operand,
pub tallying: Vec<InspectPhrase>,
pub replacing: Vec<InspectPhrase>,
pub converting: Option<(Operand, Operand, Vec<Bound>)>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Search {
pub table: Ref,
pub all: bool,
pub varying: Option<Ref>,
pub at_end: Option<Vec<Stmt>>,
pub whens: Vec<(Cond, Vec<Stmt>)>,
pub pos: Pos,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ExecKind {
Sql,
Cics,
Dli,
Other,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ExecArg {
Operand(Operand),
Text(String),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExecBlock {
pub kind: ExecKind,
pub command: String,
pub options: Vec<(String, Option<ExecArg>)>,
pub host_variables: Vec<Ref>,
pub sql: Option<crate::sql::Sql>,
pub text: String,
pub pos: Pos,
}
impl ExecBlock {
pub fn declarative(&self) -> bool {
self.kind == ExecKind::Sql
&& matches!(self.command.as_str(), "INCLUDE" | "BEGIN DECLARE SECTION" | "END DECLARE SECTION" | "WHENEVER" | "DECLARE CURSOR" | "DECLARE TABLE" | "DECLARE STATEMENT")
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Handlers {
pub on: Option<Vec<Stmt>>,
pub not_on: Option<Vec<Stmt>>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ReadStmt {
pub file: String,
pub next: bool,
pub previous: bool,
pub into: Option<Ref>,
pub key: Option<Ref>,
pub at_end: Handlers,
pub invalid: Handlers,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Alphabet {
Ebcdic,
Native,
Standard1,
Standard2,
Literal(Vec<AlphabetEntry>),
}
impl Alphabet {
pub fn name(&self) -> &'static str {
match self {
Self::Ebcdic => "EBCDIC",
Self::Native => "NATIVE",
Self::Standard1 => "STANDARD-1",
Self::Standard2 => "STANDARD-2",
Self::Literal(_) => "literal",
}
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum AlphabetEntry {
Literal(Literal),
Through(Literal, Literal),
Also(Vec<Literal>),
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Environment {
pub alphabets: Vec<(String, Alphabet)>,
pub collating_sequence: Option<String>,
pub same_record_areas: Vec<Vec<String>>,
pub same_areas: Vec<Vec<String>>,
pub mnemonics: Vec<(String, String)>,
pub debugging_mode: bool,
pub decimal_point_comma: bool,
pub currency: Vec<CurrencySign>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Upon {
pub name: String,
pub device: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CurrencySign {
pub value: String,
pub symbol: char,
pub hex: Option<Vec<u8>>,
}
pub const HEX_SYMBOL: char = '\0';
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Sorting {
Sort(SortStmt),
Release { record: Ref, from: Option<Operand>, pos: Pos },
Return { file: String, into: Option<Ref>, at_end: Handlers, pos: Pos },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SortStmt {
pub merge: bool,
pub subject: Ref,
pub keys: Vec<(bool, Ref)>,
pub duplicates: bool,
pub collating: Option<String>,
pub input: Option<SortIo>,
pub output: Option<SortIo>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum SortIo {
Files(Vec<String>),
Procedure { from: ProcName, thru: Option<ProcName> },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct JsonGenerate {
pub receiver: Ref,
pub from: Ref,
pub count: Option<Ref>,
pub names: Vec<(Ref, Option<Literal>)>,
pub suppress: Vec<Suppression>,
pub converting: Vec<(Ref, JsonConversion)>,
pub indicating: Vec<NullIndicator>,
pub encoding: Option<Encoding>,
pub on_exception: Option<Vec<Stmt>>,
pub not_on_exception: Option<Vec<Stmt>>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Suppression {
Item { item: Ref, when: Vec<Figurative> },
Every { numeric: Option<bool>, form: Option<XmlForm>, when: Vec<Figurative> },
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Marker {
Condition(Ref),
Literal(Literal),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum JsonConversion {
Boolean(Marker),
Null(Figurative),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct NullIndicator {
pub item: Ref,
pub marker: Marker,
pub indicator: Option<Ref>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Encoding {
Ccsid(Operand),
FromCodepage,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct JsonParse {
pub source: Ref,
pub into: Ref,
pub detail: bool,
pub ignoring: Vec<Option<Ref>>,
pub indicating: Vec<(Ref, Flag, Option<Ref>)>,
pub encoding: Option<Encoding>,
pub names: Vec<(Ref, Option<Literal>)>,
pub suppress: Vec<Ref>,
pub converting: Vec<(Ref, ParseConversion)>,
pub on_exception: Option<Vec<Stmt>>,
pub not_on_exception: Option<Vec<Stmt>>,
pub pos: Pos,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Flag {
Condition(Ref),
Conditions(Ref, Ref),
Literals(Literal, Literal),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ParseConversion {
Boolean(Box<Flag>),
Null(Figurative),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct XmlGenerate {
pub receiver: Ref,
pub from: Ref,
pub count: Option<Ref>,
pub encoding: Option<Operand>,
pub declaration: bool,
pub attributes: bool,
pub namespace: Option<Operand>,
pub prefix: Option<Operand>,
pub names: Vec<(Ref, Literal)>,
pub types: Vec<(Ref, XmlForm)>,
pub suppress: Vec<Suppression>,
pub on_exception: Option<Vec<Stmt>>,
pub not_on_exception: Option<Vec<Stmt>>,
pub pos: Pos,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum XmlForm {
Attribute,
Element,
Content,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct XmlParse {
pub document: Ref,
pub encoding: Option<Operand>,
pub returning_national: bool,
pub procedure: ProcName,
pub thru: Option<ProcName>,
pub on_exception: Option<Vec<Stmt>>,
pub not_on_exception: Option<Vec<Stmt>>,
pub pos: Pos,
}