mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
another attempt to port the robust parser to MacOS
This commit is contained in:
@@ -7,7 +7,6 @@ pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libgu.pc libpgf.pc
|
||||
|
||||
configincludedir = $(libdir)/libgu/include
|
||||
nodist_configinclude_HEADERS = guconfig.h
|
||||
|
||||
guincludedir=$(includedir)/gu
|
||||
guinclude_HEADERS = \
|
||||
@@ -103,7 +102,7 @@ bin_PROGRAMS = \
|
||||
utils/pgf-translate
|
||||
|
||||
utils_pgf2yaml_SOURCES = utils/pgf2yaml.c
|
||||
utils_pgf2yaml_LDADD = libpgf.la libgu.la
|
||||
utils_pgf2yaml_LDADD = libpgf.la libgu.la
|
||||
|
||||
utils_pgf_print_SOURCES = utils/pgf-print.c
|
||||
utils_pgf_print_LDADD = libpgf.la libgu.la
|
||||
@@ -119,5 +118,4 @@ EXTRA_DIST = \
|
||||
Doxyfile \
|
||||
DoxygenLayout.xml \
|
||||
libgu.pc.in \
|
||||
libpgf.pc.in \
|
||||
guconfig.h.in
|
||||
libpgf.pc.in
|
||||
|
||||
@@ -12,7 +12,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
AC_CONFIG_HEADERS([config.h guconfig.h])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
AC_CHECK_LIB(m,nan)
|
||||
@@ -35,12 +35,7 @@ fi]
|
||||
AC_C_ALIGNOF
|
||||
AC_C_FAM_IN_MEM
|
||||
AC_C_STATEMENT_EXPRESSIONS
|
||||
|
||||
m4_define([ORIG_DEFINE],m4_defn([AC_DEFINE]))
|
||||
m4_define([_ORIG_DEFINE],m4_defn([_AC_DEFINE]))
|
||||
m4_pushdef([AC_DEFINE],[ORIG_DEFINE([GU_$1],[$2],[$3])])
|
||||
AC_C_ASCII
|
||||
m4_popdef([AC_DEFINE])
|
||||
|
||||
dnl Doxygen support
|
||||
DX_PS_FEATURE(OFF)
|
||||
|
||||
@@ -171,7 +171,7 @@ gu_malloc_init(GuPool* pool, size_t size, const void* init)
|
||||
|
||||
|
||||
|
||||
#ifdef GU_HAVE_STATEMENT_EXPRESSIONS
|
||||
#ifdef HAVE_STATEMENT_EXPRESSIONS
|
||||
#define gu_new_i(pool, type, ...) \
|
||||
({ \
|
||||
type *gu_new_p_ = gu_new(type, pool); \
|
||||
@@ -179,12 +179,12 @@ gu_malloc_init(GuPool* pool, size_t size, const void* init)
|
||||
sizeof(type)); \
|
||||
gu_new_p_; \
|
||||
})
|
||||
#else // GU_HAVE_STATEMENT_EXPRESSIONS
|
||||
#else // HAVE_STATEMENT_EXPRESSIONS
|
||||
#define gu_new_i(pool, type, ...) \
|
||||
((type*)gu_malloc_init_aligned((pool), sizeof(type), \
|
||||
gu_alignof(type), \
|
||||
&(type){ __VA_ARGS__ }))
|
||||
#endif // GU_HAVE_STATEMENT_EXPRESSIONS
|
||||
#endif // HAVE_STATEMENT_EXPRESSIONS
|
||||
|
||||
/** @def gu_new_i(pool, type, ...)
|
||||
*
|
||||
|
||||
@@ -304,6 +304,7 @@ gu_buf_out(GuBuf* buf, GuPool* pool)
|
||||
bout->stream.output = gu_buf_out_output;
|
||||
bout->stream.begin_buf = gu_buf_outbuf_begin;
|
||||
bout->stream.end_buf = gu_buf_outbuf_end;
|
||||
bout->stream.flush = NULL;
|
||||
bout->buf = buf;
|
||||
return gu_new_out(&bout->stream, pool);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ gu_format_string(GuPool* pool, const char* fmt, ...)
|
||||
GuString
|
||||
gu_str_string(const char* str, GuPool* pool)
|
||||
{
|
||||
#ifdef GU_CHAR_ASCII
|
||||
#ifdef CHAR_ASCII
|
||||
return gu_utf8_string((const uint8_t*) str, strlen(str), pool);
|
||||
#else
|
||||
GuPool* tmp_pool = gu_local_pool();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GU_SYSDEPS_H_
|
||||
#define GU_SYSDEPS_H_
|
||||
|
||||
#include <guconfig.h>
|
||||
#include <config.h>
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
# define GU_GNUC
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#ifdef GU_GNUC
|
||||
# define GU_ALIGNOF __alignof
|
||||
# define GU_HAVE_STATEMENT_EXPRESSIONS
|
||||
# define GU_GNUC_ATTR(x) __attribute__(( x ))
|
||||
# if defined(__OPTIMIZE_SIZE__)
|
||||
# define GU_OPTIMIZE_SIZE
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include <gu/ucs.h>
|
||||
#include <gu/assert.h>
|
||||
#include <guconfig.h>
|
||||
#include <config.h>
|
||||
|
||||
GU_DEFINE_TYPE(GuUCSExn, abstract, _);
|
||||
|
||||
|
||||
#ifdef GU_CHAR_ASCII
|
||||
#ifdef CHAR_ASCII
|
||||
|
||||
bool
|
||||
gu_char_is_valid(char c)
|
||||
@@ -36,7 +36,7 @@ gu_ucs_char(GuUCS uc, GuExn* err)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // defined(GU_CHAR_ASCII)
|
||||
#else // defined(CHAR_ASCII)
|
||||
|
||||
static const char gu_ucs_ascii[128] =
|
||||
"\0\0\0\0\0\0\0\a\b\t\n\v\f\r\0\0"
|
||||
|
||||
@@ -29,7 +29,7 @@ inline GuUCS
|
||||
gu_char_ucs(char c)
|
||||
{
|
||||
gu_require(gu_char_is_valid(c));
|
||||
#ifdef GU_CHAR_ASCII
|
||||
#ifdef CHAR_ASCII
|
||||
GuUCS u = (GuUCS) c;
|
||||
#else
|
||||
extern const uint8_t gu_ucs_ascii_reverse_[CHAR_MAX];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <gu/assert.h>
|
||||
#include <gu/utf8.h>
|
||||
#include <guconfig.h>
|
||||
#include <config.h>
|
||||
|
||||
GuUCS
|
||||
gu_utf8_decode(const uint8_t** src_inout)
|
||||
@@ -180,7 +180,7 @@ gu_utf32_out_utf8(const GuUCS* src, size_t len, GuOut* out, GuExn* err)
|
||||
|
||||
}
|
||||
|
||||
#ifndef GU_CHAR_ASCII
|
||||
#ifndef CHAR_ASCII
|
||||
|
||||
void gu_str_out_utf8_(const char* str, GuOut* out, GuExn* err)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ gu_in_utf8(GuIn* in, GuExn* err)
|
||||
inline char
|
||||
gu_in_utf8_char(GuIn* in, GuExn* err)
|
||||
{
|
||||
#ifdef GU_CHAR_ASCII
|
||||
#ifdef CHAR_ASCII
|
||||
int i = gu_in_peek_u8(in);
|
||||
if (i >= 0 && i < 0x80) {
|
||||
gu_in_consume(in, 1);
|
||||
@@ -55,7 +55,7 @@ gu_utf8_decode(const uint8_t** utf8);
|
||||
inline void
|
||||
gu_str_out_utf8(const char* str, GuOut* out, GuExn* err)
|
||||
{
|
||||
#ifdef GU_CHAR_ASCII
|
||||
#ifdef CHAR_ASCII
|
||||
gu_out_bytes(out, (const uint8_t*) str, strlen(str), err);
|
||||
#else
|
||||
extern void
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/* Define to 1 if character literals use ASCII encoding */
|
||||
#undef GU_CHAR_ASCII
|
||||
@@ -297,11 +297,11 @@ struct PgfPArg {
|
||||
PgfCCatIds* hypos;
|
||||
};
|
||||
|
||||
GU_DECLARE_TYPE(PgfPArg, struct);
|
||||
extern GU_DECLARE_TYPE(PgfPArg, struct);
|
||||
|
||||
typedef GuSeq PgfPArgs;
|
||||
|
||||
GU_DECLARE_TYPE(PgfPArgs, GuSeq);
|
||||
extern GU_DECLARE_TYPE(PgfPArgs, GuSeq);
|
||||
|
||||
typedef struct {
|
||||
PgfFunId fun;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/// An abstract syntax tree
|
||||
typedef GuVariant PgfExpr;
|
||||
|
||||
GU_DECLARE_TYPE(PgfExpr, GuVariant);
|
||||
extern GU_DECLARE_TYPE(PgfExpr, GuVariant);
|
||||
|
||||
typedef GuList(PgfExpr) PgfExprs;
|
||||
|
||||
|
||||
@@ -110,13 +110,11 @@ static GU_DEFINE_TYPE(PgfCFCat, struct,
|
||||
|
||||
extern GuHasher pgf_cfcat_hasher;
|
||||
|
||||
typedef GuMap PgfEpsilonIdx;
|
||||
GU_DEFINE_TYPE(PgfEpsilonIdx, GuMap,
|
||||
gu_type(PgfCFCat), &pgf_cfcat_hasher,
|
||||
gu_ptr_type(PgfCCat), &gu_null_struct);
|
||||
|
||||
// GuString -> PgfItemBuf*
|
||||
typedef GuStringMap PgfTransitions;
|
||||
GU_DEFINE_TYPE(PgfTransitions, GuStringMap,
|
||||
gu_ptr_type(PgfItemBuf), &gu_null_struct);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ pgf_read(GuIn* in, GuPool* pool, GuExn* err);
|
||||
|
||||
|
||||
#include <gu/type.h>
|
||||
GU_DECLARE_TYPE(PgfPGF, struct);
|
||||
extern GU_DECLARE_TYPE(PgfPGF, struct);
|
||||
|
||||
/// @}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user