the parser for abstract expressions in the C runtime now supports partial parses

This commit is contained in:
Krasimir Angelov
2017-09-28 13:57:13 +02:00
parent 06ec6b3e92
commit 1c04fa4897
12 changed files with 202 additions and 144 deletions

View File

@@ -46,7 +46,7 @@ namespace PGFSharp
using (var strNative = new Native.NativeString(exprStr))
{
var in_ = NativeGU.gu_data_in(strNative.Ptr, strNative.Size, tmp_pool.Ptr);
var expr = Native.pgf_read_expr(in_, result_pool.Ptr, exn.Ptr);
var expr = Native.pgf_read_expr(in_, result_pool.Ptr, tmp_pool.Ptr, exn.Ptr);
if (exn.IsRaised || expr == IntPtr.Zero)
{
throw new PGFError();

View File

@@ -128,7 +128,7 @@ namespace PGFSharp
public static extern IntPtr pgf_function_type(IntPtr pgf, IntPtr funNameStr);
[DllImport(LIBNAME, CallingConvention = CC)]
public static extern IntPtr pgf_read_type(IntPtr in_, IntPtr pool, IntPtr err);
public static extern IntPtr pgf_read_type(IntPtr in_, IntPtr pool, IntPtr tmp_pool, IntPtr err);
[DllImport(LIBNAME, CallingConvention = CC)]
public static extern void pgf_print_type(IntPtr expr, IntPtr ctxt, int prec, IntPtr output, IntPtr err);
@@ -139,7 +139,7 @@ namespace PGFSharp
public static extern void pgf_print_expr(IntPtr expr, IntPtr ctxt, int prec, IntPtr output, IntPtr err);
[DllImport(LIBNAME, CallingConvention = CC)]
public static extern IntPtr pgf_read_expr(IntPtr in_, IntPtr pool, IntPtr err);
public static extern IntPtr pgf_read_expr(IntPtr in_, IntPtr pool, IntPtr tmp_pool, IntPtr err);
[DllImport(LIBNAME, CallingConvention = CC)]
public static extern IntPtr pgf_compute(IntPtr pgf, IntPtr expr, IntPtr err, IntPtr tmp_pool, IntPtr res_pool);

View File

@@ -43,7 +43,7 @@ namespace PGFSharp
using (var strNative = new Native.NativeString(typeStr))
{
var in_ = NativeGU.gu_data_in(strNative.Ptr, strNative.Size, tmp_pool.Ptr);
var typ = Native.pgf_read_type(in_, result_pool.Ptr, exn.Ptr);
var typ = Native.pgf_read_type(in_, result_pool.Ptr, tmp_pool.Ptr, exn.Ptr);
if (exn.IsRaised || typ == IntPtr.Zero)
{
throw new PGFError();