mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
added Expr.size() in the Java binding
This commit is contained in:
@@ -1575,6 +1575,13 @@ Java_org_grammaticalframework_pgf_Expr_hashCode(JNIEnv* env, jobject self)
|
||||
return pgf_expr_hash(0, e);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_org_grammaticalframework_pgf_Expr_size(JNIEnv* env, jobject self)
|
||||
{
|
||||
PgfExpr e = gu_variant_from_ptr(l2p(get_ref(env, self)));
|
||||
return pgf_expr_size(e);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_org_grammaticalframework_pgf_Type_getCategory(JNIEnv* env, jobject self)
|
||||
{
|
||||
|
||||
@@ -108,6 +108,9 @@ public class Expr implements Serializable {
|
||||
return showExpr(ref);
|
||||
}
|
||||
|
||||
/** Computes the number of functions in the expression */
|
||||
public native int size();
|
||||
|
||||
/** Reads a string in the GF syntax for abstract expressions
|
||||
* and returns an object representing the expression. */
|
||||
public static native Expr readExpr(String s) throws PGFError;
|
||||
|
||||
Reference in New Issue
Block a user