|
Boost Users : |
Subject: Re: [Boost-users] Spirit with UI Tools
From: Larry Evans (cppljevans_at_[hidden])
Date: 2014-11-04 08:34:24
On 11/04/2014 06:01 AM, Philipp Kraus wrote:
> Hello
>
> Am 03.11.2014 um 15:45 schrieb Larry Evans <cppljevans_at_[hidden]>:
>
>> Why couldn't you use Spirit to describe spirit grammar? IOW,
>> a grammar has a syntax:
>>
>> grammar = +production;
>> productions = +(terminal|non_terminal|action);
>> non_termainal = non_term_1|non_term_2|...|non_term_Nnon;
>> terminal = term_1|term_2|...|term_Nterm;
>> action = act_1|act_2|...|act_Nact;
>
> I know this, but I would like to shown the plain text grammar in a structure like (E)BNF
> for documentation.
>
That's why I thought parsing the grammar from a "plain text file" was
what you needed. I confess I didn't understand the UI part of your
subject line. Googling I found:
Is that more like what you want? In particular:
http://www.antlr3.org/works/screenshots/editor.jpg
>
>> Couldn't this grammar be described using spirit, and that spirit
>> "source" grammar could be used to *read* your the grammar you actually
>> want from a file and create the actual "target" grammar you want?
>
> The grammar shouldnt read from a file at runtime, it should be build-in
>
>> After all, I don't see what Antlr would buy you because, IIUC, you'll
>> havde to do essentially the same thing, except using Antlr you have to
>> learn to systems, Antlr as well as spirit.
>
> AntLR is a nice tool to create a visual representation of the grammar and
> it can be also helpful during the developing of the grammar. In my case
> I would like to create a logical language and dont want to create a
> hard encoding spirit code, so I would like to design the grammar in a
> UI tool and create from the visual representation the Spirit code and
> paste it in my class file which create parser & lexer.
>
> UI Grammer Modelling -> Spirit Code Generator -> Spirit Code -> Lexer / Parser
>
> Hope this is a bit clearer. Did you know a UI modeling tool or anything helpful for this
> developing process?
>
The one mentioned above, http://www.antlr3.org/works/, looks like a UI
modeling tool, but I've never used it and don't know if it can be used
to generate a qi grammar. I kinda doubt it since I guess it's used
to create a java implementation of the parser, not a c++, qi based one
:(
> Thanks
>
> Phil
>
-regards,
Larry
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net