java parser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickey0
    New Member
    • Jan 2008
    • 142

    java parser

    Hello,
    I have to write a descendant recursive parser in Java. what do you suggest? Any links with java code example, please?


    Regards,
  • nav010
    New Member
    • Sep 2008
    • 13

    #2
    instead of java , I suggest u to use Vb which would make it easier for u.

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Originally posted by mickey0
      Hello,
      I have to write a descendant recursive parser in Java. what do you suggest? Any links with java code example, please?
      Goto the ANTLR site; ANTLR is a parser generator;
      it generates LL(*) parsers (equivalent to recursive descent); on that site they've
      got a couple of grammars available including a Java grammar (if I remember well).

      kind regards,

      Jos

      Comment

      • Nepomuk
        Recognized Expert Specialist
        • Aug 2007
        • 3111

        #4
        Originally posted by nav010
        instead of java , I suggest u to use Vb which would make it easier for u.
        That depends very much on what language the OP knows better. Of course, there are languages, that are designed for parser writing, but VB isn't one of them. (You may be right, if someone knows both equally well, VB might be the better choice, but that's not the point.) Also, in Java the parser will be platform independent, so it can be run on nearly any system.

        Greetings,
        Nepomuk

        Comment

        • mickey0
          New Member
          • Jan 2008
          • 142

          #5
          Originally posted by Nepomuk
          That depends very much on what language the OP knows better. Of course, there are languages, that are designed for parser writing, but VB isn't one of them. (You may be right, if someone knows both equally well, VB might be the better choice, but that's not the point.) Also, in Java the parser will be platform independent, so it can be run on nearly any system.

          Greetings,
          Nepomuk
          Yes, I need to use Java but I'd like to see some "simple" implementations before.....I wonder if someone have linked some ".java" class around internet,,,

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by mickey0
            Yes, I need to use Java but I'd like to see some "simple" implementations before.....I wonder if someone have linked some ".java" class around internet,,,
            That ANTLR tool can generate a parser written in Java (one of the main target
            languages). Beware though: it isn't "simple".

            kind regards,

            Jos

            Comment

            • mickey0
              New Member
              • Jan 2008
              • 142

              #7
              Originally posted by JosAH
              That ANTLR tool can generate a parser written in Java (one of the main target
              languages). Beware though: it isn't "simple".

              kind regards,

              Jos
              I used Coco/r but it creates a much complex parser......

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by mickey0
                I used Coco/r but it creates a much complex parser......
                Don't expect much simpler from ANTLR; the Java syntax is quite complex and
                needs quite a complex parser to recognize it all.

                kind regards,

                Jos

                Comment

                Working...