LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2007, 04:06 PM   #1
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
data exporter specification format


BNF is standard for defining data parsers in terms of meta objects. This is not suitable for defining how a program will export data, however, because it's context-independent and is more of a "may" specification than a "will" specification.

I am looking for some sort of standard for specifying a data export format. An example of what I am looking for might take this form for a C++ code generator:
Code:
<class> ::= "class " [name_val] "{" \
            "public:" \
                 [public_subs] \
            "protected:" \
                 [protected_subs] \
            "private:" \
                 [private_subs] \
            "};"

<function_decl> ::= [storage_type] [return_type] \
                    [name_val] "(" [argument_subs] ")" [abstract_val] ";"

<argument> ::= [argument_type] [name_val]

<argument_group> ::= {value1} ", " {value2}

<sub_object> ::= <indentation> [object]
My example is similar to BNF, however the [] contain argument names, etc. and the definitions define how a specific structure WILL be exported rather than showing which forms it can take on. Does anyone know of a standard like this? Thanks.
ta0kira
 
Old 01-03-2007, 02:10 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I don't understand your doubts. BNF is used to specify different formats. Do you mean a parser that parses the data already written or code that actually exports it (which is a less typical use of BNF)?
 
Old 01-03-2007, 05:23 PM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
I'm looking for a standard way to express an exportation format for generated source code. I need to represent a general output format (such as "classes will be output with format C") and a way to specify classes themselves ("class A has members X, Y, and Z".) I think BNF will work for the class format specification, which will be compiled into a shared lib for the code generator. I will need separate libs for the specific classes that will be fed through the format library when the source code is generated, so I suppose I can just represent those as C++ structures that the format library can utilize. It would make a lot more sense if explained in UML, but regardless I've figured it out. Basically it's going to be a multi-step process where the program will help to write itself. If I get it done any time soon I will post a link! Thanks.
ta0kira
 
Old 01-03-2007, 06:40 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Upon further though, it turns out it will be WAY too complex for the end user in terms of learning curve with pure input files. I guess that leaves me with a GUI, which is much more suitable. I've got a lot of work ahead of me!
ta0kira
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Specification of the CorelDraw (cdr) format SteQve Programming 1 01-17-2006 11:30 AM
HttpServletRequest data format InJesus Programming 0 12-29-2005 12:59 PM
Format the data 25 times openbysource Red Hat 2 12-18-2005 08:45 AM
Is it possible to recover data from format? nbccbn Linux - General 1 11-30-2003 05:03 AM
how to format a HD without leaving any trace of old data? BrianK General 23 02-07-2003 06:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration