I have filled in a lot of trivial grungy stuff and the stuff that doesn't really have anything to do with lexical analysis ... I think what's left for you to fill in should be pretty quick. Keyword and punctuation patterns are certainly trivial ... you'll see the pattern in
Java will complain that the generated scanner uses unsafe operations. That's because the scanner skeleton file is written in the old, pre-generics style. I'm using one of the optional skeletons because I threw in the ability to #include just for fun and to demo how that works ... it's not part of Cool, but it's something you'll want to do in another scanner some day.
Due: Monday of next week. The parser assignment will come out Monday or Wednesday.
The README.txt file says a bit more about what you'll find and how to get going. Although the amount of work here should not be large, it's a good idea to tackle it soon, so that you have a chance to ask questions when things break.
The README refers to a a file you started for us called "CUP.jflex" which I cannot find in the download. Process of elimination says "Cool.jflex" may be the file I am looking for. Can you verify?
ReplyDeleteHere is the list of files I found in Cool.tgz:
Cool/sym.java
Cool/README.txt
Cool/ScanDriver.java
Cool/tools
Cool/tools/tokenNames.awk
Cool/symNames.java
Cool/Symbolx.java
Cool/lib
Cool/lib/jflex-skeleton-nested
Cool/lib/commons-cli-1.2.jar
Cool/lib/java-cup-11a-runtime.jar
Cool/lib/stringtemplate-3.2.1.jar
Cool/lib/antlr-2.7.7.jar
Cool/Cool.jflex
Cool/ErrorReport.java
Cool/tests
Cool/tests/backslash2.cool
Cool/tests/hairyscary.cool
Cool/tests/pathologicalstrings.cool
Cool/tests/arith.cool
Cool/tests/closecomment.cool
Cool/tests/typecase.cool
Cool/tests/keywords.cool
Cool/tests/types.cool
Cool/tests/badidentifiers.cool
Cool/Makefile
Cool/scan
Thanks for your help!!
Hmmm ... my first reply seems to have disappeared.
ReplyDeleteThere must be a typo in my instructions ... look for Cool.jflex instead of CUP.jflex. (CUP is a parser generator that we'll use in the *next* assignment.)