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
    CharacterSets are mutually exclusive with EbnfStyle.SquareBracketAsOptional, which is part of Iso14977.
    if character escapes are actually part of the standard, that'd be an easy fix by adding AllowEscapeCharacters = true to the terminal_string in the EbnfGrammar constructor.
    ArsenShnurkov
    @ArsenShnurkov
    I have no constructor (because I don't derive class, I use the existing one). And I don't see a way to add Parser into mygrammar object after it's construction
    So, I agree with you, that ISO is a standart which is not defining all details. But don't know what to do next.
    Curtis Wensley
    @cwensley
    no, this is in the Eto.Parse code, so it'd require a change there
    but the ? Terminals.Eol ? is what you could do
    ArsenShnurkov
    @ArsenShnurkov
    this is not the only character i want
    Curtis Wensley
    @cwensley
    or as I mentioned earlier, use the EbnfGrammar.SpecialParsers to define anything you want
    so.. ebnfGrammar.SpecialParsers["Woot"] = Terminals.Set("\r\n\tblah");
    then in your ebnf: ? Woot ?
    ArsenShnurkov
    @ArsenShnurkov
    yes, willl try this now
    Curtis Wensley
    @cwensley
    Terminals.Eol does match \r\n or \n btw
    Hm, I should add an EbnfStyle.EscapeStrings to allow for escapes in literals in ebnf though, it'd probably be very useful.
    It'd also allow for hex such as '\x013'
    Curtis Wensley
    @cwensley
    there we go
    ArsenShnurkov
    @ArsenShnurkov
    You are right, that Terminals.Eol is exactly what I need, but I can't use it because of NIH syndrome :)
    Curtis Wensley
    @cwensley
    haha
    that's a hard syndrome to overcome sometimes
    this is the error: Index=3, Context="
    nn>>>-nn
    ---n-n-
    "
    Expected:
    eol: EOL
    Curtis Wensley
    @cwensley
    hm that doesn't make sesnse
    *sense
    ArsenShnurkov
    @ArsenShnurkov
    what do you mean?
    or, what steps I should do to provide more details or to diagnose the problem ?
    I replaced nbody from 'n' to 'A', and replaced last '=' to ':=', nothing changes
    Eol does match
    (I mean the first eol in the C# string)
    ArsenShnurkov
    @ArsenShnurkov
    @cwensley And I can explain my NIH syndrome's source. I am not sure in '-' operator. I don't have successful experience with the construct := { ? Terminal.AnyChar ? } - { ? Terminal.Eol ? }
    Curtis Wensley
    @cwensley
    yeah that won't work
    cuz it'll find all AnyChar's first
    you need to do { ? Terminal.AnyChar ? - ? Terminal.Eol? }
    ArsenShnurkov
    @ArsenShnurkov
    one AnyChar will not match the 2-simbol sequence
    Curtis Wensley
    @cwensley
    all expressions in Eto are 'greedy'.. e.g. the { ? Terminal.AnyChar ? } will basically match the entire string
    ArsenShnurkov
    @ArsenShnurkov
    So, what to do about my nonworking example above
    ?
    (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