conflowio / parsley

Parser combinator library written in Go
Mozilla Public License 2.0
30 stars 1 forks source link

Requesting example for a simple language #15

Closed rishavs closed 1 year ago

rishavs commented 1 year ago

Hi

I am trying to use Parsley for a simple language parser but am getting stuck around defining the ast and error handling. It would be great to have a few more examples - particularly of a small programming language like Lua or Lox.

bandesz commented 1 year ago

Hi @rishavs, you can find some examples in https://github.com/conflowio/conflow/tree/main/pkg/parsers.

A complex expression parser supporting variables can be found here: https://github.com/conflowio/conflow/blob/main/pkg/parsers/expression.go

The Conflow language itself is define here: https://github.com/conflowio/conflow/blob/main/pkg/parsers/main.go.

rishavs commented 1 year ago

Thank you!