|
Post by alexfish on Nov 21, 2014 8:10:36 GMT 1
Hi all in attachments is source code for a M4BASIC IDE Compile cc m4ide.c -o m4ide `pkg-config --cflags --libs gtk+-2.0 gtksourceview-2.0` usage:: new file must be saved or file loaded , after edits file must be saved , prior to compiling left panel = Main Code top right panel = converted M4BASIC to C.. bottom right panel = log file views or feed back from exec command to set a exec command click tools Set Command . enter command IE ./hello then one can select SYSTEM mode or EXEC mode , if test exec requires terminal input opt for System Have Fun + BR Alex Attachments:m4ide.c.tar.bz2 (4.5 KB)
|
|
|
Post by Pjot on Nov 21, 2014 21:11:46 GMT 1
Thanks Alex,
Works as advertised - interesting concept is the side panel with the code preview!
BR Peter
|
|
|
Post by alexfish on Nov 22, 2014 14:56:23 GMT 1
Hi Peter
Thanks for Testing the ide , think this can be taken further , here thinking BaCon Scratch Pad
have also done a one for Bacon and Brasic .. MM! What is Brasic about
Well to cut a long story Short .
I like The Concept of M4BASIC , yet there are some short comings + think you aware of the bugs which relate to the short comings
The main one as far I was concerned is working with GUI aps .. Do have Elementary Working , No on point of Testing some Bits of GTK
In End did some mods to The M4 code + using code from Brasic.
Hope U can see what the below code is doing. with respect to the Existing M4 code
INCLUDE "brasic1.h" /* Global Defines */
INTEGER D , p , b DOUBLE a,n STRING GH, KK LONG GG ,DD
/* Subs and Functions */
SUB lop()
ENDSUB
FUNC Tesy(int l)
RETURN TRUE
ENDFUNC
FUNC Testy2(char* string) TYPE char*
RETURN "OK"
ENDFUNC
/* Main ---------------*/
MAIN
INTEGER HH , NN
LET GH="5"
PRINT(GH)
/*note in some instances no need for Let or Set */
GH=CONCAT(GH,"test")
EXIT
Will PM Details Later , since it be a while since I did some M4BASIC , it needs more Testing. + Think a Bit of GTK be a bonus.
BR Alex
|
|
|
Post by alexfish on Nov 22, 2014 23:20:32 GMT 1
Hi Peter & All just rounding up ob the M4BASIC Elementary side using the original IDE to see what can be done with it M4BASIC wise , will now test Gtk. See Screen-shot Re M4basic + Elementary. BR Alex Attachments:
|
|
|
Post by vovchik on Nov 23, 2014 9:07:31 GMT 1
Dear Alex, Looks extremely good and it is really convenient to have those panes...a manifestation of the "PITA" principle ("Paning Is The Answer"). With kind regards, vovchik
|
|
|
Post by alexfish on Nov 25, 2014 21:19:30 GMT 1
Hi Vovchik
Looking at the PITA's side of things
have managed to implement Original M4basic with an include as in the M4 macro include ,at the appropriate junction
did a quick test and looks fine..
so looks like the two panes will work , one for the defines + subs and functions other for the original as in Main
looking at layout side of things , what think of U , as to the layout if 3 pane , 1 pane left and 2 pane right or 2 pane left and one pane right
+ where think best for menu + what code to which panes ? best ?
BR Alex
|
|
|
Post by vovchik on Nov 25, 2014 22:10:07 GMT 1
Dear Alex, One pane left and two panes right, with the menu where it is (top of left pane) looks good to me. Geany also has a bottom pane for compiler/status/error messages that is useful, but that may be a PITA overload. With kind regards, vovchik
|
|
|
Post by alexfish on Nov 26, 2014 19:24:45 GMT 1
Dear Alex, One pane left and two panes right, with the menu where it is (top of left pane) looks good to me. Geany also has a bottom pane for compiler/status/error messages that is useful, but that may be a PITA overload. With kind regards, vovchik Hi Vovchik more or less just an update on progress had some problems during testing .. so a little behind on things , essence been one has to be careful how to declare , came a cropper with M4 DECLARE TYPE and the STRING blagh,blag ,there again same can happen with original . + another o how to include and where , and where to divert it , Phew... anyway , now looks as if got the proto type done , best see screen shot If Peter looks at the code then think will understand , so now got M4 BASIC working out of main as per original code. Left pane = the code to compile .. top write is for global defines + subs and functions etc , then bottom right = MAIN can code the MAIN as per original spec or as mentioned with the top pane , if no code in top pane then there be no error saving and loading etc all auto from the the one menu same for compile. now need to clean up a bit + try the GTK bits.. show be no problem to add the compiler log / progress. BR Alex Attachments:
|
|
|
Post by vovchik on Nov 27, 2014 7:58:18 GMT 1
Dear Alex, All of it looks eminently sensible. Eagerly awaiting the next.... With kind regards, vovchik
|
|
|
Post by alexfish on Nov 27, 2014 20:18:28 GMT 1
Hi all Latest M4BASIC(Simple IDE) in the folder is the source : cd to the source and compile with cc m4ide.c -o m4ide `pkg-config --cflags --libs gtk+-2.0 gtksourceview-2.0` leave all in same folder in the folder is note the file type m4.gtk the ide compiles the following formats .m4 ; compile cc .m4.alg ; compile Allegro .m4.gl ; compile GL .m4.gtk ; compile Gtk2 .m4.sdl ; compile Sdl .m4.elm ; compile Elementary
have tested gtk and sdl demos only. the compile commands are direct from Peters M4Basic demos.. usage :: best start by loading the gtk Demo "gtktest.m4.gtk" this will show where things go,, Right pane : top = declares + subs & functions : bottom = Main Save the code , must be done on first load + if new project. Compile the code . left pane will show the C code. if an err occurs the the log-file window will show if compile success then log file should not show Also included is a the original basic.m4 with an addition of and include file as mentioned everything must be in same folder , for now.. as regards file loading . the only trap is for the include file , .inc , if not exist the project will still load the file format must be of the above , if not the possible will get errs or even crash. these will be sorted in time . finally to view results set the Command as previously mentioned as in the case for the gtk demo ./gtktest & Have Fun + BR Alex PS added this one for peter . making Mark up text easy not the use of here there is no line continue "\" required . fact , in most case not required in the IDE IE the dialog message , makes for east edits. CALL dialog = gtk_message_dialog_new_with_markup(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "\n<span foreground='blue'><b>" "M4Basic" "</b></span> " "with " "<span foreground='red'><i>" "GTK" "</i></span>!")
Attachments:M4IDE.tar.bz2 (7.95 KB)
|
|
|
Post by vovchik on Nov 27, 2014 21:56:09 GMT 1
Dear Alex, The IDE compiled fine, but each time I try to load a file, the file selctor opens and then it does nothing. Is the right/latest source in the archive? With kind regards, vovchik
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 27, 2014 22:04:41 GMT 1
Did you try speaking to the IDE?
|
|
|
Post by alexfish on Nov 27, 2014 22:30:07 GMT 1
Hi Vovchik have test the original archive , compiles find but did find one bug.. if use the exec command then top pane code = none same code with fix + the compiled exec , see if exec is working if so make copy . then try compiling again . + are u loading the correct file ? BR Alex Attachments:M4IDE.tar.bz2 (24.38 KB)
|
|
|
Post by alexfish on Nov 27, 2014 22:31:06 GMT 1
Did you try speaking to the IDE? anyway thought show how can rid GUI of the SET AND CALL here showing some bits in the header IE top right pane define(INCLUDE,`_FC #include') define(SINCLUDE,`_FC sinclude') define(DISPLAY,`_FC elm_run() divert(2);divert(1) ') define(INIT,`_FC elm_init(0,0) divert(2);divert(1) ') define(SHOW,`_FC evas_object_show($1) divert(2);divert(1) ') define(HIDE,`_FC evas_object_hide($1) divert(2);divert(1) ') define(SHUTDOWN,`_FC elm_shutdown() divert(2);divert(1) ') define(WIDGET,`_FC Evas_Object divert(2);divert(1) ')
the ($1) = first var within brackets as in SHOW(win) :: INCLUDE "brasic1.h"
WIDGET *win then the code in main looks like INIT LET win=WINDOW("Test",200,300) SHOW(win) DISPLAY
SHUTDOWN
END although best place for these are in the SINCLUDE files BR Alex
|
|
|
Post by alexfish on Nov 30, 2014 16:07:00 GMT 1
@ Vovchik Just kind of wondering if got last M4Basic ide working Now got most things in place as regards :: imports + final refinements to the IDE. SIMPORT = import M4 file and IMPORT = #include. on my side have now ported most of the existing Elementary to a M4Basic Macro's , should be easy to port most of Hug since main struct consists of two types of Macros , + take into account the number of args. back to the IDE the error log window is now fixed , as in sizing now static 200 px high the IDE now has entry to display the compiler directives , can also change the directives be editing the entry. now going for final clean up + debugging , + add some parts out of hug,bac to help get started on the Gtk side. hoping to post next update later part of next week. it will appear in First Post. BR Alex Attachments:
|
|