Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-01

complex ini like syntax parser

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

I'm looking for a setting parser for something like this: ------- snips -----
[foo](!)
bar => 1
baz = fff ; comment

; comment
#include "file"
#include => "section"

------- snips --------

Before I'll do this the hard way and write something for myself, is there something like that existed already, or even something that implement part of it, so I could based my code on it instead of writing one for myself ?

Thanks,

Ido

LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110105/b9dffbd1/attachment.html>

Reply by email

Zaher Dirkey
to ik

2011/1/5 ik

Before I'll do this the hard way and write something for myself, is there something like that existed already, or even something that implement part of it, so I could based my code on it instead of writing one for myself ?

In project

http://sourceforge.net/projects/minilib/
You can port Apache syn Highlighter and modify it to highlight your config file
Lazarus\lib\SynHighlighterApache.pas

It is old for me i committed it today, if there is any bug, confirm me please.

Best regards

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110105/89b2587b/attachment.html>

Reply by email

ik
to Zaher Dirkey

2011/1/5 Zaher Dirkey

Show quoted text 14 lines
2011/1/5 ik Before I'll do this the hard way and write something for myself, is there > something like that existed already, or even something that implement part > of it, so I could based my code on it instead of writing one for myself ? > In project http://sourceforge.net/projects/minilib/ You can port Apache syn Highlighter and modify it to highlight your config file Lazarus\lib\SynHighlighterApache.pas

Thanks Zaher, but I'm looking for a parser to read the keys and values, and not syntax highlighter.

Show quoted text 16 lines
It is old for me i committed it today, if there is any bug, confirm me please. Best regards -- Zaher Dirkey -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus Ido

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110105/516d3dd3/attachment.html>

Reply by email

Zaher Dirkey
to ik

2011/1/5 ik

Thanks Zaher, but I'm looking for a parser to read the keys and values, and not syntax highlighter.

Sorry stupid me :P "syntax" word is confused me.

But that file is not just an INI file.
You can try lcl\translations.pas "UpdateStrings" but it is not fit to what your need.

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110105/a0f350ec/attachment.html>

Reply by email

Marco van de Voort
to ik: I'm looking for a setting parser for something like this: ------- snips ----- [foo](!)…
ik wrote 15 lines
I'm looking for a setting parser for something like this: ------- snips ----- [foo](!) bar => 1 baz = fff ; comment ; comment #include "file" #include => "section" ------- snips -------- Before I'll do this the hard way and write something for myself, is there something like that existed already, or even something that implement part of it, so I could based my code on it instead of writing one for myself ?

Really brave people try http://www.stack.nl/~marcov/files/conffile.zip

It is a really old experiment of mine making one parser read many kinds of files. (unix password files, ini files (with additions and modifications), apache/golded keyword based files etc)

It's pretty much "my first OOP", so be careful, but I'm still surprised how far I got.

Reply by email