20101102 - Change the grammar to E> E T | E T> T F | F...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
============================ CS 441 Fall 2010 -- JWJ Pre-class notes - do not distribute Tuesday, November 2, 2010 ============================ Topics First experience with Bison to create a simple calculator. Tasks Most of our class will be in the Multilab. - create a directory 20101102 - copy sources from http://www.epaperpress.com/lexandyacc/index.html to 20101102 - inspect the contents of the directory. Unzip if necessary - read the sources: calc1.l, calc2.y - inspect 'build' and make calc1.exe Note: the last step may need some adjustements, changing the code, etc. - add to calc2.y provision for additional operations by extending the grammar - the compilation produces errors. It is because of the grammar ambiguity.
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Change the grammar to E -> E + T | E T -> T * F | F F -> (E) | integer- make executables for the above version; do you need to change calc1.l?- make calc3.exe Sources On-line resource: http://www.lugbe.ch/action/reports/lex_yacc.pdf (Tom Niemann tutorial on Lex and Yacc) http://www.epaperpress.com/lexandyacc/index.html Programming Assignment PA2a Play with the code from the above Web pages. Write three programs in the language described in the above tutorial. Show the syntax-trees and the code for your sample programs. One of the programs should compute the number of combinations C(n,k) using an iterative algorithm....
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern