Class GMLParser

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

public class GMLParser
extends Object
implements Parser, GMLParserConstants
  • Field Details

    • token_source

      public GMLParserTokenManager token_source
      Generated Token Manager.
    • token

      public Token token
      Current token.
    • jj_nt

      public Token jj_nt
      Next token.
  • Constructor Details

    • 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 Details

    • 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.