mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 17:23:04 +01:00
-Removing PYXIS
-Cleaning BOOLEAN
This commit is contained in:
parent
4a4e8c5e74
commit
e5393798af
727
src/gpre/ada.cpp
727
src/gpre/ada.cpp
@ -24,7 +24,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: ada.cpp,v 1.19 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: ada.cpp,v 1.20 2003-09-11 02:13:46 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -38,7 +38,6 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "../jrd/gds.h"
|
#include "../jrd/gds.h"
|
||||||
#include "../gpre/gpre.h"
|
#include "../gpre/gpre.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../gpre/pat.h"
|
#include "../gpre/pat.h"
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
#include "../gpre/gpre_proto.h"
|
#include "../gpre/gpre_proto.h"
|
||||||
@ -61,16 +60,10 @@ static void gen_blob_for (ACT, USHORT);
|
|||||||
static void gen_blob_open (ACT, USHORT);
|
static void gen_blob_open (ACT, USHORT);
|
||||||
static int gen_blr (int *, int, TEXT *);
|
static int gen_blr (int *, int, TEXT *);
|
||||||
static void gen_clear_handles (ACT, int);
|
static void gen_clear_handles (ACT, int);
|
||||||
#ifdef NOT_USED_OR_REPLACED
|
|
||||||
static void gen_compatability_symbol (TEXT *, TEXT *, TEXT *);
|
|
||||||
#endif
|
|
||||||
static void gen_compile (ACT, int);
|
static void gen_compile (ACT, int);
|
||||||
static void gen_create_database (ACT, int);
|
static void gen_create_database (ACT, int);
|
||||||
static int gen_cursor_close (ACT, GPRE_REQ, int);
|
static int gen_cursor_close (ACT, GPRE_REQ, int);
|
||||||
static void gen_cursor_init (ACT, int);
|
static void gen_cursor_init (ACT, int);
|
||||||
#ifdef NOT_USED_OR_REPLACED
|
|
||||||
static int gen_cursor_open (ACT, GPRE_REQ, int);
|
|
||||||
#endif
|
|
||||||
static void gen_database (ACT, int);
|
static void gen_database (ACT, int);
|
||||||
static void gen_ddl (ACT, int);
|
static void gen_ddl (ACT, int);
|
||||||
static void gen_drop_database (ACT, int);
|
static void gen_drop_database (ACT, int);
|
||||||
@ -93,30 +86,10 @@ static void gen_event_wait (ACT, int);
|
|||||||
static void gen_fetch (ACT, int);
|
static void gen_fetch (ACT, int);
|
||||||
static void gen_finish (ACT, int);
|
static void gen_finish (ACT, int);
|
||||||
static void gen_for (ACT, int);
|
static void gen_for (ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_form_display (ACT, int);
|
|
||||||
static void gen_form_end (ACT, int);
|
|
||||||
static void gen_form_for (ACT, int);
|
|
||||||
#endif
|
|
||||||
static void gen_function (ACT, int);
|
static void gen_function (ACT, int);
|
||||||
static void gen_get_or_put_slice(ACT, REF, bool, int);
|
static void gen_get_or_put_slice(ACT, REF, bool, int);
|
||||||
static void gen_get_segment (ACT, int);
|
static void gen_get_segment (ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_item_end (ACT, int);
|
|
||||||
static void gen_item_for (ACT, int);
|
|
||||||
#endif
|
|
||||||
static void gen_loop (ACT, int);
|
static void gen_loop (ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu (ACT, int);
|
|
||||||
static void gen_menu_display (ACT, int);
|
|
||||||
static void gen_menu_end (ACT, int);
|
|
||||||
static void gen_menu_entree (ACT, int);
|
|
||||||
static void gen_menu_entree_att (ACT, int);
|
|
||||||
static void gen_menu_for (ACT, int);
|
|
||||||
static void gen_menu_item_end (ACT, int);
|
|
||||||
static void gen_menu_item_for (ACT, int);
|
|
||||||
static void gen_menu_request (GPRE_REQ, int);
|
|
||||||
#endif
|
|
||||||
static TEXT *gen_name(TEXT *, REF, bool);
|
static TEXT *gen_name(TEXT *, REF, bool);
|
||||||
static void gen_on_error (ACT, USHORT);
|
static void gen_on_error (ACT, USHORT);
|
||||||
static void gen_procedure (ACT, int);
|
static void gen_procedure (ACT, int);
|
||||||
@ -144,11 +117,6 @@ static void gen_type (ACT, int);
|
|||||||
static void gen_update (ACT, int);
|
static void gen_update (ACT, int);
|
||||||
static void gen_variable (ACT, int);
|
static void gen_variable (ACT, int);
|
||||||
static void gen_whenever (SWE, int);
|
static void gen_whenever (SWE, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_window_create (ACT, int);
|
|
||||||
static void gen_window_delete (ACT, int);
|
|
||||||
static void gen_window_suspend (ACT, int);
|
|
||||||
#endif
|
|
||||||
static void make_array_declaration (REF, int);
|
static void make_array_declaration (REF, int);
|
||||||
static void make_cursor_open_test (enum act_t, GPRE_REQ, int);
|
static void make_cursor_open_test (enum act_t, GPRE_REQ, int);
|
||||||
static TEXT *make_name (TEXT *, SYM);
|
static TEXT *make_name (TEXT *, SYM);
|
||||||
@ -156,9 +124,6 @@ static void make_ok_test (ACT, GPRE_REQ, int);
|
|||||||
static void make_port (POR, int);
|
static void make_port (POR, int);
|
||||||
static void make_ready (DBB, TEXT *, TEXT *, USHORT, GPRE_REQ);
|
static void make_ready (DBB, TEXT *, TEXT *, USHORT, GPRE_REQ);
|
||||||
static void printa (int, TEXT *, ...);
|
static void printa (int, TEXT *, ...);
|
||||||
#ifdef NOT_USED_OR_REPLACED
|
|
||||||
static void printb (TEXT *, ...);
|
|
||||||
#endif
|
|
||||||
static TEXT *request_trans (ACT, GPRE_REQ);
|
static TEXT *request_trans (ACT, GPRE_REQ);
|
||||||
static TEXT *status_vector (ACT);
|
static TEXT *status_vector (ACT);
|
||||||
static void t_start_auto (ACT, GPRE_REQ, TEXT *, int, bool);
|
static void t_start_auto (ACT, GPRE_REQ, TEXT *, int, bool);
|
||||||
@ -349,17 +314,6 @@ void ADA_action( ACT action, int column)
|
|||||||
case ACT_for:
|
case ACT_for:
|
||||||
gen_for(action, column);
|
gen_for(action, column);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_form_display:
|
|
||||||
gen_form_display(action, column);
|
|
||||||
break;
|
|
||||||
case ACT_form_end:
|
|
||||||
gen_form_end(action, column);
|
|
||||||
break;
|
|
||||||
case ACT_form_for:
|
|
||||||
gen_form_for(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_function:
|
case ACT_function:
|
||||||
gen_function(action, column);
|
gen_function(action, column);
|
||||||
return;
|
return;
|
||||||
@ -375,44 +329,9 @@ void ADA_action( ACT action, int column)
|
|||||||
case ACT_insert:
|
case ACT_insert:
|
||||||
gen_s_start(action, column);
|
gen_s_start(action, column);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_item_for:
|
|
||||||
case ACT_item_put:
|
|
||||||
gen_item_for(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_item_end:
|
|
||||||
gen_item_end(action, column);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case ACT_loop:
|
case ACT_loop:
|
||||||
gen_loop(action, column);
|
gen_loop(action, column);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_menu:
|
|
||||||
gen_menu(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_display:
|
|
||||||
gen_menu_display(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_end:
|
|
||||||
gen_menu_end(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_entree:
|
|
||||||
gen_menu_entree(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_for:
|
|
||||||
gen_menu_for(action, column);
|
|
||||||
return;
|
|
||||||
|
|
||||||
case ACT_title_text:
|
|
||||||
case ACT_title_length:
|
|
||||||
case ACT_terminator:
|
|
||||||
case ACT_entree_text:
|
|
||||||
case ACT_entree_length:
|
|
||||||
case ACT_entree_value:
|
|
||||||
gen_menu_entree_att(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_open:
|
case ACT_open:
|
||||||
gen_s_start(action, column);
|
gen_s_start(action, column);
|
||||||
break;
|
break;
|
||||||
@ -482,17 +401,6 @@ void ADA_action( ACT action, int column)
|
|||||||
case ACT_variable:
|
case ACT_variable:
|
||||||
gen_variable(action, column);
|
gen_variable(action, column);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_window_create:
|
|
||||||
gen_window_create(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_window_delete:
|
|
||||||
gen_window_delete(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_window_suspend:
|
|
||||||
gen_window_suspend(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -908,12 +816,12 @@ static gen_blob_open( ACT action, USHORT column)
|
|||||||
else
|
else
|
||||||
blob = (BLB) action->act_object;
|
blob = (BLB) action->act_object;
|
||||||
|
|
||||||
args.pat_condition = action->act_type == ACT_blob_create; /* open or create blob */
|
args.pat_condition = (action->act_type == ACT_blob_create); // open or create blob
|
||||||
args.pat_vector1 = status_vector(action); /* status vector */
|
args.pat_vector1 = status_vector(action); // status vector
|
||||||
args.pat_database = blob->blb_request->req_database; /* database handle */
|
args.pat_database = blob->blb_request->req_database; // database handle
|
||||||
args.pat_request = blob->blb_request; /* transaction handle */
|
args.pat_request = blob->blb_request; // transaction handle
|
||||||
args.pat_blob = blob; /* blob handle */
|
args.pat_blob = blob; // blob handle
|
||||||
args.pat_reference = reference; /* blob identifier */
|
args.pat_reference = reference; // blob identifier
|
||||||
args.pat_ident1 = blob->blb_bpb_ident;
|
args.pat_ident1 = blob->blb_bpb_ident;
|
||||||
|
|
||||||
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open)
|
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open)
|
||||||
@ -958,12 +866,12 @@ static void gen_blob_open( ACT action, USHORT column)
|
|||||||
"interbase.%IFCREATE%ELOPEN%EN_BLOB2 (%V1 %RF%DH, %RF%RT, %RF%BH, %RF%FR, 0, isc_null_bpb);";
|
"interbase.%IFCREATE%ELOPEN%EN_BLOB2 (%V1 %RF%DH, %RF%RT, %RF%BH, %RF%FR, 0, isc_null_bpb);";
|
||||||
|
|
||||||
blob = (BLB) action->act_object;
|
blob = (BLB) action->act_object;
|
||||||
args.pat_condition = action->act_type == ACT_blob_create; /* open or create blob */
|
args.pat_condition = (action->act_type == ACT_blob_create); // open or create blob
|
||||||
args.pat_vector1 = status_vector(action); /* status vector */
|
args.pat_vector1 = status_vector(action); // status vector
|
||||||
args.pat_database = blob->blb_request->req_database; /* database handle */
|
args.pat_database = blob->blb_request->req_database; // database handle
|
||||||
args.pat_request = blob->blb_request; /* transaction handle */
|
args.pat_request = blob->blb_request; // transaction handle
|
||||||
args.pat_blob = blob; /* blob handle */
|
args.pat_blob = blob; // blob handle
|
||||||
args.pat_reference = blob->blb_reference; /* blob identifier */
|
args.pat_reference = blob->blb_reference; // blob identifier
|
||||||
args.pat_ident1 = blob->blb_bpb_ident;
|
args.pat_ident1 = blob->blb_bpb_ident;
|
||||||
|
|
||||||
if (args.pat_value1 = blob->blb_bpb_length)
|
if (args.pat_value1 = blob->blb_bpb_length)
|
||||||
@ -1017,11 +925,6 @@ static void gen_clear_handles( ACT action, int column)
|
|||||||
for (request = requests; request; request = request->req_next) {
|
for (request = requests; request; request = request->req_next) {
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
if (!(request->req_flags & REQ_exp_hand))
|
||||||
printa(column, "%s = 0;", request->req_handle);
|
printa(column, "%s = 0;", request->req_handle);
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_form_handle &&
|
|
||||||
!(request->req_flags & REQ_exp_form_handle))
|
|
||||||
printa(column, "%s = 0;", request->req_form_handle);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1262,9 +1165,6 @@ static void gen_database( ACT action, int column)
|
|||||||
USHORT count;
|
USHORT count;
|
||||||
SSHORT blob_subtype;
|
SSHORT blob_subtype;
|
||||||
USHORT event_count, max_count;
|
USHORT event_count, max_count;
|
||||||
#ifdef PYXIS
|
|
||||||
FORM form;
|
|
||||||
#endif
|
|
||||||
LLS stack_ptr;
|
LLS stack_ptr;
|
||||||
TPB tpb_val;
|
TPB tpb_val;
|
||||||
REF reference;
|
REF reference;
|
||||||
@ -1283,12 +1183,6 @@ static void gen_database( ACT action, int column)
|
|||||||
make_port(port, column);
|
make_port(port, column);
|
||||||
}
|
}
|
||||||
ib_fprintf(out_file, "\n");
|
ib_fprintf(out_file, "\n");
|
||||||
#ifdef PYXIS
|
|
||||||
for (db = isc_databases; db; db = db->dbb_next)
|
|
||||||
for (form = db->dbb_forms; form; form = form->form_next)
|
|
||||||
printa(column, "%s\t: interbase.form_handle := 0;\t-- form %s --",
|
|
||||||
form->form_handle, form->form_name->sym_string);
|
|
||||||
#endif
|
|
||||||
for (request = requests; request; request = request->req_routine) {
|
for (request = requests; request; request = request->req_routine) {
|
||||||
if (request->req_flags & REQ_local)
|
if (request->req_flags & REQ_local)
|
||||||
continue;
|
continue;
|
||||||
@ -1363,16 +1257,6 @@ static void gen_database( ACT action, int column)
|
|||||||
"isc_status2\t: interbase.status_vector;\t-- status vector --");
|
"isc_status2\t: interbase.status_vector;\t-- status vector --");
|
||||||
printa(column, "SQLCODE\t: %s := 0;\t\t\t-- SQL status code --",
|
printa(column, "SQLCODE\t: %s := 0;\t\t\t-- SQL status code --",
|
||||||
LONG_DCL);
|
LONG_DCL);
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis && ((sw_window_scope != DBB_EXTERN) || !ada_package[0])) {
|
|
||||||
printa(column,
|
|
||||||
"isc_window\t: interbase.window_handle := 0;\t-- window handle --");
|
|
||||||
printa(column, "isc_width\t: %s := 80;\t-- window width --",
|
|
||||||
USHORT_DCL);
|
|
||||||
printa(column, "isc_height\t: %s := 24;\t-- window height --",
|
|
||||||
USHORT_DCL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!ada_package[0])
|
if (!ada_package[0])
|
||||||
for (db = isc_databases; db; db = db->dbb_next)
|
for (db = isc_databases; db; db = db->dbb_next)
|
||||||
printa(column,
|
printa(column,
|
||||||
@ -2257,109 +2141,6 @@ static void gen_for( ACT action, int column)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form interaction.
|
|
||||||
//
|
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_form_display( ACT action, int column)
|
|
||||||
{
|
|
||||||
FINT display;
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
DBB db;
|
|
||||||
TEXT s[32], out[16];
|
|
||||||
int code;
|
|
||||||
|
|
||||||
display = (FINT) action->act_object;
|
|
||||||
request = display->fint_request;
|
|
||||||
db = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next)
|
|
||||||
if ((master = reference->ref_master) &&
|
|
||||||
(code = CMP_display_code(display, master)) >= 0)
|
|
||||||
printa(column, "%s := %d;", gen_name(s, reference, true), code);
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_no_wait)
|
|
||||||
strcpy(out, "0");
|
|
||||||
else
|
|
||||||
sprintf(out, "isc_%d", port->por_ident);
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"interbase.drive_form (%s %s%s, %s%s, %sisc_window, %s, isc_%d'address, %s'address)",
|
|
||||||
status_vector(action), ada_package, db->dbb_name->sym_string,
|
|
||||||
ada_package, request->req_trans, ADA_WINDOW_PACKAGE,
|
|
||||||
request->req_handle, port->por_ident, out);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
printa(column, "interbase.pop_window (%sisc_window)", ADA_WINDOW_PACKAGE);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
FORM form;
|
|
||||||
TEXT *status;
|
|
||||||
dbb* database;
|
|
||||||
int indent;
|
|
||||||
|
|
||||||
indent = column + INDENT;
|
|
||||||
request = action->act_request;
|
|
||||||
form = request->req_form;
|
|
||||||
database = request->req_database;
|
|
||||||
status = status_vector(action);
|
|
||||||
|
|
||||||
// Get database attach and transaction started
|
|
||||||
|
|
||||||
if (sw_auto)
|
|
||||||
t_start_auto(action, 0, status_vector(action), indent, true);
|
|
||||||
|
|
||||||
// Get form loaded first
|
|
||||||
|
|
||||||
printa(column, "if %s = 0 then", request->req_form_handle);
|
|
||||||
printa(column, "interbase.load_form (%s %s%s, %s%s, %s, %d, \"%s\");",
|
|
||||||
status,
|
|
||||||
ada_package, database->dbb_name->sym_string,
|
|
||||||
ada_package, request->req_trans,
|
|
||||||
request->req_form_handle,
|
|
||||||
strlen(form->form_name->sym_string), form->form_name->sym_string);
|
|
||||||
ENDIF;
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(column, "if %s = 0 then", request->req_handle);
|
|
||||||
printa(indent, "interbase.compile_map (%s %s, %s, %d, isc_%d);",
|
|
||||||
status,
|
|
||||||
request->req_form_handle,
|
|
||||||
request->req_handle, request->req_length, request->req_ident);
|
|
||||||
ENDIF;
|
|
||||||
|
|
||||||
// Reset form to known state
|
|
||||||
|
|
||||||
printa(column, "interbase.reset_form (%s %s);",
|
|
||||||
status, request->req_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Generate a function for free standing ANY or statistical.
|
// Generate a function for free standing ANY or statistical.
|
||||||
@ -2557,103 +2338,6 @@ static void gen_get_segment( ACT action, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
dbb* database;
|
|
||||||
TEXT s[32], index[16];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_end(action, column);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
column += INDENT;
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(column, "%s := %s + 1;", index, index);
|
|
||||||
printa(column, "end loop");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
database = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next) if (master = reference->ref_master)
|
|
||||||
printa(column, "%s := %d;", gen_name(s, reference, true),
|
|
||||||
PYXIS_OPT_DISPLAY);
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"interbase.insert_sub_form (%s %s%s, %s%s, %s, isc_%d'address)",
|
|
||||||
status_vector(action),
|
|
||||||
ada_package, database->dbb_name->sym_string,
|
|
||||||
ada_package, request->req_trans,
|
|
||||||
request->req_handle, port->por_ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request, parent;
|
|
||||||
FORM form;
|
|
||||||
TEXT *status, index[30];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_for(action, column);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
column += INDENT;
|
|
||||||
form = request->req_form;
|
|
||||||
parent = form->form_parent;
|
|
||||||
|
|
||||||
status = status_vector(action);
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(column, "if %s = 0 then", request->req_handle);
|
|
||||||
printa(column + INDENT,
|
|
||||||
"interbase.compile_sub_map (%s %s, %s, %d, isc_%d);", status,
|
|
||||||
parent->req_handle, request->req_handle, request->req_length,
|
|
||||||
request->req_ident);
|
|
||||||
printa(column, "end if;");
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(column, "%s := 1;", index);
|
|
||||||
printa(column, "loop");
|
|
||||||
column += INDENT;
|
|
||||||
printa(column,
|
|
||||||
"interbase.fetch_sub_form (%s %s%s, %s%s, %s, isc_%d'address);",
|
|
||||||
status,
|
|
||||||
ada_package, request->req_database->dbb_name->sym_string,
|
|
||||||
ada_package, request->req_trans,
|
|
||||||
request->req_handle, request->req_ports->por_ident);
|
|
||||||
printa(column, "exit when %s = 0;", index);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2682,278 +2366,6 @@ static void gen_loop( ACT action, int column)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
printa(column, "case interbase.menu (%sisc_window, %s, %d, isc_%d) is",
|
|
||||||
ADA_WINDOW_PACKAGE,
|
|
||||||
request->req_handle, request->req_length, request->req_ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_display( ACT action, int column)
|
|
||||||
{
|
|
||||||
MENU a_menu;
|
|
||||||
GPRE_REQ request, display_request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
display_request = (GPRE_REQ) action->act_object;
|
|
||||||
|
|
||||||
a_menu = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next)
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"interbase.drive_menu (%sisc_window, %s, %d, isc_%d, isc_%dl, isc_%d,",
|
|
||||||
ADA_WINDOW_PACKAGE,
|
|
||||||
request->req_handle,
|
|
||||||
display_request->req_length,
|
|
||||||
display_request->req_ident, a_menu->menu_title, a_menu->menu_title);
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"\n\t\t\tisc_%d, isc_%dl, isc_%d, isc_%d);",
|
|
||||||
a_menu->menu_terminator,
|
|
||||||
a_menu->menu_entree_entree,
|
|
||||||
a_menu->menu_entree_entree, a_menu->menu_entree_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_flags & REQ_menu_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
printa(column, "when others =>");
|
|
||||||
printa(column + INDENT, "null ;");
|
|
||||||
printa(column, "end case");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu_entree( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
printa(column, "when %d =>", action->act_count);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a reference to a menu or entree attribute.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_entree_att( ACT action, int column)
|
|
||||||
{
|
|
||||||
MENU a_menu;
|
|
||||||
SSHORT ident;
|
|
||||||
bool length = false;
|
|
||||||
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
|
|
||||||
switch (action->act_type) {
|
|
||||||
case ACT_entree_text:
|
|
||||||
ident = a_menu->menu_entree_entree;
|
|
||||||
break;
|
|
||||||
case ACT_entree_length:
|
|
||||||
ident = a_menu->menu_entree_entree;
|
|
||||||
length = true;
|
|
||||||
break;
|
|
||||||
case ACT_entree_value:
|
|
||||||
ident = a_menu->menu_entree_value;
|
|
||||||
break;
|
|
||||||
case ACT_title_text:
|
|
||||||
ident = a_menu->menu_title;
|
|
||||||
break;
|
|
||||||
case ACT_title_length:
|
|
||||||
ident = a_menu->menu_title;
|
|
||||||
length = true;
|
|
||||||
break;
|
|
||||||
case ACT_terminator:
|
|
||||||
ident = a_menu->menu_terminator;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ident = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length)
|
|
||||||
printa(column, "isc_%dl", ident);
|
|
||||||
else
|
|
||||||
printa(column, "isc_%d", ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
// Get menu created
|
|
||||||
|
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
|
||||||
printa(column, "interbase.initialize_menu (%s);",
|
|
||||||
request->req_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
ENTREE menu_entree;
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
column += INDENT;
|
|
||||||
printa(column, "end loop");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
menu_entree = (ENTREE) action->act_pair->act_object;
|
|
||||||
request = entree->entree_request;
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"interbase.put_entree (%s, isc_%dl, isc_%d, isc_%d);",
|
|
||||||
request->req_handle,
|
|
||||||
menu_entree->entree_entree,
|
|
||||||
menu_entree->entree_entree, menu_entree->entree_value);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
ENTREE menu_entree;
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
menu_entree = (ENTREE) action->act_object;
|
|
||||||
request = menu_entree->entree_request;
|
|
||||||
|
|
||||||
printa(column, "loop");
|
|
||||||
column += INDENT;
|
|
||||||
align(column);
|
|
||||||
printa(column,
|
|
||||||
"interbase.get_entree (%s, isc_%dl, isc_%d, isc_%d, isc_%d);",
|
|
||||||
request->req_handle,
|
|
||||||
menu_entree->entree_entree,
|
|
||||||
menu_entree->entree_entree, menu_entree->entree_value,
|
|
||||||
menu_entree->entree_end);
|
|
||||||
|
|
||||||
printa(column, "exit when isc_%d /= 0;", menu_entree->entree_end);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate definitions associated with a dynamic menu request.
|
|
||||||
//
|
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu_request( GPRE_REQ request, int column)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
MENU a_menu = NULL;
|
|
||||||
ENTREE menu_entree = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next) {
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (action->act_type == ACT_item_for
|
|
||||||
|| action->act_type == ACT_item_put) {
|
|
||||||
menu_entree = (ENTREE) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a_menu) {
|
|
||||||
a_menu->menu_title = CMP_next_ident();
|
|
||||||
a_menu->menu_terminator = CMP_next_ident();
|
|
||||||
a_menu->menu_entree_value = CMP_next_ident();
|
|
||||||
a_menu->menu_entree_entree = CMP_next_ident();
|
|
||||||
printa(column, "isc_%dl\t: %s;\t\t-- TITLE_LENGTH --",
|
|
||||||
a_menu->menu_title, USHORT_DCL);
|
|
||||||
printa(column, "isc_%d\t: string (1..81);\t\t-- TITLE_TEXT --",
|
|
||||||
a_menu->menu_title);
|
|
||||||
printa(column, "isc_%d\t: %s;\t\t-- TERMINATOR --",
|
|
||||||
a_menu->menu_terminator, USHORT_DCL);
|
|
||||||
printa(column, "isc_%dl\t: %s;\t\t-- ENTREE_LENGTH --",
|
|
||||||
a_menu->menu_entree_entree, USHORT_DCL);
|
|
||||||
printa(column, "isc_%d\t: string (1..81);\t\t-- ENTREE_TEXT --",
|
|
||||||
a_menu->menu_entree_entree);
|
|
||||||
printa(column, "isc_%d\t: %s;\t\t-- ENTREE_VALUE --",
|
|
||||||
a_menu->menu_entree_value, LONG_DCL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu_entree) {
|
|
||||||
menu_entree->entree_entree = CMP_next_ident();
|
|
||||||
menu_entree->entree_value = CMP_next_ident();
|
|
||||||
menu_entree->entree_end = CMP_next_ident();
|
|
||||||
printa(column, "isc_%dl\t: %s;\t\t-- ENTREE_LENGTH --",
|
|
||||||
menu_entree->entree_entree, USHORT_DCL);
|
|
||||||
printa(column, "isc_%d\t: string (1..81);\t\t-- ENTREE_TEXT --",
|
|
||||||
menu_entree->entree_entree);
|
|
||||||
printa(column, "isc_%d\t: %s;\t\t-- ENTREE_VALUE --",
|
|
||||||
menu_entree->entree_value, LONG_DCL);
|
|
||||||
printa(column, "isc_%d\t: %s;\t\t-- --",
|
|
||||||
menu_entree->entree_end, USHORT_DCL);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Generate a name for a reference. Name is constructed from
|
// Generate a name for a reference. Name is constructed from
|
||||||
@ -3218,26 +2630,11 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
// generate request handle, blob handles, and ports
|
// generate request handle, blob handles, and ports
|
||||||
|
|
||||||
if (!(request->req_flags &
|
if (!(request->req_flags &
|
||||||
(REQ_exp_hand
|
(REQ_exp_hand | REQ_sql_blob_open | REQ_sql_blob_create)) &&
|
||||||
#ifdef PYXIS
|
request->req_type != REQ_slice && request->req_type != REQ_procedure)
|
||||||
| REQ_menu_for_item
|
{
|
||||||
#endif
|
printa(column, "%s\t: interbase.request_handle := 0;-- request handle --",
|
||||||
| REQ_sql_blob_open |
|
request->req_handle);
|
||||||
REQ_sql_blob_create)) &&
|
|
||||||
request->req_type != REQ_slice && request->req_type != REQ_procedure) {
|
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_type == REQ_menu)
|
|
||||||
printa(column,
|
|
||||||
"%s\t: interbase.menu_handle := 0;-- menu handle --",
|
|
||||||
request->req_handle);
|
|
||||||
else if (request->req_type == REQ_form)
|
|
||||||
printa(column, "%s\t: interbase.map_handle := 0;-- map handle --",
|
|
||||||
request->req_handle);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
printa(column,
|
|
||||||
"%s\t: interbase.request_handle := 0;-- request handle --",
|
|
||||||
request->req_handle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
|
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
|
||||||
@ -3303,42 +2700,27 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
case REQ_ready:
|
case REQ_ready:
|
||||||
string_type = "DPB";
|
string_type = "DPB";
|
||||||
if (PRETTY_print_cdb((SCHAR*) request->req_blr,
|
if (PRETTY_print_cdb((SCHAR*) request->req_blr,
|
||||||
(int (*)()) gen_blr, 0, 0))
|
(int (*)()) gen_blr, 0, 0))
|
||||||
IBERROR("internal error during parameter generation");
|
IBERROR("internal error during parameter generation");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
string_type = "DYN";
|
string_type = "DYN";
|
||||||
if (PRETTY_print_dyn((SCHAR*) request->req_blr,
|
if (PRETTY_print_dyn((SCHAR*) request->req_blr,
|
||||||
( int (*)()) gen_blr, 0, 0))
|
( int (*)()) gen_blr, 0, 0))
|
||||||
IBERROR("internal error during dynamic DDL generation");
|
IBERROR("internal error during dynamic DDL generation");
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
if (PRETTY_print_form_map((SCHAR*) request->req_blr,
|
|
||||||
( int (*)()) gen_blr, 0, 0))
|
|
||||||
IBERROR("internal error during form map generation");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
if (PRETTY_print_menu((SCHAR*) request->req_blr,
|
|
||||||
(int (*)()) gen_blr, 0, 1))
|
|
||||||
IBERROR("internal error during menu generation");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "SDL";
|
string_type = "SDL";
|
||||||
if (PRETTY_print_sdl((SCHAR*) request->req_blr,
|
if (PRETTY_print_sdl((SCHAR*) request->req_blr,
|
||||||
( int (*)() ) gen_blr, 0, 0))
|
( int (*)() ) gen_blr, 0, 0))
|
||||||
IBERROR("internal error during SDL generation");
|
IBERROR("internal error during SDL generation");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
string_type = "BLR";
|
string_type = "BLR";
|
||||||
if (isc_print_blr((SCHAR*) request->req_blr,
|
if (isc_print_blr((SCHAR*) request->req_blr,
|
||||||
( void (*)() ) gen_blr, 0, 0))
|
( void (*)() ) gen_blr, 0, 0))
|
||||||
IBERROR("internal error during BLR generation");
|
IBERROR("internal error during BLR generation");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3348,19 +2730,9 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
case REQ_ready:
|
case REQ_ready:
|
||||||
string_type = "DPB";
|
string_type = "DPB";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
string_type = "DYN";
|
string_type = "DYN";
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "SDL";
|
string_type = "SDL";
|
||||||
break;
|
break;
|
||||||
@ -3405,10 +2777,7 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
column);
|
column);
|
||||||
printa(INDENT, ");\n");
|
printa(INDENT, ");\n");
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_type == REQ_menu)
|
|
||||||
gen_menu_request(request, column);
|
|
||||||
#endif
|
|
||||||
// If this is a GET_SLICE/PUT_slice, allocate some variables
|
// If this is a GET_SLICE/PUT_slice, allocate some variables
|
||||||
|
|
||||||
if (request->req_type == REQ_slice) {
|
if (request->req_type == REQ_slice) {
|
||||||
@ -4009,47 +3378,7 @@ static void gen_whenever( SWE label, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_create( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"interbase.create_window (%sisc_window, 0, \" \", %sisc_width, %sisc_height)",
|
|
||||||
ADA_WINDOW_PACKAGE, ADA_WINDOW_PACKAGE, ADA_WINDOW_PACKAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Delete a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_delete( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "interbase.delete_window (%sisc_window)",
|
|
||||||
ADA_WINDOW_PACKAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Suspend a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_suspend( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "interbase.suspend_window (%sisc_window)",
|
|
||||||
ADA_WINDOW_PACKAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Generate a declaration of an array in the
|
// Generate a declaration of an array in the
|
||||||
@ -4071,7 +3400,7 @@ static void make_array_declaration( REF reference, int column)
|
|||||||
if (field->fld_array_info->ary_declared)
|
if (field->fld_array_info->ary_declared)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
field->fld_array_info->ary_declared = TRUE;
|
field->fld_array_info->ary_declared = true;
|
||||||
|
|
||||||
if ((field->fld_array->fld_dtype <= dtype_varying)
|
if ((field->fld_array->fld_dtype <= dtype_varying)
|
||||||
&& (field->fld_array->fld_length != 1)) {
|
&& (field->fld_array->fld_length != 1)) {
|
||||||
@ -4322,9 +3651,11 @@ static void make_port( POR port, int column)
|
|||||||
// ready;
|
// ready;
|
||||||
//
|
//
|
||||||
|
|
||||||
static void make_ready(
|
static void make_ready(DBB db,
|
||||||
DBB db,
|
TEXT * filename,
|
||||||
TEXT * filename, TEXT * vector, USHORT column, GPRE_REQ request)
|
TEXT * vector,
|
||||||
|
USHORT column,
|
||||||
|
GPRE_REQ request)
|
||||||
{
|
{
|
||||||
TEXT s1[32], s2[32];
|
TEXT s1[32], s2[32];
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: c_cxx.cpp,v 1.25 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: c_cxx.cpp,v 1.26 2003-09-11 02:13:46 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -37,7 +37,6 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "../jrd/gds.h"
|
#include "../jrd/gds.h"
|
||||||
#include "gpre.h"
|
#include "gpre.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../gpre/pat.h"
|
#include "../gpre/pat.h"
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
#include "../gpre/gpre_proto.h"
|
#include "../gpre/gpre_proto.h"
|
||||||
@ -90,30 +89,10 @@ static void gen_event_wait(ACT, int);
|
|||||||
static void gen_fetch(ACT, int);
|
static void gen_fetch(ACT, int);
|
||||||
static void gen_finish(ACT, int);
|
static void gen_finish(ACT, int);
|
||||||
static void gen_for(ACT, int);
|
static void gen_for(ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_form_display(ACT, int);
|
|
||||||
static void gen_form_end(ACT, int);
|
|
||||||
static void gen_form_for(ACT, int);
|
|
||||||
#endif
|
|
||||||
static void gen_function(ACT, int);
|
static void gen_function(ACT, int);
|
||||||
static void gen_get_or_put_slice(ACT, REF, bool, int);
|
static void gen_get_or_put_slice(ACT, REF, bool, int);
|
||||||
static void gen_get_segment(ACT, int);
|
static void gen_get_segment(ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_item_end(ACT, int);
|
|
||||||
static void gen_item_for(ACT, int);
|
|
||||||
#endif
|
|
||||||
static void gen_loop(ACT, int);
|
static void gen_loop(ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu(ACT, int);
|
|
||||||
static void gen_menu_display(ACT, int);
|
|
||||||
static void gen_menu_entree(ACT, int);
|
|
||||||
static void gen_menu_entree_att(ACT, int);
|
|
||||||
static void gen_menu_end(ACT, int);
|
|
||||||
static void gen_menu_for(ACT, int);
|
|
||||||
static void gen_menu_item_end(ACT, int);
|
|
||||||
static void gen_menu_item_for(ACT, int);
|
|
||||||
static void gen_menu_request(GPRE_REQ);
|
|
||||||
#endif
|
|
||||||
static TEXT *gen_name(char *, REF, bool);
|
static TEXT *gen_name(char *, REF, bool);
|
||||||
static void gen_on_error(ACT, USHORT);
|
static void gen_on_error(ACT, USHORT);
|
||||||
static void gen_procedure(ACT, int);
|
static void gen_procedure(ACT, int);
|
||||||
@ -141,11 +120,6 @@ static void gen_type(ACT, int);
|
|||||||
static void gen_update(ACT, int);
|
static void gen_update(ACT, int);
|
||||||
static void gen_variable(ACT, int);
|
static void gen_variable(ACT, int);
|
||||||
static void gen_whenever(SWE, int);
|
static void gen_whenever(SWE, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_window_create(ACT, int);
|
|
||||||
static void gen_window_delete(ACT, int);
|
|
||||||
static void gen_window_suspend(ACT, int);
|
|
||||||
#endif
|
|
||||||
static void make_array_declaration(REF);
|
static void make_array_declaration(REF);
|
||||||
static TEXT *make_name(TEXT *, SYM);
|
static TEXT *make_name(TEXT *, SYM);
|
||||||
static void make_ok_test(ACT, GPRE_REQ, int);
|
static void make_ok_test(ACT, GPRE_REQ, int);
|
||||||
@ -247,21 +221,10 @@ void C_CXX_action( ACT action, int column)
|
|||||||
case ACT_fetch:
|
case ACT_fetch:
|
||||||
case ACT_finish:
|
case ACT_finish:
|
||||||
case ACT_for:
|
case ACT_for:
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_form_display:
|
|
||||||
case ACT_form_for:
|
|
||||||
#endif
|
|
||||||
case ACT_get_segment:
|
case ACT_get_segment:
|
||||||
case ACT_get_slice:
|
case ACT_get_slice:
|
||||||
case ACT_insert:
|
case ACT_insert:
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_item_for:
|
|
||||||
case ACT_item_put:
|
|
||||||
#endif
|
|
||||||
case ACT_loop:
|
case ACT_loop:
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_menu_for:
|
|
||||||
#endif
|
|
||||||
case ACT_modify:
|
case ACT_modify:
|
||||||
case ACT_open:
|
case ACT_open:
|
||||||
case ACT_prepare:
|
case ACT_prepare:
|
||||||
@ -439,17 +402,6 @@ void C_CXX_action( ACT action, int column)
|
|||||||
case ACT_for:
|
case ACT_for:
|
||||||
gen_for(action, column);
|
gen_for(action, column);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_form_display:
|
|
||||||
gen_form_display(action, column);
|
|
||||||
break;
|
|
||||||
case ACT_form_end:
|
|
||||||
gen_form_end(action, column);
|
|
||||||
break;
|
|
||||||
case ACT_form_for:
|
|
||||||
gen_form_for(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_function:
|
case ACT_function:
|
||||||
gen_function(action, column);
|
gen_function(action, column);
|
||||||
return;
|
return;
|
||||||
@ -465,44 +417,9 @@ void C_CXX_action( ACT action, int column)
|
|||||||
case ACT_insert:
|
case ACT_insert:
|
||||||
gen_s_start(action, column);
|
gen_s_start(action, column);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_item_for:
|
|
||||||
case ACT_item_put:
|
|
||||||
gen_item_for(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_item_end:
|
|
||||||
gen_item_end(action, column);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case ACT_loop:
|
case ACT_loop:
|
||||||
gen_loop(action, column);
|
gen_loop(action, column);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_menu:
|
|
||||||
gen_menu(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_display:
|
|
||||||
gen_menu_display(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_end:
|
|
||||||
gen_menu_end(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_entree:
|
|
||||||
gen_menu_entree(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_for:
|
|
||||||
gen_menu_for(action, column);
|
|
||||||
return;
|
|
||||||
|
|
||||||
case ACT_title_text:
|
|
||||||
case ACT_title_length:
|
|
||||||
case ACT_terminator:
|
|
||||||
case ACT_entree_text:
|
|
||||||
case ACT_entree_length:
|
|
||||||
case ACT_entree_value:
|
|
||||||
gen_menu_entree_att(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_on_error:
|
case ACT_on_error:
|
||||||
gen_on_error(action, (USHORT) column);
|
gen_on_error(action, (USHORT) column);
|
||||||
return;
|
return;
|
||||||
@ -578,17 +495,6 @@ void C_CXX_action( ACT action, int column)
|
|||||||
case ACT_variable:
|
case ACT_variable:
|
||||||
gen_variable(action, column);
|
gen_variable(action, column);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_window_create:
|
|
||||||
gen_window_create(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_window_delete:
|
|
||||||
gen_window_delete(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_window_suspend:
|
|
||||||
gen_window_suspend(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
@ -1011,7 +917,7 @@ static void gen_blob_close( ACT action, USHORT column)
|
|||||||
|
|
||||||
args.pat_blob = blob;
|
args.pat_blob = blob;
|
||||||
args.pat_vector1 = status_vector(action);
|
args.pat_vector1 = status_vector(action);
|
||||||
args.pat_condition = action->act_type == ACT_blob_cancel;
|
args.pat_condition = (action->act_type == ACT_blob_cancel);
|
||||||
PATTERN_expand(column, pattern1, &args);
|
PATTERN_expand(column, pattern1, &args);
|
||||||
|
|
||||||
if (action->act_flags & ACT_sql) {
|
if (action->act_flags & ACT_sql) {
|
||||||
@ -1044,7 +950,7 @@ isc_close_blob (%V1, &%BH);\n\
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
args.pat_vector1 = status_vector(0);
|
args.pat_vector1 = status_vector(0);
|
||||||
args.pat_condition = action->act_type == ACT_blob_cancel;
|
args.pat_condition = (action->act_type == ACT_blob_cancel);
|
||||||
PATTERN_expand(column, pattern1, &args);
|
PATTERN_expand(column, pattern1, &args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1062,7 +968,7 @@ static void gen_blob_for( ACT action, USHORT column)
|
|||||||
{";
|
{";
|
||||||
|
|
||||||
gen_blob_open(action, column);
|
gen_blob_open(action, column);
|
||||||
args.pat_condition = action->act_error != NULL;
|
args.pat_condition = (action->act_error != NULL);
|
||||||
args.pat_string1 = status_name;
|
args.pat_string1 = status_name;
|
||||||
PATTERN_expand(column, pattern1, &args);
|
PATTERN_expand(column, pattern1, &args);
|
||||||
column += INDENT;
|
column += INDENT;
|
||||||
@ -1110,12 +1016,12 @@ static void gen_blob_open( ACT action, USHORT column)
|
|||||||
reference = blob->blb_reference;
|
reference = blob->blb_reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.pat_condition = action->act_type == ACT_blob_create; /* open or create blob */
|
args.pat_condition = (action->act_type == ACT_blob_create); // open or create blob
|
||||||
args.pat_vector1 = status_vector(action); /* status vector */
|
args.pat_vector1 = status_vector(action); // status vector
|
||||||
args.pat_database = blob->blb_request->req_database; /* database handle */
|
args.pat_database = blob->blb_request->req_database; // database handle
|
||||||
args.pat_request = blob->blb_request; /* transaction handle */
|
args.pat_request = blob->blb_request; // transaction handle
|
||||||
args.pat_blob = blob; /* blob handle */
|
args.pat_blob = blob; // blob handle
|
||||||
args.pat_reference = reference; /* blob identifier */
|
args.pat_reference = reference; // blob identifier
|
||||||
args.pat_ident1 = blob->blb_bpb_ident;
|
args.pat_ident1 = blob->blb_bpb_ident;
|
||||||
|
|
||||||
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open) {
|
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open) {
|
||||||
@ -1229,11 +1135,6 @@ static void gen_clear_handles( ACT action, int column)
|
|||||||
for (request = requests; request; request = request->req_next) {
|
for (request = requests; request; request = request->req_next) {
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
if (!(request->req_flags & REQ_exp_hand))
|
||||||
printa(column, "%s = 0;", request->req_handle);
|
printa(column, "%s = 0;", request->req_handle);
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_form_handle &&
|
|
||||||
!(request->req_flags & REQ_exp_form_handle))
|
|
||||||
printa(column, "%s = 0;", request->req_form_handle);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1276,8 +1177,7 @@ static void gen_compile( ACT action, int column)
|
|||||||
args.pat_database = db = request->req_database;
|
args.pat_database = db = request->req_database;
|
||||||
args.pat_vector1 = status_vector(action);
|
args.pat_vector1 = status_vector(action);
|
||||||
args.pat_string1 = request_trans(action, request);
|
args.pat_string1 = request_trans(action, request);
|
||||||
args.pat_condition = (sw_auto
|
args.pat_condition = (sw_auto && (action->act_error
|
||||||
&& (action->act_error
|
|
||||||
|| (action->act_flags & ACT_sql)));
|
|| (action->act_flags & ACT_sql)));
|
||||||
|
|
||||||
if (sw_auto)
|
if (sw_auto)
|
||||||
@ -1458,7 +1358,7 @@ static int gen_cursor_open( ACT action, GPRE_REQ request, int column)
|
|||||||
args.pat_request = request;
|
args.pat_request = request;
|
||||||
args.pat_database = request->req_database;
|
args.pat_database = request->req_database;
|
||||||
args.pat_vector1 = status_vector(action);
|
args.pat_vector1 = status_vector(action);
|
||||||
args.pat_condition = sw_auto && TRUE;
|
args.pat_condition = sw_auto;
|
||||||
args.pat_string1 = make_name(s, ((OPN) action->act_object)->opn_cursor);
|
args.pat_string1 = make_name(s, ((OPN) action->act_object)->opn_cursor);
|
||||||
args.pat_string2 = NULL_STRING;
|
args.pat_string2 = NULL_STRING;
|
||||||
args.pat_string3 = request_trans(action, request);
|
args.pat_string3 = request_trans(action, request);
|
||||||
@ -1491,9 +1391,6 @@ static void gen_database( ACT action, int column)
|
|||||||
GPRE_REQ request;
|
GPRE_REQ request;
|
||||||
tpb* tpb_iterator;
|
tpb* tpb_iterator;
|
||||||
TEXT *scope;
|
TEXT *scope;
|
||||||
#ifdef PYXIS
|
|
||||||
FORM a_form;
|
|
||||||
#endif
|
|
||||||
SSHORT count, max_count;
|
SSHORT count, max_count;
|
||||||
LLS stack_ptr;
|
LLS stack_ptr;
|
||||||
REF reference;
|
REF reference;
|
||||||
@ -1509,12 +1406,6 @@ static void gen_database( ACT action, int column)
|
|||||||
printa(column, "static %sISC_QUAD", CONST_STR);
|
printa(column, "static %sISC_QUAD", CONST_STR);
|
||||||
printa(column + INDENT,
|
printa(column + INDENT,
|
||||||
"isc_blob_null = {0,0};\t/* initializer for blobs */");
|
"isc_blob_null = {0,0};\t/* initializer for blobs */");
|
||||||
#ifdef PYXIS
|
|
||||||
for (db = isc_databases; db; db = db->dbb_next)
|
|
||||||
for (a_form = db->dbb_forms; a_form; a_form = a_form->form_next)
|
|
||||||
printa(column, "static isc_form_handle %s;\t\t/* form %s */",
|
|
||||||
a_form->form_handle, a_form->form_name->sym_string);
|
|
||||||
#endif
|
|
||||||
if (sw_language == lang_c)
|
if (sw_language == lang_c)
|
||||||
printa(column,
|
printa(column,
|
||||||
"static %slong *gds__null = 0;\t/* dummy status vector */",
|
"static %slong *gds__null = 0;\t/* dummy status vector */",
|
||||||
@ -1561,24 +1452,6 @@ static void gen_database( ACT action, int column)
|
|||||||
printa(column - INDENT, "%s%s", scope, DCL_LONG);
|
printa(column - INDENT, "%s%s", scope, DCL_LONG);
|
||||||
printa(column, "isc_array_length, \t/* array return size */");
|
printa(column, "isc_array_length, \t/* array return size */");
|
||||||
printa(column, "SQLCODE;\t\t/* SQL status code */");
|
printa(column, "SQLCODE;\t\t/* SQL status code */");
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis)
|
|
||||||
{
|
|
||||||
if (sw_window_scope == DBB_STATIC)
|
|
||||||
scope = "static ";
|
|
||||||
else if (sw_window_scope == DBB_EXTERN)
|
|
||||||
scope = "extern ";
|
|
||||||
else
|
|
||||||
scope = "";
|
|
||||||
printa(column - INDENT,
|
|
||||||
"%sisc_win_handle isc_window;\t/* window handle */", scope);
|
|
||||||
printa(column - INDENT, "%sshort", scope);
|
|
||||||
printa(column, "isc_width%s,\t/* window width */",
|
|
||||||
(sw_window_scope == DBB_EXTERN) ? "" : " = 80");
|
|
||||||
printa(column, "isc_height%s;\t/* window height */",
|
|
||||||
(sw_window_scope == DBB_EXTERN) ? "" : " = 24");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (sw_dyn_using) {
|
if (sw_dyn_using) {
|
||||||
printa(column - INDENT,
|
printa(column - INDENT,
|
||||||
"static struct isc_sqlda { /* SQLDA for internal use */");
|
"static struct isc_sqlda { /* SQLDA for internal use */");
|
||||||
@ -1636,13 +1509,6 @@ static void gen_database( ACT action, int column)
|
|||||||
gen_compatibility_symbol("array_length", "isc_", "");
|
gen_compatibility_symbol("array_length", "isc_", "");
|
||||||
if (max_count)
|
if (max_count)
|
||||||
gen_compatibility_symbol("events", "isc_", "");
|
gen_compatibility_symbol("events", "isc_", "");
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis) {
|
|
||||||
gen_compatibility_symbol("window", "isc_", "");
|
|
||||||
gen_compatibility_symbol("height", "isc_", "");
|
|
||||||
gen_compatibility_symbol("width", "isc_", "");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
gen_compatibility_symbol("count", "isc_", "");
|
gen_compatibility_symbol("count", "isc_", "");
|
||||||
gen_compatibility_symbol("slack", "isc_", "");
|
gen_compatibility_symbol("slack", "isc_", "");
|
||||||
gen_compatibility_symbol("utility", "isc_",
|
gen_compatibility_symbol("utility", "isc_",
|
||||||
@ -2482,108 +2348,6 @@ static void gen_for( ACT action, int column)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_display( ACT action, int column)
|
|
||||||
{
|
|
||||||
FINT display;
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
DBB database;
|
|
||||||
TEXT s[32], out[16];
|
|
||||||
const char *status;
|
|
||||||
int code;
|
|
||||||
|
|
||||||
display = (FINT) action->act_object;
|
|
||||||
request = display->fint_request;
|
|
||||||
database = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
status = (action->act_error) ? status_name : NULL_STATUS;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next)
|
|
||||||
if ((master = reference->ref_master) &&
|
|
||||||
(code = CMP_display_code(display, master)) >= 0)
|
|
||||||
printa(column, "%s = %d;", gen_name(s, reference, true), code);
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_no_wait)
|
|
||||||
strcpy(out, NULL_STRING);
|
|
||||||
else
|
|
||||||
sprintf(out, "&isc_%d", port->por_ident);
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"isc_drive_form (%s, &%s, &%s, &isc_window, &%s, &isc_%d, %s);",
|
|
||||||
status,
|
|
||||||
database->dbb_name->sym_string,
|
|
||||||
request->req_trans, request->req_handle, port->por_ident, out);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "isc_pop_window (%s, &isc_window);",
|
|
||||||
status_vector(action));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
FORM a_form;
|
|
||||||
const char *status;
|
|
||||||
DBB database;
|
|
||||||
|
|
||||||
column += INDENT;
|
|
||||||
request = action->act_request;
|
|
||||||
a_form = request->req_form;
|
|
||||||
database = request->req_database;
|
|
||||||
status = (action->act_error) ? status_name : NULL_STATUS;
|
|
||||||
|
|
||||||
// Get database attach and transaction started
|
|
||||||
|
|
||||||
if (sw_auto)
|
|
||||||
t_start_auto(action, 0, status_vector(action), column, true);
|
|
||||||
|
|
||||||
// Get form loaded first
|
|
||||||
|
|
||||||
printa(column, "if (!%s)", request->req_form_handle);
|
|
||||||
printa(column + INDENT,
|
|
||||||
"isc_load_form (%s, &%s, &%s, &%s, (short*) 0, \"%s\");", status,
|
|
||||||
database->dbb_name->sym_string, request->req_trans,
|
|
||||||
request->req_form_handle, a_form->form_name->sym_string);
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(column, "if (!%s)", request->req_handle);
|
|
||||||
printa(column + INDENT,
|
|
||||||
"isc_compile_map (%s, &%s, &%s, &isc_%dl, isc_%d);", status,
|
|
||||||
request->req_form_handle, request->req_handle, request->req_ident,
|
|
||||||
request->req_ident);
|
|
||||||
|
|
||||||
// Reset form to known state
|
|
||||||
|
|
||||||
printa(column, "isc_reset_form (%s, &%s);", status, request->req_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2722,7 +2486,7 @@ static void gen_get_or_put_slice(ACT action,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
args.pat_request = action->act_request;
|
args.pat_request = action->act_request;
|
||||||
args.pat_condition = (get) ? TRUE : FALSE; // get or put slice
|
args.pat_condition = get; // get or put slice
|
||||||
args.pat_vector1 = status_vector(action); // status vector
|
args.pat_vector1 = status_vector(action); // status vector
|
||||||
args.pat_database = action->act_request->req_database; // database handle
|
args.pat_database = action->act_request->req_database; // database handle
|
||||||
gen_name(s1, reference, true); // blob handle
|
gen_name(s1, reference, true); // blob handle
|
||||||
@ -2802,105 +2566,6 @@ static void gen_get_segment( ACT action, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
DBB database;
|
|
||||||
TEXT s[32];
|
|
||||||
const char *status;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_end(action, column);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
column += INDENT;
|
|
||||||
END;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
database = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
status = (action->act_error) ? status_name : NULL_STATUS;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next) if (master = reference->ref_master)
|
|
||||||
printa(column, "%s = %d;", gen_name(s, reference, true),
|
|
||||||
PYXIS_OPT_DISPLAY);
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"isc_form_insert (%s, &%s, &%s, &%s, &isc_%d);",
|
|
||||||
status,
|
|
||||||
database->dbb_name->sym_string,
|
|
||||||
request->req_trans, request->req_handle, port->por_ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request, parent;
|
|
||||||
FORM a_form;
|
|
||||||
TEXT *status, index[30];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_for(action, column);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
column += INDENT;
|
|
||||||
a_form = request->req_form;
|
|
||||||
parent = a_form->form_parent;
|
|
||||||
|
|
||||||
status = status_vector(action);
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(column, "if (!%s)", request->req_handle);
|
|
||||||
printa(column + INDENT,
|
|
||||||
"isc_compile_sub_map (%s, &%s, &%s, &isc_%dl, isc_%d);", status,
|
|
||||||
parent->req_handle, request->req_handle, request->req_ident,
|
|
||||||
request->req_ident);
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(column, "for (%s = 1;; ++%s)", index, index);
|
|
||||||
column += INDENT;
|
|
||||||
BEGIN;
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"isc_form_fetch (%s, &%s, &%s, &%s, &isc_%d);",
|
|
||||||
status,
|
|
||||||
request->req_database->dbb_name->sym_string,
|
|
||||||
request->req_trans,
|
|
||||||
request->req_handle, request->req_ports->por_ident);
|
|
||||||
printa(column, "if (!%s) break;", index);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2927,280 +2592,6 @@ static void gen_loop( ACT action, int column)
|
|||||||
column -= INDENT;
|
column -= INDENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
printa(column,
|
|
||||||
"switch (isc_menu (%s, &isc_window, &%s, &isc_%dl, isc_%d))",
|
|
||||||
status_vector(action), request->req_handle, request->req_ident,
|
|
||||||
request->req_ident);
|
|
||||||
printa(column + INDENT, "{");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_display( ACT action, int column)
|
|
||||||
{
|
|
||||||
MENU a_menu;
|
|
||||||
GPRE_REQ request, display_request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
display_request = (GPRE_REQ) action->act_object;
|
|
||||||
|
|
||||||
a_menu = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next)
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"isc_drive_menu (%s, &isc_window, &%s, &isc_%dl, isc_%d, &isc_%dl, isc_%d,",
|
|
||||||
status_vector(action),
|
|
||||||
request->req_handle,
|
|
||||||
display_request->req_ident,
|
|
||||||
display_request->req_ident, a_menu->menu_title, a_menu->menu_title);
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"\t\t&isc_%d, &isc_%dl, isc_%d, &isc_%d);",
|
|
||||||
a_menu->menu_terminator,
|
|
||||||
a_menu->menu_entree_entree,
|
|
||||||
a_menu->menu_entree_entree, a_menu->menu_entree_value);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_entree( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!(action->act_flags & ACT_first_entree))
|
|
||||||
printa(column + INDENT, "break;");
|
|
||||||
|
|
||||||
printa(column, "case %d:", action->act_count);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Generate code for a reference to a menu or entree attribute.
|
|
||||||
|
|
||||||
static void gen_menu_entree_att( ACT action, int column)
|
|
||||||
{
|
|
||||||
MENU a_menu;
|
|
||||||
SSHORT ident;
|
|
||||||
bool length = false;
|
|
||||||
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
|
|
||||||
switch (action->act_type) {
|
|
||||||
case ACT_entree_text:
|
|
||||||
ident = a_menu->menu_entree_entree;
|
|
||||||
break;
|
|
||||||
case ACT_entree_length:
|
|
||||||
ident = a_menu->menu_entree_entree;
|
|
||||||
length = true;
|
|
||||||
break;
|
|
||||||
case ACT_entree_value:
|
|
||||||
ident = a_menu->menu_entree_value;
|
|
||||||
break;
|
|
||||||
case ACT_title_text:
|
|
||||||
ident = a_menu->menu_title;
|
|
||||||
break;
|
|
||||||
case ACT_title_length:
|
|
||||||
ident = a_menu->menu_title;
|
|
||||||
length = true;
|
|
||||||
break;
|
|
||||||
case ACT_terminator:
|
|
||||||
ident = a_menu->menu_terminator;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ident = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length)
|
|
||||||
printa(column, "isc_%dl", ident);
|
|
||||||
else
|
|
||||||
printa(column, "isc_%d", ident);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!(action->act_request->req_flags & REQ_menu_for))
|
|
||||||
printa(column + INDENT, "break;");
|
|
||||||
END;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
// Get menu created
|
|
||||||
|
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
|
||||||
printa(column, "isc_initialize_menu (%s, &%s);",
|
|
||||||
status_vector(action), request->req_handle);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
ENTREE menu_entree;
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
column += INDENT;
|
|
||||||
END;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
menu_entree = (ENTREE) action->act_pair->act_object;
|
|
||||||
request = menu_entree->entree_request;
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"isc_put_entree (%s, &%s, &isc_%dl, isc_%d, &isc_%d);",
|
|
||||||
status_vector(action),
|
|
||||||
request->req_handle,
|
|
||||||
menu_entree->entree_entree,
|
|
||||||
menu_entree->entree_entree, menu_entree->entree_value);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
ENTREE menu_entree;
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
menu_entree = (ENTREE) action->act_object;
|
|
||||||
request = menu_entree->entree_request;
|
|
||||||
|
|
||||||
printa(column, "while (1)");
|
|
||||||
column += INDENT;
|
|
||||||
BEGIN;
|
|
||||||
align(column);
|
|
||||||
printa(column,
|
|
||||||
"isc_get_entree (%s, &%s, &isc_%dl, isc_%d, &isc_%d, &isc_%d);",
|
|
||||||
status_vector(action), request->req_handle, menu_entree->entree_entree,
|
|
||||||
menu_entree->entree_entree, menu_entree->entree_value, menu_entree->entree_end);
|
|
||||||
|
|
||||||
printa(column, "if (isc_%d) break;", menu_entree->entree_end);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate definitions associated with a dynamic menu request.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_request( GPRE_REQ request)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
MENU a_menu;
|
|
||||||
ENTREE menu_entree;
|
|
||||||
|
|
||||||
a_menu = NULL;
|
|
||||||
menu_entree = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next) {
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (action->act_type == ACT_item_for
|
|
||||||
|| action->act_type == ACT_item_put) {
|
|
||||||
menu_entree = (ENTREE) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a_menu) {
|
|
||||||
a_menu->menu_title = CMP_next_ident();
|
|
||||||
a_menu->menu_terminator = CMP_next_ident();
|
|
||||||
a_menu->menu_entree_value = CMP_next_ident();
|
|
||||||
a_menu->menu_entree_entree = CMP_next_ident();
|
|
||||||
printa(0, "static short isc_%dl;\t\t/* TITLE_LENGTH */",
|
|
||||||
a_menu->menu_title);
|
|
||||||
printa(0, "static char isc_%d [81];\t\t/* TITLE_TEXT */",
|
|
||||||
a_menu->menu_title);
|
|
||||||
printa(0, "static short isc_%d;\t\t/* TERMINATOR */",
|
|
||||||
a_menu->menu_terminator);
|
|
||||||
printa(0, "static short isc_%dl;\t\t/* ENTREE_LENGTH */",
|
|
||||||
a_menu->menu_entree_entree);
|
|
||||||
printa(0, "static char isc_%d [81];\t/* ENTREE_TEXT */",
|
|
||||||
a_menu->menu_entree_entree);
|
|
||||||
printa(0, "static %s isc_%d;\t\t/* ENTREE_VALUE */\n",
|
|
||||||
DCL_LONG, a_menu->menu_entree_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu_entree) {
|
|
||||||
menu_entree->entree_entree = CMP_next_ident();
|
|
||||||
menu_entree->entree_value = CMP_next_ident();
|
|
||||||
menu_entree->entree_end = CMP_next_ident();
|
|
||||||
printa(0, "static short isc_%dl;\t\t/* ENTREE_LENGTH */",
|
|
||||||
menu_entree->entree_entree);
|
|
||||||
printa(0, "static char isc_%d [81];\t/* ENTREE_TEXT */",
|
|
||||||
menu_entree->entree_entree);
|
|
||||||
printa(0, "static %s isc_%d;\t\t/* ENTREE_VALUE */",
|
|
||||||
DCL_LONG, menu_entree->entree_value);
|
|
||||||
if (request->req_flags & REQ_menu_for_item)
|
|
||||||
printa(0, "static short isc_%d;\t\t/* ENTREE_END */\n",
|
|
||||||
menu_entree->entree_end);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3483,18 +2874,13 @@ static void gen_request( GPRE_REQ request)
|
|||||||
BLB blob;
|
BLB blob;
|
||||||
TEXT *string_type;
|
TEXT *string_type;
|
||||||
|
|
||||||
if (!
|
if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open
|
||||||
(request->
|
| REQ_sql_blob_create)) && request->req_type != REQ_slice
|
||||||
req_flags & (REQ_exp_hand
|
&& request->req_type != REQ_procedure)
|
||||||
#ifdef PYXIS
|
{
|
||||||
| REQ_menu_for_item
|
printa(0, "static isc_req_handle\n %s = 0;\t\t/* request handle */\n",
|
||||||
#endif
|
|
||||||
| REQ_sql_blob_open |
|
|
||||||
REQ_sql_blob_create)) && request->req_type != REQ_slice
|
|
||||||
&& request->req_type != REQ_procedure)
|
|
||||||
printa(0,
|
|
||||||
"static isc_req_handle\n %s = 0;\t\t/* request handle */\n",
|
|
||||||
request->req_handle);
|
request->req_handle);
|
||||||
|
}
|
||||||
|
|
||||||
// check the case where we need to extend the dpb dynamically at runtime,
|
// check the case where we need to extend the dpb dynamically at runtime,
|
||||||
// in which case we need dpb length and a pointer to be defined even if
|
// in which case we need dpb length and a pointer to be defined even if
|
||||||
@ -3543,15 +2929,6 @@ static void gen_request( GPRE_REQ request)
|
|||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
string_type = "dyn";
|
string_type = "dyn";
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form_map";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "blr";
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "sdl";
|
string_type = "sdl";
|
||||||
break;
|
break;
|
||||||
@ -3565,52 +2942,37 @@ static void gen_request( GPRE_REQ request)
|
|||||||
case REQ_create_database:
|
case REQ_create_database:
|
||||||
case REQ_ready:
|
case REQ_ready:
|
||||||
string_type = "dpb";
|
string_type = "dpb";
|
||||||
if (PRETTY_print_cdb
|
if (PRETTY_print_cdb((SCHAR *) request->req_blr,
|
||||||
((SCHAR *) request->req_blr,
|
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0, 0))
|
||||||
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0,
|
{
|
||||||
0))
|
IBERROR("internal error during parameter generation");
|
||||||
IBERROR("internal error during parameter generation");
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
string_type = "dyn";
|
string_type = "dyn";
|
||||||
if (PRETTY_print_dyn
|
if (PRETTY_print_dyn((SCHAR *) request->req_blr,
|
||||||
((SCHAR *) request->req_blr,
|
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0, 0))
|
||||||
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0,
|
{
|
||||||
0))
|
IBERROR("internal error during dynamic DDL generation");
|
||||||
IBERROR
|
}
|
||||||
("internal error during dynamic DDL generation");
|
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
if (PRETTY_print_form_map
|
|
||||||
((SCHAR *) request->req_blr,
|
|
||||||
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0,
|
|
||||||
0)) IBERROR("internal error during form map generation");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
if (PRETTY_print_menu
|
|
||||||
((SCHAR *) request->req_blr,
|
|
||||||
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0,
|
|
||||||
0)) IBERROR("internal error during menu generation");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "sdl";
|
string_type = "sdl";
|
||||||
if (PRETTY_print_sdl
|
if (PRETTY_print_sdl((SCHAR *) request->req_blr,
|
||||||
((SCHAR *) request->req_blr,
|
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0, 0))
|
||||||
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr), 0,
|
{
|
||||||
0)) IBERROR("internal error during SDL generation");
|
IBERROR("internal error during SDL generation");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
string_type = "blr";
|
string_type = "blr";
|
||||||
if (isc_print_blr
|
if (isc_print_blr((char *) request->req_blr, (FPTR_VOID) gen_blr,
|
||||||
((char *) request->req_blr, (FPTR_VOID) gen_blr, 0, 0))
|
0, 0))
|
||||||
|
{
|
||||||
IBERROR("internal error during BLR generation");
|
IBERROR("internal error during BLR generation");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
printa(INDENT, "};\t/* end of %s string for request isc_%d */\n",
|
printa(INDENT, "};\t/* end of %s string for request isc_%d */\n",
|
||||||
string_type, request->req_ident);
|
string_type, request->req_ident);
|
||||||
@ -3620,7 +2982,9 @@ static void gen_request( GPRE_REQ request)
|
|||||||
|
|
||||||
for (port = request->req_ports; port; port = port->por_next)
|
for (port = request->req_ports; port; port = port->por_next)
|
||||||
for (reference = port->por_references; reference;
|
for (reference = port->por_references; reference;
|
||||||
reference = reference->ref_next) if (reference->ref_sdl) {
|
reference = reference->ref_next)
|
||||||
|
{
|
||||||
|
if (reference->ref_sdl) {
|
||||||
printa(0, "static %sshort\n isc_%dl = %d;", CONST_STR,
|
printa(0, "static %sshort\n isc_%dl = %d;", CONST_STR,
|
||||||
reference->ref_sdl_ident, reference->ref_sdl_length);
|
reference->ref_sdl_ident, reference->ref_sdl_length);
|
||||||
printa(0, "static %schar\n isc_%d [] = {", CONST_STR,
|
printa(0, "static %schar\n isc_%d [] = {", CONST_STR,
|
||||||
@ -3629,16 +2993,17 @@ static void gen_request( GPRE_REQ request)
|
|||||||
gen_raw((UCHAR *) reference->ref_sdl,
|
gen_raw((UCHAR *) reference->ref_sdl,
|
||||||
reference->ref_sdl_length);
|
reference->ref_sdl_length);
|
||||||
else
|
else
|
||||||
if (PRETTY_print_sdl
|
if (PRETTY_print_sdl((SCHAR *) reference->ref_sdl,
|
||||||
((SCHAR *) reference->ref_sdl,
|
|
||||||
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr),
|
reinterpret_cast < PRETTY_print_cb_pfn > (gen_blr),
|
||||||
0, 0))
|
0, 0))
|
||||||
IBERROR("internal error during SDL generation");
|
{
|
||||||
|
IBERROR("internal error during SDL generation");
|
||||||
|
}
|
||||||
printa(INDENT,
|
printa(INDENT,
|
||||||
"};\t/* end of sdl string for request isc_%d */\n",
|
"};\t/* end of sdl string for request isc_%d */\n",
|
||||||
reference->ref_sdl_ident);
|
reference->ref_sdl_ident);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Print out any blob parameter blocks required
|
// Print out any blob parameter blocks required
|
||||||
|
|
||||||
@ -3649,12 +3014,6 @@ static void gen_request( GPRE_REQ request)
|
|||||||
gen_raw(blob->blb_bpb, blob->blb_bpb_length);
|
gen_raw(blob->blb_bpb, blob->blb_bpb_length);
|
||||||
printa(INDENT, "};\n");
|
printa(INDENT, "};\n");
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
// If this is a menu request, handle things
|
|
||||||
|
|
||||||
if (request->req_type == REQ_menu)
|
|
||||||
gen_menu_request(request);
|
|
||||||
#endif
|
|
||||||
// If this is a GET_SLICE/PUT_slice, allocate some variables
|
// If this is a GET_SLICE/PUT_slice, allocate some variables
|
||||||
|
|
||||||
if (request->req_type == REQ_slice) {
|
if (request->req_type == REQ_slice) {
|
||||||
@ -4262,46 +3621,6 @@ static void gen_whenever( SWE label, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_create( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"isc_create_window (%s, &isc_window, (short*) 0, (char*) 0, &isc_width, &isc_height)",
|
|
||||||
status_vector(action));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Delete a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_delete( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "isc_delete_window (%s, &isc_window)",
|
|
||||||
status_vector(action));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Suspend a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_suspend( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "isc_suspend_window (%s, &isc_window)",
|
|
||||||
status_vector(action));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -4323,7 +3642,7 @@ static void make_array_declaration( REF reference)
|
|||||||
if (field->fld_array_info->ary_declared)
|
if (field->fld_array_info->ary_declared)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
field->fld_array_info->ary_declared = TRUE;
|
field->fld_array_info->ary_declared = true;
|
||||||
|
|
||||||
switch (field->fld_array_info->ary_dtype) {
|
switch (field->fld_array_info->ary_dtype) {
|
||||||
case dtype_short:
|
case dtype_short:
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: cmd.cpp,v 1.12 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: cmd.cpp,v 1.13 2003-09-11 02:13:46 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -2439,10 +2439,6 @@ static void init_field_struct( GPRE_FLD field)
|
|||||||
field->fld_procedure = 0;
|
field->fld_procedure = 0;
|
||||||
field->fld_symbol = 0;
|
field->fld_symbol = 0;
|
||||||
field->fld_global = 0;
|
field->fld_global = 0;
|
||||||
#ifdef PYXIS
|
|
||||||
field->fld_handle = 0;
|
|
||||||
field->fld_prototype = 0;
|
|
||||||
#endif
|
|
||||||
field->fld_array_info = 0;
|
field->fld_array_info = 0;
|
||||||
field->fld_default_value = 0;
|
field->fld_default_value = 0;
|
||||||
field->fld_default_source = 0;
|
field->fld_default_source = 0;
|
||||||
|
250
src/gpre/cmp.cpp
250
src/gpre/cmp.cpp
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: cmp.cpp,v 1.16 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: cmp.cpp,v 1.17 2003-09-11 02:13:46 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -33,7 +33,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../jrd/gds.h"
|
#include "../jrd/gds.h"
|
||||||
#include "gpre.h"
|
#include "gpre.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../jrd/align.h"
|
#include "../jrd/align.h"
|
||||||
#include "../gpre/cmd_proto.h"
|
#include "../gpre/cmd_proto.h"
|
||||||
#include "../gpre/cme_proto.h"
|
#include "../gpre/cme_proto.h"
|
||||||
@ -56,13 +55,7 @@ static void cmp_erase(ACT, GPRE_REQ);
|
|||||||
static void cmp_fetch(ACT);
|
static void cmp_fetch(ACT);
|
||||||
static void cmp_field(GPRE_REQ, GPRE_FLD, REF);
|
static void cmp_field(GPRE_REQ, GPRE_FLD, REF);
|
||||||
static void cmp_for(GPRE_REQ);
|
static void cmp_for(GPRE_REQ);
|
||||||
#ifdef PYXIS
|
|
||||||
static void cmp_form(GPRE_REQ);
|
|
||||||
#endif
|
|
||||||
static void cmp_loop(GPRE_REQ);
|
static void cmp_loop(GPRE_REQ);
|
||||||
#ifdef PYXIS
|
|
||||||
static void cmp_menu(GPRE_REQ);
|
|
||||||
#endif
|
|
||||||
static void cmp_modify(ACT, GPRE_REQ);
|
static void cmp_modify(ACT, GPRE_REQ);
|
||||||
static void cmp_port(POR, GPRE_REQ);
|
static void cmp_port(POR, GPRE_REQ);
|
||||||
static void cmp_procedure(GPRE_REQ);
|
static void cmp_procedure(GPRE_REQ);
|
||||||
@ -192,11 +185,6 @@ void CMP_compile_request( GPRE_REQ request)
|
|||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
CMD_compile_ddl(request);
|
CMD_compile_ddl(request);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_menu:
|
|
||||||
cmp_menu(request);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
cmp_slice(request);
|
cmp_slice(request);
|
||||||
return;
|
return;
|
||||||
@ -204,11 +192,6 @@ void CMP_compile_request( GPRE_REQ request)
|
|||||||
case REQ_ready:
|
case REQ_ready:
|
||||||
cmp_ready(request);
|
cmp_ready(request);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
cmp_form(request);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case REQ_procedure:
|
case REQ_procedure:
|
||||||
cmp_procedure(request);
|
cmp_procedure(request);
|
||||||
return;
|
return;
|
||||||
@ -322,54 +305,6 @@ void CMP_compile_request( GPRE_REQ request)
|
|||||||
cmp_blob(blob, false);
|
cmp_blob(blob, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// CMP_display_code is called by the code generators to compute
|
|
||||||
// the option words code for the form DISPLAY statement on a
|
|
||||||
// field by field basis. If the user has specificed explicit
|
|
||||||
// override of the field, -1 is returned.
|
|
||||||
//
|
|
||||||
|
|
||||||
int
|
|
||||||
CMP_display_code(FINT display, REF reference)
|
|
||||||
{
|
|
||||||
int code;
|
|
||||||
|
|
||||||
if (MSC_member((GPRE_NOD) reference, display->fint_override_fields))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
code = 0;
|
|
||||||
|
|
||||||
// Handle display attribute
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_display_all)
|
|
||||||
code |= PYXIS_OPT_DISPLAY;
|
|
||||||
else if (MSC_member((GPRE_NOD) reference, display->fint_display_fields))
|
|
||||||
code |= PYXIS_OPT_DISPLAY;
|
|
||||||
|
|
||||||
// Handle update attribute
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_update_all)
|
|
||||||
code |= PYXIS_OPT_UPDATE;
|
|
||||||
else if (MSC_member((GPRE_NOD) reference, display->fint_update_fields))
|
|
||||||
code |= PYXIS_OPT_UPDATE;
|
|
||||||
|
|
||||||
// Handle wakeup attribute
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_wakeup_all)
|
|
||||||
code |= PYXIS_OPT_WAKEUP;
|
|
||||||
else if (MSC_member((GPRE_NOD) reference, display->fint_wakeup_fields))
|
|
||||||
code |= PYXIS_OPT_WAKEUP;
|
|
||||||
|
|
||||||
// Handle cursor position attribute
|
|
||||||
|
|
||||||
if (MSC_member((GPRE_NOD) reference, display->fint_position_fields))
|
|
||||||
code |= PYXIS_OPT_POSITION;
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -870,13 +805,6 @@ static void cmp_field( GPRE_REQ request, GPRE_FLD field, REF reference)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case dtype_blob:
|
case dtype_blob:
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_type == REQ_form) {
|
|
||||||
STUFF(blr_blob_id);
|
|
||||||
STUFF_WORD(field->fld_sub_type);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
case dtype_quad:
|
case dtype_quad:
|
||||||
STUFF(blr_quad);
|
STUFF(blr_quad);
|
||||||
STUFF(field->fld_scale);
|
STUFF(field->fld_scale);
|
||||||
@ -1038,100 +966,6 @@ static void cmp_for( GPRE_REQ request)
|
|||||||
STUFF(blr_end);
|
STUFF(blr_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Compile a FORM request.
|
|
||||||
// This has very little to do with a BLR request.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void cmp_form( GPRE_REQ request)
|
|
||||||
{
|
|
||||||
REF reference, option, parent;
|
|
||||||
POR port;
|
|
||||||
GPRE_FLD field;
|
|
||||||
FORM request_form;
|
|
||||||
|
|
||||||
request_form = request->req_form;
|
|
||||||
|
|
||||||
if (!request_form->form_handle) {
|
|
||||||
request_form->form_handle = (TEXT *) ALLOC(20);
|
|
||||||
sprintf(request_form->form_handle, ident_pattern, CMP_next_ident());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!request->req_form_handle)
|
|
||||||
request->req_form_handle = request_form->form_handle;
|
|
||||||
|
|
||||||
request->req_blr = request->req_base = (UCHAR *) ALLOC(500);
|
|
||||||
request->req_length = 500;
|
|
||||||
STUFF(PYXIS_MAP_VERSION1);
|
|
||||||
|
|
||||||
make_port(request, request->req_references);
|
|
||||||
port = request->req_ports;
|
|
||||||
|
|
||||||
// If the request had no references, we need to generate the
|
|
||||||
// bogus, one-field reference structure within the routine
|
|
||||||
// but NOT generate the field into the blr message. Gawd.
|
|
||||||
|
|
||||||
reference = port->por_references;
|
|
||||||
if (reference->ref_field == eof_field) {
|
|
||||||
STUFF(blr_message);
|
|
||||||
STUFF(0); /* port->por_msg_number */
|
|
||||||
STUFF_WORD(0); /* port->por_count */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cmp_port(port, request);
|
|
||||||
|
|
||||||
if (field = request_form->form_field) {
|
|
||||||
STUFF(PYXIS_MAP_SUB_FORM);
|
|
||||||
CMP_stuff_symbol(request, field->fld_symbol);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request->req_flags & REQ_transparent)
|
|
||||||
STUFF(PYXIS_MAP_TRANSPARENT);
|
|
||||||
|
|
||||||
if (request->req_flags & REQ_form_tag)
|
|
||||||
STUFF(PYXIS_MAP_TAG);
|
|
||||||
|
|
||||||
reference = port->por_references;
|
|
||||||
if (!(reference->ref_field == eof_field))
|
|
||||||
for (; reference; reference = reference->ref_next)
|
|
||||||
if (!(reference->ref_flags & REF_pseudo)) {
|
|
||||||
CMP_check(request, 0);
|
|
||||||
field = reference->ref_field;
|
|
||||||
option = reference->ref_null;
|
|
||||||
if (parent = reference->ref_friend) {
|
|
||||||
STUFF(PYXIS_MAP_SUB_FIELD);
|
|
||||||
CMP_stuff_symbol(request, parent->ref_field->fld_symbol);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
STUFF((option) ? PYXIS_MAP_FIELD2 : PYXIS_MAP_FIELD1);
|
|
||||||
CMP_stuff_symbol(request, field->fld_symbol);
|
|
||||||
STUFF_WORD(reference->ref_parameter);
|
|
||||||
if (option)
|
|
||||||
STUFF_WORD(option->ref_parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reference = request->req_eof) {
|
|
||||||
STUFF(PYXIS_MAP_TERMINATOR);
|
|
||||||
STUFF_WORD(reference->ref_parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reference = request->req_term_field) {
|
|
||||||
STUFF(PYXIS_MAP_TERMINATING_FIELD);
|
|
||||||
STUFF_WORD(reference->ref_parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reference = request->req_index) {
|
|
||||||
STUFF(PYXIS_MAP_ITEM_INDEX);
|
|
||||||
STUFF_WORD(reference->ref_parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
STUFF(PYXIS_MAP_END);
|
|
||||||
request->req_length = request->req_blr - request->req_base;
|
|
||||||
request->req_blr = request->req_base;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -1154,10 +988,11 @@ static void cmp_loop( GPRE_REQ request)
|
|||||||
STUFF(blr_begin);
|
STUFF(blr_begin);
|
||||||
counter = MAKE_NODE(nod_value, 1);
|
counter = MAKE_NODE(nod_value, 1);
|
||||||
for (reference = primary->por_references; reference;
|
for (reference = primary->por_references; reference;
|
||||||
reference =
|
reference = reference->ref_next)
|
||||||
reference->ref_next) if (reference->ref_field ==
|
{
|
||||||
count_field) counter->nod_arg[0] =
|
if (reference->ref_field == count_field)
|
||||||
(GPRE_NOD) reference;
|
counter->nod_arg[0] = (GPRE_NOD) reference;
|
||||||
|
}
|
||||||
|
|
||||||
STUFF(blr_assignment);
|
STUFF(blr_assignment);
|
||||||
CME_expr(lit0, request);
|
CME_expr(lit0, request);
|
||||||
@ -1178,7 +1013,9 @@ static void cmp_loop( GPRE_REQ request)
|
|||||||
STUFF(blr_begin);
|
STUFF(blr_begin);
|
||||||
for (ptr = list->nod_arg, end = ptr + list->nod_count; ptr < end;
|
for (ptr = list->nod_arg, end = ptr + list->nod_count; ptr < end;
|
||||||
ptr++)
|
ptr++)
|
||||||
|
{
|
||||||
cmp_assignment(*ptr, request);
|
cmp_assignment(*ptr, request);
|
||||||
|
}
|
||||||
STUFF(blr_end);
|
STUFF(blr_end);
|
||||||
}
|
}
|
||||||
else if (node->nod_type == nod_store) {
|
else if (node->nod_type == nod_store) {
|
||||||
@ -1189,7 +1026,9 @@ static void cmp_loop( GPRE_REQ request)
|
|||||||
STUFF(blr_begin);
|
STUFF(blr_begin);
|
||||||
for (ptr = list->nod_arg, end = ptr + list->nod_count; ptr < end;
|
for (ptr = list->nod_arg, end = ptr + list->nod_count; ptr < end;
|
||||||
ptr++)
|
ptr++)
|
||||||
|
{
|
||||||
cmp_assignment(*ptr, request);
|
cmp_assignment(*ptr, request);
|
||||||
|
}
|
||||||
STUFF(blr_end);
|
STUFF(blr_end);
|
||||||
}
|
}
|
||||||
else if (node->nod_type == nod_erase) {
|
else if (node->nod_type == nod_erase) {
|
||||||
@ -1207,75 +1046,6 @@ static void cmp_loop( GPRE_REQ request)
|
|||||||
STUFF(blr_end);
|
STUFF(blr_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Compile a MENU request. This has very little to do
|
|
||||||
// with a BLR request.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void cmp_menu( GPRE_REQ request)
|
|
||||||
{
|
|
||||||
ACT action, temp;
|
|
||||||
TEXT *p;
|
|
||||||
USHORT l, count;
|
|
||||||
|
|
||||||
// Do not generate anything for for_menu and form_menu_item requests.
|
|
||||||
|
|
||||||
if ((request->req_flags & REQ_menu_for) ||
|
|
||||||
(request->req_flags & REQ_menu_for_item)) return;
|
|
||||||
|
|
||||||
request->req_blr = request->req_base = (UCHAR *) ALLOC(500);
|
|
||||||
request->req_length = 500;
|
|
||||||
STUFF(PYXIS_MENU_VERSION1);
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
// Reverse actions so menu will come out in right order
|
|
||||||
|
|
||||||
for (temp = NULL; action = request->req_actions;) {
|
|
||||||
request->req_actions = action->act_next;
|
|
||||||
action->act_next = temp;
|
|
||||||
temp = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
request->req_actions = temp;
|
|
||||||
|
|
||||||
if (request->req_flags & REQ_menu_tag)
|
|
||||||
STUFF(PYXIS_MENU_HORIZONTAL);
|
|
||||||
else if (request->req_flags & REQ_menu_pop_up)
|
|
||||||
STUFF(PYXIS_MENU_VERTICAL);
|
|
||||||
|
|
||||||
if (request->req_flags & REQ_transparent)
|
|
||||||
STUFF(PYXIS_MENU_TRANSPARENT);
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next)
|
|
||||||
switch (action->act_type) {
|
|
||||||
case ACT_menu_entree:
|
|
||||||
STUFF(PYXIS_MENU_ENTREE);
|
|
||||||
action->act_count = ++count;
|
|
||||||
STUFF(action->act_count);
|
|
||||||
p = (TEXT *) action->act_object;
|
|
||||||
l = strlen(p);
|
|
||||||
STUFF(l);
|
|
||||||
while (*p)
|
|
||||||
STUFF(*p++);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACT_menu:
|
|
||||||
STUFF(PYXIS_MENU_LABEL);
|
|
||||||
p = (TEXT *) action->act_object;
|
|
||||||
l = strlen(p);
|
|
||||||
STUFF(l);
|
|
||||||
while (*p)
|
|
||||||
STUFF(*p++);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
STUFF(PYXIS_MENU_END);
|
|
||||||
request->req_length = request->req_blr - request->req_base;
|
|
||||||
request->req_blr = request->req_base;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
|
@ -24,13 +24,8 @@
|
|||||||
#ifndef GPRE_CMP_PROTO_H
|
#ifndef GPRE_CMP_PROTO_H
|
||||||
#define GPRE_CMP_PROTO_H
|
#define GPRE_CMP_PROTO_H
|
||||||
|
|
||||||
#include "../gpre/form.h"
|
|
||||||
|
|
||||||
extern void CMP_check(GPRE_REQ, SSHORT);
|
extern void CMP_check(GPRE_REQ, SSHORT);
|
||||||
extern void CMP_compile_request(GPRE_REQ);
|
extern void CMP_compile_request(GPRE_REQ);
|
||||||
#ifdef PYXIS
|
|
||||||
extern int CMP_display_code(FINT, REF);
|
|
||||||
#endif
|
|
||||||
extern void CMP_external_field(GPRE_REQ, GPRE_FLD);
|
extern void CMP_external_field(GPRE_REQ, GPRE_FLD);
|
||||||
extern void CMP_init(void);
|
extern void CMP_init(void);
|
||||||
extern USHORT CMP_next_ident(void);
|
extern USHORT CMP_next_ident(void);
|
||||||
|
827
src/gpre/cob.cpp
827
src/gpre/cob.cpp
File diff suppressed because it is too large
Load Diff
160
src/gpre/exp.cpp
160
src/gpre/exp.cpp
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: exp.cpp,v 1.17 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: exp.cpp,v 1.18 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -35,11 +35,9 @@
|
|||||||
#include "../jrd/common.h"
|
#include "../jrd/common.h"
|
||||||
#include "../gpre/gpre.h"
|
#include "../gpre/gpre.h"
|
||||||
#include "../gpre/parse.h"
|
#include "../gpre/parse.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../jrd/intl.h"
|
#include "../jrd/intl.h"
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
#include "../gpre/exp_proto.h"
|
#include "../gpre/exp_proto.h"
|
||||||
#include "../gpre/form_proto.h"
|
|
||||||
#include "../gpre/gpre_proto.h"
|
#include "../gpre/gpre_proto.h"
|
||||||
#include "../gpre/hsh_proto.h"
|
#include "../gpre/hsh_proto.h"
|
||||||
#include "../gpre/gpre_meta.h"
|
#include "../gpre/gpre_meta.h"
|
||||||
@ -304,104 +302,6 @@ GPRE_FLD EXP_field(GPRE_CTX * rcontext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse a qualified form field clause. If recognized,
|
|
||||||
// return both the field block (as value) and the
|
|
||||||
// context block (by reference).
|
|
||||||
//
|
|
||||||
|
|
||||||
GPRE_FLD EXP_form_field(GPRE_CTX * rcontext)
|
|
||||||
{
|
|
||||||
SYM symbol;
|
|
||||||
GPRE_CTX context;
|
|
||||||
GPRE_FLD field, child;
|
|
||||||
REF reference, parent;
|
|
||||||
GPRE_REQ request;
|
|
||||||
FORM a_form;
|
|
||||||
TEXT s[128];
|
|
||||||
|
|
||||||
if (!(symbol = token.tok_symbol) || symbol->sym_type != SYM_form_map)
|
|
||||||
SYNTAX_ERROR("context variable");
|
|
||||||
|
|
||||||
*rcontext = context = symbol->sym_object;
|
|
||||||
request = context->ctx_request;
|
|
||||||
a_form = request->req_form;
|
|
||||||
ADVANCE_TOKEN;
|
|
||||||
|
|
||||||
if (!MATCH(KW_DOT))
|
|
||||||
SYNTAX_ERROR("dot after context variable");
|
|
||||||
|
|
||||||
if (MATCH(KW_TERMINATOR))
|
|
||||||
if (reference = request->req_eof)
|
|
||||||
return reference->ref_field;
|
|
||||||
else {
|
|
||||||
field =
|
|
||||||
MET_make_field("TERMINATOR", dtype_short, sizeof(SSHORT),
|
|
||||||
FALSE);
|
|
||||||
reference = EXP_post_field(field, context, FALSE);
|
|
||||||
reference->ref_flags |= REF_pseudo;
|
|
||||||
request->req_eof = reference;
|
|
||||||
return field;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MATCH(KW_TERMINATING_FIELD))
|
|
||||||
if (reference = request->req_term_field)
|
|
||||||
return reference->ref_field;
|
|
||||||
else {
|
|
||||||
if (sw_cstring)
|
|
||||||
field = MET_make_field("TERMINATING_FIELD", dtype_cstring, 32,
|
|
||||||
FALSE);
|
|
||||||
else
|
|
||||||
field = MET_make_field("TERMINATING_FIELD", dtype_text, 31,
|
|
||||||
FALSE);
|
|
||||||
reference = EXP_post_field(field, context, FALSE);
|
|
||||||
reference->ref_flags |= REF_pseudo;
|
|
||||||
request->req_term_field = reference;
|
|
||||||
return field;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(field = FORM_lookup_field(a_form, a_form->form_object,
|
|
||||||
token.tok_string)))
|
|
||||||
{
|
|
||||||
sprintf(s, "field \"%s\" is not defined in form %s", token.tok_string,
|
|
||||||
a_form->form_name->sym_string);
|
|
||||||
PAR_error(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
ADVANCE_TOKEN;
|
|
||||||
|
|
||||||
// Unless field is further qualified, we're done
|
|
||||||
|
|
||||||
if (!MATCH(KW_DOT))
|
|
||||||
return field;
|
|
||||||
|
|
||||||
// Check for a sub-field reference
|
|
||||||
|
|
||||||
parent = NULL;
|
|
||||||
if (field->fld_prototype &&
|
|
||||||
(child = FORM_lookup_field(request->req_form, field->fld_prototype,
|
|
||||||
token.tok_string)))
|
|
||||||
{
|
|
||||||
ADVANCE_TOKEN;
|
|
||||||
parent = MAKE_REFERENCE(0);
|
|
||||||
parent->ref_field = field;
|
|
||||||
field = child;
|
|
||||||
}
|
|
||||||
|
|
||||||
reference = EXP_post_field(field, context, FALSE);
|
|
||||||
if ((reference->ref_friend = parent) && !(MATCH(KW_DOT)))
|
|
||||||
return reference->ref_field;
|
|
||||||
|
|
||||||
if (!MATCH(KW_STATE))
|
|
||||||
SYNTAX_ERROR("STATE");
|
|
||||||
|
|
||||||
reference = reference->ref_null;
|
|
||||||
return reference->ref_field;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Eat a left parenthesis, complain if not there.
|
// Eat a left parenthesis, complain if not there.
|
||||||
@ -698,9 +598,6 @@ REF EXP_post_field(GPRE_FLD field, GPRE_CTX context, USHORT null_flag)
|
|||||||
{
|
{
|
||||||
GPRE_REQ request;
|
GPRE_REQ request;
|
||||||
REF reference;
|
REF reference;
|
||||||
#ifdef PYXIS
|
|
||||||
REF control;
|
|
||||||
#endif
|
|
||||||
GPRE_FLD ref_field;
|
GPRE_FLD ref_field;
|
||||||
TEXT s[128];
|
TEXT s[128];
|
||||||
|
|
||||||
@ -709,16 +606,19 @@ REF EXP_post_field(GPRE_FLD field, GPRE_CTX context, USHORT null_flag)
|
|||||||
// If the reference is already posted, return the reference
|
// If the reference is already posted, return the reference
|
||||||
|
|
||||||
for (reference = request->req_references; reference;
|
for (reference = request->req_references; reference;
|
||||||
reference =
|
reference = reference->ref_next)
|
||||||
reference->ref_next) if (reference->ref_context == context) {
|
{
|
||||||
|
if (reference->ref_context == context) {
|
||||||
ref_field = reference->ref_field;
|
ref_field = reference->ref_field;
|
||||||
if (ref_field == field ||
|
if (ref_field == field ||
|
||||||
(ref_field->fld_symbol == field->fld_symbol &&
|
(ref_field->fld_symbol == field->fld_symbol &&
|
||||||
ref_field->fld_array == field->fld_array)) {
|
ref_field->fld_array == field->fld_array))
|
||||||
|
{
|
||||||
if (!null_flag && (ref_field->fld_dtype != field->fld_dtype ||
|
if (!null_flag && (ref_field->fld_dtype != field->fld_dtype ||
|
||||||
ref_field->fld_length != field->fld_length
|
ref_field->fld_length != field->fld_length
|
||||||
|| ref_field->fld_scale !=
|
|| ref_field->fld_scale !=
|
||||||
field->fld_scale)) {
|
field->fld_scale))
|
||||||
|
{
|
||||||
if (reference->ref_flags & REF_null)
|
if (reference->ref_flags & REF_null)
|
||||||
reference->ref_field = field;
|
reference->ref_field = field;
|
||||||
else {
|
else {
|
||||||
@ -735,6 +635,7 @@ REF EXP_post_field(GPRE_FLD field, GPRE_CTX context, USHORT null_flag)
|
|||||||
return reference;
|
return reference;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This is first occurrence of field, make a new reference
|
// This is first occurrence of field, make a new reference
|
||||||
|
|
||||||
@ -746,30 +647,6 @@ REF EXP_post_field(GPRE_FLD field, GPRE_CTX context, USHORT null_flag)
|
|||||||
if (null_flag)
|
if (null_flag)
|
||||||
reference->ref_flags |= REF_null;
|
reference->ref_flags |= REF_null;
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
// If this is a form request, make up control field for form field
|
|
||||||
|
|
||||||
if (request->req_type == REQ_form) {
|
|
||||||
if (field->fld_array_info) {
|
|
||||||
sprintf(s,
|
|
||||||
"Arrays are not supported in forms. Field %s is an array.",
|
|
||||||
field->fld_symbol->sym_string);
|
|
||||||
PAR_error(s);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
reference->ref_null = control =
|
|
||||||
MAKE_REFERENCE(&request->req_references);
|
|
||||||
control->ref_flags |= REF_pseudo;
|
|
||||||
control->ref_field =
|
|
||||||
MET_make_field("gds__form_control", dtype_short,
|
|
||||||
sizeof(SSHORT), FALSE);
|
|
||||||
control->ref_context = context;
|
|
||||||
control->ref_master = reference;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return reference;
|
return reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -780,14 +657,14 @@ REF EXP_post_field(GPRE_FLD field, GPRE_CTX context, USHORT null_flag)
|
|||||||
// and return FALSE.
|
// and return FALSE.
|
||||||
//
|
//
|
||||||
|
|
||||||
BOOLEAN EXP_match_paren(void)
|
bool EXP_match_paren(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MATCH(KW_RIGHT_PAREN))
|
if (MATCH(KW_RIGHT_PAREN))
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
SYNTAX_ERROR("right parenthesis");
|
SYNTAX_ERROR("right parenthesis");
|
||||||
return FALSE; /* silence compiler warning */
|
return false; // silence compiler warning
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1380,10 +1257,6 @@ static GPRE_NOD par_field( GPRE_REQ request)
|
|||||||
if (MATCH(KW_DOT) && (cast = EXP_cast(field)))
|
if (MATCH(KW_DOT) && (cast = EXP_cast(field)))
|
||||||
field = cast;
|
field = cast;
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
else if (symbol->sym_type == SYM_form_map)
|
|
||||||
field = EXP_form_field(&context);
|
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
SYNTAX_ERROR("qualified field reference");
|
SYNTAX_ERROR("qualified field reference");
|
||||||
|
|
||||||
@ -1596,12 +1469,7 @@ static GPRE_NOD par_primitive_value( GPRE_REQ request, GPRE_FLD field)
|
|||||||
if (node = par_udf(request, UDF_value, field))
|
if (node = par_udf(request, UDF_value, field))
|
||||||
return node;
|
return node;
|
||||||
|
|
||||||
if (!(symbol = token.tok_symbol) ||
|
if (!(symbol = token.tok_symbol) || (symbol->sym_type != SYM_context))
|
||||||
(symbol->sym_type != SYM_context
|
|
||||||
#ifdef PYXIS
|
|
||||||
&& symbol->sym_type != SYM_form_map
|
|
||||||
#endif
|
|
||||||
))
|
|
||||||
return par_native_value(request, field);
|
return par_native_value(request, field);
|
||||||
|
|
||||||
return par_field(request);
|
return par_field(request);
|
||||||
@ -1618,7 +1486,7 @@ static GPRE_NOD par_relational( GPRE_REQ request)
|
|||||||
GPRE_NOD expr, expr1, expr2;
|
GPRE_NOD expr, expr1, expr2;
|
||||||
REF reference;
|
REF reference;
|
||||||
GPRE_FLD field;
|
GPRE_FLD field;
|
||||||
USHORT negation;
|
bool negation;
|
||||||
rel_ops* relop;
|
rel_ops* relop;
|
||||||
|
|
||||||
if (MATCH(KW_ANY)) {
|
if (MATCH(KW_ANY)) {
|
||||||
|
@ -28,14 +28,11 @@ extern GPRE_NOD EXP_array(GPRE_REQ, GPRE_FLD, SSHORT, SSHORT);
|
|||||||
extern GPRE_FLD EXP_cast(GPRE_FLD);
|
extern GPRE_FLD EXP_cast(GPRE_FLD);
|
||||||
extern GPRE_CTX EXP_context(GPRE_REQ, SYM);
|
extern GPRE_CTX EXP_context(GPRE_REQ, SYM);
|
||||||
extern GPRE_FLD EXP_field(GPRE_CTX *);
|
extern GPRE_FLD EXP_field(GPRE_CTX *);
|
||||||
#ifdef PYXIS
|
|
||||||
extern GPRE_FLD EXP_form_field(GPRE_CTX *);
|
|
||||||
#endif
|
|
||||||
extern void EXP_left_paren(TEXT *);
|
extern void EXP_left_paren(TEXT *);
|
||||||
extern GPRE_NOD EXP_literal(void);
|
extern GPRE_NOD EXP_literal(void);
|
||||||
extern void EXP_post_array(REF);
|
extern void EXP_post_array(REF);
|
||||||
extern REF EXP_post_field(GPRE_FLD, GPRE_CTX, USHORT);
|
extern REF EXP_post_field(GPRE_FLD, GPRE_CTX, USHORT);
|
||||||
extern BOOLEAN EXP_match_paren(void);
|
extern bool EXP_match_paren(void);
|
||||||
extern GPRE_REL EXP_relation(void);
|
extern GPRE_REL EXP_relation(void);
|
||||||
extern RSE EXP_rse(GPRE_REQ, SYM);
|
extern RSE EXP_rse(GPRE_REQ, SYM);
|
||||||
extern void EXP_rse_cleanup(RSE);
|
extern void EXP_rse_cleanup(RSE);
|
||||||
|
760
src/gpre/ftn.cpp
760
src/gpre/ftn.cpp
@ -24,7 +24,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: ftn.cpp,v 1.24 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: ftn.cpp,v 1.25 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
// 2002.10.28 Sean Leyne - Completed removal of obsolete "DGUX" port
|
// 2002.10.28 Sean Leyne - Completed removal of obsolete "DGUX" port
|
||||||
// 2002.10.28 Sean Leyne - Completed removal of obsolete "SGI" port
|
// 2002.10.28 Sean Leyne - Completed removal of obsolete "SGI" port
|
||||||
@ -37,7 +37,6 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "../jrd/gds.h"
|
#include "../jrd/gds.h"
|
||||||
#include "../gpre/gpre.h"
|
#include "../gpre/gpre.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../gpre/pat.h"
|
#include "../gpre/pat.h"
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
#include "../gpre/gpre_proto.h"
|
#include "../gpre/gpre_proto.h"
|
||||||
@ -106,30 +105,10 @@ static void gen_event_wait (ACT);
|
|||||||
static void gen_fetch (ACT);
|
static void gen_fetch (ACT);
|
||||||
static void gen_finish (ACT);
|
static void gen_finish (ACT);
|
||||||
static void gen_for (ACT);
|
static void gen_for (ACT);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_form_display (ACT);
|
|
||||||
static void gen_form_end (ACT);
|
|
||||||
static void gen_form_for (ACT);
|
|
||||||
#endif
|
|
||||||
static void gen_function( ACT);
|
static void gen_function( ACT);
|
||||||
static void gen_get_or_put_slice(ACT, REF, bool);
|
static void gen_get_or_put_slice(ACT, REF, bool);
|
||||||
static void gen_get_segment (ACT);
|
static void gen_get_segment (ACT);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_item_end (ACT);
|
|
||||||
static void gen_item_for (ACT);
|
|
||||||
#endif
|
|
||||||
static void gen_loop (ACT);
|
static void gen_loop (ACT);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu (ACT);
|
|
||||||
static void gen_menu_display (ACT);
|
|
||||||
static void gen_menu_end (ACT);
|
|
||||||
static void gen_menu_entree (ACT);
|
|
||||||
static void gen_menu_entree_att (ACT);
|
|
||||||
static void gen_menu_for (ACT);
|
|
||||||
static void gen_menu_item_end (ACT);
|
|
||||||
static void gen_menu_item_for (ACT);
|
|
||||||
static void gen_menu_request (GPRE_REQ);
|
|
||||||
#endif
|
|
||||||
static TEXT *gen_name (SCHAR *, REF, bool);
|
static TEXT *gen_name (SCHAR *, REF, bool);
|
||||||
static void gen_on_error (ACT);
|
static void gen_on_error (ACT);
|
||||||
static void gen_procedure (ACT);
|
static void gen_procedure (ACT);
|
||||||
@ -166,11 +145,6 @@ static void gen_type (ACT);
|
|||||||
static void gen_update (ACT);
|
static void gen_update (ACT);
|
||||||
static void gen_variable (ACT);
|
static void gen_variable (ACT);
|
||||||
static void gen_whenever (SWE);
|
static void gen_whenever (SWE);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_window_create (ACT);
|
|
||||||
static void gen_window_delete (ACT);
|
|
||||||
static void gen_window_suspend (ACT);
|
|
||||||
#endif
|
|
||||||
static void make_array_declaration (REF);
|
static void make_array_declaration (REF);
|
||||||
static TEXT *make_name (TEXT *, SYM);
|
static TEXT *make_name (TEXT *, SYM);
|
||||||
static void make_ok_test (ACT, GPRE_REQ);
|
static void make_ok_test (ACT, GPRE_REQ);
|
||||||
@ -555,17 +529,6 @@ void FTN_action( ACT action, int column)
|
|||||||
case ACT_for:
|
case ACT_for:
|
||||||
gen_for(action);
|
gen_for(action);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_form_display:
|
|
||||||
gen_form_display(action);
|
|
||||||
break;
|
|
||||||
case ACT_form_end:
|
|
||||||
gen_form_end(action);
|
|
||||||
break;
|
|
||||||
case ACT_form_for:
|
|
||||||
gen_form_for(action);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_function:
|
case ACT_function:
|
||||||
gen_function(action);
|
gen_function(action);
|
||||||
return;
|
return;
|
||||||
@ -581,45 +544,9 @@ void FTN_action( ACT action, int column)
|
|||||||
case ACT_insert:
|
case ACT_insert:
|
||||||
gen_s_start(action);
|
gen_s_start(action);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_item_for:
|
|
||||||
case ACT_item_put:
|
|
||||||
gen_item_for(action);
|
|
||||||
return;
|
|
||||||
case ACT_item_end:
|
|
||||||
gen_item_end(action);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case ACT_loop:
|
case ACT_loop:
|
||||||
gen_loop(action);
|
gen_loop(action);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_menu:
|
|
||||||
gen_menu(action);
|
|
||||||
return;
|
|
||||||
case ACT_menu_end:
|
|
||||||
gen_menu_end(action);
|
|
||||||
break;
|
|
||||||
case ACT_menu_display:
|
|
||||||
gen_menu_display(action);
|
|
||||||
return;
|
|
||||||
case ACT_menu_for:
|
|
||||||
gen_menu_for(action);
|
|
||||||
return;
|
|
||||||
|
|
||||||
case ACT_title_text:
|
|
||||||
case ACT_title_length:
|
|
||||||
case ACT_terminator:
|
|
||||||
case ACT_entree_text:
|
|
||||||
case ACT_entree_length:
|
|
||||||
case ACT_entree_value:
|
|
||||||
gen_menu_entree_att(action);
|
|
||||||
return;
|
|
||||||
|
|
||||||
case ACT_menu_entree:
|
|
||||||
gen_menu_entree(action);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_open:
|
case ACT_open:
|
||||||
gen_s_start(action);
|
gen_s_start(action);
|
||||||
break;
|
break;
|
||||||
@ -692,17 +619,6 @@ void FTN_action( ACT action, int column)
|
|||||||
case ACT_variable:
|
case ACT_variable:
|
||||||
gen_variable(action);
|
gen_variable(action);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_window_create:
|
|
||||||
gen_window_create(action);
|
|
||||||
return;
|
|
||||||
case ACT_window_delete:
|
|
||||||
gen_window_delete(action);
|
|
||||||
return;
|
|
||||||
case ACT_window_suspend:
|
|
||||||
gen_window_suspend(action);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -741,31 +657,6 @@ void FTN_fini(void)
|
|||||||
"%sDATA %s /0/ %s{ init database handle }\n",
|
"%sDATA %s /0/ %s{ init database handle }\n",
|
||||||
COLUMN, name, INLINE_COMMENT);
|
COLUMN, name, INLINE_COMMENT);
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis && (sw_window_scope != DBB_EXTERN)) {
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*4 ISC_WINDOW %s{ window handle }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*2 ISC_HEIGHT %s{ window height }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*2 ISC_WIDTH %s{ window width }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
printa(COLUMN, "COMMON /ISC_WINDOW/ISC_WINDOW");
|
|
||||||
printa(COLUMN, "COMMON /ISC_HEIGHT/ISC_HEIGHT");
|
|
||||||
printa(COLUMN, "COMMON /ISC_WIDTH/ISC_WIDTH");
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA ISC_WINDOW /0/ %s{ init window handle }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA ISC_HEIGHT /24/ %s{ init window height }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA ISC_WIDTH /80/ %s{ init window width }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
printa(COLUMN, "END");
|
printa(COLUMN, "END");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,12 +1069,12 @@ static void gen_blob_open( ACT action)
|
|||||||
reference = blob->blb_reference;
|
reference = blob->blb_reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.pat_condition = action->act_type == ACT_blob_create; /* open or create blob */
|
args.pat_condition = (action->act_type == ACT_blob_create); // open or create blob
|
||||||
args.pat_vector1 = status_vector(action); /* status vector */
|
args.pat_vector1 = status_vector(action); // status vector
|
||||||
args.pat_database = blob->blb_request->req_database; /* database handle */
|
args.pat_database = blob->blb_request->req_database; // database handle
|
||||||
args.pat_request = blob->blb_request; /* transaction handle */
|
args.pat_request = blob->blb_request; // transaction handle
|
||||||
args.pat_blob = blob; /* blob handle */
|
args.pat_blob = blob; // blob handle
|
||||||
args.pat_reference = reference; /* blob identifier */
|
args.pat_reference = reference; // blob identifier
|
||||||
args.pat_ident1 = blob->blb_bpb_ident;
|
args.pat_ident1 = blob->blb_bpb_ident;
|
||||||
|
|
||||||
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open) {
|
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open) {
|
||||||
@ -1583,19 +1474,6 @@ static void gen_database_data( ACT action)
|
|||||||
ib_fprintf(out_file,
|
ib_fprintf(out_file,
|
||||||
"%sDATA GDS__TRANS /0/ %s{ init trans handle }\n",
|
"%sDATA GDS__TRANS /0/ %s{ init trans handle }\n",
|
||||||
COLUMN, INLINE_COMMENT);
|
COLUMN, INLINE_COMMENT);
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis && (sw_window_scope != DBB_EXTERN)) {
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA ISC_WINDOW /0/ %s{ init window handle }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA ISC_HEIGHT /24/ %s{ init window height }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA ISC_WIDTH /80/ %s{ init window width }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (request = requests; request; request = request->req_next)
|
for (request = requests; request; request = request->req_next)
|
||||||
@ -1630,19 +1508,6 @@ static void gen_database_decls( ACT action)
|
|||||||
ib_fprintf(out_file,
|
ib_fprintf(out_file,
|
||||||
"%sINTEGER*4 GDS__TRANS %s{ default transaction handle }\n",
|
"%sINTEGER*4 GDS__TRANS %s{ default transaction handle }\n",
|
||||||
COLUMN, INLINE_COMMENT);
|
COLUMN, INLINE_COMMENT);
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis) {
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*4 ISC_WINDOW %s{ window handle }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*2 ISC_HEIGHT %s{ window height }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*2 ISC_WIDTH %s{ window width }\n",
|
|
||||||
COLUMN, INLINE_COMMENT);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
ib_fprintf(out_file,
|
ib_fprintf(out_file,
|
||||||
"%sINTEGER*4 ISC_STATUS(20) %s{ status vector }\n", COLUMN,
|
"%sINTEGER*4 ISC_STATUS(20) %s{ status vector }\n", COLUMN,
|
||||||
INLINE_COMMENT);
|
INLINE_COMMENT);
|
||||||
@ -1739,13 +1604,6 @@ static void gen_database_decls( ACT action)
|
|||||||
printa(COLUMN, "COMMON /ISC_STATUS2/ISC_STATUS2");
|
printa(COLUMN, "COMMON /ISC_STATUS2/ISC_STATUS2");
|
||||||
printa(COLUMN, "COMMON /SQLCODE/SQLCODE");
|
printa(COLUMN, "COMMON /SQLCODE/SQLCODE");
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis && sw_window_scope != DBB_STATIC) {
|
|
||||||
printa(COLUMN, "COMMON /ISC_WINDOW/ISC_WINDOW");
|
|
||||||
printa(COLUMN, "COMMON /ISC_HEIGHT/ISC_HEIGHT");
|
|
||||||
printa(COLUMN, "COMMON /ISC_WIDTH/ISC_WIDTH");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
array_decl_list = NULL;
|
array_decl_list = NULL;
|
||||||
for (request = requests; request; request = request->req_next) {
|
for (request = requests; request; request = request->req_next) {
|
||||||
gen_request_decls(request);
|
gen_request_decls(request);
|
||||||
@ -2626,115 +2484,6 @@ static void gen_for( ACT action)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_display( ACT action)
|
|
||||||
{
|
|
||||||
FINT display;
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
dbb* database;
|
|
||||||
TEXT s[32], out[16];
|
|
||||||
int code;
|
|
||||||
|
|
||||||
display = (FINT) action->act_object;
|
|
||||||
request = display->fint_request;
|
|
||||||
database = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next)
|
|
||||||
{
|
|
||||||
if ((master = reference->ref_master) &&
|
|
||||||
(code = CMP_display_code(display, master)) >= 0)
|
|
||||||
{
|
|
||||||
printa(COLUMN, "%s = %d", gen_name(s, reference, true), code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_no_wait)
|
|
||||||
strcpy(out, "0");
|
|
||||||
else
|
|
||||||
sprintf(out, "isc_%d", port->por_ident);
|
|
||||||
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__DRIVE_FORM (isc_status, %s, %s, isc_window, %s, %sisc_%d%s, %s%s%s)",
|
|
||||||
database->dbb_name->sym_string, request->req_trans, request->req_handle,
|
|
||||||
REF_1, port->por_ident, REF_2, REF_1, out, REF_2);
|
|
||||||
//
|
|
||||||
//status_and_stop (action);
|
|
||||||
//
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_end( ACT action)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(COLUMN, "CALL PYXIS__POP_WINDOW (isc_window)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_for( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request = action->act_request;
|
|
||||||
FORM a_form = request->req_form;
|
|
||||||
dbb* database = request->req_database;
|
|
||||||
|
|
||||||
// Get database attach and transaction started
|
|
||||||
|
|
||||||
if (sw_auto)
|
|
||||||
t_start_auto(0, status_vector(action), action, true);
|
|
||||||
|
|
||||||
// Get form loaded first
|
|
||||||
|
|
||||||
printa(COLUMN, "IF (%s .EQ. 0) THEN", request->req_form_handle);
|
|
||||||
printa(COLUMN_INDENT,
|
|
||||||
"CALL PYXIS__LOAD_FORM (isc_status, %s, %s, %s, %s%d%s, %s'%s'%s)",
|
|
||||||
database->dbb_name->sym_string, request->req_trans,
|
|
||||||
request->req_form_handle, I2_1,
|
|
||||||
strlen(a_form->form_name->sym_string), I2_2, REF_1,
|
|
||||||
a_form->form_name->sym_string, REF_2);
|
|
||||||
status_and_stop(action);
|
|
||||||
printa(COLUMN, "END IF");
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(COLUMN, "IF (%s .EQ. 0) THEN", request->req_handle);
|
|
||||||
printa(COLUMN_INDENT,
|
|
||||||
"CALL PYXIS__COMPILE_MAP (isc_status, %s, %s, %s%d%s, isc_%d)",
|
|
||||||
request->req_form_handle, request->req_handle, I2_1,
|
|
||||||
request->req_length, I2_2, request->req_ident);
|
|
||||||
//
|
|
||||||
//status_and_stop (action);
|
|
||||||
//
|
|
||||||
printa(COLUMN, "END IF");
|
|
||||||
|
|
||||||
// Reset form to known state
|
|
||||||
|
|
||||||
printa(COLUMN, "CALL PYXIS__RESET_FORM (isc_status, %s)",
|
|
||||||
request->req_handle);
|
|
||||||
//
|
|
||||||
//status_and_stop (action);
|
|
||||||
//
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2873,117 +2622,6 @@ static void gen_get_segment( ACT action)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_end( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
dbb* database;
|
|
||||||
TEXT s[32], index[16];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_end(action);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(COLUMN_INDENT, "%s = %s + 1", index, index);
|
|
||||||
printa(COLUMN, "GOTO %d", request->req_top_label);
|
|
||||||
printa("", "%-6dCONTINUE", request->req_btm_label);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
database = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next) if (master = reference->ref_master)
|
|
||||||
printa(COLUMN_INDENT, "%s = %d", gen_name(s, reference, true),
|
|
||||||
PYXIS_OPT_DISPLAY);
|
|
||||||
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__INSERT (isc_status, %s, %s, %s, %sisc_%d%s)",
|
|
||||||
database->dbb_name->sym_string,
|
|
||||||
request->req_trans,
|
|
||||||
request->req_handle, REF_1, port->por_ident, REF_2);
|
|
||||||
//
|
|
||||||
//status_and_stop (action);
|
|
||||||
//
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_for( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request, parent;
|
|
||||||
TEXT index[30];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_for(action);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent = request->req_form->form_parent;
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(COLUMN, "IF (%s .EQ. 0) THEN", request->req_handle);
|
|
||||||
printa(COLUMN_INDENT,
|
|
||||||
"CALL PYXIS__COMPILE_SUB_MAP (isc_status, %s, %s, %s%d%s, isc_%d)",
|
|
||||||
parent->req_handle, request->req_handle, I2_1, request->req_length,
|
|
||||||
I2_2, request->req_ident);
|
|
||||||
//
|
|
||||||
//status_and_stop (action);
|
|
||||||
//
|
|
||||||
printa(COLUMN, "END IF");
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(COLUMN, "%s = 1", index);
|
|
||||||
request->req_top_label = next_label();
|
|
||||||
request->req_btm_label = next_label();
|
|
||||||
if (action->act_error || (action->act_flags & ACT_sql))
|
|
||||||
printa(COLUMN, "IF (ISC_STATUS(2) .NE. 0) GOTO %d\n",
|
|
||||||
request->req_btm_label);
|
|
||||||
|
|
||||||
printa("", "%-6dCONTINUE", request->req_top_label);
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__FETCH (isc_status, %s, %s, %s, %sisc_%d%s)",
|
|
||||||
request->req_database->dbb_name->sym_string,
|
|
||||||
request->req_trans,
|
|
||||||
request->req_handle, REF_1, request->req_ports->por_ident, REF_2);
|
|
||||||
//
|
|
||||||
//status_and_stop (action);
|
|
||||||
//
|
|
||||||
if (action->act_error || (action->act_flags & ACT_sql))
|
|
||||||
printa(COLUMN, "IF (%s .EQ. 0 .OR. ISC_STATUS(2) .NE. 0) GOTO %d\n",
|
|
||||||
index, request->req_btm_label);
|
|
||||||
else
|
|
||||||
printa(COLUMN, "IF (%s .EQ. 0) GOTO %d\n",
|
|
||||||
index, request->req_btm_label);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3008,283 +2646,6 @@ static void gen_loop( ACT action)
|
|||||||
printa(COLUMN, "END IF");
|
printa(COLUMN, "END IF");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
printa(COLUMN, "%ss = pyxis__menu (isc_window, %s, %s%d%s, isc_%d)",
|
|
||||||
request->req_handle,
|
|
||||||
request->req_handle,
|
|
||||||
I2_1, request->req_length, I2_2, request->req_ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_display( ACT action)
|
|
||||||
{
|
|
||||||
MENU a_menu = NULL;
|
|
||||||
GPRE_REQ request, display_request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
display_request = (GPRE_REQ) action->act_object;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next)
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__DRIVE_MENU (isc_window, %s, %s%d%s, isc_%d,",
|
|
||||||
request->req_handle,
|
|
||||||
I2_1, display_request->req_length, I2_2,
|
|
||||||
display_request->req_ident);
|
|
||||||
|
|
||||||
printa(CONTINUE,
|
|
||||||
"isc_%dl, %sisc_%d%s,",
|
|
||||||
a_menu->menu_title, REF_1, a_menu->menu_title, REF_2);
|
|
||||||
|
|
||||||
printa(CONTINUE,
|
|
||||||
"isc_%d, isc_%dl, %sisc_%d%s, isc_%d)",
|
|
||||||
a_menu->menu_terminator,
|
|
||||||
a_menu->menu_entree_entree,
|
|
||||||
REF_1, a_menu->menu_entree_entree, REF_2, a_menu->menu_entree_value);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_end( ACT action)
|
|
||||||
{
|
|
||||||
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_flags & REQ_menu_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
printa(COLUMN, "END IF");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_entree( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
if (action->act_flags & ACT_first_entree)
|
|
||||||
printa(COLUMN, "IF (%ss .EQ. %d) THEN", request->req_handle,
|
|
||||||
action->act_count);
|
|
||||||
else
|
|
||||||
printa(COLUMN, "ELSE IF (%ss .EQ. %d) THEN", request->req_handle,
|
|
||||||
action->act_count);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Generate code for a reference to a menu or entree attribute.
|
|
||||||
|
|
||||||
static void gen_menu_entree_att( ACT action)
|
|
||||||
{
|
|
||||||
MENU a_menu;
|
|
||||||
SSHORT ident;
|
|
||||||
TEXT *length;
|
|
||||||
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
|
|
||||||
length = "";
|
|
||||||
switch (action->act_type) {
|
|
||||||
case ACT_entree_text:
|
|
||||||
ident = a_menu->menu_entree_entree;
|
|
||||||
break;
|
|
||||||
case ACT_entree_length:
|
|
||||||
ident = a_menu->menu_entree_entree;
|
|
||||||
length = "l";
|
|
||||||
break;
|
|
||||||
case ACT_entree_value:
|
|
||||||
ident = a_menu->menu_entree_value;
|
|
||||||
break;
|
|
||||||
case ACT_title_text:
|
|
||||||
ident = a_menu->menu_title;
|
|
||||||
break;
|
|
||||||
case ACT_title_length:
|
|
||||||
ident = a_menu->menu_title;
|
|
||||||
length = "l";
|
|
||||||
break;
|
|
||||||
case ACT_terminator:
|
|
||||||
ident = a_menu->menu_terminator;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ident = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printa("", "%sisc_%d%s",
|
|
||||||
(action->act_flags & ACT_first) ? COLUMN : CONTINUE,
|
|
||||||
ident, length);
|
|
||||||
|
|
||||||
ib_fputs(CONTINUE, out_file);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_for( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
// Get menu created
|
|
||||||
|
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
|
||||||
printa(COLUMN, "CALL PYXIS__INITIALIZE_MENU (%s)",
|
|
||||||
request->req_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_end( ACT action)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
ENTREE menu_entree;
|
|
||||||
|
|
||||||
menu_entree = (ENTREE) action->act_pair->act_object;
|
|
||||||
request = menu_entree->entree_request;
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
printa(COLUMN, "GOTO %d", request->req_top_label);
|
|
||||||
printa("", "%-6dCONTINUE", request->req_btm_label);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__PUT_ENTREE (%s, isc_%dl, %sisc_%d%s, isc_%d)",
|
|
||||||
request->req_handle,
|
|
||||||
menu_entree->entree_entree,
|
|
||||||
REF_1, menu_entree->entree_entree, REF_2, menu_entree->entree_value);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_for( ACT action)
|
|
||||||
{
|
|
||||||
ENTREE menu_entree;
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
menu_entree = (ENTREE) action->act_object;
|
|
||||||
request = menu_entree->entree_request;
|
|
||||||
|
|
||||||
request->req_top_label = next_label();
|
|
||||||
request->req_btm_label = next_label();
|
|
||||||
|
|
||||||
printa("", "%-6dCONTINUE", request->req_top_label);
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__GET_ENTREE (%s, isc_%dl, %sisc_%d%s, isc_%d, %sisc_%d%s)",
|
|
||||||
request->req_handle,
|
|
||||||
menu_entree->entree_entree,
|
|
||||||
REF_1, menu_entree->entree_entree, REF_2,
|
|
||||||
menu_entree->entree_value, REF_1, menu_entree->entree_end, REF_2);
|
|
||||||
|
|
||||||
printa(COLUMN, "IF (isc_%d .NE. 0) GOTO %d\n",
|
|
||||||
menu_entree->entree_end, request->req_btm_label);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate definitions associated with a dynamic menu request.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_request( GPRE_REQ request)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
MENU a_menu = NULL;
|
|
||||||
ENTREE menu_entree = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next) {
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
a_menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if ((action->act_type == ACT_item_for)
|
|
||||||
|| (action->act_type == ACT_item_put)) {
|
|
||||||
menu_entree = (ENTREE) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a_menu) {
|
|
||||||
a_menu->menu_title = CMP_next_ident();
|
|
||||||
a_menu->menu_terminator = CMP_next_ident();
|
|
||||||
a_menu->menu_entree_value = CMP_next_ident();
|
|
||||||
a_menu->menu_entree_entree = CMP_next_ident();
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*2 isc_%dl %s{ TITLE_LENGTH }\n",
|
|
||||||
COLUMN, a_menu->menu_title, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sCHARACTER*81 isc_%d %s{ TITLE_TEXT }\n",
|
|
||||||
COLUMN, a_menu->menu_title, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*2 isc_%d %s{ TERMINATOR }\n",
|
|
||||||
COLUMN, a_menu->menu_terminator, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*2 isc_%dl %s{ ENTREE_LENGTH }\n",
|
|
||||||
COLUMN, a_menu->menu_entree_entree, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sCHARACTER*81 isc_%d %s{ ENTREE_TEXT }\n",
|
|
||||||
COLUMN, a_menu->menu_entree_entree, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*4 isc_%d %s{ ENTREE_VALUE }\n\n",
|
|
||||||
COLUMN, a_menu->menu_entree_value, INLINE_COMMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu_entree) {
|
|
||||||
menu_entree->entree_entree = CMP_next_ident();
|
|
||||||
menu_entree->entree_value = CMP_next_ident();
|
|
||||||
menu_entree->entree_end = CMP_next_ident();
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*2 isc_%dl %s{ ENTREE_LENGTH }\n",
|
|
||||||
COLUMN, menu_entree->entree_entree, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sCHARACTER*81 isc_%d %s{ ENTREE_TEXT }\n",
|
|
||||||
COLUMN, menu_entree->entree_entree, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*4 isc_%d %s{ ENTREE_VALUE }\n",
|
|
||||||
COLUMN, menu_entree->entree_value, INLINE_COMMENT);
|
|
||||||
ib_fprintf(out_file, "%sINTEGER*2 isc_%d %s{ }\n\n",
|
|
||||||
COLUMN, menu_entree->entree_end, INLINE_COMMENT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3448,12 +2809,10 @@ static void gen_raw(
|
|||||||
*c = isc_sdl_eoc;
|
*c = isc_sdl_eoc;
|
||||||
else if ((request_type == REQ_ddl) ||
|
else if ((request_type == REQ_ddl) ||
|
||||||
(request_type == REQ_create_database) ||
|
(request_type == REQ_create_database) ||
|
||||||
#ifdef PYXIS
|
|
||||||
(request_type == REQ_form) ||
|
|
||||||
(request_type == REQ_menu) ||
|
|
||||||
#endif
|
|
||||||
(request_length != end_c + 1))
|
(request_length != end_c + 1))
|
||||||
|
{
|
||||||
*c = *blr++;
|
*c = *blr++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
*c = blr_eoc;
|
*c = blr_eoc;
|
||||||
break;
|
break;
|
||||||
@ -3577,11 +2936,8 @@ static void gen_request_data( GPRE_REQ request)
|
|||||||
// and doesn't allow byte value assignments to character
|
// and doesn't allow byte value assignments to character
|
||||||
// fields.
|
// fields.
|
||||||
|
|
||||||
if (!(request->req_flags & (REQ_exp_hand |
|
if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open
|
||||||
#ifdef PYXIS
|
| REQ_sql_blob_create)) &&
|
||||||
REQ_menu_for_item |
|
|
||||||
#endif
|
|
||||||
REQ_sql_blob_open | REQ_sql_blob_create)) &&
|
|
||||||
request->req_type != REQ_slice && request->req_type != REQ_procedure)
|
request->req_type != REQ_slice && request->req_type != REQ_procedure)
|
||||||
{
|
{
|
||||||
ib_fprintf(out_file,
|
ib_fprintf(out_file,
|
||||||
@ -3589,12 +2945,6 @@ static void gen_request_data( GPRE_REQ request)
|
|||||||
COLUMN, request->req_handle, INLINE_COMMENT);
|
COLUMN, request->req_handle, INLINE_COMMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_type == REQ_form)
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sDATA %s /0/ %s{ init form handle }\n\n",
|
|
||||||
COLUMN, request->req_form_handle, INLINE_COMMENT);
|
|
||||||
#endif
|
|
||||||
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
|
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
|
||||||
ib_fprintf(out_file,
|
ib_fprintf(out_file,
|
||||||
"%sDATA isc_%dS /0/ %s{ init SQL statement handle }\n\n",
|
"%sDATA isc_%dS /0/ %s{ init SQL statement handle }\n\n",
|
||||||
@ -3650,19 +3000,6 @@ static void gen_request_data( GPRE_REQ request)
|
|||||||
if (PRETTY_print_dyn((SCHAR*) request->req_blr, (int(*)()) gen_blr, 0, 0))
|
if (PRETTY_print_dyn((SCHAR*) request->req_blr, (int(*)()) gen_blr, 0, 0))
|
||||||
IBERROR("internal error during dynamic DDL generation");
|
IBERROR("internal error during dynamic DDL generation");
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
if (PRETTY_print_form_map((SCHAR*) request->req_blr, (int(*)())gen_blr, 0, 0))
|
|
||||||
IBERROR("internal error during form map generation");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
if (PRETTY_print_menu((SCHAR*)request->req_blr, (int(*)())gen_blr, 0, 0))
|
|
||||||
IBERROR("internal error during menu generation");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "SDL";
|
string_type = "SDL";
|
||||||
if (PRETTY_print_sdl((SCHAR*)request->req_blr, (int(*)()) gen_blr, 0, 0))
|
if (PRETTY_print_sdl((SCHAR*)request->req_blr, (int(*)()) gen_blr, 0, 0))
|
||||||
@ -3685,15 +3022,6 @@ static void gen_request_data( GPRE_REQ request)
|
|||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
string_type = "DYN";
|
string_type = "DYN";
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "SDL";
|
string_type = "SDL";
|
||||||
break;
|
break;
|
||||||
@ -3770,31 +3098,14 @@ static void gen_request_decls( GPRE_REQ request)
|
|||||||
BLB blob;
|
BLB blob;
|
||||||
POR port;
|
POR port;
|
||||||
|
|
||||||
if (!(request->req_flags & (REQ_exp_hand |
|
if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open
|
||||||
#ifdef PYXIS
|
| REQ_sql_blob_create)) &&
|
||||||
REQ_menu_for_item |
|
|
||||||
#endif
|
|
||||||
REQ_sql_blob_open | REQ_sql_blob_create)) &&
|
|
||||||
request->req_type != REQ_slice && request->req_type != REQ_procedure)
|
request->req_type != REQ_slice && request->req_type != REQ_procedure)
|
||||||
{
|
{
|
||||||
ib_fprintf(out_file,
|
ib_fprintf(out_file,
|
||||||
"%sINTEGER*4 %s %s{ request handle }\n\n",
|
"%sINTEGER*4 %s %s{ request handle }\n\n",
|
||||||
COLUMN, request->req_handle, INLINE_COMMENT);
|
COLUMN, request->req_handle, INLINE_COMMENT);
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_type == REQ_menu && !(request->req_flags & REQ_menu_for))
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*2 %ss %s{ menu switch variable }\n\n",
|
|
||||||
COLUMN, request->req_handle, INLINE_COMMENT);
|
|
||||||
|
|
||||||
if (request->req_type == REQ_menu)
|
|
||||||
gen_menu_request(request);
|
|
||||||
|
|
||||||
if (request->req_type == REQ_form)
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"%sINTEGER*4 %s %s{ form handle }\n\n",
|
|
||||||
COLUMN, request->req_form_handle, INLINE_COMMENT);
|
|
||||||
#endif
|
|
||||||
// generate the request as BLR long words
|
// generate the request as BLR long words
|
||||||
|
|
||||||
length = (request->req_length + (sizeof(SLONG) - 1)) / sizeof(SLONG);
|
length = (request->req_length + (sizeof(SLONG) - 1)) / sizeof(SLONG);
|
||||||
@ -4466,44 +3777,6 @@ static void gen_whenever( SWE label)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_create( ACT action)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(COLUMN,
|
|
||||||
"CALL PYXIS__CREATE_WINDOW (isc_window, 0, 0, isc_width, isc_height)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Delete a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_delete( ACT action)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(COLUMN, "CALL PYXIS__DELETE_WINDOW (isc_window)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Suspend a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_suspend( ACT action)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(COLUMN, "CALL PYXIS__SUSPEND_WINDOW (isc_window)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Generate a declaration of an array in the
|
// Generate a declaration of an array in the
|
||||||
@ -5075,13 +4348,6 @@ static void gen_clear_handles( ACT action)
|
|||||||
for (request = requests; request; request = request->req_next) {
|
for (request = requests; request; request = request->req_next) {
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
if (!(request->req_flags & REQ_exp_hand))
|
||||||
printa("%s%s = 0;", COLUMN, request->req_handle);
|
printa("%s%s = 0;", COLUMN, request->req_handle);
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_form_handle &&
|
|
||||||
!(request->req_flags & REQ_exp_form_handle))
|
|
||||||
{
|
|
||||||
printa("%s%s = 0;", COLUMN, request->req_form_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
//
|
//
|
||||||
// All Rights Reserved.
|
// All Rights Reserved.
|
||||||
// Contributor(s): ______________________________________.
|
// Contributor(s): ______________________________________.
|
||||||
// $Id: gpre.cpp,v 1.32 2003-09-10 19:48:53 brodsom Exp $
|
// $Id: gpre.cpp,v 1.33 2003-09-11 02:13:45 brodsom Exp $
|
||||||
// Revision 1.2 2000/11/16 15:54:29 fsg
|
// Revision 1.2 2000/11/16 15:54:29 fsg
|
||||||
// Added new switch -verbose to gpre that will dump
|
// Added new switch -verbose to gpre that will dump
|
||||||
// parsed lines to stderr
|
// parsed lines to stderr
|
||||||
@ -266,9 +266,9 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
errors = warnings = fatals = 0;
|
errors = warnings = fatals = 0;
|
||||||
|
|
||||||
BOOLEAN use_lang_internal_gxx_output;
|
bool use_lang_internal_gxx_output;
|
||||||
|
|
||||||
use_lang_internal_gxx_output = FALSE;
|
use_lang_internal_gxx_output = false;
|
||||||
strcpy(ada_package, "");
|
strcpy(ada_package, "");
|
||||||
ada_flags = 0;
|
ada_flags = 0;
|
||||||
input_char = input_buffer;
|
input_char = input_buffer;
|
||||||
@ -639,7 +639,7 @@ int main(int argc, char* argv[])
|
|||||||
* done with it.
|
* done with it.
|
||||||
*/
|
*/
|
||||||
gen_routine = INT_CXX_action;
|
gen_routine = INT_CXX_action;
|
||||||
use_lang_internal_gxx_output = TRUE;
|
use_lang_internal_gxx_output = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IN_SW_GPRE_LANG_INTERNAL:
|
case IN_SW_GPRE_LANG_INTERNAL:
|
||||||
@ -2549,16 +2549,7 @@ static void pass2( SLONG start_position)
|
|||||||
const bool continue_flag =
|
const bool continue_flag =
|
||||||
(action->act_type == ACT_variable) ||
|
(action->act_type == ACT_variable) ||
|
||||||
(action->act_type == ACT_segment) ||
|
(action->act_type == ACT_segment) ||
|
||||||
(action->act_type == ACT_segment_length)
|
(action->act_type == ACT_segment_length) ;
|
||||||
#ifdef PYXIS
|
|
||||||
|| (action->act_type == ACT_title_text) ||
|
|
||||||
(action->act_type == ACT_title_length) ||
|
|
||||||
(action->act_type == ACT_terminator) ||
|
|
||||||
(action->act_type == ACT_entree_text) ||
|
|
||||||
(action->act_type == ACT_entree_length) ||
|
|
||||||
(action->act_type == ACT_entree_value)
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
// Unless the action is purely a marker, insert a comment initiator
|
// Unless the action is purely a marker, insert a comment initiator
|
||||||
// into the output stream.
|
// into the output stream.
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
* Contributor(s): ______________________________________.
|
* Contributor(s): ______________________________________.
|
||||||
* $Id: gpre.h,v 1.39 2003-09-10 19:48:53 brodsom Exp $
|
* $Id: gpre.h,v 1.40 2003-09-11 02:13:45 brodsom Exp $
|
||||||
* Revision 1.3 2000/11/27 09:26:13 fsg
|
* Revision 1.3 2000/11/27 09:26:13 fsg
|
||||||
* Fixed bugs in gpre to handle PYXIS forms
|
* Fixed bugs in gpre to handle PYXIS forms
|
||||||
* and allow edit.e and fred.e to go through
|
* and allow edit.e and fred.e to go through
|
||||||
@ -374,7 +374,7 @@ typedef struct ary {
|
|||||||
dim* ary_dimension; /* Linked list of range info for each dimension */
|
dim* ary_dimension; /* Linked list of range info for each dimension */
|
||||||
SLONG ary_size; /* Size of the array */
|
SLONG ary_size; /* Size of the array */
|
||||||
USHORT ary_ident; /* Array identifier */
|
USHORT ary_ident; /* Array identifier */
|
||||||
BOOLEAN ary_declared; /* True if a declaration already was generated */
|
bool ary_declared; /* True if a declaration already was generated */
|
||||||
struct ary_repeat {
|
struct ary_repeat {
|
||||||
SLONG ary_lower;
|
SLONG ary_lower;
|
||||||
SLONG ary_upper;
|
SLONG ary_upper;
|
||||||
@ -618,29 +618,6 @@ typedef enum act_t {
|
|||||||
ACT_total,
|
ACT_total,
|
||||||
ACT_update,
|
ACT_update,
|
||||||
ACT_variable,
|
ACT_variable,
|
||||||
#ifdef PYXIS
|
|
||||||
ACT_form_for,
|
|
||||||
ACT_form_display,
|
|
||||||
ACT_form_end,
|
|
||||||
ACT_form_field,
|
|
||||||
ACT_menu,
|
|
||||||
ACT_menu_display,
|
|
||||||
ACT_menu_entree,
|
|
||||||
ACT_menu_end,
|
|
||||||
ACT_menu_for,
|
|
||||||
ACT_title_text,
|
|
||||||
ACT_title_length,
|
|
||||||
ACT_terminator,
|
|
||||||
ACT_entree_text,
|
|
||||||
ACT_entree_length,
|
|
||||||
ACT_entree_value,
|
|
||||||
ACT_window_create,
|
|
||||||
ACT_window_delete,
|
|
||||||
ACT_window_suspend,
|
|
||||||
ACT_item_put,
|
|
||||||
ACT_item_for,
|
|
||||||
ACT_item_end,
|
|
||||||
#endif
|
|
||||||
ACT_clear_handles,
|
ACT_clear_handles,
|
||||||
ACT_type,
|
ACT_type,
|
||||||
ACT_noop,
|
ACT_noop,
|
||||||
@ -674,9 +651,6 @@ typedef struct act {
|
|||||||
#define ACT_sql 8 /* action is SQL statement */
|
#define ACT_sql 8 /* action is SQL statement */
|
||||||
#define ACT_decl 16 /* action is a PASCAL forward or extern routine */
|
#define ACT_decl 16 /* action is a PASCAL forward or extern routine */
|
||||||
#define ACT_main 32 /* action is the main routine in the program/module */
|
#define ACT_main 32 /* action is the main routine in the program/module */
|
||||||
#ifdef PYXIS
|
|
||||||
#define ACT_first_entree 64 /* first entree in menu */
|
|
||||||
#endif
|
|
||||||
#define ACT_back_token 128 /* end of action marked by prior token */
|
#define ACT_back_token 128 /* end of action marked by prior token */
|
||||||
|
|
||||||
#define ACT_LEN sizeof(act)
|
#define ACT_LEN sizeof(act)
|
||||||
@ -749,9 +723,6 @@ typedef struct dbb {
|
|||||||
dbb* dbb_next; /* next database in program */
|
dbb* dbb_next; /* next database in program */
|
||||||
struct gpre_rel *dbb_relations; /* relations in database */
|
struct gpre_rel *dbb_relations; /* relations in database */
|
||||||
struct gpre_rel *dbb_procedures; /* procedures in database */
|
struct gpre_rel *dbb_procedures; /* procedures in database */
|
||||||
#ifdef PYXIS
|
|
||||||
form* dbb_forms; /* forms in database */
|
|
||||||
#endif
|
|
||||||
USHORT dbb_id; /* database id in program */
|
USHORT dbb_id; /* database id in program */
|
||||||
USHORT dbb_flags; /* Misc flag bytes */
|
USHORT dbb_flags; /* Misc flag bytes */
|
||||||
struct sym *dbb_name; /* database name */
|
struct sym *dbb_name; /* database name */
|
||||||
@ -845,10 +816,6 @@ typedef struct gpre_fld {
|
|||||||
struct gpre_prc *fld_procedure; /* procedure */
|
struct gpre_prc *fld_procedure; /* procedure */
|
||||||
struct sym *fld_symbol; /* symbol for field */
|
struct sym *fld_symbol; /* symbol for field */
|
||||||
struct sym *fld_global; /* symbol for global field */
|
struct sym *fld_global; /* symbol for global field */
|
||||||
#ifdef PYXIS
|
|
||||||
int *fld_handle; /* form handle */
|
|
||||||
int *fld_prototype; /* prototype object for sub-form */
|
|
||||||
#endif
|
|
||||||
ary* fld_array_info; /* Dimension and range information about an
|
ary* fld_array_info; /* Dimension and range information about an
|
||||||
array field */
|
array field */
|
||||||
gpre_nod* fld_default_value; /* field's default value */
|
gpre_nod* fld_default_value; /* field's default value */
|
||||||
@ -873,9 +840,6 @@ typedef struct gpre_fld {
|
|||||||
#define FLD_text 2
|
#define FLD_text 2
|
||||||
#define FLD_stream_blob 4
|
#define FLD_stream_blob 4
|
||||||
#define FLD_dbkey 8
|
#define FLD_dbkey 8
|
||||||
#ifdef PYXIS
|
|
||||||
#define FLD_repeating 16 /* Field is form repeating group */
|
|
||||||
#endif
|
|
||||||
#define FLD_not_null 32 /* if CREATE TABLE specifies not null */
|
#define FLD_not_null 32 /* if CREATE TABLE specifies not null */
|
||||||
#define FLD_delete 64 /* if ALTER TABLE specifies delete of field */
|
#define FLD_delete 64 /* if ALTER TABLE specifies delete of field */
|
||||||
#define FLD_meta 128 /* if true, created for a metadata operation */
|
#define FLD_meta 128 /* if true, created for a metadata operation */
|
||||||
@ -1042,7 +1006,7 @@ typedef struct gpre_rel {
|
|||||||
struct sym *rel_symbol; /* symbol for relation */
|
struct sym *rel_symbol; /* symbol for relation */
|
||||||
struct dbb *rel_database; /* parent database */
|
struct dbb *rel_database; /* parent database */
|
||||||
gpre_rel* rel_next; /* next relation in database */
|
gpre_rel* rel_next; /* next relation in database */
|
||||||
BOOLEAN rel_meta; /* if true, created for a metadata operation */
|
bool rel_meta; /* if true, created for a metadata operation */
|
||||||
struct rse *rel_view_rse;
|
struct rse *rel_view_rse;
|
||||||
txt* rel_view_text; /* source for VIEW definition */
|
txt* rel_view_text; /* source for VIEW definition */
|
||||||
struct sym *rel_owner; /* owner of relation, if any */
|
struct sym *rel_owner; /* owner of relation, if any */
|
||||||
@ -1070,13 +1034,7 @@ enum req_t {
|
|||||||
REQ_any,
|
REQ_any,
|
||||||
REQ_statistical,
|
REQ_statistical,
|
||||||
REQ_ddl,
|
REQ_ddl,
|
||||||
#ifdef PYXIS
|
|
||||||
REQ_form,
|
|
||||||
#endif
|
|
||||||
REQ_create_database,
|
REQ_create_database,
|
||||||
#ifdef PYXIS
|
|
||||||
REQ_menu,
|
|
||||||
#endif
|
|
||||||
REQ_slice,
|
REQ_slice,
|
||||||
REQ_ready,
|
REQ_ready,
|
||||||
REQ_procedure,
|
REQ_procedure,
|
||||||
@ -1095,9 +1053,6 @@ typedef struct gpre_req {
|
|||||||
SCHAR *req_handle; /* request handle */
|
SCHAR *req_handle; /* request handle */
|
||||||
TEXT *req_trans; /* transaction handle */
|
TEXT *req_trans; /* transaction handle */
|
||||||
SCHAR *req_request_level; /* request level expression */
|
SCHAR *req_request_level; /* request level expression */
|
||||||
#ifdef PYXIS
|
|
||||||
SCHAR *req_form_handle; /* optional handle for forms */
|
|
||||||
#endif
|
|
||||||
USHORT req_level; /* access level */
|
USHORT req_level; /* access level */
|
||||||
USHORT req_count; /* number of ports in request */
|
USHORT req_count; /* number of ports in request */
|
||||||
USHORT req_internal; /* next internal context number */
|
USHORT req_internal; /* next internal context number */
|
||||||
@ -1117,9 +1072,6 @@ typedef struct gpre_req {
|
|||||||
struct ref *req_eof; /* eof reference for FOR */
|
struct ref *req_eof; /* eof reference for FOR */
|
||||||
struct ref *req_index; /* index variable */
|
struct ref *req_index; /* index variable */
|
||||||
struct ref *req_references; /* fields referenced in context */
|
struct ref *req_references; /* fields referenced in context */
|
||||||
#ifdef PYXIS
|
|
||||||
struct ref *req_term_field; /* terminating field for forms */
|
|
||||||
#endif
|
|
||||||
struct map *req_map; /* map for aggregates, etc */
|
struct map *req_map; /* map for aggregates, etc */
|
||||||
struct rse *req_rse; /* record selection expression */
|
struct rse *req_rse; /* record selection expression */
|
||||||
struct por *req_ports; /* linked list of ports */
|
struct por *req_ports; /* linked list of ports */
|
||||||
@ -1131,9 +1083,6 @@ typedef struct gpre_req {
|
|||||||
#endif
|
#endif
|
||||||
gpre_req* req_routine; /* other requests in routine */
|
gpre_req* req_routine; /* other requests in routine */
|
||||||
blb* req_blobs; /* blobs in request */
|
blb* req_blobs; /* blobs in request */
|
||||||
#ifdef PYXIS
|
|
||||||
form* req_form; /* form for request */
|
|
||||||
#endif
|
|
||||||
struct slc *req_slice; /* slice for request */
|
struct slc *req_slice; /* slice for request */
|
||||||
struct ref *req_array_references; /* array fields referenced in context */
|
struct ref *req_array_references; /* array fields referenced in context */
|
||||||
USHORT req_scope_level; /* scope level for SQL subquery parsing */
|
USHORT req_scope_level; /* scope level for SQL subquery parsing */
|
||||||
@ -1148,16 +1097,6 @@ typedef struct gpre_req {
|
|||||||
|
|
||||||
#define REQ_exp_hand 1
|
#define REQ_exp_hand 1
|
||||||
#define REQ_local 2 /* defined in an included routine */
|
#define REQ_local 2 /* defined in an included routine */
|
||||||
#ifdef PYXIS
|
|
||||||
#define REQ_menu_tag 4 /* tag line menu */
|
|
||||||
#define REQ_menu_pop_up 8 /* pop-up style menu */
|
|
||||||
#define REQ_exp_form_handle 16 /* Explicit handle for form */
|
|
||||||
#define REQ_transparent 32 /* Form is transparent */
|
|
||||||
#define REQ_form_tag 64 /* Put form on tag line */
|
|
||||||
#define REQ_form_nowait 128
|
|
||||||
#define REQ_menu_for 256 /* dynamic menu */
|
|
||||||
#define REQ_menu_for_item 512 /* dynamic menu for item */
|
|
||||||
#endif
|
|
||||||
#define REQ_sql_cursor 1024 /* request is an SQL cursor */
|
#define REQ_sql_cursor 1024 /* request is an SQL cursor */
|
||||||
#define REQ_extend_dpb 2048 /* we need to extend dpb at runtime */
|
#define REQ_extend_dpb 2048 /* we need to extend dpb at runtime */
|
||||||
#define REQ_sql_declare_cursor 4096 /* request is declare cursor */
|
#define REQ_sql_declare_cursor 4096 /* request is declare cursor */
|
||||||
@ -1259,17 +1198,8 @@ enum sym_t {
|
|||||||
SYM_blob,
|
SYM_blob,
|
||||||
SYM_statement,
|
SYM_statement,
|
||||||
SYM_dyn_cursor,
|
SYM_dyn_cursor,
|
||||||
#ifdef PYXIS
|
|
||||||
SYM_form,
|
|
||||||
SYM_form_map,
|
|
||||||
SYM_form_field,
|
|
||||||
#endif
|
|
||||||
SYM_type,
|
SYM_type,
|
||||||
SYM_udf,
|
SYM_udf,
|
||||||
#ifdef PYXIS
|
|
||||||
SYM_menu,
|
|
||||||
SYM_menu_map,
|
|
||||||
#endif
|
|
||||||
SYM_username,
|
SYM_username,
|
||||||
SYM_procedure,
|
SYM_procedure,
|
||||||
SYM_charset,
|
SYM_charset,
|
||||||
@ -1503,9 +1433,6 @@ EXTERN bool sw_ids;
|
|||||||
EXTERN bool sw_trace;
|
EXTERN bool sw_trace;
|
||||||
EXTERN bool sw_case;
|
EXTERN bool sw_case;
|
||||||
EXTERN bool sw_external;
|
EXTERN bool sw_external;
|
||||||
#ifdef PYXIS
|
|
||||||
EXTERN bool sw_pyxis;
|
|
||||||
#endif
|
|
||||||
EXTERN bool sw_version;
|
EXTERN bool sw_version;
|
||||||
EXTERN USHORT sw_window_scope;
|
EXTERN USHORT sw_window_scope;
|
||||||
EXTERN bool sw_alsys;
|
EXTERN bool sw_alsys;
|
||||||
|
@ -62,9 +62,6 @@
|
|||||||
{"^", KW_CARAT},
|
{"^", KW_CARAT},
|
||||||
{"CASCADE", KW_CASCADE},
|
{"CASCADE", KW_CASCADE},
|
||||||
{"CASE", KW_CASE},
|
{"CASE", KW_CASE},
|
||||||
#ifdef PYXIS
|
|
||||||
{"CASE_MENU", KW_CASE_MENU},
|
|
||||||
#endif
|
|
||||||
{"CAST", KW_CAST},
|
{"CAST", KW_CAST},
|
||||||
{"CHAR", KW_CHAR},
|
{"CHAR", KW_CHAR},
|
||||||
{"CHARACTER", KW_CHAR},
|
{"CHARACTER", KW_CHAR},
|
||||||
@ -95,9 +92,6 @@
|
|||||||
{"COUNT", KW_COUNT},
|
{"COUNT", KW_COUNT},
|
||||||
{"CREATE", KW_CREATE},
|
{"CREATE", KW_CREATE},
|
||||||
{"CREATE_BLOB", KW_CREATE_BLOB},
|
{"CREATE_BLOB", KW_CREATE_BLOB},
|
||||||
#ifdef PYXIS
|
|
||||||
{"CREATE_WINDOW", KW_CREATE_WINDOW},
|
|
||||||
#endif
|
|
||||||
{"CROSS", KW_CROSS},
|
{"CROSS", KW_CROSS},
|
||||||
{"CSTRING", KW_CSTRING},
|
{"CSTRING", KW_CSTRING},
|
||||||
{"CURRENT", KW_CURRENT},
|
{"CURRENT", KW_CURRENT},
|
||||||
@ -116,9 +110,6 @@
|
|||||||
{"DECLARE", KW_DECLARE},
|
{"DECLARE", KW_DECLARE},
|
||||||
{"DEFAULT", KW_DEFAULT},
|
{"DEFAULT", KW_DEFAULT},
|
||||||
{"DELETE", KW_DELETE},
|
{"DELETE", KW_DELETE},
|
||||||
#ifdef PYXIS
|
|
||||||
{"DELETE_WINDOW", KW_DELETE_WINDOW},
|
|
||||||
#endif
|
|
||||||
{"DERIVED_FROM", KW_DERIVED_FROM},
|
{"DERIVED_FROM", KW_DERIVED_FROM},
|
||||||
{"DESC", KW_DESCENDING},
|
{"DESC", KW_DESCENDING},
|
||||||
{"DESCENDING", KW_DESCENDING},
|
{"DESCENDING", KW_DESCENDING},
|
||||||
@ -126,10 +117,6 @@
|
|||||||
{"DESCRIPTOR", KW_DESCRIPTOR},
|
{"DESCRIPTOR", KW_DESCRIPTOR},
|
||||||
{"DIALECT", KW_DIALECT},
|
{"DIALECT", KW_DIALECT},
|
||||||
{"DISCONNECT", KW_DISCONNECT},
|
{"DISCONNECT", KW_DISCONNECT},
|
||||||
#ifdef PYXIS
|
|
||||||
{"DISPLAY", KW_DISPLAY},
|
|
||||||
{"DISPLAYING", KW_DISPLAYING},
|
|
||||||
#endif
|
|
||||||
{"DISTINCT", KW_DISTINCT},
|
{"DISTINCT", KW_DISTINCT},
|
||||||
{".", KW_DOT},
|
{".", KW_DOT},
|
||||||
{"..", KW_DOT_DOT},
|
{"..", KW_DOT_DOT},
|
||||||
@ -146,20 +133,10 @@
|
|||||||
{"END_EXEC", KW_END_EXEC},
|
{"END_EXEC", KW_END_EXEC},
|
||||||
{"END_FETCH", KW_END_FETCH},
|
{"END_FETCH", KW_END_FETCH},
|
||||||
{"END_FOR", KW_END_FOR},
|
{"END_FOR", KW_END_FOR},
|
||||||
#ifdef PYXIS
|
|
||||||
{"END_FORM", KW_END_FORM},
|
|
||||||
{"END_ITEM", KW_END_ITEM},
|
|
||||||
{"END_MENU", KW_END_MENU},
|
|
||||||
#endif
|
|
||||||
{"END_MODIFY", KW_END_MODIFY},
|
{"END_MODIFY", KW_END_MODIFY},
|
||||||
{"END_STORE", KW_END_STORE},
|
{"END_STORE", KW_END_STORE},
|
||||||
{"END_STORE_SPECIAL", KW_END_STORE_SPECIAL},
|
{"END_STORE_SPECIAL", KW_END_STORE_SPECIAL},
|
||||||
{"END_STREAM", KW_END_STREAM},
|
{"END_STREAM", KW_END_STREAM},
|
||||||
#ifdef PYXIS
|
|
||||||
{"ENTREE_LENGTH", KW_ENTREE_LENGTH},
|
|
||||||
{"ENTREE_TEXT", KW_ENTREE_TEXT},
|
|
||||||
{"ENTREE_VALUE", KW_ENTREE_VALUE},
|
|
||||||
#endif
|
|
||||||
{"ENTRY_POINT", KW_ENTRY_POINT},
|
{"ENTRY_POINT", KW_ENTRY_POINT},
|
||||||
{"==", KW_EQ},
|
{"==", KW_EQ},
|
||||||
{"EQ", KW_EQ},
|
{"EQ", KW_EQ},
|
||||||
@ -189,23 +166,11 @@
|
|||||||
{"float", KW_FLOAT},
|
{"float", KW_FLOAT},
|
||||||
{"FOR", KW_FOR},
|
{"FOR", KW_FOR},
|
||||||
{"FOREIGN", KW_FOREIGN},
|
{"FOREIGN", KW_FOREIGN},
|
||||||
#ifdef PYXIS
|
|
||||||
{"FORM", KW_FORM},
|
|
||||||
{"FORM_HANDLE", KW_FORM_HANDLE},
|
|
||||||
#endif
|
|
||||||
{"FORWARD", KW_FORWARD},
|
{"FORWARD", KW_FORWARD},
|
||||||
#ifdef PYXIS
|
|
||||||
{"FOR_FORM", KW_FOR_FORM},
|
|
||||||
{"FOR_ITEM", KW_FOR_ITEM},
|
|
||||||
{"FOR_MENU", KW_FOR_MENU},
|
|
||||||
#endif
|
|
||||||
{"FOUND", KW_FOUND},
|
{"FOUND", KW_FOUND},
|
||||||
{"FROM", KW_FROM},
|
{"FROM", KW_FROM},
|
||||||
{"FULL", KW_FULL},
|
{"FULL", KW_FULL},
|
||||||
{"FUNCTION", KW_FUNCTION},
|
{"FUNCTION", KW_FUNCTION},
|
||||||
#ifdef PYXIS
|
|
||||||
{"WINDOW_SCOPE", KW_GDS_WINDOWS},
|
|
||||||
#endif
|
|
||||||
{">=", KW_GE},
|
{">=", KW_GE},
|
||||||
{"GE", KW_GE},
|
{"GE", KW_GE},
|
||||||
{"^<", KW_GE},
|
{"^<", KW_GE},
|
||||||
@ -280,10 +245,6 @@
|
|||||||
{"MATCHING", KW_MATCHES},
|
{"MATCHING", KW_MATCHES},
|
||||||
{"MAX", KW_MAX},
|
{"MAX", KW_MAX},
|
||||||
{"MAXIMUM_SEGMENT", KW_MAX_SEGMENT},
|
{"MAXIMUM_SEGMENT", KW_MAX_SEGMENT},
|
||||||
#ifdef PYXIS
|
|
||||||
{"MENU_ENTREE", KW_MENU_ENTREE},
|
|
||||||
{"MENU_HANDLE", KW_MENU_HANDLE},
|
|
||||||
#endif
|
|
||||||
{"MERGE", KW_MERGE},
|
{"MERGE", KW_MERGE},
|
||||||
{"MIN", KW_MIN},
|
{"MIN", KW_MIN},
|
||||||
{"MINUTE", KW_MINUTE},
|
{"MINUTE", KW_MINUTE},
|
||||||
@ -351,9 +312,6 @@
|
|||||||
{"PROCEDURE", KW_PROCEDURE},
|
{"PROCEDURE", KW_PROCEDURE},
|
||||||
{"PROTECTED", KW_PROTECTED},
|
{"PROTECTED", KW_PROTECTED},
|
||||||
{"PUBLIC", KW_PUBLIC},
|
{"PUBLIC", KW_PUBLIC},
|
||||||
#ifdef PYXIS
|
|
||||||
{"PUT_ITEM", KW_PUT_ITEM},
|
|
||||||
#endif
|
|
||||||
{"PUT_SEGMENT", KW_PUT_SEGMENT},
|
{"PUT_SEGMENT", KW_PUT_SEGMENT},
|
||||||
{"PUT_SLICE", KW_PUT_SLICE},
|
{"PUT_SLICE", KW_PUT_SLICE},
|
||||||
{"QUADWORD", KW_QUAD},
|
{"QUADWORD", KW_QUAD},
|
||||||
@ -440,9 +398,6 @@
|
|||||||
{"SUB_TYPE", KW_SUB_TYPE},
|
{"SUB_TYPE", KW_SUB_TYPE},
|
||||||
{"SUBROUTINE", KW_SUBROUTINE},
|
{"SUBROUTINE", KW_SUBROUTINE},
|
||||||
{"SUM", KW_SUM},
|
{"SUM", KW_SUM},
|
||||||
#ifdef PYXIS
|
|
||||||
{"SUSPEND_WINDOW", KW_SUSPEND_WINDOW},
|
|
||||||
#endif
|
|
||||||
{"SYNONYM", KW_SYNONYM},
|
{"SYNONYM", KW_SYNONYM},
|
||||||
{"TABLE", KW_TABLE},
|
{"TABLE", KW_TABLE},
|
||||||
{"TABLESPACE", KW_TABLESPACE},
|
{"TABLESPACE", KW_TABLESPACE},
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: msc.cpp,v 1.10 2003-09-08 11:27:51 robocop Exp $
|
// $Id: msc.cpp,v 1.11 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -311,7 +311,7 @@ void MSC_init(void)
|
|||||||
// false.
|
// false.
|
||||||
//
|
//
|
||||||
|
|
||||||
BOOLEAN MSC_match(KWWORDS keyword)
|
bool MSC_match(KWWORDS keyword)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (token.tok_keyword == KW_none && token.tok_symbol) {
|
if (token.tok_keyword == KW_none && token.tok_symbol) {
|
||||||
@ -329,21 +329,21 @@ BOOLEAN MSC_match(KWWORDS keyword)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((int) token.tok_keyword != (int) keyword)
|
if ((int) token.tok_keyword != (int) keyword)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
CPR_token();
|
CPR_token();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NOT_USED_OR_REPLACED
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Determinate where a specific object is
|
// Determinate where a specific object is
|
||||||
// represented on a linked list stack.
|
// represented on a linked list stack.
|
||||||
//
|
//
|
||||||
|
|
||||||
BOOLEAN MSC_member(GPRE_NOD object, LLS stack)
|
bool MSC_member(GPRE_NOD object, LLS stack)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (; stack; stack = stack->lls_next)
|
for (; stack; stack = stack->lls_next)
|
||||||
@ -352,7 +352,7 @@ BOOLEAN MSC_member(GPRE_NOD object, LLS stack)
|
|||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
|
@ -37,10 +37,7 @@ extern SYM MSC_find_symbol(SYM, enum sym_t);
|
|||||||
extern void MSC_free(UCHAR *);
|
extern void MSC_free(UCHAR *);
|
||||||
extern void MSC_free_request(GPRE_REQ);
|
extern void MSC_free_request(GPRE_REQ);
|
||||||
extern void MSC_init(void);
|
extern void MSC_init(void);
|
||||||
extern BOOLEAN MSC_match(KWWORDS);
|
extern bool MSC_match(KWWORDS);
|
||||||
#ifdef PYXIS
|
|
||||||
extern BOOLEAN MSC_member(GPRE_NOD, LLS);
|
|
||||||
#endif
|
|
||||||
extern GPRE_NOD MSC_node(enum nod_t, SSHORT);
|
extern GPRE_NOD MSC_node(enum nod_t, SSHORT);
|
||||||
extern GPRE_NOD MSC_pop(LLS *);
|
extern GPRE_NOD MSC_pop(LLS *);
|
||||||
extern PRV MSC_privilege_block(void);
|
extern PRV MSC_privilege_block(void);
|
||||||
|
743
src/gpre/par.cpp
743
src/gpre/par.cpp
@ -20,7 +20,7 @@
|
|||||||
//
|
//
|
||||||
// All Rights Reserved.
|
// All Rights Reserved.
|
||||||
// Contributor(s): ______________________________________.
|
// Contributor(s): ______________________________________.
|
||||||
// $Id: par.cpp,v 1.28 2003-09-10 19:48:52 brodsom Exp $
|
// $Id: par.cpp,v 1.29 2003-09-11 02:13:45 brodsom Exp $
|
||||||
// Revision 1.2 2000/11/27 09:26:13 fsg
|
// Revision 1.2 2000/11/27 09:26:13 fsg
|
||||||
// Fixed bugs in gpre to handle PYXIS forms
|
// Fixed bugs in gpre to handle PYXIS forms
|
||||||
// and allow edit.e and fred.e to go through
|
// and allow edit.e and fred.e to go through
|
||||||
@ -46,10 +46,8 @@
|
|||||||
#include "../jrd/gds.h"
|
#include "../jrd/gds.h"
|
||||||
#include "../gpre/gpre.h"
|
#include "../gpre/gpre.h"
|
||||||
#include "../gpre/parse.h"
|
#include "../gpre/parse.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
#include "../gpre/exp_proto.h"
|
#include "../gpre/exp_proto.h"
|
||||||
#include "../gpre/form_proto.h"
|
|
||||||
#include "../gpre/gpre_proto.h"
|
#include "../gpre/gpre_proto.h"
|
||||||
#include "../gpre/hsh_proto.h"
|
#include "../gpre/hsh_proto.h"
|
||||||
#include "../gpre/gpre_meta.h"
|
#include "../gpre/gpre_meta.h"
|
||||||
@ -83,50 +81,21 @@ static ACT par_end_block();
|
|||||||
static ACT par_end_error();
|
static ACT par_end_error();
|
||||||
static ACT par_end_fetch();
|
static ACT par_end_fetch();
|
||||||
static ACT par_end_for();
|
static ACT par_end_for();
|
||||||
#ifdef PYXIS
|
|
||||||
static ACT par_end_form();
|
|
||||||
static ACT par_end_menu();
|
|
||||||
#endif
|
|
||||||
static ACT par_end_modify();
|
static ACT par_end_modify();
|
||||||
static ACT par_end_stream();
|
static ACT par_end_stream();
|
||||||
static ACT par_end_store(bool);
|
static ACT par_end_store(bool);
|
||||||
#ifdef PYXIS
|
|
||||||
static ACT par_entree();
|
|
||||||
#endif
|
|
||||||
static ACT par_erase();
|
static ACT par_erase();
|
||||||
static ACT par_fetch();
|
static ACT par_fetch();
|
||||||
static ACT par_finish();
|
static ACT par_finish();
|
||||||
static ACT par_for();
|
static ACT par_for();
|
||||||
#ifdef PYXIS
|
|
||||||
static GPRE_CTX par_form_menu(enum sym_t);
|
|
||||||
static ACT par_form_display();
|
|
||||||
static ACT par_form_field();
|
|
||||||
static void par_form_fields(GPRE_REQ, LLS *);
|
|
||||||
static ACT par_form_for();
|
|
||||||
#endif
|
|
||||||
static ACT par_function();
|
static ACT par_function();
|
||||||
#ifdef PYXIS
|
|
||||||
static ACT par_item_end();
|
|
||||||
static ACT par_item_for(ACT_T);
|
|
||||||
#endif
|
|
||||||
static ACT par_left_brace();
|
static ACT par_left_brace();
|
||||||
#ifdef PYXIS
|
|
||||||
static ACT par_menu_att();
|
|
||||||
static ACT par_menu_case();
|
|
||||||
static ACT par_menu_display(GPRE_CTX);
|
|
||||||
static ACT par_menu_entree_att();
|
|
||||||
static ACT par_menu_for();
|
|
||||||
static ACT par_menu_item_for(SYM, GPRE_CTX, ACT_T);
|
|
||||||
#endif
|
|
||||||
static ACT par_modify();
|
static ACT par_modify();
|
||||||
static ACT par_on();
|
static ACT par_on();
|
||||||
static ACT par_on_error();
|
static ACT par_on_error();
|
||||||
static ACT par_open_blob(ACT_T, SYM);
|
static ACT par_open_blob(ACT_T, SYM);
|
||||||
static bool par_options(GPRE_REQ, bool);
|
static bool par_options(GPRE_REQ, bool);
|
||||||
static ACT par_procedure();
|
static ACT par_procedure();
|
||||||
#ifdef PYXIS
|
|
||||||
static TEXT* par_quoted_string();
|
|
||||||
#endif
|
|
||||||
static ACT par_ready();
|
static ACT par_ready();
|
||||||
static ACT par_returning_values();
|
static ACT par_returning_values();
|
||||||
static ACT par_right_brace();
|
static ACT par_right_brace();
|
||||||
@ -139,12 +108,6 @@ static ACT par_subroutine();
|
|||||||
static ACT par_trans(ACT_T);
|
static ACT par_trans(ACT_T);
|
||||||
static ACT par_type();
|
static ACT par_type();
|
||||||
static ACT par_variable();
|
static ACT par_variable();
|
||||||
#ifdef PYXIS
|
|
||||||
static ACT par_window_create();
|
|
||||||
static ACT par_window_delete();
|
|
||||||
static ACT par_window_scope();
|
|
||||||
static ACT par_window_suspend();
|
|
||||||
#endif
|
|
||||||
static ACT scan_routine_header();
|
static ACT scan_routine_header();
|
||||||
static void set_external_flag();
|
static void set_external_flag();
|
||||||
static bool terminator();
|
static bool terminator();
|
||||||
@ -158,9 +121,7 @@ static LLS cur_for;
|
|||||||
static LLS cur_store;
|
static LLS cur_store;
|
||||||
static LLS cur_fetch;
|
static LLS cur_fetch;
|
||||||
static LLS cur_modify;
|
static LLS cur_modify;
|
||||||
static LLS cur_form;
|
|
||||||
static LLS cur_error;
|
static LLS cur_error;
|
||||||
static LLS cur_menu;
|
|
||||||
static LLS routine_stack;
|
static LLS routine_stack;
|
||||||
static GPRE_FLD flag_field;
|
static GPRE_FLD flag_field;
|
||||||
|
|
||||||
@ -244,34 +205,14 @@ ACT PAR_action(TEXT* base_dir)
|
|||||||
return par_based();
|
return par_based();
|
||||||
case KW_CLEAR_HANDLES:
|
case KW_CLEAR_HANDLES:
|
||||||
return par_clear_handles();
|
return par_clear_handles();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_CREATE_WINDOW:
|
|
||||||
return par_window_create();
|
|
||||||
#endif
|
|
||||||
case KW_DATABASE:
|
case KW_DATABASE:
|
||||||
return PAR_database(false, base_dir);
|
return PAR_database(false, base_dir);
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_DELETE_WINDOW:
|
|
||||||
return par_window_delete();
|
|
||||||
#endif
|
|
||||||
case KW_DERIVED_FROM:
|
case KW_DERIVED_FROM:
|
||||||
return par_derived_from();
|
return par_derived_from();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_DISPLAY:
|
|
||||||
return par_form_display();
|
|
||||||
#endif
|
|
||||||
case KW_END_ERROR:
|
case KW_END_ERROR:
|
||||||
return par_end_error();
|
return par_end_error();
|
||||||
case KW_END_FOR:
|
case KW_END_FOR:
|
||||||
return cur_statement = par_end_for();
|
return cur_statement = par_end_for();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_END_FORM:
|
|
||||||
return par_end_form();
|
|
||||||
case KW_END_ITEM:
|
|
||||||
return par_item_end();
|
|
||||||
case KW_END_MENU:
|
|
||||||
return par_end_menu();
|
|
||||||
#endif
|
|
||||||
case KW_END_MODIFY:
|
case KW_END_MODIFY:
|
||||||
return cur_statement = par_end_modify();
|
return cur_statement = par_end_modify();
|
||||||
case KW_END_STREAM:
|
case KW_END_STREAM:
|
||||||
@ -280,10 +221,6 @@ ACT PAR_action(TEXT* base_dir)
|
|||||||
return cur_statement = par_end_store(false);
|
return cur_statement = par_end_store(false);
|
||||||
case KW_END_STORE_SPECIAL:
|
case KW_END_STORE_SPECIAL:
|
||||||
return cur_statement = par_end_store(true);
|
return cur_statement = par_end_store(true);
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_MENU_ENTREE:
|
|
||||||
return par_entree();
|
|
||||||
#endif
|
|
||||||
case KW_ELEMENT:
|
case KW_ELEMENT:
|
||||||
return par_array_element();
|
return par_array_element();
|
||||||
case KW_ERASE:
|
case KW_ERASE:
|
||||||
@ -298,30 +235,14 @@ ACT PAR_action(TEXT* base_dir)
|
|||||||
return cur_statement = par_finish();
|
return cur_statement = par_finish();
|
||||||
case KW_FOR:
|
case KW_FOR:
|
||||||
return par_for();
|
return par_for();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_FOR_FORM:
|
|
||||||
return par_form_for();
|
|
||||||
case KW_FOR_ITEM:
|
|
||||||
return par_item_for(ACT_item_for);
|
|
||||||
case KW_FOR_MENU:
|
|
||||||
return par_menu_for();
|
|
||||||
#endif
|
|
||||||
case KW_END_FETCH:
|
case KW_END_FETCH:
|
||||||
return cur_statement = par_end_fetch();
|
return cur_statement = par_end_fetch();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_CASE_MENU:
|
|
||||||
return par_menu_case();
|
|
||||||
#endif
|
|
||||||
case KW_MODIFY:
|
case KW_MODIFY:
|
||||||
return par_modify();
|
return par_modify();
|
||||||
case KW_ON:
|
case KW_ON:
|
||||||
return par_on();
|
return par_on();
|
||||||
case KW_ON_ERROR:
|
case KW_ON_ERROR:
|
||||||
return par_on_error();
|
return par_on_error();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_PUT_ITEM:
|
|
||||||
return par_item_for(ACT_item_put);
|
|
||||||
#endif
|
|
||||||
case KW_READY:
|
case KW_READY:
|
||||||
return cur_statement = par_ready();
|
return cur_statement = par_ready();
|
||||||
case KW_RELEASE_REQUESTS:
|
case KW_RELEASE_REQUESTS:
|
||||||
@ -334,16 +255,8 @@ ACT PAR_action(TEXT* base_dir)
|
|||||||
return par_store();
|
return par_store();
|
||||||
case KW_START_TRANSACTION:
|
case KW_START_TRANSACTION:
|
||||||
return cur_statement = par_start_transaction();
|
return cur_statement = par_start_transaction();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_SUSPEND_WINDOW:
|
|
||||||
return par_window_suspend();
|
|
||||||
#endif
|
|
||||||
case KW_FUNCTION:
|
case KW_FUNCTION:
|
||||||
return par_function();
|
return par_function();
|
||||||
#ifdef PYXIS
|
|
||||||
case KW_GDS_WINDOWS:
|
|
||||||
return par_window_scope();
|
|
||||||
#endif
|
|
||||||
case KW_PROCEDURE:
|
case KW_PROCEDURE:
|
||||||
return par_procedure();
|
return par_procedure();
|
||||||
|
|
||||||
@ -428,17 +341,6 @@ ACT PAR_action(TEXT* base_dir)
|
|||||||
catch (const std::exception&) {
|
catch (const std::exception&) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
case SYM_form_map:
|
|
||||||
try {
|
|
||||||
PAR_jmp_buf = &env;
|
|
||||||
cur_statement = NULL;
|
|
||||||
return par_form_field();
|
|
||||||
}
|
|
||||||
catch (const std::exception&) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
case SYM_blob:
|
case SYM_blob:
|
||||||
try {
|
try {
|
||||||
PAR_jmp_buf = &env;
|
PAR_jmp_buf = &env;
|
||||||
@ -457,26 +359,6 @@ ACT PAR_action(TEXT* base_dir)
|
|||||||
catch (const std::exception&) {
|
catch (const std::exception&) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
case SYM_menu:
|
|
||||||
try {
|
|
||||||
PAR_jmp_buf = &env;
|
|
||||||
cur_statement = NULL;
|
|
||||||
return par_menu_att();
|
|
||||||
}
|
|
||||||
catch (const std::exception&) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
case SYM_menu_map:
|
|
||||||
try {
|
|
||||||
PAR_jmp_buf = &env;
|
|
||||||
cur_statement = NULL;
|
|
||||||
return par_menu_entree_att();
|
|
||||||
}
|
|
||||||
catch (const std::exception&) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -709,16 +591,16 @@ ACT PAR_database(bool sql, const TEXT* base_directory)
|
|||||||
// FALSE.
|
// FALSE.
|
||||||
//
|
//
|
||||||
|
|
||||||
BOOLEAN PAR_end()
|
bool PAR_end()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((sw_language == lang_ada) ||
|
if ((sw_language == lang_ada) || (sw_language == lang_c) ||
|
||||||
(sw_language == lang_c) ||
|
(isLangCpp(sw_language)))
|
||||||
(isLangCpp(sw_language))) {
|
{
|
||||||
return MATCH(KW_SEMI_COLON);
|
return (MATCH(KW_SEMI_COLON));
|
||||||
}
|
}
|
||||||
|
|
||||||
return KEYWORD(KW_SEMI_COLON);
|
return (KEYWORD(KW_SEMI_COLON));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -863,12 +745,6 @@ void PAR_fini()
|
|||||||
if (cur_error)
|
if (cur_error)
|
||||||
IBERROR("unterminated ON_ERROR clause");
|
IBERROR("unterminated ON_ERROR clause");
|
||||||
|
|
||||||
if (cur_menu)
|
|
||||||
IBERROR("unterminated MENU statement");
|
|
||||||
|
|
||||||
if (cur_form)
|
|
||||||
IBERROR("unterminated FOR_FORM statement");
|
|
||||||
|
|
||||||
if (cur_item)
|
if (cur_item)
|
||||||
IBERROR("unterminated ITEM statement");
|
IBERROR("unterminated ITEM statement");
|
||||||
}
|
}
|
||||||
@ -911,8 +787,7 @@ void PAR_init()
|
|||||||
|
|
||||||
SQL_init();
|
SQL_init();
|
||||||
|
|
||||||
cur_error = cur_fetch = cur_for = cur_modify = cur_store = cur_form =
|
cur_error = cur_fetch = cur_for = cur_modify = cur_store = NULL;
|
||||||
cur_menu = NULL;
|
|
||||||
cur_statement = cur_item = NULL;
|
cur_statement = cur_item = NULL;
|
||||||
bas_extern_flag = false;
|
bas_extern_flag = false;
|
||||||
|
|
||||||
@ -1871,42 +1746,6 @@ static ACT par_end_for()
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse an END_FORM statement.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_end_form()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle a menu entree.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_end_menu()
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
GPRE_CTX context;
|
|
||||||
|
|
||||||
if (!cur_menu)
|
|
||||||
PAR_error("END_MENU not in MENU context");
|
|
||||||
|
|
||||||
request = (GPRE_REQ) POP(&cur_menu);
|
|
||||||
|
|
||||||
if (request->req_flags & REQ_menu_for) {
|
|
||||||
context = request->req_contexts;
|
|
||||||
HSH_remove(context->ctx_symbol);
|
|
||||||
}
|
|
||||||
|
|
||||||
return MAKE_ACTION(request, ACT_menu_end);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2121,50 +1960,6 @@ static ACT par_end_store(bool special)
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle a menu entree.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_entree()
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
ACT action;
|
|
||||||
bool first;
|
|
||||||
|
|
||||||
if (!cur_menu)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
request = (GPRE_REQ) cur_menu->lls_object;
|
|
||||||
|
|
||||||
// Check that this is a case menu, not a dynamic menu.
|
|
||||||
|
|
||||||
if (request->req_flags & REQ_menu_for)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
first = true;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next)
|
|
||||||
if (action->act_type == ACT_menu_entree) {
|
|
||||||
first = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
action = MAKE_ACTION(request, ACT_menu_entree);
|
|
||||||
action->act_object = (REF) par_quoted_string();
|
|
||||||
|
|
||||||
if (first)
|
|
||||||
action->act_flags |= ACT_first_entree;
|
|
||||||
|
|
||||||
if (!MATCH(KW_COLON))
|
|
||||||
SYNTAX_ERROR("colon");
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2283,10 +2078,6 @@ static ACT par_for()
|
|||||||
GPRE_REL relation;
|
GPRE_REL relation;
|
||||||
TEXT s[128];
|
TEXT s[128];
|
||||||
bool dup_symbol;
|
bool dup_symbol;
|
||||||
#ifdef PYXIS
|
|
||||||
if (MATCH(KW_FORM))
|
|
||||||
return par_form_for();
|
|
||||||
#endif
|
|
||||||
symbol = NULL;
|
symbol = NULL;
|
||||||
dup_symbol = false;
|
dup_symbol = false;
|
||||||
|
|
||||||
@ -2338,66 +2129,6 @@ static ACT par_for()
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse a form or menu name, if one is present. Return form
|
|
||||||
// or menu context.
|
|
||||||
//
|
|
||||||
|
|
||||||
static GPRE_CTX par_form_menu( enum sym_t type)
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse a form display/interaction statement.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_form_display()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle a reference to a form field.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_form_field()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse a parenthesed list of form field names.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void par_form_fields( GPRE_REQ request, LLS * stack)
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_form_for()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// A function declaration is interesting in
|
// A function declaration is interesting in
|
||||||
@ -2421,116 +2152,6 @@ static ACT par_function()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse/handle END_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_item_end()
|
|
||||||
{
|
|
||||||
ACT action, prior;
|
|
||||||
GPRE_REQ request;
|
|
||||||
GPRE_CTX context;
|
|
||||||
|
|
||||||
if (!cur_item) {
|
|
||||||
CPR_error("unmatched END_ITEM");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
prior = (ACT) POP((LLS *) & cur_item);
|
|
||||||
request = prior->act_request;
|
|
||||||
context = request->req_contexts;
|
|
||||||
HSH_remove(context->ctx_symbol);
|
|
||||||
action = MAKE_ACTION(request, ACT_item_end);
|
|
||||||
action->act_pair = prior;
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle FOR_ITEM and/or PUT_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_item_for( ACT_T type)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
FORM form;
|
|
||||||
SYM symbol;
|
|
||||||
GPRE_REQ request, parent;
|
|
||||||
GPRE_CTX context;
|
|
||||||
GPRE_FLD field;
|
|
||||||
REF reference;
|
|
||||||
TEXT *form_handle;
|
|
||||||
|
|
||||||
sw_pyxis = TRUE;
|
|
||||||
form_handle = NULL;
|
|
||||||
symbol = PAR_symbol(SYM_dummy);
|
|
||||||
|
|
||||||
if (!MATCH(KW_IN))
|
|
||||||
SYNTAX_ERROR("IN");
|
|
||||||
|
|
||||||
// Pick up parent form or menu context
|
|
||||||
|
|
||||||
if (!(context = par_form_menu(SYM_form_map))) {
|
|
||||||
if (!(context = par_form_menu(SYM_menu)))
|
|
||||||
SYNTAX_ERROR("form context or menu context");
|
|
||||||
else
|
|
||||||
return par_menu_item_for(symbol, context, type);
|
|
||||||
}
|
|
||||||
symbol->sym_type = SYM_form_map;
|
|
||||||
|
|
||||||
parent = context->ctx_request;
|
|
||||||
|
|
||||||
if (!(MATCH(KW_DOT)))
|
|
||||||
SYNTAX_ERROR("period");
|
|
||||||
|
|
||||||
// Pick up form
|
|
||||||
|
|
||||||
form = parent->req_form;
|
|
||||||
|
|
||||||
if (!(field = FORM_lookup_field(form, form->form_object,
|
|
||||||
token.tok_string)))
|
|
||||||
{
|
|
||||||
SYNTAX_ERROR("sub-form name");
|
|
||||||
}
|
|
||||||
|
|
||||||
ADVANCE_TOKEN;
|
|
||||||
|
|
||||||
if (!(form = FORM_lookup_subform(parent->req_form, field)))
|
|
||||||
SYNTAX_ERROR("sub-form name");
|
|
||||||
|
|
||||||
form->form_parent = parent;
|
|
||||||
|
|
||||||
// Set up various data structures
|
|
||||||
|
|
||||||
request = MAKE_REQUEST(REQ_form);
|
|
||||||
request->req_form = form;
|
|
||||||
request->req_form_handle = form_handle;
|
|
||||||
request->req_database = parent->req_database;
|
|
||||||
request->req_trans = parent->req_trans;
|
|
||||||
context = MSC_context(request);
|
|
||||||
context->ctx_symbol = symbol;
|
|
||||||
symbol->sym_object = context;
|
|
||||||
HSH_insert(symbol);
|
|
||||||
action = MAKE_ACTION(request, type);
|
|
||||||
PUSH((GPRE_NOD) action, (LLS *) & cur_item);
|
|
||||||
|
|
||||||
// If this is a FOR_ITEM, generate an index variable
|
|
||||||
|
|
||||||
if (type == ACT_item_for) {
|
|
||||||
field =
|
|
||||||
MET_make_field("ITEM_INDEX", dtype_short, sizeof(SSHORT), FALSE);
|
|
||||||
request->req_index = reference =
|
|
||||||
EXP_post_field(field, context, FALSE);
|
|
||||||
reference->ref_flags |= REF_pseudo;
|
|
||||||
}
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2551,271 +2172,6 @@ static ACT par_left_brace()
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle a reference to a menu attribute.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_menu_att()
|
|
||||||
{
|
|
||||||
ACT_T type;
|
|
||||||
ACT action;
|
|
||||||
GPRE_CTX context;
|
|
||||||
SSHORT first;
|
|
||||||
MENU menu;
|
|
||||||
|
|
||||||
first = token.tok_first;
|
|
||||||
context = par_form_menu(SYM_menu);
|
|
||||||
|
|
||||||
if (MATCH(KW_DOT)) {
|
|
||||||
if (MATCH(KW_TITLE_TEXT))
|
|
||||||
type = ACT_title_text;
|
|
||||||
else if (MATCH(KW_TITLE_LENGTH))
|
|
||||||
type = ACT_title_length;
|
|
||||||
else if (MATCH(KW_TERMINATOR))
|
|
||||||
type = ACT_terminator;
|
|
||||||
else if (MATCH(KW_ENTREE_VALUE))
|
|
||||||
type = ACT_entree_value;
|
|
||||||
else if (MATCH(KW_ENTREE_TEXT))
|
|
||||||
type = ACT_entree_text;
|
|
||||||
else if (MATCH(KW_ENTREE_LENGTH))
|
|
||||||
type = ACT_entree_length;
|
|
||||||
else
|
|
||||||
SYNTAX_ERROR("menu attribute");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SYNTAX_ERROR("period");
|
|
||||||
|
|
||||||
menu = NULL;
|
|
||||||
|
|
||||||
for (action = context->ctx_request->req_actions; action;
|
|
||||||
action = action->act_next) if (action->act_type == ACT_menu_for) {
|
|
||||||
menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!menu)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
action = MAKE_ACTION(context->ctx_request, type);
|
|
||||||
action->act_object = (REF) menu;
|
|
||||||
|
|
||||||
if (first)
|
|
||||||
action->act_flags |= ACT_first;
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_menu_case()
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
ACT action;
|
|
||||||
|
|
||||||
sw_pyxis = TRUE;
|
|
||||||
request = MAKE_REQUEST(REQ_menu);
|
|
||||||
PUSH((GPRE_NOD) request, &cur_menu);
|
|
||||||
action = MAKE_ACTION(request, ACT_menu);
|
|
||||||
|
|
||||||
if (MATCH(KW_LEFT_PAREN)) {
|
|
||||||
for (;;)
|
|
||||||
if (MATCH(KW_VERTICAL))
|
|
||||||
request->req_flags |= REQ_menu_pop_up;
|
|
||||||
else if (MATCH(KW_HORIZONTAL))
|
|
||||||
request->req_flags |= REQ_menu_tag;
|
|
||||||
else if (MATCH(KW_TRANSPARENT))
|
|
||||||
request->req_flags |= REQ_transparent;
|
|
||||||
else if (MATCH(KW_MENU_HANDLE)) {
|
|
||||||
request->req_handle = PAR_native_value(false, true);
|
|
||||||
request->req_flags |= REQ_exp_hand;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
EXP_match_paren();
|
|
||||||
}
|
|
||||||
|
|
||||||
action->act_object = (REF) par_quoted_string();
|
|
||||||
|
|
||||||
// We should eat semicolons at the end of case_menu statements.
|
|
||||||
// mao 3/29/89
|
|
||||||
//
|
|
||||||
MATCH(KW_SEMI_COLON);
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse a menu display/interaction statement.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_menu_display( GPRE_CTX context)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
GPRE_REQ display_request;
|
|
||||||
|
|
||||||
action = MAKE_ACTION(context->ctx_request, ACT_menu_display);
|
|
||||||
display_request = MAKE_REQUEST(REQ_menu);
|
|
||||||
display_request->req_flags |= REQ_exp_hand;
|
|
||||||
action->act_object = (REF) display_request;
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
if (MATCH(KW_VERTICAL)) {
|
|
||||||
display_request->req_flags |= REQ_menu_pop_up;
|
|
||||||
display_request->req_flags &= ~REQ_menu_tag;
|
|
||||||
}
|
|
||||||
else if (MATCH(KW_HORIZONTAL)) {
|
|
||||||
display_request->req_flags |= REQ_menu_tag;
|
|
||||||
display_request->req_flags &= ~REQ_menu_pop_up;
|
|
||||||
}
|
|
||||||
else if (MATCH(KW_TRANSPARENT))
|
|
||||||
display_request->req_flags |= REQ_transparent;
|
|
||||||
else if (MATCH(KW_OPAQUE))
|
|
||||||
display_request->req_flags &= ~REQ_transparent;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
PAR_end();
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle a reference to a menu entree attribute.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_menu_entree_att()
|
|
||||||
{
|
|
||||||
ACT_T type;
|
|
||||||
ACT action;
|
|
||||||
GPRE_CTX context;
|
|
||||||
SSHORT first;
|
|
||||||
ENTREE entree;
|
|
||||||
|
|
||||||
first = token.tok_first;
|
|
||||||
context = par_form_menu(SYM_menu_map);
|
|
||||||
|
|
||||||
if (MATCH(KW_DOT)) {
|
|
||||||
if (MATCH(KW_ENTREE_TEXT))
|
|
||||||
type = ACT_entree_text;
|
|
||||||
else if (MATCH(KW_ENTREE_LENGTH))
|
|
||||||
type = ACT_entree_length;
|
|
||||||
else if (MATCH(KW_ENTREE_VALUE))
|
|
||||||
type = ACT_entree_value;
|
|
||||||
else
|
|
||||||
SYNTAX_ERROR("entree attribute");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SYNTAX_ERROR("period");
|
|
||||||
|
|
||||||
entree = NULL;
|
|
||||||
for (action = context->ctx_request->req_actions; action;
|
|
||||||
action = action->act_next) if (action->act_type == ACT_item_for
|
|
||||||
|| action->act_type == ACT_item_put) {
|
|
||||||
entree = (ENTREE) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entree)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
action = MAKE_ACTION(context->ctx_request, type);
|
|
||||||
|
|
||||||
if (first)
|
|
||||||
action->act_flags |= ACT_first;
|
|
||||||
|
|
||||||
action->act_object = (REF) entree;
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_menu_for()
|
|
||||||
{
|
|
||||||
SYM symbol;
|
|
||||||
GPRE_REQ request;
|
|
||||||
GPRE_CTX context;
|
|
||||||
|
|
||||||
sw_pyxis = TRUE;
|
|
||||||
request = MAKE_REQUEST(REQ_menu);
|
|
||||||
request->req_flags |= REQ_menu_for;
|
|
||||||
|
|
||||||
if (MATCH(KW_LEFT_PAREN)) {
|
|
||||||
for (;;)
|
|
||||||
if (MATCH(KW_MENU_HANDLE)) {
|
|
||||||
request->req_handle = PAR_native_value(false, true);
|
|
||||||
request->req_flags |= REQ_exp_hand;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
EXP_match_paren();
|
|
||||||
}
|
|
||||||
|
|
||||||
symbol = PAR_symbol(SYM_dummy);
|
|
||||||
symbol->sym_type = SYM_menu;
|
|
||||||
|
|
||||||
// Set up various data structures
|
|
||||||
|
|
||||||
context = MSC_context(request);
|
|
||||||
context->ctx_symbol = symbol;
|
|
||||||
symbol->sym_object = context;
|
|
||||||
HSH_insert(symbol);
|
|
||||||
PUSH((GPRE_NOD) request, &cur_menu);
|
|
||||||
|
|
||||||
ACT action = MAKE_ACTION(request, ACT_menu_for);
|
|
||||||
MENU a_menu = (MENU) ALLOC(sizeof(menu));
|
|
||||||
action->act_object = (REF) a_menu;
|
|
||||||
a_menu->menu_request = request;
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Handle FOR_ITEM and/or PUT_ITEM for menus.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_menu_item_for( SYM symbol, GPRE_CTX context, ACT_T type)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
GPRE_REQ request, parent;
|
|
||||||
|
|
||||||
sw_pyxis = TRUE;
|
|
||||||
symbol->sym_type = SYM_menu_map;
|
|
||||||
parent = context->ctx_request;
|
|
||||||
|
|
||||||
// Set up various data structures
|
|
||||||
|
|
||||||
request = MAKE_REQUEST(REQ_menu);
|
|
||||||
request->req_flags |= REQ_menu_for_item;
|
|
||||||
|
|
||||||
context = MSC_context(request);
|
|
||||||
context->ctx_symbol = symbol;
|
|
||||||
symbol->sym_object = context;
|
|
||||||
HSH_insert(symbol);
|
|
||||||
action = MAKE_ACTION(request, type);
|
|
||||||
PUSH((GPRE_NOD) action, (LLS *) & cur_item);
|
|
||||||
|
|
||||||
ENTREE a_entree = (ENTREE) ALLOC(sizeof(entree));
|
|
||||||
action->act_object = (REF) a_entree;
|
|
||||||
a_entree->entree_request = parent;
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3082,29 +2438,6 @@ static ACT par_procedure()
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Parse a quoted string.
|
|
||||||
//
|
|
||||||
|
|
||||||
static TEXT *par_quoted_string()
|
|
||||||
{
|
|
||||||
TEXT *string;
|
|
||||||
|
|
||||||
if (!SINGLE_QUOTED(token.tok_type))
|
|
||||||
SYNTAX_ERROR("quoted string");
|
|
||||||
string = (TEXT *) ALLOC(token.tok_length + 1);
|
|
||||||
COPY(token.tok_string, token.tok_length, string);
|
|
||||||
|
|
||||||
// Adjust size to include quotes
|
|
||||||
// FSG 26.Nov.2000
|
|
||||||
//
|
|
||||||
token.tok_length = token.tok_length + 2;
|
|
||||||
ADVANCE_TOKEN;
|
|
||||||
return string;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3653,7 +2986,7 @@ static ACT par_subroutine()
|
|||||||
static ACT par_trans( ACT_T act_op)
|
static ACT par_trans( ACT_T act_op)
|
||||||
{
|
{
|
||||||
ACT action;
|
ACT action;
|
||||||
USHORT parens;
|
bool parens;
|
||||||
|
|
||||||
action = MAKE_ACTION(0, act_op);
|
action = MAKE_ACTION(0, act_op);
|
||||||
|
|
||||||
@ -3750,7 +3083,7 @@ static ACT par_variable()
|
|||||||
GPRE_REQ request;
|
GPRE_REQ request;
|
||||||
GPRE_CTX context;
|
GPRE_CTX context;
|
||||||
USHORT first;
|
USHORT first;
|
||||||
USHORT dot;
|
bool dot;
|
||||||
bool is_null = false;
|
bool is_null = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -3768,7 +3101,7 @@ static ACT par_variable()
|
|||||||
|
|
||||||
if (dot && MATCH(KW_NULL)) {
|
if (dot && MATCH(KW_NULL)) {
|
||||||
is_null = true;
|
is_null = true;
|
||||||
dot = FALSE;
|
dot = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
request = context->ctx_request;
|
request = context->ctx_request;
|
||||||
@ -3813,56 +3146,6 @@ static ACT par_variable()
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_window_create()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_window_delete()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Establish the scope of window declarations,
|
|
||||||
// whether local, external, or global. This
|
|
||||||
// is a purely declarative statement.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_window_scope()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static ACT par_window_suspend()
|
|
||||||
{
|
|
||||||
PAR_error("FORMs not supported");
|
|
||||||
return NULL; /* silence compiler */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3910,7 +3193,9 @@ static ACT scan_routine_header()
|
|||||||
}
|
}
|
||||||
else if (MATCH(KW_INTERNAL) || MATCH(KW_ABNORMAL) ||
|
else if (MATCH(KW_INTERNAL) || MATCH(KW_ABNORMAL) ||
|
||||||
MATCH(KW_VARIABLE) || MATCH(KW_VAL_PARAM))
|
MATCH(KW_VARIABLE) || MATCH(KW_VAL_PARAM))
|
||||||
|
{
|
||||||
MATCH(KW_SEMI_COLON);
|
MATCH(KW_SEMI_COLON);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
extern ACT PAR_action(TEXT*);
|
extern ACT PAR_action(TEXT*);
|
||||||
extern SSHORT PAR_blob_subtype(DBB);
|
extern SSHORT PAR_blob_subtype(DBB);
|
||||||
extern ACT PAR_database(bool, const TEXT*);
|
extern ACT PAR_database(bool, const TEXT*);
|
||||||
extern BOOLEAN PAR_end(void);
|
extern bool PAR_end(void);
|
||||||
extern void PAR_error(const TEXT *);
|
extern void PAR_error(const TEXT *);
|
||||||
extern ACT PAR_event_init(bool);
|
extern ACT PAR_event_init(bool);
|
||||||
extern ACT PAR_event_wait(bool);
|
extern ACT PAR_event_wait(bool);
|
||||||
|
681
src/gpre/pas.cpp
681
src/gpre/pas.cpp
@ -24,7 +24,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: pas.cpp,v 1.15 2003-09-10 19:48:52 brodsom Exp $
|
// $Id: pas.cpp,v 1.16 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -34,7 +34,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../jrd/gds.h"
|
#include "../jrd/gds.h"
|
||||||
#include "../gpre/gpre.h"
|
#include "../gpre/gpre.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../gpre/pat.h"
|
#include "../gpre/pat.h"
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
#include "../gpre/lang_proto.h"
|
#include "../gpre/lang_proto.h"
|
||||||
@ -89,28 +88,9 @@ static void gen_event_wait(ACT, int);
|
|||||||
static void gen_fetch(ACT, int);
|
static void gen_fetch(ACT, int);
|
||||||
static void gen_finish(ACT, int);
|
static void gen_finish(ACT, int);
|
||||||
static void gen_for(ACT, int);
|
static void gen_for(ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_form_display(ACT, int);
|
|
||||||
static void gen_form_end(ACT, int);
|
|
||||||
static void gen_form_for(ACT, int);
|
|
||||||
#endif
|
|
||||||
static void gen_get_or_put_slice(ACT, REF, bool, int);
|
static void gen_get_or_put_slice(ACT, REF, bool, int);
|
||||||
static void gen_get_segment(ACT, int);
|
static void gen_get_segment(ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_item_end(ACT, int);
|
|
||||||
static void gen_item_for(ACT, int);
|
|
||||||
#endif
|
|
||||||
static void gen_loop(ACT, int);
|
static void gen_loop(ACT, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_menu(ACT, int);
|
|
||||||
static void gen_menu_display(ACT, int);
|
|
||||||
static void gen_menu_entree(ACT, int);
|
|
||||||
static void gen_menu_entree_att(ACT, int);
|
|
||||||
static void gen_menu_for(ACT, int);
|
|
||||||
static void gen_menu_item_end(ACT, int);
|
|
||||||
static void gen_menu_item_for(ACT, int);
|
|
||||||
static void gen_menu_request(GPRE_REQ, int);
|
|
||||||
#endif
|
|
||||||
static TEXT *gen_name(TEXT *, REF, bool);
|
static TEXT *gen_name(TEXT *, REF, bool);
|
||||||
static void gen_on_error(ACT, USHORT);
|
static void gen_on_error(ACT, USHORT);
|
||||||
static void gen_procedure(ACT, int);
|
static void gen_procedure(ACT, int);
|
||||||
@ -137,11 +117,6 @@ static void gen_trans(ACT, int);
|
|||||||
static void gen_update(ACT, int);
|
static void gen_update(ACT, int);
|
||||||
static void gen_variable(ACT, int);
|
static void gen_variable(ACT, int);
|
||||||
static void gen_whenever(SWE, int);
|
static void gen_whenever(SWE, int);
|
||||||
#ifdef PYXIS
|
|
||||||
static void gen_window_create(ACT, int);
|
|
||||||
static void gen_window_delete(ACT, int);
|
|
||||||
static void gen_window_suspend(ACT, int);
|
|
||||||
#endif
|
|
||||||
static void make_array_declaration(REF);
|
static void make_array_declaration(REF);
|
||||||
static TEXT *make_name(TEXT *, SYM);
|
static TEXT *make_name(TEXT *, SYM);
|
||||||
static void make_ok_test(ACT, GPRE_REQ, int);
|
static void make_ok_test(ACT, GPRE_REQ, int);
|
||||||
@ -246,21 +221,10 @@ void PAS_action( ACT action, int column)
|
|||||||
case ACT_fetch:
|
case ACT_fetch:
|
||||||
case ACT_finish:
|
case ACT_finish:
|
||||||
case ACT_for:
|
case ACT_for:
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_form_display:
|
|
||||||
case ACT_form_for:
|
|
||||||
#endif
|
|
||||||
case ACT_get_segment:
|
case ACT_get_segment:
|
||||||
case ACT_get_slice:
|
case ACT_get_slice:
|
||||||
case ACT_insert:
|
case ACT_insert:
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_item_for:
|
|
||||||
case ACT_item_put:
|
|
||||||
#endif
|
|
||||||
case ACT_loop:
|
case ACT_loop:
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_menu_for:
|
|
||||||
#endif
|
|
||||||
case ACT_modify:
|
case ACT_modify:
|
||||||
case ACT_open:
|
case ACT_open:
|
||||||
case ACT_prepare:
|
case ACT_prepare:
|
||||||
@ -438,17 +402,6 @@ void PAS_action( ACT action, int column)
|
|||||||
case ACT_for:
|
case ACT_for:
|
||||||
gen_for(action, column);
|
gen_for(action, column);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_form_display:
|
|
||||||
gen_form_display(action, column);
|
|
||||||
break;
|
|
||||||
case ACT_form_end:
|
|
||||||
gen_form_end(action, column);
|
|
||||||
break;
|
|
||||||
case ACT_form_for:
|
|
||||||
gen_form_for(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_get_segment:
|
case ACT_get_segment:
|
||||||
gen_get_segment(action, column);
|
gen_get_segment(action, column);
|
||||||
break;
|
break;
|
||||||
@ -461,43 +414,9 @@ void PAS_action( ACT action, int column)
|
|||||||
case ACT_insert:
|
case ACT_insert:
|
||||||
gen_s_start(action, column);
|
gen_s_start(action, column);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_item_for:
|
|
||||||
case ACT_item_put:
|
|
||||||
gen_item_for(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_item_end:
|
|
||||||
gen_item_end(action, column);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case ACT_loop:
|
case ACT_loop:
|
||||||
gen_loop(action, column);
|
gen_loop(action, column);
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_menu:
|
|
||||||
gen_menu(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_display:
|
|
||||||
gen_menu_display(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_end:
|
|
||||||
break;
|
|
||||||
case ACT_menu_entree:
|
|
||||||
gen_menu_entree(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_menu_for:
|
|
||||||
gen_menu_for(action, column);
|
|
||||||
return;
|
|
||||||
|
|
||||||
case ACT_title_text:
|
|
||||||
case ACT_title_length:
|
|
||||||
case ACT_terminator:
|
|
||||||
case ACT_entree_text:
|
|
||||||
case ACT_entree_length:
|
|
||||||
case ACT_entree_value:
|
|
||||||
gen_menu_entree_att(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
case ACT_on_error:
|
case ACT_on_error:
|
||||||
gen_on_error(action, column);
|
gen_on_error(action, column);
|
||||||
return;
|
return;
|
||||||
@ -567,17 +486,6 @@ void PAS_action( ACT action, int column)
|
|||||||
case ACT_variable:
|
case ACT_variable:
|
||||||
gen_variable(action, column);
|
gen_variable(action, column);
|
||||||
return;
|
return;
|
||||||
#ifdef PYXIS
|
|
||||||
case ACT_window_create:
|
|
||||||
gen_window_create(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_window_delete:
|
|
||||||
gen_window_delete(action, column);
|
|
||||||
return;
|
|
||||||
case ACT_window_suspend:
|
|
||||||
gen_window_suspend(action, column);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
@ -991,12 +899,12 @@ static void gen_blob_open( ACT action, USHORT column)
|
|||||||
reference = blob->blb_reference;
|
reference = blob->blb_reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.pat_condition = action->act_type == ACT_blob_create; /* open or create blob */
|
args.pat_condition = (action->act_type == ACT_blob_create); // open or create blob
|
||||||
args.pat_vector1 = status_vector(action); /* status vector */
|
args.pat_vector1 = status_vector(action); // status vector
|
||||||
args.pat_database = blob->blb_request->req_database; /* database handle */
|
args.pat_database = blob->blb_request->req_database; // database handle
|
||||||
args.pat_request = blob->blb_request; /* transaction handle */
|
args.pat_request = blob->blb_request; // transaction handle
|
||||||
args.pat_blob = blob; /* blob handle */
|
args.pat_blob = blob; // blob handle
|
||||||
args.pat_reference = reference; /* blob identifier */
|
args.pat_reference = reference; // blob identifier
|
||||||
args.pat_ident1 = blob->blb_bpb_ident;
|
args.pat_ident1 = blob->blb_bpb_ident;
|
||||||
|
|
||||||
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open)
|
if ((action->act_flags & ACT_sql) && action->act_type == ACT_blob_open)
|
||||||
@ -1237,7 +1145,7 @@ static int gen_cursor_open( ACT action, GPRE_REQ request, int column)
|
|||||||
args.pat_request = request;
|
args.pat_request = request;
|
||||||
args.pat_database = request->req_database;
|
args.pat_database = request->req_database;
|
||||||
args.pat_vector1 = status_vector(action);
|
args.pat_vector1 = status_vector(action);
|
||||||
args.pat_condition = sw_auto && TRUE;
|
args.pat_condition = sw_auto;
|
||||||
args.pat_string1 = make_name(s, ((OPN) action->act_object)->opn_cursor);
|
args.pat_string1 = make_name(s, ((OPN) action->act_object)->opn_cursor);
|
||||||
args.pat_string3 = request_trans(action, request);
|
args.pat_string3 = request_trans(action, request);
|
||||||
args.pat_value2 = -1;
|
args.pat_value2 = -1;
|
||||||
@ -1277,9 +1185,6 @@ static void gen_database( ACT action, int column)
|
|||||||
BLB blob;
|
BLB blob;
|
||||||
USHORT count;
|
USHORT count;
|
||||||
TPB tpb_val;
|
TPB tpb_val;
|
||||||
#ifdef PYXIS
|
|
||||||
FORM form;
|
|
||||||
#endif
|
|
||||||
int indent;
|
int indent;
|
||||||
REF reference;
|
REF reference;
|
||||||
SSHORT event_count;
|
SSHORT event_count;
|
||||||
@ -1311,13 +1216,6 @@ static void gen_database( ACT action, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ib_fprintf(out_file, "\nvar");
|
ib_fprintf(out_file, "\nvar");
|
||||||
#ifdef PYXIS
|
|
||||||
for (db = isc_databases; db; db = db->dbb_next)
|
|
||||||
for (form = db->dbb_forms; form; form = form->form_next)
|
|
||||||
printa(indent, "%s\t\t: %s gds__handle := nil;\t\t(* form %s *)",
|
|
||||||
form->form_handle, STATIC_STRING,
|
|
||||||
form->form_name->sym_string);
|
|
||||||
#endif
|
|
||||||
for (request = requests; request; request = request->req_routine) {
|
for (request = requests; request; request = request->req_routine) {
|
||||||
if (request->req_flags & REQ_local)
|
if (request->req_flags & REQ_local)
|
||||||
continue;
|
continue;
|
||||||
@ -1426,18 +1324,6 @@ static void gen_database( ACT action, int column)
|
|||||||
printa(indent,
|
printa(indent,
|
||||||
"SQLCODE\t: %s integer := 0;\t\t\t(* SQL status code *)",
|
"SQLCODE\t: %s integer := 0;\t\t\t(* SQL status code *)",
|
||||||
STATIC_STRING);
|
STATIC_STRING);
|
||||||
#ifdef PYXIS
|
|
||||||
if (sw_pyxis) {
|
|
||||||
printa(indent,
|
|
||||||
"gds__window\t\t: [COMMON (gds__window)] gds__handle;\t\t(* window handle *)");
|
|
||||||
printa(indent,
|
|
||||||
"gds__width\t\t: [COMMON (gds__width)] %s;\t(* window width *)",
|
|
||||||
SHORT_DCL);
|
|
||||||
printa(indent,
|
|
||||||
"gds__height\t\t: [COMMON (gds__height)] %s;\t(* window height *)",
|
|
||||||
SHORT_DCL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (all_extern) {
|
else if (all_extern) {
|
||||||
printa(indent,
|
printa(indent,
|
||||||
@ -2336,112 +2222,6 @@ static void gen_for( ACT action, int column)
|
|||||||
gen_get_or_put_slice(action, reference, true, column);
|
gen_get_or_put_slice(action, reference, true, column);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_display( ACT action, int column)
|
|
||||||
{
|
|
||||||
FINT display;
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference, master;
|
|
||||||
POR port;
|
|
||||||
DBB db;
|
|
||||||
TEXT s[32], *status, out[16];
|
|
||||||
int code;
|
|
||||||
|
|
||||||
display = (FINT) action->act_object;
|
|
||||||
request = display->fint_request;
|
|
||||||
db = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
status = (action->act_error) ? "gds__status" : "gds__null^";
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next)
|
|
||||||
if ((master = reference->ref_master) &&
|
|
||||||
(code = CMP_display_code(display, master)) >= 0)
|
|
||||||
printa(column, "%s := %d;", gen_name(s, reference, true), code);
|
|
||||||
|
|
||||||
if (display->fint_flags & FINT_no_wait)
|
|
||||||
strcpy(out, "0");
|
|
||||||
else
|
|
||||||
sprintf(out, "gds__%d", port->por_ident);
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"pyxis__drive_form (%s, %s, %s, gds__window, %s, gds__%d, %s);",
|
|
||||||
status, db->dbb_name->sym_string, request->req_trans,
|
|
||||||
request->req_handle, port->por_ident, out);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "pyxis__pop_window (gds__window);");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a form block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_form_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
FORM form;
|
|
||||||
TEXT *status;
|
|
||||||
DBB db;
|
|
||||||
int indent;
|
|
||||||
|
|
||||||
indent = column + INDENT;
|
|
||||||
request = action->act_request;
|
|
||||||
form = request->req_form;
|
|
||||||
db = request->req_database;
|
|
||||||
status = status_vector(action);
|
|
||||||
|
|
||||||
// Get database attach and transaction started
|
|
||||||
|
|
||||||
if (sw_auto) {
|
|
||||||
printa(column, "if (gds__trans = nil) then");
|
|
||||||
t_start_auto(action, 0, status_vector(action), indent);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get form loaded first
|
|
||||||
|
|
||||||
printa(column, "if %s = nil then", request->req_form_handle);
|
|
||||||
align(indent);
|
|
||||||
ib_fprintf(out_file, "pyxis__load_form (%s, %s, %s, %s, %d, '%s');",
|
|
||||||
status,
|
|
||||||
db->dbb_name->sym_string,
|
|
||||||
request->req_trans,
|
|
||||||
request->req_form_handle,
|
|
||||||
strlen(form->form_name->sym_string),
|
|
||||||
form->form_name->sym_string);
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(column, "if %s = nil then", request->req_handle);
|
|
||||||
printa(indent, "pyxis__compile_map (%s, %s, %s, %d, gds__%d);",
|
|
||||||
status,
|
|
||||||
request->req_form_handle,
|
|
||||||
request->req_handle, request->req_length, request->req_ident);
|
|
||||||
|
|
||||||
// Reset form to known state
|
|
||||||
|
|
||||||
printa(column, "pyxis__reset_form (%s, %s);",
|
|
||||||
status, request->req_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2525,7 +2305,7 @@ static void gen_get_segment( ACT action, int column)
|
|||||||
|
|
||||||
args.pat_blob = blob;
|
args.pat_blob = blob;
|
||||||
args.pat_vector1 = status_vector(action);
|
args.pat_vector1 = status_vector(action);
|
||||||
args.pat_condition = TRUE;
|
args.pat_condition = true;
|
||||||
args.pat_ident1 = blob->blb_len_ident;
|
args.pat_ident1 = blob->blb_len_ident;
|
||||||
args.pat_ident2 = blob->blb_buff_ident;
|
args.pat_ident2 = blob->blb_buff_ident;
|
||||||
args.pat_string1 = SIZEOF;
|
args.pat_string1 = SIZEOF;
|
||||||
@ -2551,114 +2331,6 @@ static void gen_get_segment( ACT action, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
REF reference;
|
|
||||||
POR port;
|
|
||||||
DBB db;
|
|
||||||
TEXT s[32], *status, index[16];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_end(action, column);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = (action->act_error) ? "gds__status" : "gds__null^";
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
column += INDENT;
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(column, "%s := %s + 1;", index, index);
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"pyxis__fetch (%s, %s, %s, %s, gds__%d);",
|
|
||||||
status,
|
|
||||||
request->req_database->dbb_name->sym_string,
|
|
||||||
request->req_trans,
|
|
||||||
request->req_handle, request->req_ports->por_ident);
|
|
||||||
if (action->act_error)
|
|
||||||
ENDS;
|
|
||||||
else
|
|
||||||
END;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
db = request->req_database;
|
|
||||||
port = request->req_ports;
|
|
||||||
|
|
||||||
// Initialize field options
|
|
||||||
|
|
||||||
for (reference = port->por_references; reference;
|
|
||||||
reference = reference->ref_next) if (reference->ref_master)
|
|
||||||
printa(column, "%s := %d;", gen_name(s, reference, true),
|
|
||||||
PYXIS_OPT_DISPLAY);
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"pyxis__insert (%s, %s, %s, %s, gds__%d);",
|
|
||||||
status,
|
|
||||||
db->dbb_name->sym_string,
|
|
||||||
request->req_trans, request->req_handle, port->por_ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_item_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request, parent;
|
|
||||||
FORM form;
|
|
||||||
TEXT *status, index[30];
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
if (request->req_type == REQ_menu) {
|
|
||||||
gen_menu_item_for(action, column);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
column += INDENT;
|
|
||||||
form = request->req_form;
|
|
||||||
parent = form->form_parent;
|
|
||||||
|
|
||||||
status = (action->act_error) ? "gds__status" : "gds__null^";
|
|
||||||
|
|
||||||
// Get map compiled
|
|
||||||
|
|
||||||
printa(column, "if %s = nil then", request->req_handle);
|
|
||||||
printa(column + INDENT,
|
|
||||||
"pyxis__compile_sub_map (%s, %s, %s, %d, gds__%d);", status,
|
|
||||||
parent->req_handle, request->req_handle, request->req_length,
|
|
||||||
request->req_ident);
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
gen_name(index, request->req_index, true);
|
|
||||||
printa(column, "%s := 1;", index);
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"pyxis__fetch (%s, %s, %s, %s, gds__%d);",
|
|
||||||
status,
|
|
||||||
request->req_database->dbb_name->sym_string,
|
|
||||||
request->req_trans,
|
|
||||||
request->req_handle, request->req_ports->por_ident);
|
|
||||||
printa(column, "while (%s <> 0) do", index);
|
|
||||||
column += INDENT;
|
|
||||||
BEGIN;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -2686,257 +2358,6 @@ static void gen_loop( ACT action, int column)
|
|||||||
column -= INDENT;
|
column -= INDENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
printa(column, "case pyxis__menu (gds__window, %s, %d, gds__%d) of",
|
|
||||||
request->req_handle, request->req_length, request->req_ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu interaction.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_display( ACT action, int column)
|
|
||||||
{
|
|
||||||
MENU menu;
|
|
||||||
GPRE_REQ request, display_request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
display_request = (GPRE_REQ) action->act_object;
|
|
||||||
|
|
||||||
menu = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next)
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"pyxis__drive_menu (gds__window, %s, %d, gds__%d, gds__%dl, gds__%d,",
|
|
||||||
request->req_handle,
|
|
||||||
display_request->req_length,
|
|
||||||
display_request->req_ident, menu->menu_title, menu->menu_title);
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"\n\t\t\tgds__%d, gds__%dl, gds__%d, gds__%d);",
|
|
||||||
menu->menu_terminator,
|
|
||||||
menu->menu_entree_entree,
|
|
||||||
menu->menu_entree_entree, menu->menu_entree_value);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_entree( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "%d:", action->act_count);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Generate code for a reference to a menu or entree attribute.
|
|
||||||
|
|
||||||
static void gen_menu_entree_att( ACT action, int column)
|
|
||||||
{
|
|
||||||
MENU menu;
|
|
||||||
SSHORT ident;
|
|
||||||
bool length = false;
|
|
||||||
|
|
||||||
menu = (MENU) action->act_object;
|
|
||||||
|
|
||||||
switch (action->act_type) {
|
|
||||||
case ACT_entree_text:
|
|
||||||
ident = menu->menu_entree_entree;
|
|
||||||
break;
|
|
||||||
case ACT_entree_length:
|
|
||||||
ident = menu->menu_entree_entree;
|
|
||||||
length = true;
|
|
||||||
break;
|
|
||||||
case ACT_entree_value:
|
|
||||||
ident = menu->menu_entree_value;
|
|
||||||
break;
|
|
||||||
case ACT_title_text:
|
|
||||||
ident = menu->menu_title;
|
|
||||||
break;
|
|
||||||
case ACT_title_length:
|
|
||||||
ident = menu->menu_title;
|
|
||||||
length = true;
|
|
||||||
break;
|
|
||||||
case ACT_terminator:
|
|
||||||
ident = menu->menu_terminator;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ident = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length)
|
|
||||||
printa(column, "gds__%dl", ident);
|
|
||||||
else
|
|
||||||
printa(column, "gds__%d", ident);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate code for a menu block.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
request = action->act_request;
|
|
||||||
|
|
||||||
// Get menu created
|
|
||||||
|
|
||||||
if (!(request->req_flags & REQ_exp_hand))
|
|
||||||
printa(column, "pyxis__initialize_menu (%s);", request->req_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate end of block for PUT_ITEM and FOR_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_end( ACT action, int column)
|
|
||||||
{
|
|
||||||
GPRE_REQ request;
|
|
||||||
ENTREE entree;
|
|
||||||
|
|
||||||
entree = (ENTREE) action->act_pair->act_object;
|
|
||||||
request = entree->entree_request;
|
|
||||||
|
|
||||||
if (action->act_pair->act_type == ACT_item_for) {
|
|
||||||
align(column);
|
|
||||||
printa(column,
|
|
||||||
"pyxis__get_entree (%s, gds__%dl, gds__%d, gds__%d, gds__%d);",
|
|
||||||
request->req_handle, entree->entree_entree,
|
|
||||||
entree->entree_entree, entree->entree_value,
|
|
||||||
entree->entree_end);
|
|
||||||
column += INDENT;
|
|
||||||
END;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
ib_fprintf(out_file,
|
|
||||||
"pyxis__put_entree (%s, gds__%dl, gds__%d, gds__%d);",
|
|
||||||
request->req_handle,
|
|
||||||
entree->entree_entree,
|
|
||||||
entree->entree_entree, entree->entree_value);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate insert text for FOR_ITEM and PUT_ITEM
|
|
||||||
// for a dynamic menu.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_item_for( ACT action, int column)
|
|
||||||
{
|
|
||||||
ENTREE entree;
|
|
||||||
GPRE_REQ request;
|
|
||||||
|
|
||||||
if (action->act_type != ACT_item_for)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Build stuff for item loop
|
|
||||||
|
|
||||||
entree = (ENTREE) action->act_object;
|
|
||||||
request = entree->entree_request;
|
|
||||||
|
|
||||||
align(column);
|
|
||||||
printa(column,
|
|
||||||
"pyxis__get_entree (%s, gds__%dl, gds__%d, gds__%d, gds__%d);",
|
|
||||||
request->req_handle, entree->entree_entree, entree->entree_entree,
|
|
||||||
entree->entree_value, entree->entree_end);
|
|
||||||
printa(column, "while (gds__%d = 0) do", entree->entree_end);
|
|
||||||
column += INDENT;
|
|
||||||
BEGIN;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Generate definitions associated with a dynamic menu request.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_menu_request( GPRE_REQ request, int column)
|
|
||||||
{
|
|
||||||
ACT action;
|
|
||||||
MENU menu;
|
|
||||||
ENTREE entree;
|
|
||||||
|
|
||||||
menu = NULL;
|
|
||||||
entree = NULL;
|
|
||||||
|
|
||||||
for (action = request->req_actions; action; action = action->act_next) {
|
|
||||||
if (action->act_type == ACT_menu_for) {
|
|
||||||
menu = (MENU) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if ((action->act_type == ACT_item_for)
|
|
||||||
|| (action->act_type == ACT_item_put)) {
|
|
||||||
entree = (ENTREE) action->act_object;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu) {
|
|
||||||
menu->menu_title = CMP_next_ident();
|
|
||||||
menu->menu_terminator = CMP_next_ident();
|
|
||||||
menu->menu_entree_value = CMP_next_ident();
|
|
||||||
menu->menu_entree_entree = CMP_next_ident();
|
|
||||||
printa(column, "gds__%dl\t: %s;\t\t(* TITLE_LENGTH *)",
|
|
||||||
menu->menu_title, SHORT_DCL);
|
|
||||||
printa(column, "gds__%d\t: %s [1..81] of char;\t\t(* TITLE_TEXT *)",
|
|
||||||
menu->menu_title, PACKED_ARRAY);
|
|
||||||
printa(column, "gds__%d\t: %s;\t\t(* TERMINATOR *)",
|
|
||||||
menu->menu_terminator, SHORT_DCL);
|
|
||||||
printa(column, "gds__%dl\t: %s;\t\t(* ENTREE_LENGTH *)",
|
|
||||||
menu->menu_entree_entree, SHORT_DCL);
|
|
||||||
printa(column, "gds__%d\t: %s [1..81] of char;\t\t(* ENTREE_TEXT *)",
|
|
||||||
menu->menu_entree_entree, PACKED_ARRAY);
|
|
||||||
printa(column, "gds__%d\t: %s;\t\t(* ENTREE_VALUE *)",
|
|
||||||
menu->menu_entree_value, LONG_DCL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entree) {
|
|
||||||
entree->entree_entree = CMP_next_ident();
|
|
||||||
entree->entree_value = CMP_next_ident();
|
|
||||||
entree->entree_end = CMP_next_ident();
|
|
||||||
printa(column, "gds__%dl\t: %s;\t\t(* ENTREE_LENGTH *)",
|
|
||||||
entree->entree_entree, SHORT_DCL);
|
|
||||||
printa(column, "gds__%d\t: %s [1..81] of char;\t\t(* ENTREE_TEXT *)",
|
|
||||||
entree->entree_entree, PACKED_ARRAY);
|
|
||||||
printa(column, "gds__%d\t: %s;\t\t(* ENTREE_VALUE *)",
|
|
||||||
entree->entree_value, LONG_DCL);
|
|
||||||
printa(column, "gds__%d\t: %s;\t\t(* *)",
|
|
||||||
entree->entree_end, SHORT_DCL);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
@ -3075,7 +2496,7 @@ static void gen_put_segment( ACT action, int column)
|
|||||||
|
|
||||||
args.pat_blob = blob;
|
args.pat_blob = blob;
|
||||||
args.pat_vector1 = status_vector(action);
|
args.pat_vector1 = status_vector(action);
|
||||||
args.pat_condition = TRUE;
|
args.pat_condition = true;
|
||||||
args.pat_ident1 = blob->blb_len_ident;
|
args.pat_ident1 = blob->blb_len_ident;
|
||||||
args.pat_ident2 = blob->blb_buff_ident;
|
args.pat_ident2 = blob->blb_buff_ident;
|
||||||
PATTERN_expand(column, pattern1, &args);
|
PATTERN_expand(column, pattern1, &args);
|
||||||
@ -3223,17 +2644,13 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
sw_volatile = FB_DP_VOLATILE;
|
sw_volatile = FB_DP_VOLATILE;
|
||||||
printa(column, " ");
|
printa(column, " ");
|
||||||
|
|
||||||
if (!
|
if (!(request-> req_flags & (REQ_exp_hand | REQ_sql_blob_open |
|
||||||
(request->
|
REQ_sql_blob_create)) && request->req_type != REQ_slice
|
||||||
req_flags & (REQ_exp_hand
|
&& request->req_type != REQ_procedure)
|
||||||
#ifdef PYXIS
|
{
|
||||||
| REQ_menu_for_item
|
|
||||||
#endif
|
|
||||||
| REQ_sql_blob_open |
|
|
||||||
REQ_sql_blob_create)) && request->req_type != REQ_slice
|
|
||||||
&& request->req_type != REQ_procedure)
|
|
||||||
printa(column, "%s\t: %s gds__handle := nil;\t\t(* request handle *)",
|
printa(column, "%s\t: %s gds__handle := nil;\t\t(* request handle *)",
|
||||||
request->req_handle, sw_volatile);
|
request->req_handle, sw_volatile);
|
||||||
|
}
|
||||||
|
|
||||||
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
|
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
|
||||||
printa(column,
|
printa(column,
|
||||||
@ -3271,15 +2688,6 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
case REQ_ddl:
|
case REQ_ddl:
|
||||||
string_type = "DYN";
|
string_type = "DYN";
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "SDL";
|
string_type = "SDL";
|
||||||
break;
|
break;
|
||||||
@ -3305,21 +2713,6 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
reinterpret_cast<int(*)()>(gen_blr), 0, 1))
|
reinterpret_cast<int(*)()>(gen_blr), 0, 1))
|
||||||
IBERROR("internal error during dynamic DDL generation");
|
IBERROR("internal error during dynamic DDL generation");
|
||||||
break;
|
break;
|
||||||
#ifdef PYXIS
|
|
||||||
case REQ_form:
|
|
||||||
string_type = "form map";
|
|
||||||
if (PRETTY_print_form_map(reinterpret_cast<char*>(request->req_blr),
|
|
||||||
reinterpret_cast<int(*)()>(gen_blr), 0, 1))
|
|
||||||
IBERROR("internal error during form map generation");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_menu:
|
|
||||||
string_type = "menu";
|
|
||||||
if (PRETTY_print_menu(reinterpret_cast<char*>(request->req_blr),
|
|
||||||
reinterpret_cast<int(*)()>(gen_blr), 0, 1))
|
|
||||||
IBERROR("internal error during menu generation");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case REQ_slice:
|
case REQ_slice:
|
||||||
string_type = "SDL";
|
string_type = "SDL";
|
||||||
if (PRETTY_print_sdl(reinterpret_cast<char*>(request->req_blr),
|
if (PRETTY_print_sdl(reinterpret_cast<char*>(request->req_blr),
|
||||||
@ -3367,10 +2760,6 @@ static void gen_request( GPRE_REQ request, int column)
|
|||||||
gen_raw(blob->blb_bpb, blob->blb_bpb_length, column);
|
gen_raw(blob->blb_bpb, blob->blb_bpb_length, column);
|
||||||
printa(column, "%s;\n", CLOSE_BRACKET);
|
printa(column, "%s;\n", CLOSE_BRACKET);
|
||||||
}
|
}
|
||||||
#ifdef PYXIS
|
|
||||||
if (request->req_type == REQ_menu)
|
|
||||||
gen_menu_request(request, column);
|
|
||||||
#endif
|
|
||||||
// If this is GET_SLICE/PUT_SLICE, allocate some variables
|
// If this is GET_SLICE/PUT_SLICE, allocate some variables
|
||||||
|
|
||||||
if (request->req_type == REQ_slice) {
|
if (request->req_type == REQ_slice) {
|
||||||
@ -3991,44 +3380,6 @@ static void gen_whenever( SWE label, int column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Create a new window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_create( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column,
|
|
||||||
"pyxis__create_window (gds__window, 0, 0, gds__width, gds__height)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Delete a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_delete( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "pyxis__delete_window (gds__window)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef PYXIS
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Suspend a window.
|
|
||||||
//
|
|
||||||
|
|
||||||
static void gen_window_suspend( ACT action, int column)
|
|
||||||
{
|
|
||||||
|
|
||||||
printa(column, "pyxis__suspend_window (gds__window)");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Generate a declaration of an array in the
|
// Generate a declaration of an array in the
|
||||||
@ -4050,7 +3401,7 @@ static void make_array_declaration( REF reference)
|
|||||||
if (field->fld_array_info->ary_declared)
|
if (field->fld_array_info->ary_declared)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
field->fld_array_info->ary_declared = TRUE;
|
field->fld_array_info->ary_declared = true;
|
||||||
|
|
||||||
if (field->fld_array_info->ary_dtype <= dtype_varying)
|
if (field->fld_array_info->ary_dtype <= dtype_varying)
|
||||||
ib_fprintf(out_file, "gds__%d : %s [",
|
ib_fprintf(out_file, "gds__%d : %s [",
|
||||||
|
@ -24,14 +24,13 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: pat.cpp,v 1.12 2003-09-10 19:48:52 brodsom Exp $
|
// $Id: pat.cpp,v 1.13 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
#include "../jrd/ib_stdio.h"
|
#include "../jrd/ib_stdio.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../gpre/gpre.h"
|
#include "../gpre/gpre.h"
|
||||||
#include "../gpre/form.h"
|
|
||||||
#include "../gpre/pat.h"
|
#include "../gpre/pat.h"
|
||||||
#include "../gpre/gpre_proto.h"
|
#include "../gpre/gpre_proto.h"
|
||||||
#include "../gpre/pat_proto.h"
|
#include "../gpre/pat_proto.h"
|
||||||
@ -195,7 +194,7 @@ void PATTERN_expand( USHORT column, TEXT * pattern, PAT * args)
|
|||||||
pattern += 2;
|
pattern += 2;
|
||||||
switch (oper_iter->ops_type) {
|
switch (oper_iter->ops_type) {
|
||||||
case IF:
|
case IF:
|
||||||
sw_gen = (args->pat_condition);
|
sw_gen = args->pat_condition;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case EL:
|
case EL:
|
||||||
|
@ -91,7 +91,7 @@ struct pat {
|
|||||||
int pat_value4;
|
int pat_value4;
|
||||||
SLONG pat_long1;
|
SLONG pat_long1;
|
||||||
SLONG pat_long2;
|
SLONG pat_long2;
|
||||||
BOOLEAN pat_condition;
|
bool pat_condition;
|
||||||
REF pat_reference;
|
REF pat_reference;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,14 +28,7 @@ typedef int (*PRETTY_print_cb_pfn) ();
|
|||||||
|
|
||||||
extern int PRETTY_print_cdb(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
extern int PRETTY_print_cdb(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
||||||
extern int PRETTY_print_dyn(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
extern int PRETTY_print_dyn(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
||||||
#ifdef PYXIS
|
|
||||||
extern int PRETTY_print_form_map(SCHAR *, PRETTY_print_cb_pfn, SCHAR *,
|
|
||||||
SSHORT);
|
|
||||||
#endif
|
|
||||||
extern int PRETTY_print_mblr(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
extern int PRETTY_print_mblr(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
||||||
#ifdef PYXIS
|
|
||||||
extern int PRETTY_print_menu(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
|
||||||
#endif
|
|
||||||
extern int PRETTY_print_sdl(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
extern int PRETTY_print_sdl(SCHAR *, PRETTY_print_cb_pfn, SCHAR *, SSHORT);
|
||||||
|
|
||||||
#endif /* _GPRE_PRETT_PROTO_H_ */
|
#endif /* _GPRE_PRETT_PROTO_H_ */
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: pretty.cpp,v 1.14 2003-09-10 19:48:52 brodsom Exp $
|
// $Id: pretty.cpp,v 1.15 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -115,15 +115,6 @@ const char *map_strings[] = {
|
|||||||
"SUB_FIELD"
|
"SUB_FIELD"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *menu_strings[] = {
|
|
||||||
"LABEL",
|
|
||||||
"ENTREE",
|
|
||||||
"OPAQUE",
|
|
||||||
"TRANSPARENT",
|
|
||||||
"HORIZONTAL",
|
|
||||||
"VERTICAL"
|
|
||||||
};
|
|
||||||
|
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// Pretty print create database parameter buffer thru callback routine.
|
// Pretty print create database parameter buffer thru callback routine.
|
||||||
@ -235,101 +226,6 @@ int PRETTY_print_dyn(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
int
|
|
||||||
PRETTY_print_form_map(SCHAR * blr,
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Pretty print a form map.
|
|
||||||
//
|
|
||||||
|
|
||||||
int (*routine) (), SCHAR * user_arg, SSHORT language)
|
|
||||||
{
|
|
||||||
ctl ctl_buffer;
|
|
||||||
ctl* control = &ctl_buffer;
|
|
||||||
SCHAR c;
|
|
||||||
int offset, n;
|
|
||||||
SSHORT version, level;
|
|
||||||
|
|
||||||
offset = level = 0;
|
|
||||||
|
|
||||||
if (!routine) {
|
|
||||||
routine = (int (*)()) ib_printf;
|
|
||||||
user_arg = "%.4d %s\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
control->ctl_routine = reinterpret_cast < pfn_ctl_routine > (routine);
|
|
||||||
control->ctl_user_arg = user_arg;
|
|
||||||
control->ctl_blr = control->ctl_blr_start = blr;
|
|
||||||
control->ctl_ptr = control->ctl_buffer;
|
|
||||||
control->ctl_language = language;
|
|
||||||
|
|
||||||
version = BLR_BYTE;
|
|
||||||
|
|
||||||
if (version != PYXIS_MAP_VERSION1)
|
|
||||||
return error(control, offset,
|
|
||||||
"*** dyn version %d is not supported ***\n",
|
|
||||||
version);
|
|
||||||
|
|
||||||
blr_format(control, "PYXIS_MAP_VERSION1,");
|
|
||||||
PRINT_LINE;
|
|
||||||
level++;
|
|
||||||
|
|
||||||
while ((c = BLR_BYTE) != PYXIS_MAP_END) {
|
|
||||||
indent(control, level);
|
|
||||||
if (c >= PYXIS_MAP_FIELD2 && c <= PYXIS_MAP_SUB_FIELD)
|
|
||||||
blr_format(control, "PYXIS_MAP_%s, ",
|
|
||||||
map_strings[c - PYXIS_MAP_FIELD2]);
|
|
||||||
switch (c) {
|
|
||||||
case PYXIS_MAP_MESSAGE:
|
|
||||||
PRINT_BYTE;
|
|
||||||
for (n = PRINT_WORD; n; --n) {
|
|
||||||
PRINT_LINE;
|
|
||||||
indent(control, (SSHORT) (level + 1));
|
|
||||||
print_blr_dtype(control, true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PYXIS_MAP_SUB_FORM:
|
|
||||||
PRINT_STRING;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PYXIS_MAP_SUB_FIELD:
|
|
||||||
PRINT_STRING;
|
|
||||||
|
|
||||||
case PYXIS_MAP_FIELD1:
|
|
||||||
case PYXIS_MAP_FIELD2:
|
|
||||||
PRINT_STRING;
|
|
||||||
PRINT_LINE;
|
|
||||||
indent(control, (SSHORT) (level + 1));
|
|
||||||
PRINT_WORD;
|
|
||||||
if (c != PYXIS_MAP_FIELD1)
|
|
||||||
PRINT_WORD;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PYXIS_MAP_TERMINATOR:
|
|
||||||
case PYXIS_MAP_TERMINATING_FIELD:
|
|
||||||
case PYXIS_MAP_ITEM_INDEX:
|
|
||||||
PRINT_WORD;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PYXIS_MAP_OPAQUE:
|
|
||||||
case PYXIS_MAP_TRANSPARENT:
|
|
||||||
case PYXIS_MAP_TAG:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return error(control, offset, "*** invalid form map ***\n", 0);
|
|
||||||
}
|
|
||||||
PRINT_LINE;
|
|
||||||
}
|
|
||||||
|
|
||||||
blr_format(control, "PYXIS_MAP_END");
|
|
||||||
PRINT_LINE;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int PRETTY_print_mblr(
|
int PRETTY_print_mblr(
|
||||||
SCHAR * blr,
|
SCHAR * blr,
|
||||||
@ -345,77 +241,6 @@ int PRETTY_print_mblr(
|
|||||||
return PRETTY_print_dyn(blr, routine, user_arg, language);
|
return PRETTY_print_dyn(blr, routine, user_arg, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PYXIS
|
|
||||||
int
|
|
||||||
PRETTY_print_menu(SCHAR * blr,
|
|
||||||
//____________________________________________________________
|
|
||||||
//
|
|
||||||
// Pretty print a menu definition.
|
|
||||||
//
|
|
||||||
|
|
||||||
int (*routine) (), SCHAR * user_arg, SSHORT language)
|
|
||||||
{
|
|
||||||
ctl ctl_buffer;
|
|
||||||
ctl* control = &ctl_buffer;
|
|
||||||
SCHAR c;
|
|
||||||
int offset;
|
|
||||||
SSHORT version, level;
|
|
||||||
|
|
||||||
offset = level = 0;
|
|
||||||
|
|
||||||
if (!routine) {
|
|
||||||
routine = (int (*)()) ib_printf;
|
|
||||||
user_arg = "%.4d %s\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
control->ctl_routine = reinterpret_cast < pfn_ctl_routine > (routine);
|
|
||||||
control->ctl_user_arg = user_arg;
|
|
||||||
control->ctl_blr = control->ctl_blr_start = blr;
|
|
||||||
control->ctl_ptr = control->ctl_buffer;
|
|
||||||
control->ctl_language = language;
|
|
||||||
|
|
||||||
version = BLR_BYTE;
|
|
||||||
|
|
||||||
if (version != PYXIS_MENU_VERSION1)
|
|
||||||
return error(control, offset,
|
|
||||||
"*** menu version %d is not supported ***\n",
|
|
||||||
version);
|
|
||||||
|
|
||||||
blr_format(control, "PYXIS_MENU_VERSION1,");
|
|
||||||
PRINT_LINE;
|
|
||||||
level++;
|
|
||||||
|
|
||||||
while ((c = BLR_BYTE) != PYXIS_MENU_END) {
|
|
||||||
indent(control, level);
|
|
||||||
if (c >= PYXIS_MENU_LABEL && c <= PYXIS_MENU_VERTICAL)
|
|
||||||
blr_format(control, "PYXIS_MENU_%s, ",
|
|
||||||
menu_strings[c - PYXIS_MENU_LABEL]);
|
|
||||||
switch (c) {
|
|
||||||
case PYXIS_MENU_ENTREE:
|
|
||||||
PRINT_BYTE;
|
|
||||||
|
|
||||||
case PYXIS_MENU_LABEL:
|
|
||||||
PRINT_STRING;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PYXIS_MENU_HORIZONTAL:
|
|
||||||
case PYXIS_MENU_VERTICAL:
|
|
||||||
case PYXIS_MENU_OPAQUE:
|
|
||||||
case PYXIS_MENU_TRANSPARENT:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return error(control, offset, "*** invalid MENU ***\n", 0);
|
|
||||||
}
|
|
||||||
PRINT_LINE;
|
|
||||||
}
|
|
||||||
|
|
||||||
blr_format(control, "PYXIS_MENU_END");
|
|
||||||
PRINT_LINE;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
PRETTY_print_sdl(SCHAR * blr,
|
PRETTY_print_sdl(SCHAR * blr,
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: sqe.cpp,v 1.17 2003-09-10 19:48:52 brodsom Exp $
|
// $Id: sqe.cpp,v 1.18 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -1063,8 +1063,7 @@ RSE SQE_select(GPRE_REQ request,
|
|||||||
bool union_all = false;
|
bool union_all = false;
|
||||||
|
|
||||||
have_union = true;
|
have_union = true;
|
||||||
if (MATCH(KW_ALL))
|
union_all = MATCH(KW_ALL);
|
||||||
union_all = true;
|
|
||||||
if (!MATCH(KW_SELECT))
|
if (!MATCH(KW_SELECT))
|
||||||
SYNTAX_ERROR("SELECT");
|
SYNTAX_ERROR("SELECT");
|
||||||
|
|
||||||
@ -2465,7 +2464,7 @@ static GPRE_NOD par_primitive_value(GPRE_REQ request,
|
|||||||
node = MAKE_NODE(op->rel_op, 2);
|
node = MAKE_NODE(op->rel_op, 2);
|
||||||
node->nod_count = 1;
|
node->nod_count = 1;
|
||||||
EXP_left_paren("left parenthesis in statistical function");
|
EXP_left_paren("left parenthesis in statistical function");
|
||||||
distinct = (MATCH(KW_DISTINCT));
|
distinct = MATCH(KW_DISTINCT);
|
||||||
if (request) {
|
if (request) {
|
||||||
tmp_map = request->req_map;
|
tmp_map = request->req_map;
|
||||||
request->req_map = NULL;
|
request->req_map = NULL;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: sql.cpp,v 1.19 2003-09-10 19:48:52 brodsom Exp $
|
// $Id: sql.cpp,v 1.20 2003-09-11 02:13:45 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -2553,7 +2553,7 @@ static ACT act_delete(void)
|
|||||||
GPRE_REQ request = MAKE_REQUEST(REQ_mass_update);
|
GPRE_REQ request = MAKE_REQUEST(REQ_mass_update);
|
||||||
UPD update = (UPD) ALLOC(UPD_LEN);
|
UPD update = (UPD) ALLOC(UPD_LEN);
|
||||||
|
|
||||||
SSHORT where = MATCH(KW_WITH);
|
bool where = MATCH(KW_WITH);
|
||||||
if (where && MATCH(KW_CURRENT)) {
|
if (where && MATCH(KW_CURRENT)) {
|
||||||
if (!MATCH(KW_OF))
|
if (!MATCH(KW_OF))
|
||||||
SYNTAX_ERROR("OF <cursor>");
|
SYNTAX_ERROR("OF <cursor>");
|
||||||
@ -2688,7 +2688,7 @@ static ACT act_disconnect(void)
|
|||||||
{
|
{
|
||||||
ACT action = MAKE_ACTION(0, ACT_disconnect);
|
ACT action = MAKE_ACTION(0, ACT_disconnect);
|
||||||
action->act_whenever = gen_whenever();
|
action->act_whenever = gen_whenever();
|
||||||
USHORT all = MATCH(KW_ALL) || MATCH(KW_DEFAULT);
|
bool all = MATCH(KW_ALL) || MATCH(KW_DEFAULT);
|
||||||
|
|
||||||
if (!all) {
|
if (!all) {
|
||||||
if (MATCH(KW_CURRENT))
|
if (MATCH(KW_CURRENT))
|
||||||
@ -3894,7 +3894,7 @@ static ACT act_procedure(void)
|
|||||||
if (!KEYWORD(KW_RETURNING) && !KEYWORD(KW_SEMI_COLON)) {
|
if (!KEYWORD(KW_RETURNING) && !KEYWORD(KW_SEMI_COLON)) {
|
||||||
// parse input references
|
// parse input references
|
||||||
|
|
||||||
BOOLEAN paren = MATCH(KW_LEFT_PAREN);
|
bool paren = MATCH(KW_LEFT_PAREN);
|
||||||
GPRE_FLD field = procedure->prc_inputs;
|
GPRE_FLD field = procedure->prc_inputs;
|
||||||
REF *ref_ptr = &request->req_values;
|
REF *ref_ptr = &request->req_values;
|
||||||
do {
|
do {
|
||||||
@ -3919,7 +3919,7 @@ static ACT act_procedure(void)
|
|||||||
if (MATCH(KW_RETURNING)) {
|
if (MATCH(KW_RETURNING)) {
|
||||||
/* parse output references */
|
/* parse output references */
|
||||||
|
|
||||||
BOOLEAN paren = MATCH(KW_LEFT_PAREN);
|
bool paren = MATCH(KW_LEFT_PAREN);
|
||||||
GPRE_FLD field = procedure->prc_outputs;
|
GPRE_FLD field = procedure->prc_outputs;
|
||||||
REF *ref_ptr = &request->req_references;
|
REF *ref_ptr = &request->req_references;
|
||||||
do {
|
do {
|
||||||
@ -4386,7 +4386,7 @@ static ACT act_update(void)
|
|||||||
// then this is a sub-action of an existing request. If not, then it is
|
// then this is a sub-action of an existing request. If not, then it is
|
||||||
// a free standing request
|
// a free standing request
|
||||||
|
|
||||||
SSHORT where = MATCH(KW_WITH);
|
bool where = MATCH(KW_WITH);
|
||||||
if (where && MATCH(KW_CURRENT)) {
|
if (where && MATCH(KW_CURRENT)) {
|
||||||
if (!MATCH(KW_OF))
|
if (!MATCH(KW_OF))
|
||||||
SYNTAX_ERROR("OF cursor");
|
SYNTAX_ERROR("OF cursor");
|
||||||
@ -5095,7 +5095,7 @@ static GPRE_REL make_relation( GPRE_REQ request, const TEXT * relation_name)
|
|||||||
|
|
||||||
relation = MET_make_relation(r);
|
relation = MET_make_relation(r);
|
||||||
relation->rel_database = isc_databases;
|
relation->rel_database = isc_databases;
|
||||||
relation->rel_meta = TRUE;
|
relation->rel_meta = true;
|
||||||
|
|
||||||
if (request)
|
if (request)
|
||||||
request->req_database = isc_databases;
|
request->req_database = isc_databases;
|
||||||
|
@ -27,9 +27,6 @@ KW_start_actions,
|
|||||||
KW_CACHE,
|
KW_CACHE,
|
||||||
KW_CANCEL_BLOB,
|
KW_CANCEL_BLOB,
|
||||||
KW_CASE,
|
KW_CASE,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_CASE_MENU,
|
|
||||||
#endif
|
|
||||||
KW_CHAR,
|
KW_CHAR,
|
||||||
KW_CLEAR_HANDLES,
|
KW_CLEAR_HANDLES,
|
||||||
KW_CLOSE_BLOB,
|
KW_CLOSE_BLOB,
|
||||||
@ -37,17 +34,8 @@ KW_start_actions,
|
|||||||
KW_COMMIT,
|
KW_COMMIT,
|
||||||
KW_CONSTRAINT,
|
KW_CONSTRAINT,
|
||||||
KW_CREATE_BLOB,
|
KW_CREATE_BLOB,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_CREATE_WINDOW,
|
|
||||||
#endif
|
|
||||||
KW_DATABASE,
|
KW_DATABASE,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_DELETE_WINDOW,
|
|
||||||
#endif
|
|
||||||
KW_DERIVED_FROM,
|
KW_DERIVED_FROM,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_DISPLAY,
|
|
||||||
#endif
|
|
||||||
KW_DOMAIN,
|
KW_DOMAIN,
|
||||||
KW_DOUBLE,
|
KW_DOUBLE,
|
||||||
KW_ELEMENT,
|
KW_ELEMENT,
|
||||||
@ -56,11 +44,6 @@ KW_start_actions,
|
|||||||
KW_END_ERROR,
|
KW_END_ERROR,
|
||||||
KW_END_FETCH,
|
KW_END_FETCH,
|
||||||
KW_END_FOR,
|
KW_END_FOR,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_END_FORM,
|
|
||||||
KW_END_ITEM,
|
|
||||||
KW_END_MENU,
|
|
||||||
#endif
|
|
||||||
KW_END_MODIFY,
|
KW_END_MODIFY,
|
||||||
KW_END_STORE,
|
KW_END_STORE,
|
||||||
KW_END_STORE_SPECIAL,
|
KW_END_STORE_SPECIAL,
|
||||||
@ -76,15 +59,7 @@ KW_start_actions,
|
|||||||
KW_FINISH,
|
KW_FINISH,
|
||||||
KW_FLOAT,
|
KW_FLOAT,
|
||||||
KW_FOR,
|
KW_FOR,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_FOR_FORM,
|
|
||||||
KW_FOR_ITEM,
|
|
||||||
KW_FOR_MENU,
|
|
||||||
#endif
|
|
||||||
KW_FUNCTION,
|
KW_FUNCTION,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_GDS_WINDOWS,
|
|
||||||
#endif
|
|
||||||
KW_GET_SEGMENT,
|
KW_GET_SEGMENT,
|
||||||
KW_GET_SLICE,
|
KW_GET_SLICE,
|
||||||
KW_INACTIVE,
|
KW_INACTIVE,
|
||||||
@ -92,9 +67,6 @@ KW_start_actions,
|
|||||||
KW_KEY,
|
KW_KEY,
|
||||||
KW_LONG,
|
KW_LONG,
|
||||||
KW_L_BRACE,
|
KW_L_BRACE,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_MENU_ENTREE,
|
|
||||||
#endif
|
|
||||||
KW_MODIFY,
|
KW_MODIFY,
|
||||||
KW_MONTH,
|
KW_MONTH,
|
||||||
KW_NATIONAL,
|
KW_NATIONAL,
|
||||||
@ -105,9 +77,6 @@ KW_start_actions,
|
|||||||
KW_PREPARE,
|
KW_PREPARE,
|
||||||
KW_PROC,
|
KW_PROC,
|
||||||
KW_PROCEDURE,
|
KW_PROCEDURE,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_PUT_ITEM,
|
|
||||||
#endif
|
|
||||||
KW_PUT_SEGMENT,
|
KW_PUT_SEGMENT,
|
||||||
KW_PUT_SLICE,
|
KW_PUT_SLICE,
|
||||||
KW_READY,
|
KW_READY,
|
||||||
@ -181,19 +150,11 @@ KW_start_actions,
|
|||||||
KW_DESCRIPTOR,
|
KW_DESCRIPTOR,
|
||||||
KW_DIALECT,
|
KW_DIALECT,
|
||||||
KW_DISCONNECT,
|
KW_DISCONNECT,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_DISPLAYING,
|
|
||||||
#endif
|
|
||||||
KW_DISTINCT,
|
KW_DISTINCT,
|
||||||
KW_DOT,
|
KW_DOT,
|
||||||
KW_DOT_DOT,
|
KW_DOT_DOT,
|
||||||
KW_DROP,
|
KW_DROP,
|
||||||
KW_END_EXEC,
|
KW_END_EXEC,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_ENTREE_LENGTH,
|
|
||||||
KW_ENTREE_TEXT,
|
|
||||||
KW_ENTREE_VALUE,
|
|
||||||
#endif
|
|
||||||
KW_ENTRY_POINT,
|
KW_ENTRY_POINT,
|
||||||
KW_EQ,
|
KW_EQ,
|
||||||
KW_EQUALS,
|
KW_EQUALS,
|
||||||
@ -209,10 +170,6 @@ KW_start_actions,
|
|||||||
KW_FILTER,
|
KW_FILTER,
|
||||||
KW_FIRST,
|
KW_FIRST,
|
||||||
KW_FOREIGN,
|
KW_FOREIGN,
|
||||||
#ifdef PYXIS
|
|
||||||
KW_FORM,
|
|
||||||
KW_FORM_HANDLE,
|
|
||||||
#endif
|
|
||||||
KW_FORWARD,
|
KW_FORWARD,
|
||||||
KW_FOUND,
|
KW_FOUND,
|
||||||
KW_FROM,
|
KW_FROM,
|
||||||
|
Loading…
Reference in New Issue
Block a user