Hello Przemek,

Yes! great, this works fine - thx

Gradually i'll explore the new pp to see whether it can replace the need for
supplementary ca-clipper pp passes, which kind of use quite a number of
hacks, which i don't expect to being replicable with harbour's pp (and
perhaps don't need to)

If you don't mind me mentioning, one such things is

--- test.prg ---------------------------------------
#xTRAN %% =>

#ifndef _PASS3
             #xTRANSLATE c9type\( o([<_O_>]) [ ,<_ ,...>] ) => VALTYPE
(<_O_> %\% [ ,<_ >] )
#else   _PASS3
_PASS3 #xTRANSLATE c9type\( o([<_O_>]) [ ,<_ ,...>] ) => VALTYPE (<_O_> %\%
[ ,<_ >] )
#endif  _PASS3

proc main ()
       c9type(o(object))
----------------------------------------------------
in my actual header generated code, there's no #ifndef ... #else ... #endif
around the shown #xTRANSLATE, so as to only show

_PASS3 #xTRANSLATE c9type\( o([<_O_>]) [ ,<_ ,...>] ) => VALTYPE (<_O_> %\%
[ ,<_ >] )

which triggering is merely controlled by whether the manifest constant
_PASS3 is defined (with empty value) or not; this enables pass-relevant pp
rules; only, when preprocessing this snippet with -D_PASS3 the compiler
complains about Error E0008  Unknown result marker in #translate/#command,
whereas when _PASS3 is not defined, the very same #xTRANSLATE rule runs fine

Also, it seems that harbour.exe writes to the error device, mentioning the
number of errors and 'No code generated' - could writing to the error device
also be controlled by HB_PP_STRICT_LINEINFO_TOKEN or something similar?  The
ca-clipper compiler always echoes to the std output, which is redirectable
to a file - but this is really not important

PPLIB is a possibility, but in the run i'm hoping to move away from a pp
based transpilation process for my project, only now hoping to switch the
old xharbour pp for this new one of yours, if modifications to the
implementation of the multi-pass approach are minimal.

Kind regards,

frank

----- Original Message ----- From: "Przemyslaw Czerpak" <[EMAIL PROTECTED]>
To: "Harbour Project Main Developer List." <[email protected]>
Sent: Tuesday, May 06, 2008 2:23 AM
Subject: Re: [Harbour] Re: .ppo selectively skips #line ... directives


On Mon, 05 May 2008, frank van nuffel wrote:

Hi Frank,

[>> snip]

OK, now I understand what you are looking for.
Harbour generates #line directives only when necessary.
It means that it does not generate them for empty files or
files which does not have any code which can be passed to
compiler, f.e. files with only empty lines or PP directives.
It's intentional so compiler receives #line tokens only
when it's necessary and should update current file name
and/or counter line number.
Anyhow I can add to PP optional support for strict Clipper
#line directives. I'll try to make it in few minutes and
I'll commit it. This mode will be enabled using some compile
time macro, f.e.: HB_PP_STRICT_LINEINFO_TOKEN. So it will
be enough to recompile Harbour compiler with:
  set C_USR=-DHB_PP_STRICT_LINEINFO_TOKEN
Please test and tell me if its what you need.

BTW if you need PP output then you can write your own
preprocessor as .prg code using functions from PPLIB.

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to