|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.microstar.xml.HandlerBase | +--diva.sketch.parser2d.Grammar2dParser
Reads in an XML file and parses it into an array of rules that make up a grammar.
Field Summary | |
static java.lang.String |
ANGLE_TAG
The string constant that specifies an angle constraint element. |
static java.lang.String |
AREA_TAG
The string constant that specifies an area ratio constraint element. |
static java.lang.String |
CONSTRAINT_TAG
The string constant that specifies the constraint attribute of an overlap constraint element. |
static double |
DEFAULT_ANGLE_TOLERANCE
FIXME ??? this parser is smart |
static java.lang.String |
DIRECTION_TAG
The string constant that specifies the direction attribute of an angle constraint element. |
static java.lang.String |
DISTANCE_TAG
The string constant that specifies a distance constraint element. |
static java.lang.String |
GRAMMAR_TAG
The string constant that specifies a grammar element. |
static java.lang.String |
HEIGHT_TAG
The string constant that specifies an height ratio constraint element. |
static java.lang.String |
MAX_TAG
The string constant that specifies the max attribute of a constraint element. |
static java.lang.String |
MIN_TAG
The string constant that specifies the min attribute of a constraint element. |
static java.lang.String |
NAME_TAG
The string constant that specifies the name attribute of a root or a relative. |
static java.lang.String |
OVERLAP_TAG
The string constant that specifies an overlap constraint element. |
static java.lang.String |
RELATIVE_SITE_TAG
The string constant that specifies the relativeSite attribute of a distance or angle constraint element. |
static java.lang.String |
RELATIVE_TAG
The string constant that specifies a relative element. |
static java.lang.String |
ROOT_SITE_TAG
The string constant that specifies the rootSite attribute of a distance or angle constraint element. |
static java.lang.String |
ROOT_TAG
The string constant that specifies a root element. |
static java.lang.String |
RULE_TAG
The string constant that specifies a rule element. |
static java.lang.String |
TITLE_TAG
The string constant that specifies the title attribute of a grammar. |
static java.lang.String |
TYPE_TAG
The string constant that specifies the type attribute of a rule, a root, or a relative. |
static java.lang.String |
VERSION_TAG
The string constant that specifies the version attribute of a grammar. |
static java.lang.String |
WHICH_TAG
The string constant that specifies the "which" attribute of an overlap constraint element. |
static java.lang.String |
WIDTH_TAG
The string constant that specifies an width ratio constraint element. |
Constructor Summary | |
Grammar2dParser()
|
Method Summary | |
void |
attribute(java.lang.String name,
java.lang.String value,
boolean isSpecified)
Handle an attribute value assignment. |
void |
endElement(java.lang.String name)
Handle the end of an element. |
void |
error(java.lang.String message)
Handle a parsing error by throwing an exception with the given error message prepended with the line number and column number. |
Rule[] |
getRules()
Return the resulting set of rules from the previous parse. |
static void |
main(java.lang.String[] args)
Test this puppy out! |
Rule[] |
parse(java.lang.String url)
Create the full path string for the url and parses the file into a Document object. |
protected void |
resetConstraintState()
Reset the parsing state from the previous constraint that was parsed. |
protected void |
resetParseState()
Reset the parsing state from the previous rule that was parsed. |
protected void |
resetRelativeState()
Reset the parsing state from the previous rule that was parsed. |
protected void |
resetRuleState()
Reset the parsing state from the previous rule that was parsed. |
void |
startElement(java.lang.String name)
Handle the start of an element. |
Methods inherited from class com.microstar.xml.HandlerBase |
charData,
doctypeDecl,
endDocument,
endExternalEntity,
error,
ignorableWhitespace,
processingInstruction,
resolveEntity,
startDocument,
startExternalEntity |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final double DEFAULT_ANGLE_TOLERANCE
public static final java.lang.String GRAMMAR_TAG
public static final java.lang.String VERSION_TAG
public static final java.lang.String TITLE_TAG
public static final java.lang.String RULE_TAG
public static final java.lang.String TYPE_TAG
public static final java.lang.String ROOT_TAG
public static final java.lang.String NAME_TAG
public static final java.lang.String RELATIVE_TAG
public static final java.lang.String DISTANCE_TAG
public static final java.lang.String ROOT_SITE_TAG
public static final java.lang.String RELATIVE_SITE_TAG
public static final java.lang.String MIN_TAG
public static final java.lang.String MAX_TAG
public static final java.lang.String OVERLAP_TAG
public static final java.lang.String CONSTRAINT_TAG
public static final java.lang.String WHICH_TAG
public static final java.lang.String ANGLE_TAG
public static final java.lang.String DIRECTION_TAG
public static final java.lang.String AREA_TAG
public static final java.lang.String WIDTH_TAG
public static final java.lang.String HEIGHT_TAG
Constructor Detail |
public Grammar2dParser()
Method Detail |
protected void resetParseState()
protected void resetRuleState()
protected void resetRelativeState()
protected void resetConstraintState()
public void attribute(java.lang.String name, java.lang.String value, boolean isSpecified)
XmlHandler.attribute(java.lang.String, java.lang.String, boolean)
public void startElement(java.lang.String name)
public void endElement(java.lang.String name)
public void error(java.lang.String message)
public Rule[] getRules()
public Rule[] parse(java.lang.String url) throws java.lang.Exception
public static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |