mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
bits of documentation for the .NET binding
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||||||
namespace PGFSharp
|
namespace PGFSharp
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Grammatical Framework grammar.
|
/// This is the class for PGF grammars.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PGF
|
public class PGF
|
||||||
{
|
{
|
||||||
@@ -18,10 +18,10 @@ namespace PGFSharp
|
|||||||
NativeGU.NativeMemoryPool pool;
|
NativeGU.NativeMemoryPool pool;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read grammar from PGF file.
|
/// Reads a grammar with the specified file path.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="fn">filename</param>
|
/// <param name="fn">The path to the file.</param>
|
||||||
/// <returns></returns>
|
/// <returns>an object representing the grammar in memory.</returns>
|
||||||
public static PGF ReadPGF(string fn)
|
public static PGF ReadPGF(string fn)
|
||||||
{
|
{
|
||||||
var obj = new PGF();
|
var obj = new PGF();
|
||||||
@@ -76,10 +76,9 @@ namespace PGFSharp
|
|||||||
public IEnumerable<string> Functions => GetStringList(Native.pgf_iter_functions);
|
public IEnumerable<string> Functions => GetStringList(Native.pgf_iter_functions);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All functions producing the given category name.
|
/// Returns a list with all functions with a given return category.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="catName"></param>
|
/// <param name="catName">The name of the return category.</param>
|
||||||
/// <returns></returns>
|
|
||||||
public IEnumerable<string> FunctionByCategory(string catName)
|
public IEnumerable<string> FunctionByCategory(string catName)
|
||||||
{
|
{
|
||||||
using (var str = new Native.NativeString(catName))
|
using (var str = new Native.NativeString(catName))
|
||||||
@@ -89,9 +88,9 @@ namespace PGFSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get type from function name.
|
/// Returns the type of the function with the given name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="funName"></param>
|
/// <param name="funName">The name of the function.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Type FunctionType(string funName)
|
public Type FunctionType(string funName)
|
||||||
{
|
{
|
||||||
@@ -104,10 +103,10 @@ namespace PGFSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reduce expression.
|
/// Normalizes an expression to its normal form by using the 'def' rules in the grammar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="expr"></param>
|
/// <param name="expr">the original expression.</param>
|
||||||
/// <returns></returns>
|
/// <returns>the normalized expression.</returns>
|
||||||
public Expr Compute(Expr expr)
|
public Expr Compute(Expr expr)
|
||||||
{
|
{
|
||||||
var tmp_pool = new NativeGU.NativeMemoryPool();
|
var tmp_pool = new NativeGU.NativeMemoryPool();
|
||||||
@@ -126,9 +125,11 @@ namespace PGFSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enumerate all expressions in the given category.
|
/// Returns an enumerable over the set of all expression in
|
||||||
|
/// the given category. The expressions are enumerated in decreasing
|
||||||
|
/// probability order.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cat"></param>
|
/// <param name="cat">the start category.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public IEnumerable<Expr> GenerateAll(Type cat = null)
|
public IEnumerable<Expr> GenerateAll(Type cat = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<ProjectGuid>{81C13B1B-FE00-4A56-A831-964D55032CDD}</ProjectGuid>
|
<ProjectGuid>{81C13B1B-FE00-4A56-A831-964D55032CDD}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>PGF</RootNamespace>
|
<RootNamespace>PGFSharp</RootNamespace>
|
||||||
<AssemblyName>PGFSharp</AssemblyName>
|
<AssemblyName>PGFSharp</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
@@ -29,6 +29,9 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DocumentationFile>$(OutputPath)PGFSharp.xml</DocumentationFile>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|||||||
Reference in New Issue
Block a user