svn:ignore set on bottomup directory, added Evaluator

git-svn-id: svn://anubis/gvsu@111 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2008-06-01 19:02:14 +00:00
parent 98bce7f896
commit 64396d1559
2 changed files with 33 additions and 0 deletions

View File

@ -4,3 +4,7 @@ all: sablecc
.PHONY: sablecc .PHONY: sablecc
sablecc: sablecc:
sablecc arithmetic.grammar sablecc arithmetic.grammar
.PHONY: run
run:
java jholtrop.gvsu.cs675.bottomup.Evaluator

View File

@ -0,0 +1,29 @@
package jholtrop.gvsu.cs675.bottomup;
import java.io.*;
public class Evaluator
{
public static void main(String[] args)
{
Evaluator e = new Evaluator();
e.evaluate();
}
void evaluate()
{
try
{
System.out.println("Enter an expression to evaluate");
Parser p = new Parser(new Lexer(new PushbackReader(
new InputStreamReader(System.in), 1024)));
Start tree = p.parse();
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}