|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lexonics.edsel.parser.Parser
An Edsel parser.
Edsel, the Easy Data Structure Expression Language, is a notation for representing labeled, attributed directed graphs. This is an application for which XML is commonly used. Edsel, however, is better suited for this purpose than XML, in two ways:
graph.
attribute = attribute-name { attribute-value } ';' .
attribute-name = name .
attribute-value = STRING .
graph = { node-definition } .
name = IDENTIFIER .
node = node-definition | node-reference .
node-body = '{' { attribute } [ '|' { outgoing-edge } ] '}' .
node-definition = node-name node-body .
node-name = name .
node-reference = node-name .
outgoing-edge = outgoing-edge-name { outgoing-edge-destination } ';' .
outgoing-edge-destination = node .
outgoing-edge-name = name .
An IDENTIFIER is a sequence of one or more upper- and lowercase ASCII letters,
digits, and hyphens.
A STRING is a single-quoted sequence of zero or more Unicode characters;
any character may be escaped by a backslash,
and single quotes and backslashes must be.
Whitespace may occur freely between tokens and is insignificant. Parenthesized comments may also occur between tokens; comments may be nested.
By convention, the first node may be named -Edsel
and have a -version attribute giving the Edsel version (1.0).
Example:
-Edsel { -version '1.0'; }
(This is a simple example of Edsel.)
John
{
first-name 'John';
last-name 'Smith';
|
wife Mary;
}
Mary
{
first-name 'Mary';
last-name 'Smith';
|
husband John;
}
| Nested Class Summary | |
static class |
Parser.ParseException
An Edsel parse exception. |
| Method Summary | |
static Graph |
graph(CharSequence edsel)
Parse an Edsel string representation of a graph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static Graph graph(CharSequence edsel)
throws Parser.ParseException
edsel - The Edsel string representation. Must be non-null.
IllegalArgumentException - The Edsel string representation is null
Parser.ParseException - The Edsel string representation is syntactically incorrect.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||