Re: Ebnf Lexer and Parser generator in nim

2019-08-21 Thread dponyatov
As I read, Nim has seamless with any C libraries and code, so for the lexer, you can use Ragel, it produces readable and compact code with -G2 option (I use it on low-end microcontrollers for command parsing). The more interesting question is Nim able to do backtracking to implement DCG

Re: Ebnf Lexer and Parser generator in nim

2019-08-16 Thread zevv
Hi @spip, Sorry, only noticed your post just now - for future communication feel free to post into the NPeg issues at github so I get properly notified. > It has its own grammar syntax for rules that does not follow (E)BNF like > Nim's pegs This is a design choice: having a grammar parseable

Re: Ebnf Lexer and Parser generator in nim

2019-07-26 Thread spip
npeg has very nice features: * A complete documentation with clear code. * Peg generation at compile time. * AST captures to build an Abstract Syntax Tree while matching the grammar. * Nim code embedding in the rules. * Debugging and tracing functions, with the nice grammar tree view.

Re: Ebnf Lexer and Parser generator in nim

2019-04-10 Thread loloiccl
Add option and repeat in [https://github.com/loloiccl/nimly/pull/22](https://github.com/loloiccl/nimly/pull/22)

Re: Ebnf Lexer and Parser generator in nim

2019-04-05 Thread Araq
Ah please support "0 or more", it sucks to write simple loops as recursion.

Re: Ebnf Lexer and Parser generator in nim

2019-04-04 Thread loloiccl
nimly support only BNF now. For example, these are missing now. * option ([else] in) : IF cond THEN exp [else] * 0 or more ({param} in): PROC NAME RPAR {param} LPAR But you can write BNF which equal to these. I will support EBNF later

Re: Ebnf Lexer and Parser generator in nim

2019-04-04 Thread zevv
I'm taking the liberty to shamelessly mention my recent project here, as this seems the appropriate thread to do so: NPeg is a PEG-style parser generator which allows free mixing of grammar and Nim code, which should be suitable for the task of lexing and parsing. It can collect simple string

Re: Ebnf Lexer and Parser generator in nim

2019-04-04 Thread Araq
Wow, nimly looks nice. Don't have the time to try it. When you say "EBNF not supported" what exactly is missing?

Ebnf Lexer and Parser generator in nim

2019-04-04 Thread loloiccl
I made a BNF lexer/parser generator library ([https://github.com/loloiccl/nimly)](https://github.com/loloiccl/nimly\)). (unfortunately, EBNF is not supported now)