Package ca.spatial.parser
Class SqlToBeanShell
java.lang.Object
ca.spatial.parser.SqlToBeanShell
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
FieldsModifier and TypeFieldDescriptionstatic 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
ConstructorsConstructorDescriptionSqlToBeanShell(ca.spatial.parser.SqlToBeanShellTokenManager tm)
Constructor with generated Token Manager.SqlToBeanShell(InputStream stream)
Constructor with InputStream.SqlToBeanShell(InputStream stream, String encoding)
Constructor with InputStream and supplied encodingSqlToBeanShell(Reader stream)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
void
ReInit(ca.spatial.parser.SqlToBeanShellTokenManager tm)
Reinitialise.void
ReInit(InputStream stream)
Reinitialise.void
ReInit(InputStream stream, String encoding)
Reinitialise.void
Reinitialise.
-
Field Details
-
token_source
public ca.spatial.parser.SqlToBeanShellTokenManager token_sourceGenerated Token Manager. -
token
public ca.spatial.parser.Token tokenCurrent token. -
jj_nt
public ca.spatial.parser.Token jj_ntNext token. -
EOF
static final int EOFEnd of File.- See Also:
- Constant Field Values
-
COMMENT
static final int COMMENTRegularExpression Id.- See Also:
- Constant Field Values
-
LANGUAGE
static final int LANGUAGERegularExpression Id.- See Also:
- Constant Field Values
-
ALTER
static final int ALTERRegularExpression Id.- See Also:
- Constant Field Values
-
SEMI2
static final int SEMI2RegularExpression Id.- See Also:
- Constant Field Values
-
INT
static final int INTRegularExpression Id.- See Also:
- Constant Field Values
-
INTEGER
static final int INTEGERRegularExpression Id.- See Also:
- Constant Field Values
-
TEXT
static final int TEXTRegularExpression Id.- See Also:
- Constant Field Values
-
CHARACTER
static final int CHARACTERRegularExpression Id.- See Also:
- Constant Field Values
-
VARYING
static final int VARYINGRegularExpression Id.- See Also:
- Constant Field Values
-
AS
static final int ASRegularExpression Id.- See Also:
- Constant Field Values
-
CASE
static final int CASERegularExpression Id.- See Also:
- Constant Field Values
-
END
static final int ENDRegularExpression Id.- See Also:
- Constant Field Values
-
WHEN
static final int WHENRegularExpression Id.- See Also:
- Constant Field Values
-
THEN
static final int THENRegularExpression Id.- See Also:
- Constant Field Values
-
ELSE
static final int ELSERegularExpression Id.- See Also:
- Constant Field Values
-
DECLARE
static final int DECLARERegularExpression Id.- See Also:
- Constant Field Values
-
BEGIN
static final int BEGINRegularExpression Id.- See Also:
- Constant Field Values
-
CONCAT
static final int CONCATRegularExpression Id.- See Also:
- Constant Field Values
-
CAST
static final int CASTRegularExpression Id.- See Also:
- Constant Field Values
-
COMMA
static final int COMMARegularExpression Id.- See Also:
- Constant Field Values
-
SEMI
static final int SEMIRegularExpression Id.- See Also:
- Constant Field Values
-
LPAREN
static final int LPARENRegularExpression Id.- See Also:
- Constant Field Values
-
RPAREN
static final int RPARENRegularExpression Id.- See Also:
- Constant Field Values
-
RETURNS
static final int RETURNSRegularExpression Id.- See Also:
- Constant Field Values
-
RETURN
static final int RETURNRegularExpression Id.- See Also:
- Constant Field Values
-
BODY
static final int BODYRegularExpression Id.- See Also:
- Constant Field Values
-
SELECT
static final int SELECTRegularExpression Id.- See Also:
- Constant Field Values
-
INTO
static final int INTORegularExpression Id.- See Also:
- Constant Field Values
-
EQ
static final int EQRegularExpression Id.- See Also:
- Constant Field Values
-
NE
static final int NERegularExpression Id.- See Also:
- Constant Field Values
-
LT
static final int LTRegularExpression Id.- See Also:
- Constant Field Values
-
LE
static final int LERegularExpression Id.- See Also:
- Constant Field Values
-
GT
static final int GTRegularExpression Id.- See Also:
- Constant Field Values
-
GE
static final int GERegularExpression Id.- See Also:
- Constant Field Values
-
AND
static final int ANDRegularExpression Id.- See Also:
- Constant Field Values
-
OR
static final int ORRegularExpression Id.- See Also:
- Constant Field Values
-
ASSIGN
static final int ASSIGNRegularExpression Id.- See Also:
- Constant Field Values
-
IS
static final int ISRegularExpression Id.- See Also:
- Constant Field Values
-
NULL
static final int NULLRegularExpression Id.- See Also:
- Constant Field Values
-
NUM
static final int NUMRegularExpression Id.- See Also:
- Constant Field Values
-
OTHERS
static final int OTHERSRegularExpression Id.- See Also:
- Constant Field Values
-
ID
static final int IDRegularExpression Id.- See Also:
- Constant Field Values
-
NUMBER
static final int NUMBERRegularExpression Id.- See Also:
- Constant Field Values
-
STRING_LITERAL
static final int STRING_LITERALRegularExpression Id.- See Also:
- Constant Field Values
-
DEFAULT
static final int DEFAULTLexical state.- See Also:
- Constant Field Values
-
IGNORE
static final int IGNORELexical state.- See Also:
- Constant Field Values
-
tokenImage
Literal token values.
-
-
Constructor Details
-
SqlToBeanShell
Constructor with InputStream. -
SqlToBeanShell
Constructor with InputStream and supplied encoding -
SqlToBeanShell
Constructor. -
SqlToBeanShell
public SqlToBeanShell(ca.spatial.parser.SqlToBeanShellTokenManager tm)Constructor with generated Token Manager.
-
-
Method Details
-
main
-
convertMethod
-
convertMethod
-
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
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
Generate ParseException. -
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-