Math 302, Differential Equations JHU

Math 302X
- HW3.pdf
- Statement on Disabilities
- Statement on Ethics
- Homework
- Java Tools
 
- An example of a circuit
- An example of a circuit
- An example of a circuit
- An Application to Population Dynamics
- An application to Population Dynamics
- Slope Field Calculator
- ODE 2D Calculator
- ODE 2D Calculator
- ODE 3D Calculator
- ODE 3D Calculator
- Slope Field Calculator
- Slope Field Calculator
- Solution Verifier
- Solution Verifier 2D
- Solution Verifier 2D
- Solution Verifier
- A Lotke-Volterra System
- A Lotke-Volterra system
- Labor Managed Oligopoly - Two firms
- ODE 3D Calculator
- 2D Map Calculator
- A model of sunami
- A model of sunami
- The three body problem
- The two body problem
- The two body problem
- Van der Pol Equation
- Van der Pol Equation
- List of parameters of the JOde Applet
- Browser test
- Generated Documentation (Untitled)
 
- All Classes
- All Classes
- Constant Field Values
- Deprecated List
- API Help
- Index
- Overview
- Overview
- Class Hierarchy
-
- Serialized Form
- ODE 2D Calculator
+ Using Marek Rychliks's Applet for Euler's Method
- JOde Manual Page
- JOde - An Applet for Studying Ordinary Differential Equations
- ODE 2D Calculator
- Syllabus
Math Dept. Home
Help room

com.rychlik.calculator.parser
Class Calculator

java.lang.Object
  |
  +--com.rychlik.calculator.parser.Calculator
All Implemented Interfaces:
CalculatorConstants

public class Calculator
extends java.lang.Object
implements CalculatorConstants

This class implements a parser for a simple arithmetical language.


Field Summary
 com.rychlik.calculator.parser.Token jj_nt
           
 boolean lookingAhead
           
 com.rychlik.calculator.parser.Token token
           
 com.rychlik.calculator.parser.CalculatorTokenManager token_source
           
 
Fields inherited from interface com.rychlik.calculator.parser.CalculatorConstants
AND, ASSIGN, BEGIN, BREAK, COMMA, CONSTANT, CONTINUE, DEFAULT, DEFINE, DIGIT, DIVIDE, ELSE, END, EOF, EOL, EQ, EXP, FLOAT, GE, GT, ID, IF, ILLEGAL, INTEGER, LE, LETTER, LPAREN, LT, MINUS, MULTIPLY, NE, OR, PLUS, PRINT, RETURN, RPAREN, SEPARATOR, tokenImage, WHILE
 
Constructor Summary
Calculator()
           
Calculator(com.rychlik.calculator.parser.CalculatorTokenManager tm)
           
Calculator(java.io.InputStream stream)
           
Calculator(java.io.InputStream s, com.rychlik.calculator.StackMachine sm)
           
Calculator(java.io.Reader stream)
           
Calculator(com.rychlik.calculator.StackMachine sm)
           
Calculator(java.io.StringReader r, com.rychlik.calculator.StackMachine sm)
           
 
Method Summary
 int arglist()
           
 void assignment()
           
 void breakStatement()
           
 void checkIdentifier(java.lang.String id)
          Check whether id is a legal identifier.
 int compileStream()
           
 int compileString(java.lang.String s)
           
 void conjunction()
           
 void continueStatement()
           
 void definition()
           
 void disable_tracing()
           
 void disjunction()
           
 void enable_tracing()
           
 double evalStream()
           
 double evalString(java.lang.String s)
           
 void expression()
           
 void factor()
           
 void funcall()
           
 com.rychlik.calculator.parser.ParseException generateParseException()
           
 com.rychlik.calculator.parser.Token getNextToken()
           
 com.rychlik.calculator.parser.Token getToken(int index)
           
 void identifier()
           
 void ifStatement()
           
 void logical()
           
 void oneLine()
           
 void power()
           
 void print()
           
 void program()
           
 void ReInit(com.rychlik.calculator.parser.CalculatorTokenManager tm)
           
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
 void relational()
           
 void returnStatement()
           
 void signed_factor()
           
 void signed_power()
           
 void signed_term()
           
 void simple_expression()
           
 void sum()
           
 void term()
           
 void whileStatement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public com.rychlik.calculator.parser.CalculatorTokenManager token_source

