Continue discussion of regular expressions and parsing tools.
Information about how to use Lex and YACC is available at this compact guide to lex and yacc
Simple Reference Code for Haskell. Contribute to vinitrinh/haskell-cheat-sheet development by creating an account on GitHub. The Haskell Report, while very thorough, wasn't quite it. For that reason I've created this cheatsheet. It's intended for beginning to intermediate Haskell programmers to use as a quick-reference guide for syntax, keywords or other language issues. . What is the best Haskell cheat sheet? The best I have found so far, and likely close to the best overall, is this one: A Haskell cheat sheet in PDF and literate formats. Haskell Cheat Sheet This cheat sheet lays out the fundamental ele-ments of the Haskell language: syntax, keywords and other elements. It is presented as both an ex-ecutable Haskell file and a printable document. Load the source into your favorite interpreter to play with code samples shown. Basic Syntax Comments. Haskell CheatSheet Written and maintained by Justin Bailey. The cheat sheet is a PDF included in the source distribution. If you installed this package through cabal install, run 'cheatsheet.exe' to find where the PDF was installed.
I will go through the example Lex/YACC program given in /afs/umbc.edu/users/n/i/nicholas/pub/331/lexYacc/calc. You can all make use of this from GL.
Programming Exercise: modify the Lex/YACC calculator example to support any four of the following five operations
(1) exponentiation using the caret (^) operator. Note that the ^ operator in C is not exponentiation. (If you use any C math functions in this project, you may need to add -lm to the gcc command in the makefile. The file in my pub directory has been updated.)
(2) hexadecimal constants of the form 0xff which for example is decimal 255.
(3) add the expr ? true_case : false_case for expressions, where the true_case is returned if the expr is not zero, otherwise the value of the false_case is returned
(4) scientifc notation, i.e. 1e-2 should be 0.01, while 2e3 should be 2000.
(5) a logical comparison operator , which evaluates to 0 or 1
Markdown Cheatsheet Pdf
Haskell Keywords
Submit your Lex and YACC files as attachments to an email. Also attach a typescript file that demonstrates the features of the program. Send that email to Rujuta Palande <palande1@umbc.edu> and cc me. I will demonstrate the script command on GL. Due before 5pm Friday 10/9/2015.