lua-users home
lua-l archive

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


On 02/01/2017 01:26 AM, Luiz Henrique de Figueiredo wrote:
> Since you remove comments, you can reuse the Lua lexer.
> This has the clear benefit that the lexing will be exactly what Lua does.
> 
> To reuse the Lua lexer, consider using my ltokenp
> 	http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html#ltokenp
> 	http://lua-users.org/lists/lua-l/2016-05/msg00028.html
> 
[snip]
> 
> Thanks for sharing lcf.

Thank you for appreciating it.

lcf is a quite long experimental project, started at 2013 with idea of
parser where grammar is presented as lua table, not ad-hoc code,
not write-only regexp. So there is no lexing stage in this parser,
tokens are just subgrammars. (Finite nodes are strings to compare with
input stream or functions which returns true and new stream position
if successfully ate token.)

(I've read about lexing stage relatively recently in dragon
compilers book and frankly speaking see no much need in it in
general.)

-- Martin