mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-12 06:19:33 -06:00
bugfix for print names in the C runtime and expose the functionality from Java
This commit is contained in:
@@ -1146,6 +1146,19 @@ Java_org_grammaticalframework_pgf_Concr_hasLinearization(JNIEnv* env, jobject se
|
||||
return res;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_org_grammaticalframework_pgf_Concr_getPrintName(JNIEnv* env, jobject self, jstring jid)
|
||||
{
|
||||
PgfConcr* concr = get_ref(env, self);
|
||||
GuPool* tmp_pool = gu_local_pool();
|
||||
PgfCId id = j2gu_string(env, jid, tmp_pool);
|
||||
GuString name = pgf_print_name(concr, id);
|
||||
jstring jname = (name == NULL) ? NULL : gu2j_string(env, name);
|
||||
gu_pool_free(tmp_pool);
|
||||
|
||||
return jname;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_grammaticalframework_pgf_Pool_alloc(JNIEnv* env, jclass clazz)
|
||||
{
|
||||
|
||||
@@ -79,6 +79,10 @@ public class Concr {
|
||||
*/
|
||||
public native boolean hasLinearization(String fun);
|
||||
|
||||
/** returns the print name for that function or category.
|
||||
*/
|
||||
public native String getPrintName(String id);
|
||||
|
||||
/** If the concrete syntaxes in the grammar are stored in external
|
||||
* files then this method can be used to load the current syntax
|
||||
* in memory.
|
||||
|
||||
Reference in New Issue
Block a user