CS200 Lab 3, Scanning and Parsing

Overview

The goals of this lab are:

The Scanner Class and String Parsing.

The Scanner class does some low-level parsing. It can give you many different things, including tokens, lines, integers, reals, etc.

Pre- and Post- Conditions

These are conditions that apply to running a method or a code segment. For example, System.out.println(String s) might have as its precondition that there must be a console to print to, and its post-condition might be that s has been printed.

In Parse.java leave a comment at the top of the "ID(String indent)" method that describes the pre- and post- conditions of this method.

Grammars

The TA will go over a couple exercises on the board from this file. Afterward, go over the additional exercises on your own.

© 2014 CS200 Colorado State University. All Rights Reserved.