| Level
4gl : Page 1
> Level
4gl : Page 3
PAGE 2 : TO
BE PART A ENDUSER4GL EVOLUTION
EndUser4gl Tools : Enduser4gl.lib,EndUser4gl.dsw,endusercompif.cpp,execute.cpp,opcdefine.h,
aso...
The project path
: c:\endUser4gl\4gl\bin\User4gl\Enduser4gl\EndUser4gl.dsw
The EndUser4gl.exe program
is in the repertory : c:\EndUser4gl\4gl\bin\EndUser4gl.exe.
It is obligatory
With each new compilation
of your executions codes, you must transfer the new program
:
c:\endUser4gl\4gl\bin\User4gl\Enduser4gl\debug\EndUser4gl.exe
into the repertory
c:\EndUser4gl\4gl\bin\EndUser4gl.exe.

|
Level 3: The Specialists 4gl: Implementation
Your turn to realize....... Let's go to the
simplest explanations to understand
|
|
The compiler
../FichierCommun/Sysdict.txt
../FichierCommun/Systoken.txt
|
The EndUser4gl
compiler has 2 cycles:
Cycle
1: It is the reading
of the user's program * Eu4glExe and creation
of the symbols
table, syntactic
analyzer, aso.
You can develop
executions codes to create variables, to control instructions,
aso
1) These
possible executions codes are included in the section
from 20000 to 21000:
creation of
only these variables : integer, char, string,
float, double
2) These
possible codes executions are included in the section
from 21001 to 32500:
creation of
controls or else
Cycle
2: It is the second reading ofthe user's
program * Eu4glExe and execution of your actions
through your
executions codes.
The number
section of the executions codes must be > to 32500
up to 2,147,483,647
(it is a long
type)
|
|
Instructions
../FichierCommun/EndUserRules.txt
|
It is practically
the most difficult exercise.
Reflexion on
the creation of an instruction: its goal, its
utility, its optimization.
EndUsergl has
the role to be an OPTIMUM language without being restricted.
There are
enoughdata-processing
languages on the market able to satisfy our data processing
specialists in case of
complex progamming.
EndUser4gl:
It is the art of mastering a function synthesis
or several functions through one instruction
.......
|
|
SUMMARY
:
ENDUSERCOMPIL.CPP
OPCCODEX.H
ENDUSERGL.H
EXECUTE.CPP
|
* create
your token
: EndUserCompil.cpp : #TOKEN xxxxx
* create
your instructions
and/or key words :EndUsercompil.cpp:
#DEFINE-INST <identifying
for the rule > follow-up
<key word of language> or
#DEFINE-MCLE
<identifying
for the rule > follow-up
<key word of language> or
* create your
syntactic rule : EndUsercompil.cpp :
T_INSTRUCTION : ",
"
T_DECLARE_PROCFUNC
",
"
|
M_BEGIN T_INST_LIST M_ENDBEGIN ",
* create your execution
codes
: EndUsercompil.cpp + opccodex.h
"#define CodeCreateVarInteger
20000",
+ your program source cpp :To
create the function which will be called by EXECUTE.CPP
* ADD in
Class ENDUSER4GL.H
: to add your new function
To
create the function which will be called by EXECUTE.CPP:
EndUser4glApp::OPCExecute_user(long
OPCcodeExe) :
* To
add in EXECUTE.CPP your code execution while adding
to it the above created function
|
|
the
fonctions of
compilater
Type
of the variable :
P_INTEGER
P_FLOAT
P_DOUBLE
P_STRING
P_ALNUM
P_NAMEVAR
: Name of the variable
../FichierCommun/Opcsysh.txt
../FichierCommun/Opcdefineh.txt
|
see you Depile fonctions above
Update of
the symbols table : Ex
: a := b;
OPC_Update_TableSymbole( variable
name (a), &adress of value) ../FichierCommun/Excalculcpp.txt
OPC_Update_TableSymboleString( variable (a), &adress of value) ../FichierCommun/Exmovecpp.txt
OPC_CreateGlobalVar_TableSymbole(P_INTEGER,data1,(int)NULL);
OPC_CreateLocalVar_TableSymbole(P_INTEGER,0,data,(int)NULL);
../FichierCommun/Exvarcpp.txt
void OPC_ReturnValuesTabSymbole(\
short int , /* type : P_FLOAT,P_STRING etc... */
short int, /* local : LOCAL ou GLOBAL ou CONTEXTE */
char *, /* Name of the variable */
short int *, /* Taille de la structure : type P_STRUCT, */
short int *, /* nombre d'élément : type P_TABLE */
short int *, /* offset Debut de la variable dans la structure : type P_STRUCT, */
short int *, /* offsetFin de la variable dans la structure : type P_STRUCT, */
short int *, /* longueur decimale de la variable */
short int *, /* longueur de la variable */
void *); /* ./FichierCommun/Excalculcpp.txt
To recover
the index one of dialogue box :
int NumDialog
= OPC_Return_NumDialog(data1);../FichierCommun/Exewinob.txt
To recover
index of the windows :./FichierCommun/Exewinob.txt
Dialog[NumDialog].TabCoordWin[Ival].hWnd
Instruction
EndUser4gl : M_SETNEWPARENTWIN
M_PO L_WIN M_2PP L_WIN M_PF {
CodeExeSetNewParentWin } ",
case CodeExeSetNewParentWin
:
OPCF_Pile_Depile(
P_NAMEVAR, (void *)zone1 );
OPCF_Pile_Depile(
P_INTEGER, (void *)&Ival ) ;
NumDialog
= OPC_Return_NumDialog(zone1);
OPCF_Pile_Depile(
P_NAMEVAR, (void *)zone2 );
OPCF_Pile_Depile(
P_INTEGER, (void *)&Ival2 ) ;
NumDialog2
= OPC_Return_NumDialog(zone2);
OPC_Depile_All();
SetParent(Dialog[NumDialog2].TabCoordWin[Ival2].hWnd,
Dialog[NumDialog].TabCoordWin[Ival].hWnd);//
child,new parent
To empty
the piles of variables : OPC_Depile_All();
After each
execution of a code, the pile must be empty. To
use in the event of precaution...
|
|
Codes
Sources
|
calcul.cpp
: calculette ordinaire
if.cpp
move.cpp
sql.cpp
ExeSynListView.cpp
ExeWinOb.cpp
etc....
The
execution codes
of EnUser4gl ( not includedexewin.cpp,sql.cpp,query.cpp,gif.cpp,grid.cpp....)
|
Example of implementation
:
Creation of an instruction : CycleCompilerEndUser4gl
: <L_STRING>
Objective of this instruction : Demonstration
of 2cycles of EndUser4gl :
C:\ENDUSER4GL\EXAMPLECYCLEENDUSER4GL.EU4GLEXE
Cycle1: Test of the
value < L_string > and posting of one limps of dialogue.
Recall: cycle 1 allows
to create the table of the symbols, analyzes
syntactic and checks desired by the informaticien.(notre example)
Cycle 2: Reading of
the character strings, concatenation with " HTTP: \\"
and access to Internet.
They are the actions of the codes executions
of EndUser4gl.
What is necessary to develop for this demonstration :
In source program EndUserCompil.cpp
:
1°) Creation of the token :
#TOKEN T_4GL
2°) Creation of key word :
#DEFINE-MCLE
M_CYCLECOMPILERENDUSER4GL CYCLECOMPILERENDUSER4GL
3°) Add token : T_4GL at
end of Token T_INSTRUCTIONS and development of instruction
CycleCompilerEndUser4gl :
Extract of Endusercompli.cpp :
"
| T_4GL ;",
// *****************************************************
// PARTICIPATION 4GL :
specialist
// ***************************************************
" T_4GL :
M_CYCLECOMPILERENDUSER4GL M_2PP
L_STRING ",
" {
CodexDemoCycle1 } ",
" {
CodexDemoCycle2 } ; ",
4°) Toujours dans EndUserCompil.cpp,
création des codes éxécutions :
" #define CodexDemoCycle1
20600",
" #define CodexDemoCycle2
70000",
5°) Declarations C/CPP in file
header OPCCODEXE.H
#define CodexDemoCycle1
20600
#define CodexDemoCycle2
70000
6°) Link 2 codes executions
above in the source program: EXECUTE.CPP
Extractt de execute.cpp
:
long EndUser4glApp::OPCExecute_user(long
OPCcodeExe)
{ MSG msg;
/* ************** *****************************************
*/
/* DEMO ENDUSER4GL COMPILER
*/
/************** *****************************************
*/
if((
OPCcodeExe == 20600) || ( OPCcodeExe == 70000)
)
return
OPCExecute_DemoEndUser4gl(OPCcodeExe) ;
7°) Development of the function
:OPCExecute_DemoEndUser4gl(OPCcodeExe) in
the source program : ExedemoendUser.cpp
Development of codes executions
:
Extract of exedemoenduser.cpp
:
long EndUser4glApp ::OPCExecute_DemoEndUser4gl(long
OPCcodeExe)
{ char
valeur1 [MAXBUFLENSTRING] = "\0";
char
url [MAXBUFLENSTRING] = "\0";
char
zone1[C_CMP_TAILLE_NOM_DICT] = "\0";
switch(
OPCcodeExe)
{ case
CodexDemoCycle1 : // 20600
see you: EndUsercompil.cpp/Opccodex.h
OPCF_Pile_Depile(
P_NAMEVAR, (void *)zone1 ); // ***NULL
OPCF_Pile_Depile(
P_STRING, (void *)valeur1 ) ;
OPC_Depile_All();
printfEU("Cycle 1 Enduser4gl Compiler : Action %s ",valeur1);STOP();STOP();
OkMsgBox("Enduser4gl
Compiler ","Waiting...%s",valeur1); break;
case
CodexDemoCycle2 : // 70000
see you: EndUsercompil.cpp/Opccodex.h
OPCF_Pile_Depile(
P_NAMEVAR, (void *)zone1 ); // ***NULL
OPCF_Pile_Depile(
P_STRING, (void *)valeur1 ) ;
OPC_Depile_All();
printfEU("Cycle 2 Enduser4gl Compiler : Action %s ",valeur1);STOP();STOP();
lstrcpy(url,"http://");
lstrcat(url,valeur1);
ShellExecute(NULL,_T("open"),url,_T(""),NULL,0);
8) Creation of your text file with
extension *.Eu4glExe :
c:\endUser4gl\exampleEndUser4lgLib.Eu4glExe.


Bergougnoux
Consulting
14 rue Jean Moulin 37550 St Avertin, Tours FRANCE.
Copyright (c) 2001-2004 Enduser4gl,
Tous droits réservés.
All rights reserved
fax : 00
33 2 47 28 58 19
contact@enduser4gl.com
|