mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-15 15:59:32 -06:00
Fixed c-bindings gfctest
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
gf --make ../../examples/tutorial/embedded/QueryEng.gf &&
|
||||
ghc --make -fglasgow-exts -O2 -no-hs-main $* -c PGFFFI.hs &&
|
||||
ghc --make -fglasgow-exts -O2 -no-hs-main $* gfctest.c gf_lexing.c PGFFFI.hs -o gfctest
|
||||
gf=../../dist/build/gf/gf
|
||||
src=../../src
|
||||
import=-i$src/runtime/haskell:$src/compiler
|
||||
$gf --make ../../examples/tutorial/embedded/QueryEng.gf &&
|
||||
ghc $import --make -fglasgow-exts -O2 -no-hs-main $* -c PGFFFI.hs &&
|
||||
ghc $import --make -fglasgow-exts -O2 -no-hs-main $* gfctest.c PGFFFI.hs -o gfctest # gf_lexing.c
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "pgf.h"
|
||||
#include "gf_lexing.h"
|
||||
// #include "gf_lexing.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -27,9 +27,10 @@ int main(int argc, char *argv[])
|
||||
GF_PGF pgf = gf_readPGF("Query.pgf");
|
||||
GF_Language lang = gf_readLanguage("QueryEng");
|
||||
GF_Type cat = gf_startCat(pgf);
|
||||
char *lexed = gf_stringOp("lextext")("Is 2 prime");
|
||||
// char *lexed = gf_stringOp("lextext", "Is 2 prime");
|
||||
char *lexed = "is 23 odd";
|
||||
GF_Tree *result = gf_parse(pgf, lang, cat, lexed);
|
||||
free(lexed);
|
||||
//free(lexed);
|
||||
GF_Tree *p = result;
|
||||
if (*p) {
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user