Giter Club home page Giter Club logo

Comments (8)

shnewto avatar shnewto commented on June 16, 2024 2

Thanks @vityafx this does seem like it'd be a really nice addition. I'll see what I'm able to figure out and keep you posted.

from bnf.

shnewto avatar shnewto commented on June 16, 2024 2

@vityafx I think exposing the AST would be a very valuable part a feature like this. I plan on incorporating that too, thanks for bringing it up! As far as timeline for progress on this work / series of features, it's likely that it'll be pushed back until January.

from bnf.

vityafx avatar vityafx commented on June 16, 2024 1

If I'm understanding correctly, this might be a way to analyse input that conforms to the parsed grammar?

Yes.

Then we parsed an input string ATCGT, what would you expect to get back?

Yes.
I am not sure (it was many years ago), however, I think it was something like that:

<dna> --> "ATCGT"
   |
   |--------- <base> -------> "A"
   |--------- <dna> -------> "TCGT"
                     |--------- <base> -------> "T"
                     |--------- <dna> -------> "CGT"
                                       |--------- <base> -------> "C"
                                       |--------- <dna> -------> "GT"
                                                         |--------- <base> -------> "G"
                                                         |--------- <dna> -------> "T"
                                                                           |--------- <base> -------> "T"

So, the idea is to see how the data entered by the user fits the grammar, what rules and how are satisfied.

I would also suggest to make output be supported in different formats - in a human-readable one and in, for example, json, because if anyone wanted to create a gui for it, he would need it.

from bnf.

shnewto avatar shnewto commented on June 16, 2024

Ah! Thanks for this suggestion! If I'm understanding correctly, this might be a way to analyse input that conforms to the parsed grammar?

Maybe you could help clarify the output. As a very simple example, if we used the dna grammar from the REAMDE:

<dna> ::= <base> | <base> <dna>
<base> ::= "A" | "C" | "G" | "T";

Then we parsed an input string ATCGT, what would you expect to get back?

Something like this?

<dna> --> 
<base> <dna> --> 
<base> <base> <dna> -->
<base> <base> <base> <dna> -->
<base> <base> <base> <base> <dna> -->
<base> <base> <base> <base> <base>

from bnf.

vityafx avatar vityafx commented on June 16, 2024

Just noticing, it would also be nice to have a possibility to navigate through them, not only see the output. For example, I am remembering the university course for implementing lisp in rust, so I wanna create a translator scheme -> rust to be used by rustc directly. I know the grammar but if I already have a parser which can be done by this issue, it will also be nice to navigate trough the rules and be able to build the ast and then use it (I will probably just convert it to rust ast and feed the rustc with it).

from bnf.

shnewto avatar shnewto commented on June 16, 2024

Time flies like an arrow! I kicked around some work on building an out Earley parser on top of bnf, it seems like a promising solution but I don't know if I'm going to be able to incorporate anything anytime soon. Would welcome anyone who wants to take a stab.

from bnf.

shnewto avatar shnewto commented on June 16, 2024

@vityafx The implementation for this has made it to the main branch, a release is being drafted now and will be published later today.

Wowie, it was a long time coming!

from bnf.

vityafx avatar vityafx commented on June 16, 2024

Indeed! I'll check out, thanks!

from bnf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.