
Hello
Am 03.11.2014 um 15:45 schrieb Larry Evans
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.
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 shouldn’t 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 don’t 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? Thanks Phil