|
Object-oriented Parser System v3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectMops
public class Mops
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.
| 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 |
|---|
public static final ResourceBundle templates
MessageFormat.format templates to
generate output. The property templates overwrites the
filename stem.
| Constructor Detail |
|---|
public Mops()
| Method Detail |
|---|
protected static String format(String key,
Object... args)
args - can be null if none.public Object Blank(Object value)
public Object Jsm(Object... arg)
public Object Monad(Object... arg)
public Object Mvalue(Object... arg)
public Object Mvalues(Object... arg)
public Object Paren(Object... arg)
public Object Text(Object... arg)
public Object Trees(Object... arg)
public static void main(String... arg)
throws IOException
arg - if any: dump tree to diagnostic output.
IOException
|
(c) 2008 Axel T. Schreiner |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||