No subject


Thu Oct 26 18:16:52 CEST 2017


is
called in the C code this is i presume valid for most errors coming from th=
e=20=20
gambas parser.

Here we go, there are 3 files to modify in src/comp directory. I assume you=
=20
know what you are doing and if you dont, don't do it, you have been warned.

in gb_error.h ----------------------------------------------
Line 53 add these 2 lines:
 int NumTOKEN;
 int len;

in gb_read.c -----------------------------------------------
Line 252 in function PRIVATE void add_newline()
add
  NumTOKEN=3D0;

then below L. 580 in the function called
  PUBLIC void READ_do(void)
find near line 585
  int len;
and replace it with:
  /*int len;*/

Still below, near line 617 find
  if (car =3D=3D '"')
now everywherebelow where you see an instruction beginning with
 add_
add this just above it:
 NumTOKEN++;

For example...
    if (car =3D=3D '"')
    {
      add_string(); // <- here function beginning with add_
      begin_line =3D FALSE;
      continue;
    }
...becomes
    if (car =3D=3D '"')
    {
      NumTOKEN++; /* <- ADDED BY BERTRAND-XAVIER M.*/
      add_string();
      begin_line =3D FALSE;
      continue;
    }
There are 5 "NumTOKEN++;" to add in this function and this was the hardest=
=20
part.  Though this is not pretty programming as one would do things=20
differently. Don't blame the one who's willing to try, and share. Later you=
=20
might say you've modified manually a lexical analyser written in C!

Lastly in gb_error.c ----------------------------------------
L.129
Change
    for (;;)
so that it looks like:
    char strErrCOL [60];
    sprintf(strErrCOL, "%dth word, %dth character: ", NumTOKEN, len);
    _add_string (strErrCOL);
    for (;;)

And it's time to compile. You don't want to configure and recompile
everything right? Open a console and type
$ cd /home/joe/Gambas-1.0.17/src/comp
$ make
Watch out for some errors reported among a payload of garbage generated by=
=20
make. Tip: gcc compiler always speaks in a clear language, easy to identify=
=20
among chinese. If error occurs check what you've done in the code and start=
=20
make again.
Now open up another console as root, and copy the compiler in /usr/bin:
# cp gbc /usr/bin/gbc

In the meantime the Gambas IDE was still open. Throw some error in your cod=
e=20
like
PUBLIC SUB Main()
PRINT "Hello " & "uhu & "ihi"
END

Run or compile it, he will tell precisely where the error is and have fun.




More information about the Devel mailing list