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

Parser performance - newbie question.

Expand Messages
  • praveen_c
    Hi, I m new to the world of Parser Generators/Lexers. I just learned about what ANTLR and JavaCC can do and I m pretty excited about em. While I don t have a
    Message 1 of 2 , Apr 1, 2002
      Hi,

      I'm new to the world of Parser Generators/Lexers. I just learned
      about what ANTLR and JavaCC can do and I'm pretty excited about 'em.
      While I don't have a complete understanding of what these tools can
      do, I do have the following questions.

      I'm trying to write a parser that recognizes specials tags in a HTML
      template at runtime( in a J2EE server ). Would a parser generated
      from ANTLR or JavaCC offer acceptable performance when used to parse
      HTML templates at runtime? My gut feeling is that I can handcode a
      parser that offers better performance that the generated parser. I
      think I can optimize it better for my needs. Is that a right
      approach? I know when it comes to extensibility, I'll loose. But I'm
      willing take that risk.

      Thanks in advance for any responses.

      -Praveen.
    • Remus Pereni
      Hello praveen_c, Monday, April 01, 2002, 11:54:10 AM, you wrote: p Hi, p I m new to the world of Parser Generators/Lexers. I just learned p about what ANTLR
      Message 2 of 2 , Apr 1, 2002
        Hello praveen_c,

        Monday, April 01, 2002, 11:54:10 AM, you wrote:

        p> Hi,

        p> I'm new to the world of Parser Generators/Lexers. I just learned
        p> about what ANTLR and JavaCC can do and I'm pretty excited about 'em.
        p> While I don't have a complete understanding of what these tools can
        p> do, I do have the following questions.

        Yes it is exactly what you need then !

        p> I'm trying to write a parser that recognizes specials tags in a HTML
        p> template at runtime( in a J2EE server ). Would a parser generated
        p> from ANTLR or JavaCC offer acceptable performance when used to parse
        p> HTML templates at runtime? My gut feeling is that I can handcode a
        p> parser that offers better performance that the generated parser. I
        p> think I can optimize it better for my needs. Is that a right
        p> approach? I know when it comes to extensibility, I'll loose. But I'm
        p> willing take that risk.

        While I have no doubt that you could write your own parser it is not
        worth the effort. From my experience what ANTLR generates it is
        quite fast ( I had no concerns at all about the speed of
        the lexer/parser/tree walker and I've done a full blown oo scripting
        language).

        Anyhow I believe there will be very small difference in
        speed between your hand coded parser and an antlr generated one and
        your time would be a lot more well spent if you go with antlr and
        use the saved time to work on caching ;)

        I work with anltr for almost a year now and I have the most positive
        feelings about it. It is an excellent tool, thank you guys!

        p> Thanks in advance for any responses.

        p> -Praveen.

        Best regards,
        Remus
        --
        Remus Pereni mailto:remus@...
        http://neuro.nolimits.ro http://mappa.mundi.net/spacemapper
        http://www.nolimits.ro http://rue.nolimits.ro
      Your message has been successfully submitted and would be delivered to recipients shortly.