Building Parsers with Java

sjm.examples.minimath
Class MinimathParser

java.lang.Object
  |
  +--sjm.examples.minimath.MinimathParser

public class MinimathParser
extends java.lang.Object

Show a properly working utility class that provides an parser for "Minimath", using the grammar:

	
     e = Num m*;
     m = '-' Num;
 


Field Summary
protected static Sequence e
           
 
Constructor Summary
MinimathParser()
           
 
Method Summary
static Parser e()
          Return a parser that will recognize a Minimath expression.
protected static Parser m()
           
static void main(java.lang.String[] args)
          Just a little demo.
protected static Parser n()
           
static Parser start()
          Returns a parser that will recognize a Minimath expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e

protected static Sequence e
Constructor Detail

MinimathParser

public MinimathParser()
Method Detail

e

public static Parser e()
Return a parser that will recognize a Minimath expression.
Returns:
a parser that will recognize a Minimath expression

m

protected static Parser m()

main

public static void main(java.lang.String[] args)
Just a little demo.

n

protected static Parser n()

start

public static Parser start()
Returns a parser that will recognize a Minimath expression.
Returns:
a parser that will recognize a Minimath expression

by Steve Metsker