Class DlgpeParser

java.lang.Object
fr.inria.rules.integraal.io.dlgpe2.DlgpeParser

public class DlgpeParser extends Object
Parses DLGPE content into sentence objects using an Integraal environment.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a parser bound to an Integraal environment.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    Demonstrates parsing and serializing a DLGPE document.
    Iterator<fr.inria.rules.dlgpemodel.api.sentences.ISentence>
    parse(String input)
    Parses a sequence of DLGPE items from a string.
    Iterator<fr.inria.rules.dlgpemodel.api.sentences.ISentence>
    parse(org.antlr.v4.runtime.CharStream input)
    Parses a sequence of DLGPE items from a character stream.
    List<fr.inria.rules.dlgpemodel.api.sentences.ISentence>
    Parses a full DLGPE document from a string.
    List<fr.inria.rules.dlgpemodel.api.sentences.ISentence>
    parseAll(org.antlr.v4.runtime.CharStream input)
    Parses a full DLGPE document from a character stream.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DlgpeParser

      public DlgpeParser(IntegraalEnvironment env)
      Creates a parser bound to an Integraal environment.
      Parameters:
      env - the environment providing the parser dependencies
  • Method Details

    • parseAll

      public List<fr.inria.rules.dlgpemodel.api.sentences.ISentence> parseAll(String input) throws Exception
      Parses a full DLGPE document from a string.
      Parameters:
      input - the input document
      Returns:
      the parsed sentences
      Throws:
      Exception - if parsing fails
    • parseAll

      public List<fr.inria.rules.dlgpemodel.api.sentences.ISentence> parseAll(org.antlr.v4.runtime.CharStream input) throws NoSuchMethodException
      Parses a full DLGPE document from a character stream.
      Parameters:
      input - the input stream
      Returns:
      the parsed sentences
      Throws:
      NoSuchMethodException - if the configured parse rule cannot be resolved
    • parse

      public Iterator<fr.inria.rules.dlgpemodel.api.sentences.ISentence> parse(String input) throws Exception
      Parses a sequence of DLGPE items from a string.
      Parameters:
      input - the input document
      Returns:
      an iterator over parsed sentences
      Throws:
      Exception - if parsing fails
    • parse

      public Iterator<fr.inria.rules.dlgpemodel.api.sentences.ISentence> parse(org.antlr.v4.runtime.CharStream input) throws Exception
      Parses a sequence of DLGPE items from a character stream.
      Parameters:
      input - the input stream
      Returns:
      an iterator over parsed sentences
      Throws:
      Exception - if parsing fails
    • main

      public static void main(String[] args) throws Exception
      Demonstrates parsing and serializing a DLGPE document.
      Parameters:
      args - unused command-line arguments
      Throws:
      Exception - if parsing fails