suvi.parse
Class GraphParser
java.lang.Object
|
+--suvi.parse.GraphParser
- public class GraphParser
- extends java.lang.Object
Parser for attributed graphs.
The syntax recognized by the parser is described below in EBNF
notation; → represents productions, | represents alternatives, [...]
represents options and + represents one or more instances.
graph | → | [global_attr+] node+ [attr+] |
global_attr | → | assignment ';' |
node | → | ID [':' neighbour+] ';' |
neighbour | → | ID [eid] |
eid | → | '[' value ']' |
attr | → | '(' node_or_edge+ ')' '{' assignment+ '}' ';' |
node_or_edge | → | ID |
| | | '(' ID ',' ID ')' [eid] |
assignment | → | ID '=' value |
value | → | '(' value ',' value ')' |
| | | ID |
| | | INTEGER |
| | | DOUBLE |
| | | BOOLEAN |
Method Summary |
static void |
parse(java.io.Reader in,
javautils.graph.GraphBuilder gb,
GraphLayoutAttrMapBuilder mb)
Parses graph topology and attribute information from the given
input reader and translates it to graph and attribute building
commands. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphParser
public GraphParser()
parse
public static void parse(java.io.Reader in,
javautils.graph.GraphBuilder gb,
GraphLayoutAttrMapBuilder mb)
Parses graph topology and attribute information from the given
input reader and translates it to graph and attribute building
commands.
In the case of a syntax error, a ParseException
-exception will be thrown wrapped inside a
RuntimeException
.