Executable Statements

SYNTAX:
stmt =  alias_stmt | assignment_stmt | case_stmt | compound_stmt  | delete_stmt | escape_stmt | from_stmt | if_stmt  | map_call_stmt | new_stmt | null_stmt | procdedure_call_stmt  | repeat_stmt | return_stmt | skip_stmt | when_stmt .
A sequence of one or more executable statements defines the actions of maps, composes, statements, functions, and procedures declarations in an EDMexpressX mapping schema. These statements act on global variables, local variables or persistent instances in the source and target model.
EDMexpressX defines the DELETE, FROM, MAP_CALL, NEW, and WHEN statements in addition to the executable statements defined in the EXPRESS language: (null, alias, assignment, case , compound, escape , if, procedure, call, repeat , return and skip). A sequence of statements may require constants, global variables and local variables to be able to perform its intended operations. Constants are declared within constant declarations. Global variables can be defined in the global declaration. Local variables can be defined within the map body, compose body, statements clause, function, and procedure declarations.
EXAMPLE
SCHEMA example2;
 
GLOBAL
 DECLARE source INSTANCE OF SOURCE_SCHEMA ARM;
 DECLARE target INSTANCE OF TARGET_SCHEMA AIM;
 
 (* Global variables *)
 MapStatus   : INTEGER;
 fileId   : GENERIC;
END_GLOBAL;
 
CONSTANT
 Language : STRING := ?NORWEGIAN?;
END_CONSTANT;
 
COPY_MODEL
 . . .
END_COPY_MODEL;
 
STATEMENTS;
 LOCAL
  i, j, k, l : INTEGER;
  aPerson   : target::person;
 END_LOCAL;
 . . .
 (* Sequence of executable statements *)
 . . .
END_STATEMENTS;
 
MAP t:target::targetEntity;
FROM (s:source::sourceEntity)WHEN (TRUE);
BEGIN_MAP
 LOCAL
  i, l, n  : INTEGER;
  anInst  : GENERIC;
 END_LOCAL;
 . . .
 (* Sequence of executable statements *)
 . . .
END_MAP;
 
COMPOSE t:target::entityA;
WHEN (TRUE);
BEGIN_COMPOSE
 LOCAL
  i, amount   : INTEGER;
  stat    : BOOLEAN;
 END_LOCAL;
 . . .
 (* Sequence of executable statements *)
 . . .
END_COMPOSE;
 
FUCNTION aFunction(val : INTEGER) : REAL;
LOCAL
 i, n  : INTEGER;
 str  : STRING;
END_LOCAL;
. . .
(* Sequence of executable statements *)
. . .
END_FUNCTION;
 
PROCEDURE aProcedure(rArg : REAL, VAR stat : LOGICAL);
LOCAL
 i, n  : INTEGER;
 str  : STRING;
END_LOCAL;
. . .
(* Sequence of executable statements *)
. . .
END_PROCEDURE;
 
END_SCHEMA_MAP;