lua-users home
lua-l archive

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


Ok. Never mind on this question. I've got it to work.

On Thu, 20 Jun 2019 at 12:09, Kees Jan Hermans <foxkjhermans@gmail.com> wrote:
>
> Also (I'm unfamiliar with Lua native module building): do I build your
> github code using something other than:
>
> $ export C_INCLUDE_PATH=/usr/include/lua5.1
> $ make && sudo make install
>
> In other words: is there a specific Lua toolchain related command that
> I can fire off inside that directory that will automatically build and
> install it in the Lua world?
>
> On Wed, 19 Jun 2019 at 14:31, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:
> >
> > > I've just finished reading Mr Ierusalemschi's 2008 paper on Lua
> > > Parsing Expression Grammars, and I'm very enthusiastic about the
> > > possibilities of PEG in general. Especially the intermediate language
> > > that it produces (because I want to play with creating an engine that
> > > executes that code). And there lies a bit of a problem for me: I
> > > cannot seem to make the traditional PEG libraries output the
> > > intermediate language, for example in the form that is also used in
> > > the paper (the 'ASM' of the language, with the instructions 'Char',
> > > 'Jump', etc). Is there a way to use the PEG library much more
> > > modularly, in a way that, for example, a C compiler can generally also
> > > output ASM? Thanks!
> >
> > The current version (now at github [1]) has a method to print
> > these bytecodes. ('pattern:pcode()', when compiled with LPEG_DEBUG
> > defined.) However, there is no explicit way to export or have
> > other access to the code. But it shouldn't be difficult for another
> > library to access that code inside the corresponding userdata.
> > (See the print function 'lp_printcode' for inspiration.)
> >
> > Please keep in mind that the current instruction set is different from
> > the one used back there in that paper, but the general idea is the same.
> >
> > [1] https://github.com/roberto-ieru/LPeg
> >
> > -- Roberto
> >