Search


CS 310 - Programming Languages


Frequently Asked Questions



Eclipse

  1. Q:My Eclipse at home doesn't have JavaCC. How do I install a new plugin, such as JavaCC?
    A: To learn how to install plugins, watch the movie, Eclipse-Install Plugin
    The JavaCC plugin can be found at the update site: http://eclipse-javacc.sourceforge.net

Java

HW #1 - First Project

  1. Q: I see the report on my turned-in homework, but where is my grade?
    A: The professor will give it to you in class. It's also posted on Blackboard.

HW #2 - English Grammar

  1. Q: I'm getting a file open error: it says it can't find the dictionary file, but it's definitley there.
    A: Two options:
    1. Put the entire path name in that open file command.
      Just change the code for the open file command and expand the filename String.
    2. Augment the base directory for the run.
      1. Go to Run > Open Run Dialog
      2. Then create a new Java Application run dialog
      3. Click on the tab for "Arguments"
      4. Change the working directory (at the bottom of the tab)
  2. Q:I'm slightly confused at what we need to do with the two Index functions? Any help you can offer would be great.
    A:Index is supposed to be like an index for a book. It should contain all the keywords for the book and correlate them with the page number they occur on. In our case, we only have a short story, so there are no page numbers. Furthermore, we can just collect all the words in the story, rather than just the keywords. So, getWords() is supposed to add each word in the story to the member variable words.

    The member variable, words in the Index class is a SortedSet. That means, words.add(myWord), where myWord is a String, will add myWord to the SortedSet, words. If it is already in the SortedSet, nothing will change. If not, it will be added, in alphabetical order. The method display() should just print all the words in the SortedSet words.
  3. Q: When I run the test, everything matches up in the compare box but it's still giving me an error
    A: If you're running Windows, you must change the Test file so that all the strings end with \r\n instead of \n.

HW #3 - Parsing Clite

  1. Q: I am having a problem with the AbstractSyntax file that's in our third Java assignment. The statement, "import sun.tools.tree.WhileStatement" does not resolve.
    A: This is my fault. My apologies. Please use the Refactoring command "Organize Imports" (Alt-Shift-O) or just delete the import line. It is unneeded for your project.
  2. Q: In the slides you say first to make sure that matching works in the parser. When I'm creating my FOR loop entry in the parser, don't I need to make the abstract syntax for the FOR loop before I can test my grammar?
    A: A way to test your matching of for loops is to just return a new Skip() statement instead of creating a FOR abstract syntax first. When you create the FOR abstract syntax, then you can add that in later.
  3. Q: When I have a JavaCC Identifier that matches <IDENTIFIER>, how do I get the String name out of it?
    A:
    1. Declare a token in the preamble of the Rule with Token id;.
    2. Match the identifier and assign it to the Token: id = <IDENTIFIER>
    3. In the body of the rule, you can access the String itself with id.image
  4. Q: When I have a JavaCC integer value that matches <INTEGER_LITERAL>, how do I get the integer value out of it?
    A:
    1. Declare a token in the preamble of the Rule with Token intval;.
    2. Match the identifier and assign it to the Token: intval = <INTEGER_LITERAL>
    3. In the body of the rule, you can access the int itself by converting the String image to an integer with Integer.parseInt(id.image)

Midterm Exam

  1. Q: Is the exam open book, open note?
    A: Yes. You can bring the textbook and any notes, but not any communication devices.
  2. Q: I was wondering if you could give me any guidance for my studies for the midterm on Monday?
    A: Read over the slides and make sure you understand them. Look over your homeworks and make sure you understand them. Read through the book, especially related to the stuff we talked about in class and make sure you understand it. The book chapters we covered were 1-5 and 16.

Functional Programming with Haskell

  1. Q: How do I install Haskell?
    A:
    1. Install the Haskell compiler
      1. go to http://haskell.org/ghc
      2. select Downloads
      3. select 6.8.2 (most recent distribution)
      4. select Binaries
      5. select the appropriate platform
      6. follow the instructions provided from there
    2. Install the Eclipse plugin for Haskell
      1. go to http://eclipsefp.sourceforge.net
      2. grab the one-stop plugin
      3. copy the files in to your Eclipe dir (features/* into Eclipse/features/ and plugin/* into Eclipse/plugins/)
Maintained by: Fr. Boniface Hicks
Last updated: April 16, 2008
Disclaimer