[Lazarus] WriteLn back to the GUI
pascaldragon at googlemail.com
Fri Oct 25 09:53:33 CEST 2013
Am 25.10.2013 01:06, schrieb ListMember:
> First, I wanted to see if it's possible/hard to work with compiler
> sources under Lazarus.
Considerung that some compiler developers (including me) use Lazarus for
development on FPC: yes, it's definitely possible. Especially debugging
and code completion are very handy here :)
> One of my aims (one which we discussed here a few years ago) is to rip
> the parser and lexer from the compiler. I want to have a token tree
> (including directives) from the mouth of the horse (so to speak).
That will be quite complicated, because the scanner will not output the
directives it parsed (e.g. if you do a "consume(_SEMICOLON)" to parse a
";" any directive between your current position and the next ";" will be
handled and the parser will not be notified of any changes (as a result
of these directives there might be changes in settings variables or
defines however). Also the tree is not really possible to get a hold of,
because a node (e.g. a fornode for a for-in) might be immediately
replaced by a whilenode thus you'll never see that there was a for-in.
Additionally the parser is not geared towards handling erratic code.
There are quite some places where error recovery is tried so that errors
further down can be displayed, but in essence the parser is very bad in
handling erratic code.
> I also want to see how hard it is to turn the compiler into a module
> of the frontend (see my text mode hatred) by getting rid of
> commandline switches (and also of textmode feedback).
Here I'd suggest you to look at the code of the text mode IDE again. It
compiles the compiler itself and passes its own options set in the
FreeVision TUI to the compiler.
> Actually, I am surprised that no one (that I know of) has done this yet.
The text mode IDE is doing it...
> After all, both FPC and all the IDEs (Lazarus, fpGUI, MSEide+MSEgui
> etc.) use FPC but the degree of integration between them is lacking, IMO.
Because by the way it currently is you can easily switch the compiler
version and the compiler target. Each compiled compiler can only compile
for one architecture (but each supported OS of that architecture), so
how would you implement cross platform compilation then?
> Anyway, if nothing else, it will be a great learning experience.
> I love frustration :)
I noticed ^^
More information about the Lazarus