On Tue, 15 Dec 2009, Derek Gaston wrote:
> On Dec 15, 2009, at 12:09 PM, Roy Stogner wrote:
>
>> If text in brackets has whitespace in it, it is interpreted as a
>> directive rather than as a section name. I.e.
>> [include.chemistry.in] is a section name, whereas
>> [include chemistry.in] is an include directive that reads the contents
>> of the chemistry.in file (and of any files that chemistry.in includes,
>> depth first).
>
> That's a little twiddly for me. What about using some other type of
> brackets? Like <> so it would be:
>
> <chemistry.in>
Parsing could be uglier. GetPot already uses "{}" for variable
substitution and "Dollar Bracket Expressions", and their DBE operators
include "<->", "<", "<=", ">", and ">=".
>> On the other hand, it would be just as easy to eschew writing Yet
>> Another Meta-Language, and instead just run all input files through a
>> cpp pipe before parsing the result.
>
> We already do something like this... we just open multiple getpot
> objects to multiple input files and parse each one. It works _ok_
> but there is some crappy code in there....
More importantly, the code has to be in user apps, it has to be
repeated for each new app, and you've either got to implement your own
"search-for-include-directives" code or you've got to hard-code the
list of multiple input files. It'd be better in the library. We just
need to figure out an API that works for everybody, is easy to add,
and doesn't include too many nasty side effects.
That's what I like about the first version: effectively no nasty side
effects, since tokens like "[two words]" are pretty much bugs in a
current version getpot input file. Using cpp would be much nicer than
gradually reimplementing cpp poorly, but it would need to be a
non-default option since it would barf at input files which use '#' as
a comment character.
What if we make directives into additional DBE operators?
i.e. ${include chemistry.in}
---
Roy
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel