grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Re: [Grammatica-users] How can I generate grammar at run-time?


From: Ламер
Subject: Re: Re: Re: [Grammatica-users] How can I generate grammar at run-time?
Date: Thu, 22 Apr 2010 13:47:30 +0400

thanks for replying me..

 

Actually, there is some difficulties with the grammar file.

They will be written by users, it'll be hard for them to write it.

 

Let me explain,

/* file f1 tells the structure of input string, */

<<${title}>>, ${date}, ${time} \n

${text}

 

/*input string*/

<<My news>>, 21 apr 2010, 15.45

Lot's of text coming here

 

---------------------------------------------

Output will be a HashMap

 -key-       -value-

${title}       My news

${date}      21 apr 2010

${time}      15.45

 

f1 will change for different types of input,

 

22.04.10, 11:16, "Oliver Gramberg" <address@hidden>:


Hi, Ламер,

> thanks,but actually by saying "at run-time" I mean that
> it is decided dynamically how to parse an input string. I

> want to write flexible formatter of incomingdocuments of
> different structures. And metadata from thattexts will be
> retrieved according to some files that containgrammar. It
> would be useful for write another file of grammar, than

> rewriting the code.

I'm getting lost in the details here, but it stillseems to me that Grammatica's "--parse" action does the samething as you describe. Think about it: It reads a grammar, builds a parseron the fly, and parses an input according to that grammar, all in one go.Isn't that in principle what you want to do? So, even if you cannot useGrammatica as is, have a look at the sources--it's free, isn't it?--reusethe parser generator code on a high level and roll your own!

What is your preferred programming language?

Regards
Oliver


--
Яндекс.Почта. Письма есть. Спама - нет. http://mail.yandex.ru/nospam/sign
reply via email to

[Prev in Thread] Current Thread [Next in Thread]