Building Parsers with Java

sjm.examples.logic
Class LogikusFacade

java.lang.Object
  |
  +--sjm.examples.logic.LogikusFacade

public class LogikusFacade
extends java.lang.Object

This class provides utility methods that simplify the use of the Logikus parser.


Constructor Summary
LogikusFacade()
           
 
Method Summary
static Axiom axiom(java.lang.String s)
           
protected static Axiom axiom(TokenString ts)
           
protected static void checkForUppercase(TokenString ts, java.lang.String type)
           
protected static java.lang.Object parse(TokenString ts, Parser p, java.lang.String type)
           
static Program program(java.lang.String s)
          Parse the text of a Logikus program and return a Program object.
static Query query(java.lang.String s, AxiomSource as)
          Parse the text of a Logikus query and return a Query object.
protected static java.lang.Object reportLeftovers(Assembly out, java.lang.String type)
           
protected static void reportNoMatch(TokenString ts, java.lang.String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogikusFacade

public LogikusFacade()
Method Detail

axiom

public static Axiom axiom(java.lang.String s)

axiom

protected static Axiom axiom(TokenString ts)

checkForUppercase

protected static void checkForUppercase(TokenString ts,
                                        java.lang.String type)

parse

protected static java.lang.Object parse(TokenString ts,
                                        Parser p,
                                        java.lang.String type)

program

public static Program program(java.lang.String s)
Parse the text of a Logikus program and return a Program object.
Parameters:
String - the text of the program
Returns:
a Program object
Throws:
java.lang.RuntimeException - if parsing fails

query

public static Query query(java.lang.String s,
                          AxiomSource as)
Parse the text of a Logikus query and return a Query object.
Parameters:
String - the text of the query
Returns:
a Query object
Throws:
java.lang.RuntimeException - if parsing fails

reportLeftovers

protected static java.lang.Object reportLeftovers(Assembly out,
                                                  java.lang.String type)

reportNoMatch

protected static void reportNoMatch(TokenString ts,
                                    java.lang.String type)

by Steve Metsker