Class ActionSignatureParser


  • public class ActionSignatureParser
    extends java.lang.Object
    This class implements a parser for signatures of action descriptions. The BNF for such signatures is given by: (starting symbol is SIG)

    SIG ::== (SORTSDEC | DECLAR)*
    SORTSDEC ::== ( SORTNAME "=" "{" (CONSTANTNAME ("," CONSTANTNAME)*)? "}" "\n" )*
    DECLAR ::== (ACTIONDEC | FLUENTDEC)*
    ACTIONDEC ::== "action" "(" ACTIONNAME ("(" SORTNAME ("," SORTNAME)* ")")? ")" "\n"
    FLUENTDEC ::== "fluent" "(" FLUENTNAME ("(" SORTNAME ("," SORTNAME)* ")")? ")" "\n"

    where SORTNAME, ACTIONNAME, FLUENTNAME, CONSTANTNAME are sequences of
    symbols from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning.
    Author:
    Sebastian Homann
    • Method Summary

      Modifier and Type Method Description
      ActionSignature parseSignature​(java.io.Reader reader)
      Parses the given reader into a signature of the given type.
      ActionSignature parseSignature​(java.lang.String text)
      Parses the given text into a signature of the given type.
      ActionSignature parseSignatureFromFile​(java.lang.String filename)
      Parses the file of the given filename into a signature.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ActionSignatureParser

        public ActionSignatureParser()
    • Method Detail

      • parseSignatureFromFile

        public ActionSignature parseSignatureFromFile​(java.lang.String filename)
                                               throws java.io.FileNotFoundException,
                                                      java.io.IOException,
                                                      ParserException
        Parses the file of the given filename into a signature.
        Parameters:
        filename - the name of a file
        Returns:
        a formula
        Throws:
        java.io.FileNotFoundException - if the file is not found
        java.io.IOException - if IO fails
        ParserException - some parsing exceptions may be added here.
      • parseSignature

        public ActionSignature parseSignature​(java.lang.String text)
                                       throws java.io.IOException,
                                              ParserException
        Parses the given text into a signature of the given type.
        Parameters:
        text - a string
        Returns:
        a formula
        Throws:
        java.io.IOException - if IO fails
        ParserException - some parsing exceptions may be added here.
      • parseSignature

        public ActionSignature parseSignature​(java.io.Reader reader)
                                       throws java.io.IOException,
                                              ParserException
        Parses the given reader into a signature of the given type.
        Parameters:
        reader - a reader
        Returns:
        a formula
        Throws:
        java.io.IOException - if IO fails
        ParserException - some parsing exceptions may be added here.