com.threerings.expr
Class ExpressionParser<T>

java.lang.Object
  extended by com.threerings.expr.ExpressionParser<T>

public class ExpressionParser<T>
extends Object

Parses simple expressions using an implementation of the shunting-yard algorithm.


Constructor Summary
ExpressionParser(Reader reader)
          Creates a new parser to read from the specified reader.
 
Method Summary
static void main(String... args)
          Main method for testing.
 T parse()
          Parses the expression and returns the object at the top of the stack (or null if the stack is empty).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionParser

public ExpressionParser(Reader reader)
Creates a new parser to read from the specified reader.

Method Detail

main

public static void main(String... args)
                 throws Exception
Main method for testing.

Throws:
Exception

parse

public T parse()
        throws Exception
Parses the expression and returns the object at the top of the stack (or null if the stack is empty).

Throws:
Exception


Copyright © 2011. All Rights Reserved.