emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tree-sitter and Android port


From: Yuan Fu
Subject: Re: tree-sitter and Android port
Date: Mon, 20 Feb 2023 18:56:40 -0800


> On Feb 20, 2023, at 6:23 AM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
>> I believe the Android port of Emacs is now more or less feature
>> complete.
> 
> I've added support for tree-sitter to the Android port, and ported that
> library to our Android build system as well.
> 
> However, there is one problem.  Android does not let Emacs link with any
> shared libraries or run any executables installed in non-system
> directories, meaning that compiled grammars cannot be installed in a
> useful fashion.  This is done for security reasons, as apparently many
> Android programs have been tricked into executing malicious downloaded
> code in the past.
> 
> Would one of you two (Yuan Fu or Theodor) please ask the tree-sitter
> developers if there is a way to solve this problem (i.e. by having
> tree-sitter provide a way to ``interpret'' uncompiled grammar files.)
> 
> Thanks in advance.

I’ve looked at this before. The “uncompiled grammar file”, grammar.c, not only 
contains static data, but also functions. Some language also requires a 
scanner.cc <http://scanner.cc/> file which contains nontrivial functions. So to 
“interpret” the grammar file you essentially need a C (and sometimes even C++) 
compiler.

Yuan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]