View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Squeak Core Dumpers


Team Members:

Possible future development of Milestone 3:



Sample output:




In P3, we made a MathEquation editor to create graphical equations via text input in the LaTeX format.

The following types of string would be accepted:




In doing this project we had to develop a grammar to handle this kind of a graphing tool. However, at this stage we realized what steps would be needed to not just to display a math equation but to evaluate them as well. This would make the tool we developed able to be used as a calculator as well as a displaying tool.

Originally, we made our design to handle only the graphing aspect of the problem. When the project was developing, we then realized that the changes we made to the grammar could handle not only the drawing aspect drawing, but also it could be used to handle evaluation as well, should a need for this arise. The grammar was adapted from the sample grammar given on the coweb by Brian McNamara with some changes. This alteration could be done by adding code that accumulates the value of each token in the action portion of each rule and passes it back to a global variable (which each message can see). We then can print this value out after finishing parsing the whole expression. The key changes we made to the grammar to handle this is making it handle numbers and proper parentheses.

Our original UML design looked like this and here is the corresponding CRC diagram.

After changes, our UML looked like this.

Instead of having to write the same code again to implement the math equation evaluator, we can take advantage of our original OO design by simply adding to it. This can be done since our design allows us to reuse the code.

The following grammar would allow us to so this:

<Exp> ::= <Term> <op> <Exp> | <Term>

<Term> ::= <factor> <RestTerm>

<factor> ::= <fraction> | { Exp } | ( Exp ) | <text>

<fraction> ::= \frac {Exp} {Exp} | \frac (Exp) (Exp)

<RestTerm> ::= ^{Exp}RestTerm | _{Exp}RestTerm | lambda

<text> ::= <char> <text> | <char>

<char> ::= <greeks> | <puncts> | <specialChars> | <regChars> | <numbers>

<greeks> ::= \alpha | \beta| …

<puncts> ::= \{  |  \} | …

<regChars> ::= a | A | b | B| …

<numbers> ::= [0-9]+

<op> ::= + | - | * | / | =



Problems encountered implementing Milestone 3










Anticipated problems implementing evaluator








Hence, we can see that it is possible to expand our original P3 program to handle the evaluation of mathematical expressions. This would enable us to make even greater use of this program. However, there are certain problems we would expect to encounter as we have discussed above. We are hoping at some point to come back and implement this part of the program, as it seems to have many uses. We welcome any suggestions or comments that you think might help us implement this phase of the program.

Links to other milestones:
MileStone P1
MileStone P2
Milestone P2.5
Milestone P4

Links to this Page