Object-oriented Parser System
v3.6

mops
Class Mops

Object
  extended by Mops

public class Mops
extends Object

preprocessor for monadic notation, tree factory for classes implementing code generation.

Translated from the JavaScript version: no regular expressions in the quoted pattern, typing in representation classes.

Extensions: syntax to generate tree classes and provision to store input position in a tree node; see Tree example.

Generates Java code by default; generates JavaScript code with templates=mops/js.

Version:
1.2.1

Nested Class Summary
static class Mops.Blank
          wraps normalized white space.
static interface Mops.Gen
          what the tree classes must do (but for Mvalue).
static class Mops.Jsm
          Jsm: (Blank|Monad|Paren|Text)+
static class Mops.Monad
          Monad: Mvalues+
static class Mops.Mvalue
          Mvalue: Blank?
static class Mops.Mvalues
          Mvalues: Mvalue+
static class Mops.Paren
          Paren: lpar (Blank|Monad|Paren|Text)* rpar
static class Mops.Text
          wraps a string.
static class Mops.Trees
          Trees: Blank?
 
Field Summary
static ResourceBundle templates
          MessageFormat.format templates to generate output.
 
Constructor Summary
Mops()
           
 
Method Summary
 Object Blank(Object value)
          factory method, normalizes white space.
protected static String format(String key, Object... args)
          format a string from the resource file.
 Object Jsm(Object... arg)
          factory method.
static void main(String... arg)
          convert monadic notation from standard input into Java.
 Object Monad(Object... arg)
          factory method.
 Object Mvalue(Object... arg)
          factory method.
 Object Mvalues(Object... arg)
          factory method.
 Object Paren(Object... arg)
          factory method.
 Object Text(Object... arg)
          factory method.
 Object Trees(Object... arg)
          factory method.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templates

public static final ResourceBundle templates
MessageFormat.format templates to generate output. The property templates overwrites the filename stem.

Constructor Detail

Mops

public Mops()
Method Detail

format

protected static String format(String key,
                               Object... args)
format a string from the resource file.

Parameters:
args - can be null if none.

Blank

public Object Blank(Object value)
factory method, normalizes white space.


Jsm

public Object Jsm(Object... arg)
factory method.


Monad

public Object Monad(Object... arg)
factory method.


Mvalue

public Object Mvalue(Object... arg)
factory method.


Mvalues

public Object Mvalues(Object... arg)
factory method.


Paren

public Object Paren(Object... arg)
factory method.


Text

public Object Text(Object... arg)
factory method.


Trees

public Object Trees(Object... arg)
factory method.


main

public static void main(String... arg)
                 throws IOException
convert monadic notation from standard input into Java.

Parameters:
arg - if any: dump tree to diagnostic output.
Throws:
IOException


(c) 2008 Axel T. Schreiner