help for writing compliers

sahana

sahana

@sahana-S4nL10 Oct 21, 2024
hi.i need to write yacc and lex programs.so do i have to necessarily load unix?i came across some thing called cygwin.so is it helpful?all i need is to write yacc and lex programs not specific about any os and i dont know how to boot unix all by my self.please help wanted urgently.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • friendster7

    friendster7

    @friendster7-oVJr9h Mar 2, 2008

    hey i found a some information do check out..is is a software
    Parser Generator is a YACC and Lex programming tool for Windows. As well as including a Graphical User Interface, the software also includes two versions of YACC and Lex, called AYACC and ALex. Parser Generator is able to generate C, C++ and Java parsers and lexical analysers. This includes both Unicode and Multibyte Character Set (MBCS) variants. In your applications you can create multiple, thread safe, instances of these parsers and lexical analysers. Direct support is provided with Parser Generator for Visual C++ and Borland C++ and C++Builder.
  • friendster7

    friendster7

    @friendster7-oVJr9h Mar 2, 2008

    here is the link for download..hope it helps

    note:-source net
    #-Link-Snipped-#
  • friendster7

    friendster7

    @friendster7-oVJr9h Mar 2, 2008

    if u do find it difficult the best way is to install linux.it is same as how u install windows xp.do partion ur hard disk and install the linux os in that partion..

    and u can execute the programs their..

    hope it helps
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Mar 2, 2008

    For more details on Lex and YACC, refer forum thread

    #-Link-Snipped-#

    Also, look at the link <a href="https://www.thefreecountry.com/programming/compilerconstruction.shtml" target="_blank" rel="nofollow noopener noreferrer">Free Compiler Construction Tools: Lexer and Parser Generators(thefreecountry.com)</a>

    -Pradeep
  • sahana

    sahana

    @sahana-S4nL10 Mar 4, 2008

    Thanks a ton friendster7 and pradeep.😀
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Mar 4, 2008

    [off topic]
    Pradeep, I know you're a Linux Guru. How about starting development activity on CE forums? Possible or its just too big for us (at this point). ?
  • friendster7

    friendster7

    @friendster7-oVJr9h Mar 4, 2008

    sahana
    Thanks a ton friendster7 and pradeep.😀
    ur welcome sahana..hope i get help here too..
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Mar 4, 2008

    sahana
    Thanks a ton friendster7 and pradeep.😀
    Welcome Sahana.


    The_Big_K
    Pradeep, I know you're a Linux Guru. How about starting development activity on CE forums? Possible or its just too big for us (at this point). ?
    Thanks for your appreciation Big K, but the word 'Guru' will be too big for me. I am also beginner in Linux and i am sure many people here will be knowing more then me. Cheers to all CE's

    But i am always ready for any such knowledge sharing activities.

    -Pradeep
  • sahana

    sahana

    @sahana-S4nL10 Mar 6, 2008

    hi.i dont think i understood this software ie parser generator too good.do i have to store the TC and this parser generator software in same folder?

    i have to write a source program and have to identify the tokens of my c input file.say my lex program is
    %{
    %}
    %%
    "girl1" !"girl2" {printf("noun");}
    %%
    void main()
    {FILE *fp1;
    fp1=fopen("in.c","read");
    yyin=fp1;
    yylex();
    }
    and my c program is
    in.c

    girl1 sings girl2 dances

    so my i first compile my lex program.then will the tokens be generated automatically?incase of unix,lex tool ie lex prgname.l is used right.what do i do in this case?
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Mar 7, 2008

    sahana
    do i have to store the TC and this parser generator software in same folder?
    No, you don't need to keep the TC and lex tool in the same folder.

    Basically, while writing lex programs, you specify tokens and the action to be performed when that token is found.

    When you compile your lex program (like the one given above), it will generate a .c file that contain c code for the specified task.

    Now, you have to take that c file and need to compile with TC or any other compiler (i will suggest gcc) and you gets the executable which when executed performs the task.

    -Pradeep
  • sahana

    sahana

    @sahana-S4nL10 Mar 16, 2008

    i do get a c file,my c file is not getting compiled by TC.should i go necessarily for gcc,that means i have to install linux?i hope borland c++ compiler is same as turboc. coz i guess this parser generator software is compatible with borland c++
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Mar 16, 2008

    sahana
    should i go necessarily for gcc
    I would always recommend to use gcc over TC.

    sahana
    that means i have to install linux?
    No need to install Linux, use cygwin available at <a href="https://cygwin.com/" target="_blank" rel="nofollow noopener noreferrer">Cygwin</a> or use GCW (gcc for windows) available at <a href="https://sourceforge.net/projects/gcw/" target="_blank" rel="nofollow noopener noreferrer">gcw. Gcc for Windows download | SourceForge.net</a>

    -Pradeep