nl.bluering
Class ExpParser

java.lang.Object
  |
  +--nl.bluering.ExpParser

public class ExpParser
extends java.lang.Object

this parser can read Expressions from Strings or files. It uses a prologlike syntax (which is also java-like). An example is:

foo(bar(),1,abc)
. An Expression parser can also read input using quotes:
foo('ab c')
. A more advanced feature is the use of operators:
 2*(3+4)**8++
. You also see the use of brackets here.


Constructor Summary
ExpParser(CoolFileHandle f)
          you must first construct a CoolFileHandle to use an ExpPArser.
 
Method Summary
 void close()
          close the CoolFileHandle.
 Expression get()
          read an Expression from this ExpParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpParser

public ExpParser(CoolFileHandle f)
you must first construct a CoolFileHandle to use an ExpPArser. You can do that from a String or a filename.
Method Detail

close

public void close()
close the CoolFileHandle. If it was constructed from a file, you should call this method after parsing.

get

public Expression get()
               throws java.lang.Exception
read an Expression from this ExpParser. It returns null if no Expression can be read. No warning is given if there are unused characters at the end, you should check this yourself if you care about it..