🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
3 messages
3 total messages Started by Oleg Serebryany Tue, 11 May 1999 00:00
Text file pre-processor
#453
Author: Oleg Serebryany
Date: Tue, 11 May 1999 00:00
24 lines
1708 bytes
Hello All,

I am looking for a way to pre-process a text file (any text file).  Does
anyone know of a tool, component, or just Delphi or Pascal source code
that takes a text file, and using some syntax within the file to:
  - Expand macros
  - Allow conditional inclusion or exclusion of text lines based on
DEFINEs or something along those lines.
  - Include other files

Ideally, this tool would either produce a result text file or return a
Delphi string list with the result text lines.  I prefer to compile the
tool right into the product.  The tool could even be a C-style
pre-processor for handling #define, #include, etc.

Our text file is a large custom data dictionary for a FlashFiler
database.  I would like to use conditional inclusion and macros to
maintain only one copy of this file while supporting all variations of
the core product.

Any help is much appreciated.

Oleg Serebryany
ICG Research Incorporated
Re: Text file pre-processor
#451
Author: A. Moore
Date: Tue, 11 May 1999 00:00
26 lines
1551 bytes
Oleg Serebryany wrote:
> 
> Hello All,
> 
> I am looking for a way to pre-process a text file (any text file).  Does
> anyone know of a tool, component, or just Delphi or Pascal source code
> that takes a text file, and using some syntax within the file to:
>   - Expand macros
>   - Allow conditional inclusion or exclusion of text lines based on
> DEFINEs or something along those lines.
>   - Include other files

<snip>

Probably there is something that could do this specific job.
If you don't find it soon, try looking for TP-Lex and TP-Yacc
from the Simtel collection:

http://www.simtel.net/simtel.net/msdos/turbopas-pre.html
tply30a1.zip and tply30a2.zip.

You can with a little study of the manual and examples,
you can easily create your own.

Regards,
Al Moore
Re: Text file pre-processor
#452
Author: Frank Peelo
Date: Wed, 12 May 1999 00:00
30 lines
1809 bytes
Oleg Serebryany wrote in message
<37387F3E.FB2BC8F1@icgresearch.com>...
>Hello All,
>
>I am looking for a way to pre-process a text file (any text
file).  Does
>anyone know of a tool, component, or just Delphi or Pascal
source code
>that takes a text file, and using some syntax within the file
to:
>  - Expand macros
>  - Allow conditional inclusion or exclusion of text lines based
on
>DEFINEs or something along those lines.
>  - Include other files


Sorry, I don't know of one which you can download, but if you
have a C or C++ compiler you may be able to use its preprocessor.
I have Borland C++ 4.5 on my machine and there is a separate
preprocessor (CPP.EXE) in the package. This takes the source and
just obeys the preprocessor directives, dumping its output to a
text file. (Use -P- or you get file name info in the output
file.) I think it's for debugging complicated macros, but it
sounds like it might be what you're looking for. But where you
get it, I don't know.


FP
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads