Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Curtis Wensley
    @cwensley
    indeed that is a logical path
    ArsenShnurkov
    @ArsenShnurkov
    EBNF comes earlier in wikipedia page than ABNF (that is why I did't trie d yet with RFC)
    Curtis Wensley
    @cwensley
    oh yay another format for Eto.Parse to support!
    ArsenShnurkov
    @ArsenShnurkov
    I don't want to use code, because BNF is something what I have a bit of knowledge, and your code model is completely unknown for me
    Curtis Wensley
    @cwensley
    yep, no problem.. hence is why I've added the ebnf, bnf, and gold parsers.. there's just ambiguities that need to be addressed, and recursive descent parsing to take into consideration
    ArsenShnurkov
    @ArsenShnurkov
    oh, now my mistake
    space instead of '-'
    Curtis Wensley
    @cwensley
    yeah you got it.
    ArsenShnurkov
    @ArsenShnurkov
    Ok. Now will do the third attempt to rewrite my grammar
    Curtis Wensley
    @cwensley
    ah, you don't have to change nbody if you changed it that way to 'A', { 'A' }
    that is the 'typical' bnf way of doing things
    er, don't have to move nbody to the end, that is
    ArsenShnurkov
    @ArsenShnurkov
    also, I didn't get what to do constructs similar to { AA - BBB }
    Curtis Wensley
    @cwensley
    what do you mean?
    the AnyChar stuff?
    ArsenShnurkov
    @ArsenShnurkov
    for example - comment line cosists from comment symbols except some sequences
    Curtis Wensley
    @cwensley
    you just can't do { ? Terminals.AnyChar ? } pretty much anywhere in your grammar
    ArsenShnurkov
    @ArsenShnurkov
    yes, but what i should do ?
    Curtis Wensley
    @cwensley
    it will match the rest of the input since well, it'll match one or more of any character
    you need to limit AnyChar to the exception, so { ? Terminals.AnyChar ? - ? Terminals.Eol ? } should match everything up till the newline
    anyway.. off to bed.. it's really late here.
    ArsenShnurkov
    @ArsenShnurkov
    you already told that 3 times. Everything you say (on this thread) is correct. But you don't listen my words about another types of terminators
    like in bash there is possibility to use fragments which ends by concrete word
    Curtis Wensley
    @cwensley
    sorry about that. I didn't see your questions about that specifically. What are you trying to do exactly?
    ArsenShnurkov
    @ArsenShnurkov
    like cat <<-'EOF' | sed -e 's/^ //' -e 's/ $//' | ed -s server.xml
    H
    /BEGIN realm/i
    .
    /BEGIN realm/+1,/END realm/-1d
    .-1r realm.xml
    wq
    EOF
    I am trying to learn one more feature of parser which i need to understand to write my grammar
    exactly I want to define strings which ends by specific sequence of characters
    (i want to be able to define)
    Curtis Wensley
    @cwensley
    myEbnfGrammar.SpecialParsers["UntilEOF"] = (+Terminals.AnyChar).Until("EOF"); (;
    ArsenShnurkov
    @ArsenShnurkov
    thanks
    Curtis Wensley
    @cwensley
    no way to do that using ebnf I'm afraid.. at least with Eto.Parse.
    ArsenShnurkov
    @ArsenShnurkov
    @cwensley What do you think about other parser generators? ruffin--/SqlDbSharp#3
    GPPG, C#, BSD, https://gppg.codeplex.com
    GPLEX, C#, BSD, https://gplex.codeplex.com
    C#, GLL, Apache 2.0, YaccConstructor, http://yaccconstructor.github.io/YaccConstructor/gll.html
    ArsenShnurkov
    @ArsenShnurkov
    GLL and GLR should be easiest to define the grammar (because they should resolve ambiguilities automagically)
    But I have not tried them
    on wikipedia there is no page for GLL, but the page for GLR do exist - https://en.wikipedia.org/wiki/GLR_parser
    ArsenShnurkov
    @ArsenShnurkov

    You asked about practical application of '-' operation. Here it is:
     vmid := letter_english | digit | minus | ".";
     vend := letter_english | digit;
     variable_name := letter_english , [ [ { vmid } ] , vend ] ;
    it has exactly the same problem - greedy "vmid" eats all the word, and then the end doesn't match all the rule
    Curtis Wensley
    @cwensley
    @ArsenShnurkov, thanks. Hm, I wonder if it would make sense to interpret the '-' applied to a repeat as an until instead of using an except parser..
    ArsenShnurkov
    @ArsenShnurkov
    I debugged my grammar deeper, but still not to the end
    doesn't work for me, for unknown reason
    ArsenShnurkov
    @ArsenShnurkov
    oh, found one more bug, no "line_separator" rule defined