org.fun4j.compiler
Class Parser

java.lang.Object
  extended by org.fun4j.compiler.Parser

public class Parser
extends java.lang.Object

Very simple Parser that reads a "lisp"-expressions and parses it to an abstract syntax tree. The AST is not represented as an intermediary data type but as closely to Java data types as possible. This is done to allow smooth integration of Lisp and Java code.


Field Summary
static java.lang.String separators
           
 
Constructor Summary
Parser()
           
 
Method Summary
static java.lang.Object parse(java.lang.String s)
          read a lisp expression from a string, return an abstract syntax tree nil is parsed to null T or true is parsed to boolean true F or false is parsed to boolean true Numbers are parsed to Integers / BigIntegers or BigDecimals Symbols are parsed to Strings Lists are parsed into Cons Binary trees The Readmacro 'x is expanded to (QUOTE x)
static java.lang.Object parse(java.util.StringTokenizer tokens)
          read lisp expression, return a lambda syntax tree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separators

public static final java.lang.String separators
See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()
Method Detail

parse

public static java.lang.Object parse(java.lang.String s)
read a lisp expression from a string, return an abstract syntax tree nil is parsed to null T or true is parsed to boolean true F or false is parsed to boolean true Numbers are parsed to Integers / BigIntegers or BigDecimals Symbols are parsed to Strings Lists are parsed into Cons Binary trees The Readmacro 'x is expanded to (QUOTE x)


parse

public static java.lang.Object parse(java.util.StringTokenizer tokens)
read lisp expression, return a lambda syntax tree