Class SqlToBeanShell

java.lang.Object
ca.spatial.parser.SqlToBeanShell

public class SqlToBeanShell extends Object
Convert a PL/pgSQL function to an equivalent BeanShell function. This class is experimental and has not been programmed to contain all of the syntax and data types possible in PL/pgSQL. Consequently it may not be able to properly convert all cases. Please report any issues to SPS so that this script may be improved.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    Lexical state.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    End of File.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    Lexical state.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    ca.spatial.parser.Token
    Next token.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
    ca.spatial.parser.Token
    Current token.
    ca.spatial.parser.SqlToBeanShellTokenManager
    Generated Token Manager.
    static String[]
    Literal token values.
    static int
    RegularExpression Id.
    static int
    RegularExpression Id.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SqlToBeanShell​(ca.spatial.parser.SqlToBeanShellTokenManager tm)
    Constructor with generated Token Manager.
    Constructor with InputStream.
    SqlToBeanShell​(InputStream stream, String encoding)
    Constructor with InputStream and supplied encoding
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    convertMethod​(String filename, Window parent, boolean modal)
     
    static String
    convertMethod​(String sql, String filename)
     
    void
    Disable tracing.
    void
    Enable tracing.
    Generate ParseException.
    ca.spatial.parser.Token
    Get the next Token.
    ca.spatial.parser.Token
    getToken​(int index)
    Get the specific Token.
    static void
    main​(String[] args)
     
    void
    ReInit​(ca.spatial.parser.SqlToBeanShellTokenManager tm)
    Reinitialise.
    void
    ReInit​(InputStream stream)
    Reinitialise.
    void
    ReInit​(InputStream stream, String encoding)
    Reinitialise.
    void
    ReInit​(Reader stream)
    Reinitialise.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SqlToBeanShell

      public SqlToBeanShell(InputStream stream)
      Constructor with InputStream.
    • SqlToBeanShell

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

      public SqlToBeanShell(Reader stream)
      Constructor.
    • SqlToBeanShell

      public SqlToBeanShell(ca.spatial.parser.SqlToBeanShellTokenManager tm)
      Constructor with generated Token Manager.
  • Method Details

    • main

      public static void main(String[] args)
    • convertMethod

      public static String convertMethod(String sql, String filename)
    • convertMethod

      public static void convertMethod(String filename, Window parent, boolean modal)
    • 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(ca.spatial.parser.SqlToBeanShellTokenManager tm)
      Reinitialise.
    • getNextToken

      public final ca.spatial.parser.Token getNextToken()
      Get the next Token.
    • getToken

      public final ca.spatial.parser.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.