-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create GF source files from a CF file #150
Comments
It doesn't look like it's a simple case of just connecting the components. These are the functions responsible for producing the canonical gf grammar for gf-core/src/compiler/GF/Compile/GrammarToCanonical.hs Lines 36 to 37 in 85038d0
gf-core/src/compiler/GF/Compile/GrammarToCanonical.hs Lines 74 to 75 in 85038d0
and they require a gf-core/src/compiler/GF/Grammar/Grammar.hs Lines 85 to 105 in 85038d0
They convert it to the gf-core/src/compiler/GF/Grammar/Canonical.hs Lines 22 to 131 in 85038d0
which is then printed directly using gf-core/src/compiler/GF/Compiler.hs Lines 74 to 78 in 85038d0
So if one manage to write a function for converting a gf-core/src/compiler/GF/Compile/CFGtoPGF.hs Lines 20 to 21 in 85038d0
|
I see, thanks for digging into it @anka-213! Abstract syntax is quite easy to copy and paste together, once you open the cf file in the GF shell and then type the commands Motivation for my question is to recreate this work https://github.com/smucclaw/sandbox/tree/default/aarne#readme , where the pipeline involves automatically producing first a CF grammar, then converting it to a GF grammar and continuing to refine the rules manually. But it may well be that the first step of string-based GF grammar is not even necessary, and one could jump right into RGL-based concrete syntax, which inevitably needs human effort. (Or an automated script, but that's not a matter of GF compiler to do it.) |
I want to be able to do this:
I infer from this line that this has been an intention 12 years ago.
gf-core/src/compiler/GF/CompilerAPI.hs
Line 63 in 85038d0
However, this line shows that it has never worked:
gf-core/src/compiler/GF/CompilerAPI.hs
Line 89 in 85038d0
I see also that the conversion from cf goes directly into PGF here without going to GF source code first:
gf-core/src/compiler/GF/Compiler.hs
Lines 111 to 123 in 85038d0
Is there any way to piece together generation of GF source code from existing code, such as using any functions that produce canonical GF? I have already tried to use the
-f canonical_gf
flag, but it doesn't work for cf files as input, only for gf files.The text was updated successfully, but these errors were encountered: