org.graphstream.stream.file.gml
Class GMLParser

java.lang.Object
  extended by org.graphstream.stream.file.gml.GMLParser
All Implemented Interfaces:
GMLParserConstants, Parser

public class GMLParser
extends Object
implements Parser, GMLParserConstants


Field Summary
 Token jj_nt
          Next token.
 Token token
          Current token.
 GMLParserTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface org.graphstream.stream.file.gml.GMLParserConstants
COMMENT, DEFAULT, DIGIT, DIGRAPH, EOF, EOL, GRAPH, HEXDIGIT, KEY, LSQBR, REAL, RSQBR, STRING, tokenImage
 
Constructor Summary
GMLParser(FileSourceGML gml, InputStream stream)
           
GMLParser(FileSourceGML gml, Reader stream)
           
GMLParser(GMLParserTokenManager tm)
          Constructor with generated Token Manager.
GMLParser(InputStream stream)
          Constructor with InputStream.
GMLParser(InputStream stream, String encoding)
          Constructor with InputStream and supplied encoding
GMLParser(Reader stream)
          Constructor.
 
Method Summary
 void all()
          Parse the whole stream.
 void close()
          Closes the parser, closing the opened stream.
 void diGraphStart()
           
 void disable_tracing()
          Disable tracing.
 void enable_tracing()
          Enable tracing.
 ParseException generateParseException()
          Generate ParseException.
 Token getNextToken()
          Get the next Token.
 Token getToken(int index)
          Get the specific Token.
 void graphEnd()
           
 void graphStart()
           
 boolean isInGraph()
           
 String keyValue(org.graphstream.stream.file.gml.KeyValues values)
          A set of key and value, the value can recursively be a list of key-values.
 org.graphstream.stream.file.gml.KeyValues list()
          A list of key values, all values are stored in a KeyValues object.
 boolean next()
           
 org.graphstream.stream.file.gml.KeyValues nextEvents()
          The top-level method to be called by the file source.
 void open()
          Start parsing the stream.
 void ReInit(GMLParserTokenManager tm)
          Reinitialise.
 void ReInit(InputStream stream)
          Reinitialise.
 void ReInit(InputStream stream, String encoding)
          Reinitialise.
 void ReInit(Reader stream)
          Reinitialise.
 void start()
          Unused rule, call it to slurp in the whole file.
 boolean step()
           
 Object value(String key)
          A value for a key, either a number, a string or a recursive list of key-values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public GMLParserTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

GMLParser

public GMLParser(FileSourceGML gml,
                 InputStream stream)

GMLParser

public GMLParser(FileSourceGML gml,
                 Reader stream)

GMLParser

public GMLParser(InputStream stream)
Constructor with InputStream.


GMLParser

public GMLParser(InputStream stream,
                 String encoding)
Constructor with InputStream and supplied encoding


GMLParser

public GMLParser(Reader stream)
Constructor.


GMLParser

public GMLParser(GMLParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

isInGraph

public boolean isInGraph()

open

public void open()
          throws IOException,
                 ParseException
Description copied from interface: Parser
Start parsing the stream.

Specified by:
open in interface Parser
Throws:
ParseException
IOException

next

public boolean next()
             throws IOException,
                    ParseException
Specified by:
next in interface Parser
Returns:
Throws:
ParseException
IOException

step

public boolean step()
             throws IOException,
                    ParseException
Throws:
IOException
ParseException

close

public void close()
           throws IOException
Closes the parser, closing the opened stream.

Specified by:
close in interface Parser
Throws:
IOException

start

public final void start()
                 throws ParseException
Unused rule, call it to slurp in the whole file.

Throws:
ParseException

all

public final void all()
               throws ParseException,
                      IOException
Description copied from interface: Parser
Parse the whole stream.

Specified by:
all in interface Parser
Throws:
ParseException
IOException

graphStart

public final void graphStart()
                      throws ParseException
Throws:
ParseException

diGraphStart

public final void diGraphStart()
                        throws ParseException
Throws:
ParseException

graphEnd

public final void graphEnd()
                    throws ParseException
Throws:
ParseException

nextEvents

public final org.graphstream.stream.file.gml.KeyValues nextEvents()
                                                           throws ParseException
The top-level method to be called by the file source. Returns a set of top-level key values or null if the end of the file was reached. Top-level key values are nodes and edges as well as all key-values defined before and after the graph.

Throws:
ParseException

list

public final org.graphstream.stream.file.gml.KeyValues list()
                                                     throws ParseException
A list of key values, all values are stored in a KeyValues object.

Throws:
ParseException

keyValue

public final String keyValue(org.graphstream.stream.file.gml.KeyValues values)
                      throws ParseException
A set of key and value, the value can recursively be a list of key-values. Only the key-value list "graph [ ... ]" is not parsed by this rule, and parsed by another rules, so that the nextEvent() rule can be called repeatedly.

Throws:
ParseException

value

public final Object value(String key)
                   throws ParseException
A value for a key, either a number, a string or a recursive list of key-values.

Throws:
ParseException

ReInit

public void ReInit(InputStream stream)
Reinitialise.


ReInit

public void ReInit(InputStream stream,
                   String encoding)
Reinitialise.


ReInit

public void ReInit(Reader stream)
Reinitialise.


ReInit

public void ReInit(GMLParserTokenManager tm)
Reinitialise.


getNextToken

public final Token getNextToken()
Get the next Token.


getToken

public final Token getToken(int index)
Get the specific Token.


generateParseException

public ParseException generateParseException()
Generate ParseException.


enable_tracing

public final void enable_tracing()
Enable tracing.


disable_tracing

public final void disable_tracing()
Disable tracing.



Copyright © 2013. All Rights Reserved.