Compilers

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Tools for Front End.

    5 answers - 535 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    Currently I planning to write a compiler for a very complex grammaer
    and I am investigating tools.
    There are different tools available in the market .e.g yacc, bisson,
    gold, lemnon ,cocoR and more.
    The other option I am planning is writting compiler without tools so
    that we can get good performnce.
    Can you please help me what approach I should take to investigate tools
    ? Is you can give me some idea or direction then it would be really
    useful.
    Regards
    Asheesh
  • No.1 | | 1452 bytes | |

    Asheesh wrote:
    Hi,

    Currently I planning to write a compiler for a very complex grammar
    and I am investigating tools.

    If you'd tell more about the grammar and give a couple of examples,
    it will be much easier to find the right tools.

    There are different tools available in the market .e.g yacc, bisson,
    gold, lemnon ,cocoR and more.

    The other option I am planning is writting compiler without tools so
    that we can get good performnce.

    Well, most of the computation time of a compiler is spent in lexical
    analyzer. the 2nd place is the backend, so I'm afraid that writing
    compiler without tools wouldn't give you much better performance. For
    improving a lexer, you can check the "perfect hash" functions.
    BTW, bison is a dialect of yacc.

    Can you please help me what approach I should take to investigate tools
    ? Is you can give me some idea or direction then it would be really
    useful.

    It heavily depends on the grammar of your language. Just two examples
    are shown below.

    1. C language: a very simple grammar, an existing parser can be found
    for every existing tool. Not a context-free language, needs semantic
    hacks for typedefs, pointer dereference.

    2. English language: a bit more complicated grammar, usually needs
    simultaneous translation on several levels, with information exchange
    between all the levels.
  • No.2 | | 2123 bytes | |

    Currently I planning to write a compiler for a very complex grammaer
    and I am investigating tools.

    There are different tools available in the market .e.g yacc, bisson,
    gold, lemnon ,cocoR and more.

    The other option I am planning is writting compiler without tools so
    that we can get good performnce.

    I'm not sure why you conclude that using tools yields worse
    performance. There is reasonable evidence that tools can embody
    efficient implementation techniques that many (most?) users are not
    aware of, so the result is often more efficient than the user would
    have produced. Even if the user can read up on efficient techniques
    and implement them, a tool often gets you to the same point much
    faster with less knowledge required. If I may be permitted a self
    citation, see [1] for a study of the efficiency of generated compilers
    compared to hand-coded ones.

    There are many tools that enable easy creation of various kinds of
    parsers (some of which you cite above). However, a more important
    aspect is what other processing you plan to do. The parser usually
    constitutes a fairly minor part of a full compiler, so I would advise
    you to consider carefully what other tasks you plan to do (e.g. name
    and type analysis, optimisation, code generation) and look at tools in
    terms of the support they provide for those tasks.

    the other hand, if you plan to do mostly parsing, then there is not
    much to choose between the many tools out there. Two points for
    comparison that might be relevant are:
    - the method used by the parser generator (e.g., bottom-up table
    driven vs top-down recursive descent), some folks prefer the latter
    since the generated parsers are easier to understand, although many
    of us never plan to read the generated code anyway
    - the target language of the generator

    Tony Sloane

    [1] An evaluation of an automatically generated compiler, A M Sloane
    ACM Transactions on Programming Languages and Systems (TPLAS)
    Volume 17, Issue 5 (September 1995), 691 - 703

  • No.3 | | 802 bytes | |

    Hi,

    Thanks a lot for your kind reply.

    I am planning to write a Fortran compiler and for it I am just
    evaluating various tools available in the market which can help me in
    designing various modules lexical, semantic, parser, preprocessor etc.

    As there are lots of tools in market and it will take lots of time to
    evaluate all the tools so I need help of you guys who can atleast guide
    me for known tools so that I can do investigation about certain tools
    only.

    Please let me know if my explanation is ok ? or u need some more
    detailed one ?

    regards
    asheesh
    [Fortran is hard to lex but easy to parse. I have front end for most of
    Fortran 77 in on the compilers FTP site, with a hand-written C lexer and
    a yacc parser. -John]
  • No.4 | | 519 bytes | |

    Hi,

    Thanks a lot for your reply. I would be writing Fortran compiler from
    the scratch and for various phases I am looking for best tools
    available in the market so that I can write highly optimized compiler.

    Can you suggest some tools for various phases so that I can investigate
    them as per my requirement ?

    currently I am investigating following tools:

    1) Eli
    2) Gold
    3) Antlar
    4) lex/yacc
    5) coco R.

    Can you help me now ?

    Regards
    Chads
  • No.5 | | 851 bytes | |

    Asheesh <asheeshc@noida.hcltech.comwrote:
    I am planning to write a Fortran compiler and for it I am just
    evaluating various tools available in the market which can help me in
    designing various modules lexical, semantic, parser, preprocessor etc.

    We have built lexers and parsers for Fortran 77 and Fortran 90 and many
    other languages using the Cocktail Toolbox for compiler construction.
    Besides a scaner generator and two parser generators the Cocktail Toolbox
    contains tools for syntax trees, semantic analysis, and code generation.
    The Fortran parsers are available.

    Best regards

    Dr. Josef Grosch

    CoCoLab - Datenverarbeitung
    Hoehenweg 6
    77855 Achern
    Germany

    Phone : +49-7841-669144
    Fax : +49-7841-669145
    Email : grosch@cocolab.com
    Internet: www.cocolab.com

Re: Tools for Front End.


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Compilers"

EMSDN.COM