|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.xml.XMLSyntax ix.util.xml.BNFSyntax
public class BNFSyntax
Describes the (XML) syntax of data objects in a BNF-like style.
Nested Class Summary | |
---|---|
(package private) class |
BNFSyntax.Alternatives
A RHS that represents a disjunction of BNFSyntax.Instance s. |
(package private) class |
BNFSyntax.CollectionInstance
Represents an instance of a collection class. |
(package private) class |
BNFSyntax.ConstraintTemplate
A TemplateInstance based on a Constraint . |
(package private) class |
BNFSyntax.Instance
A RHS that describes an instance of a class. |
(package private) class |
BNFSyntax.InstanceField
Represents a field of a structure class. |
(package private) class |
BNFSyntax.ListInstance
|
(package private) class |
BNFSyntax.Literal
An instance used when only a (simple) literal value shoud appear. |
(package private) class |
BNFSyntax.MapEntryInstance
|
(package private) class |
BNFSyntax.MapInstance
|
(package private) class |
BNFSyntax.Nonterminal
An Instance used when only the name of a nonterminal should appear. |
(package private) class |
BNFSyntax.RHS
The right-hand side of a syntax rule. |
(package private) class |
BNFSyntax.Rule
A syntax rule. |
(package private) class |
BNFSyntax.RuleList
Represents the grammar that is being produced. |
(package private) class |
BNFSyntax.SetInstance
|
(package private) class |
BNFSyntax.SimpleInstance
Represents an instance of a primitve or atomic class. |
(package private) class |
BNFSyntax.StructInstance
Represents an instance of a structure class. |
(package private) class |
BNFSyntax.TemplateInstance
An instance that's already XML in the form of a JDOM Element. |
Field Summary | |
---|---|
protected XMLTranslator |
noNamespaceXmlt
|
Fields inherited from class ix.util.xml.XMLSyntax |
---|
attributeFieldP, classSyntax, inheritance, xmlt |
Constructor Summary | |
---|---|
BNFSyntax()
|
|
BNFSyntax(XMLTranslator xmlt)
|
Method Summary | |
---|---|
void |
describeClass(java.lang.String className,
java.io.PrintStream out)
Prints the syntax for the indicated class and for any related classes that can be found. |
static void |
main(java.lang.String[] argv)
Test loop that repeatedly asks the user for a class name and prints a description of the syntax for objects of that class. |
(package private) BNFSyntax.Instance |
makeClassInstance(ClassDescr cd)
Makes a description of an instance of a class. |
(package private) void |
printAlternatives(BNFSyntax.Alternatives alts,
java.io.PrintStream out)
Prints the BNF for a RHS that is an Alternatives. |
(package private) void |
printIndented(java.io.PrintStream out,
int indent,
java.lang.String text)
Utility that breaks text into lines and prints them with the specified indentation. |
(package private) void |
printInstance(BNFSyntax.Instance inst,
java.io.PrintStream out)
Prints the BNF for a RHS that is an Instance -- a description of an instance of a class. |
(package private) void |
printRuleSyntax(BNFSyntax.RuleList list,
java.io.PrintStream out)
Prints the the BNF that corresponds to each rule. |
(package private) void |
printRuleSyntax(BNFSyntax.Rule rule,
java.io.PrintStream out)
Prints the BNF that corresponds to an individual rule. |
(package private) java.lang.String |
tagged(java.lang.String tag,
java.lang.String contents)
Returns a string representing an XML element. |
Methods inherited from class ix.util.xml.XMLSyntax |
---|
attributeFields, collectListofClasses, elementFields, getClassDescr, getConstraintSyntaxList, getElementName, getElementName, getElementName, getEnumerationValues, getNTName, getNTName, getUpperName, getUpperName, relevantClasses, structTextDescription, walkStructFields |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected XMLTranslator noNamespaceXmlt
Constructor Detail |
---|
public BNFSyntax()
public BNFSyntax(XMLTranslator xmlt)
Method Detail |
---|
public void describeClass(java.lang.String className, java.io.PrintStream out)
describeClass
in class XMLSyntax
void printRuleSyntax(BNFSyntax.RuleList list, java.io.PrintStream out)
void printRuleSyntax(BNFSyntax.Rule rule, java.io.PrintStream out)
void printAlternatives(BNFSyntax.Alternatives alts, java.io.PrintStream out)
void printInstance(BNFSyntax.Instance inst, java.io.PrintStream out)
void printIndented(java.io.PrintStream out, int indent, java.lang.String text)
BNFSyntax.Instance makeClassInstance(ClassDescr cd)
java.lang.String tagged(java.lang.String tag, java.lang.String contents)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |