Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] Ocamlyacc vs. Yacc syntax questions

Expand Messages
  • Giuseppe Lo Brutto
    Ok, I think I ve understood what you mean. Anyway, I ve always found that way in order to treat the empty case in ocamlyacc which is not to specify any symbol.
    Message 1 of 13 , Dec 2, 2005
    • 0 Attachment
      Ok, I think I've understood what you mean.
      Anyway, I've always found that way in order to
      treat the empty case in ocamlyacc which is not
      to specify any symbol.
      In the end we can discuss about that, whether that is the right way or not
      but that is how ocamlyacc works by now :-)

      Cheers


      On 12/2/05, Radu Grigore <radugrigore@...> wrote:
      > --- Giuseppe Lo Brutto <giuseppelobrutto@...> wrote:
      >
      > > I really think this way is better in order to pay attantion on and
      > > control when and where the ambiguity problem of a grammar turns
      > > out.
      > > Since to have full control on the empty case or epsilon its useful.
      >
      > I don't follow you here, but...
      >
      > No, it clearly makes no sense and should be filed as a bug. The
      > _grammar_ is the same in both cases. What actions you write should
      > not affect in any way what is and what is not parsed.
      >
      > Also, in ocaml actions are supposed to be values and hence for each
      > non-terminal (or at least for those with types different from unit)
      > you should be forced to give a value since there is no "default
      > value" in OCaml.
      >
      > This is unless ocamlyacc, like yacc, provides a default action when
      > one is missing. But the docs do not mention anything like this. Even
      > if it would do it, the only default that would make sense is { $1 },
      > which would work only for productions with non-empty RHS.
      >
      > Either case, ocamlyacc should produce an error for the original mly.
      > It makes no sense to behave differently.
      >
      >
      >
      >
      > __________________________________
      > Start your day with Yahoo! - Make it your home page!
      > http://www.yahoo.com/r/hs
      >
      >
      > Archives up to August 22, 2005 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
      > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
      > Attachments are banned and you're asked to be polite, avoid flames etc.
      >
      >
      >
      >
      > SPONSORED LINKS
      > Basic programming language Computer programming languages Programming languages
      > Java programming language
      >
      > ________________________________
      YAHOO! GROUPS LINKS
      >
      >
      >
      > Visit your group "ocaml_beginners" on the web.
      >
      > To unsubscribe from this group, send an email to:
      > ocaml_beginners-unsubscribe@yahoogroups.com
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      >
      > ________________________________




      --
      Knockin' on to the heaven's doors
    • Radu Grigore
      ... BTW, ocamlyacc is written in C so don t blame OCaml for its bugs ;) __________________________________________ Yahoo! DSL – Something to write home
      Message 2 of 13 , Dec 3, 2005
      • 0 Attachment
        --- Giuseppe Lo Brutto <giuseppelobrutto@...> wrote:

        > Ok, I think I've understood what you mean.

        BTW, ocamlyacc is written in C so don't blame OCaml for its bugs ;)



        __________________________________________
        Yahoo! DSL – Something to write home about.
        Just $16.99/mo. or less.
        dsl.yahoo.com
      • Stalkern 2
        ... I thought that the parser needed to meet a stop point at a higher level before switching to another rule. My fault. And I did not even know that a rule can
        Message 3 of 13 , Dec 5, 2005
        • 0 Attachment
          Radu Grigore wrote:
          > --- Joshua Smith <josh@...> wrote:
          >
          >
          >>titles:
          >
          > { "" }
          >
          >>| titles title { $1 ^ " " ^ $2 }
          >>;
          >
          >
          > It works just fine with that modification.
          >
          >
          > To the other replyers:
          > 1. former = first, so its's hard to follow.

          I thought that the parser needed to meet a stop point at a higher level
          before switching to another rule. My fault.

          And I did not even know that a rule can contain a epsilon production
          like that in Ocaml (what I know about lex/yacc is the ocamllex/ocamlyacc
          file in the Ocaml doc).

          Now,the manual says:
          (http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html)

          "The syntax for rules is as usual:
          nonterminal :
          symbol ... symbol { semantic-action }
          | ...
          | symbol ... symbol { semantic-action }
          ;"

          Either I can't read the EBNF notation (that I can't find a complete
          description of), or your case does not show up. If the latter is
          correct, I would like to tell the mantainers of the doc.
          Can anybody tell me whether is the doc incomplete or am I in troubles
          with EBNF?


          And: Thanks, Radu. Please stay tuned!!! :-))

          Ernesto
        • Giuseppe Lo Brutto
          ... Let s say that it s incomplete and really essential :-)
          Message 4 of 13 , Dec 5, 2005
          • 0 Attachment
            > Can anybody tell me whether is the doc incomplete or am I in troubles
            > with EBNF?

            Let's say that it's incomplete and really essential :-)
          • Stalkern 2
            ... OK, I ll tell the mantainers about that issue then. Ernesto
            Message 5 of 13 , Dec 7, 2005
            • 0 Attachment
              Giuseppe Lo Brutto wrote:
              >> Can anybody tell me whether is the doc incomplete or am I in troubles
              >> with EBNF?
              >
              >
              > Let's say that it's incomplete and really essential :-)
              >
              >

              OK, I'll tell the mantainers about that issue then.

              Ernesto
            Your message has been successfully submitted and would be delivered to recipients shortly.