Building Parsers with Java

sjm.examples.imperative
Class ShowAssignmentCommand

java.lang.Object
  |
  +--sjm.examples.imperative.ShowAssignmentCommand

public class ShowAssignmentCommand
extends java.lang.Object

This class provides an example of the assignment command. The main method of this class creates a variable "x" and pre-assigns it the value 0. Then the method creates a "for" command that encapsulates:


     for (int i = 1; i <= 4; i++) {
         x = x * 10 + 1;
     }

 
The method executes the "for" command, leaving x with the value 1111.0.


Constructor Summary
ShowAssignmentCommand()
           
 
Method Summary
static void main(java.lang.String[] args)
          Provide an example of the assignment command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShowAssignmentCommand

public ShowAssignmentCommand()
Method Detail

main

public static void main(java.lang.String[] args)
Provide an example of the assignment command.

by Steve Metsker