Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ArsenShnurkov
    @ArsenShnurkov
    ?
    (about syntax3.ebnf)
    Curtis Wensley
    @cwensley
    hm, not sure.. I'd have to debug it..
    I can't spot any problems at initial glance
    ArsenShnurkov
    @ArsenShnurkov
    Curtis Wensley
    @cwensley
    oh cool, I'll take a look
    Curtis Wensley
    @cwensley
    ok, so it's a little odd behaviour, but the nbody is using { } which means 'zero or more'.. so, it matches and never gets to the myws rule in the alternative
    if you move nbody to the last alternative for file_unit, it'll work
    ArsenShnurkov
    @ArsenShnurkov
    is there an IDE for debugging grammars ?
    i want a highlighting for nondefined symbols, possible empty rules and etc
    Curtis Wensley
    @cwensley
    no but that'd be awesome to have
    wouldn't be too difficult to put together either
    eto.parse is just purely a hobby of mine so I don't always get a lot of time to work on it
    ArsenShnurkov
    @ArsenShnurkov
    I see how "not difficult" is just to use this library. I think IDE will take several months
    meebey have an IRC client, it took 10 years to write
    Curtis Wensley
    @cwensley
    well depends on what you mean by "ide".. a simple editor/debugger wouldn't take much to put together initially.. but maybe it wouldn't meet expectations
    the main difficulty of Eto.Parse is because it's a recursive descent parser instead of a state parser.. order of rules counts
    ArsenShnurkov
    @ArsenShnurkov
    all this should be written in teaching course (like wikibooks). I learned this only on the third day of solving "simple" task
    Curtis Wensley
    @cwensley
    indeed that would be nice. Using ebnf or bnf certainly complicates things quite a bit
    mainly due to their limitations and inconsistent formats
    ArsenShnurkov
    @ArsenShnurkov
    You could recommend your own format (propose an RFC if there is none yet
    Curtis Wensley
    @cwensley
    I suppose, but defining your grammar through code is what I'd recommend instead
    but if you have existing ebnf or are more comfortable with it, it is not a bad way to go but you have to mix it with code using the SpecialParsers
    ArsenShnurkov
    @ArsenShnurkov
    What was my logic? 1) I to parse file. 2) I was teached that there such thing as parsers 3) BNF is syntax 4) there is more modern EBNF 5) EBNF in wikipedia gives ISO standart of 1996
    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