token

public com.rychlik.calculator.parser.Token token

jj_nt

public com.rychlik.calculator.parser.Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

Calculator

public Calculator(java.io.StringReader r,
                  com.rychlik.calculator.StackMachine sm)

Calculator

public Calculator(java.io.InputStream s,
                  com.rychlik.calculator.StackMachine sm)

Calculator

public Calculator(com.rychlik.calculator.StackMachine sm)

Calculator

public Calculator()

Calculator

public Calculator(java.io.InputStream stream)

Calculator

public Calculator(java.io.Reader stream)

Calculator

public Calculator(com.rychlik.calculator.parser.CalculatorTokenManager tm)
Method Detail

compileStream

public int compileStream()
                  throws ParseException
ParseException

evalStream

public double evalStream()
                  throws ParseException
ParseException

compileString

public int compileString(java.lang.String s)
                  throws ParseException
Parameters:
s - String to be evaluated.
Returns:
The value of the expression.
Throws:
ParseException - Thrown when the string does not represent a syntactically correct expression.

evalString

public double evalString(java.lang.String s)
                  throws ParseException
Parameters:
s - String to be evaluated.
Returns:
The value of the expression.
Throws:
ParseException - Thrown when the string does not represent a syntactically correct expression.

checkIdentifier

public void checkIdentifier(java.lang.String id)
                     throws ParseException
Check whether id is a legal identifier.

Parameters:
id - The name of the variable
Throws:
ParseException - if id is not a valid identifier.

program

public final void program()
                   throws ParseException
ParseException

oneLine

public final void oneLine()
                   throws ParseException
ParseException

print

public final void print()
                 throws ParseException
ParseException

ifStatement

public final void ifStatement()
                       throws ParseException
ParseException

whileStatement

public final void whileStatement()
                          throws ParseException
ParseException

expression

public final void expression()
                      throws ParseException
ParseException

simple_expression

public final void simple_expression()
                             throws ParseException
ParseException

logical

public final void logical()
                   throws ParseException
ParseException

conjunction

public final void conjunction()
                       throws ParseException
ParseException

disjunction

public final void disjunction()
                       throws ParseException
ParseException

relational

public final void relational()
                      throws ParseException
ParseException

assignment

public final void assignment()
                      throws ParseException
ParseException

definition

public final void definition()
                      throws ParseException
ParseException

continueStatement

public final void continueStatement()
                             throws ParseException
ParseException

breakStatement

public final void breakStatement()
                          throws ParseException
ParseException

returnStatement

public final void returnStatement()
                           throws ParseException
ParseException

funcall

public final void funcall()
                   throws ParseException
ParseException

sum

public final void sum()
               throws ParseException
ParseException

term

public final void term()
                throws ParseException
ParseException

power

public final void power()
                 throws ParseException
ParseException

signed_term

public final void signed_term()
                       throws ParseException
ParseException

signed_power

public final void signed_power()
                        throws ParseException
ParseException

signed_factor

public final void signed_factor()
                         throws ParseException
ParseException

factor

public final void factor()
                  throws ParseException
ParseException

identifier

public final void identifier()
                      throws ParseException
ParseException

arglist

public final int arglist()
                  throws ParseException
ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(com.rychlik.calculator.parser.CalculatorTokenManager tm)

getNextToken

public final com.rychlik.calculator.parser.Token getNextToken()

getToken

public final com.rychlik.calculator.parser.Token getToken(int index)

generateParseException

public final com.rychlik.calculator.parser.ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()



This page last modified Sun Sep 12 12:29:12 2004
Questions? Comments? Please send feedback to jason howald