Recent Changes - Search:

Wiki Home
204 Home

Class Common
CSLite
JDOM Tutorial
Scribbler
Student Common

Student Wiki

Wiki HowTo

edit SideBar

Class /Class

Class Common

Week 16

Week 15

Code Generation example: while loop

  1. test_while_loop.csl
  2. lexer.g
  3. parser.g
  4. code generation

Code Generation:

  1. TestCodeGen: code generation driver class
  2. CodeGen: entry point of codegen module
  3. IRNode and other code gen classes
  4. XMLTreeView: JDOM tree visualization

Front-End:

  1. lexer.g
  2. simplified parser.g
  3. full parser.g

Week 14

  1. CSLite sample compiler tutorial
  2. JDOM XML tree package tutorial
  3. Chirp-Scribbler Lite Sample Compiler in Eclipse project:
    download project .zip file

Week 12

File I/O

  1. FileCopy Class

Expression classes

  1. Expression class
  2. Constant class
  3. AddExp class
  4. SubExp class
  5. MulExp class
  6. DivExp class
  7. TestExp class

Week 11

  • Lab Tutorial 2: Scribbler Programming
    1. Read BASIC Stamp Manual v2.1.pdf p79-98 to understand BASIC Stamp memory and variables. Answer the following questions:
      • What's the maximum number of word-sized variables that can be defined in Scribbler?
      • What's the difference between ROM and RAM data/variables?
      • How to define variables of word, byte, nib, bit type?
      • What is pin variable and how do you use it? use LED pin to experiment.
    2. Experiment with arithmetic expression evaluation using variables, use DEBUG commands to read input and print output through Stamp Editor console.
    3. Read What's a Microcontroller v2.2.pdf Ch2, write PBASIC commands to turn on/off LEDs, find out proper LED pins.
    4. Read Ch7 Light Measurement, write PBASIC commands to read and print light sensor value. Block the sensor and find out how the light data will change.
    5. Read Ch8 Frequency and Sound, understand how to set frequency and play note on Scribbler speaker. Run the TwinkleTwinkle.bs2 program on p232 on Scribbler.
  • Lab Tutorial 1
    1. Read the Scribbler Start-Up Guide v1.0.pdf in ~cs204/scribbler/scribbler_cd/Resources/ (the cs204 account web page) to understand scribbler hardware features
    2. Login to 314 lab PC and run Scribbler GUI Maker and Stamp Editor.
    3. Connect Scribbler robot with USB cable to PC, run StampEditor, use the Identify command (push ID button on tool bar) to verify robot-PC connection.
    4. Use Scribbler GUI Maker to reset Scribbler to default demo program: exit any open StampEditor to avoid conflict, push the restore-to-demo button on toolbar. Popup message should report upload successful.
    5. Disconnect the cable, test the demo program as described in Scribbler Start-Up Guide v1.0.pdf. The code pattern is summarized on the Scribbler Wiki.
    6. Use Scribbler GUI Maker to build simple program to control scribbler, eg, turn on/off LEDs, play music notes. Upload your program to Scribbler. Push the open StampEditor toolbar button to view the generated PBASIC code. Read and understand the generated code.
    7. Connect Scribbler to PC, read What's a Microcontroller v2.2.pdf p20-p27, run the "Hello Wolrd" example using StampEditor.
    8. Read and understand the overall structure of the Default Demo Program

Week 10

http://java.sun.com/javase/6/docs/api/java/util/package-summary.html

  • java.util.Collections class:

http://java.sun.com/javase/6/docs/api/java/util/Collections.html

Week 9

Week 8

Week 6

Stack Adaptor

Week 5

MovieMgr:

FindMin Visitor:

Sum Visitor:

Test class for FindMin and Sum:

Visitor Pattern:

  1. AList
  2. Visitor interface
  3. EmptyAList
  4. NEList
  5. Length visitor
  6. Test class

FindMin method:

Week 4

Sum Example:

Singleton Pattern:

Week 3

Week 2

Week 1

  1. Hello world in Java
  2. Using DrJava from command line:
    • download drjava.jar and put it on your CLASSPATH
    • type: java edu.rice.cs.drjava.DrJava
  3. Using printf
    • System.out.printf("hello, %s\n", world);
  4. Using classes from the Media Java book
    • download mediabook.jar
    • edit DrJava preference->Resource Location, add mediabook.jar to the Extra Classpath
    • now try the following in the DrJava interactions panel:
> World w = new World();
> Turtle t = new Turtle(w);
> t.forward(100);
> 
Page last modified on May 13, 2008, at 03:46 PM