| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.datatools.sqltools.sql.parser.ParsingResult
public abstract class ParsingResult
Used to cache the parsing result of a sql text. TODO: move the findXXX and getXXX methods to Visitor.
| Constructor Summary | |
|---|---|
| ParsingResult() | |
| ParsingResult(Node rootNode,
              java.util.ArrayList exceptions) | |
| Method Summary | |
|---|---|
|  void | addCurrentTables(Node simpleNode,
                 Token token,
                 boolean isContentAssist)Add a new table object into the current table list. | 
|  void | addCurrentTables(java.lang.String tableName,
                 java.lang.String aliasName,
                 boolean isContentAssist)Add a new table object into the current table list. | 
|  void | addEntry(java.lang.Object t,
         java.lang.String type) | 
|  void | addExpectedUnreservedKeywords(java.lang.String unReservedKeyword)Adds an unreserved keyword if it doesn't exist in the list. | 
|  void | clearCurrentTableNames(boolean isContentAssist)Clear the content of the current table list. | 
|  Node | findContainingDeployable(org.eclipse.jface.text.IDocument document,
                         int offset,
                         IASTStart start)Finds the containing SP/event/function/trigger statement, or _rootNode if there're standalone statements before offset, else return null | 
| static Node | findNode(org.eclipse.jface.text.IDocument document,
         int offset,
         Node rootNode,
         boolean inclusive)Finds the node that offset belongs to, or return null if none is found. | 
|  Node | findParentCompound(org.eclipse.jface.text.IDocument document,
                   int offset,
                   Node rootNode)Finds the immediate containing compound statement, or return null | 
|  java.util.List | getCurrentTables()Return the current table list. | 
|  java.util.ArrayList | getCursorNames(org.eclipse.jface.text.IDocument document,
               int offset)Returns all the cursor names that can be used at the position indicated by offset. | 
|  java.util.HashMap | getCursors(org.eclipse.jface.text.IDocument document,
           int offset)Gets all the parameter definitions indexed by their names in the surrounding stored procedure | 
|  java.lang.String[] | getEntries(java.lang.String type) | 
|  java.util.ArrayList | getExceptions()Accumulates all the exceptions during the parsing process | 
|  java.util.List | getExpectedUnreservedKeywords()Returns the expected unreserved keywords, used in content assist. | 
|  java.util.HashMap | getParameters(org.eclipse.jface.text.IDocument document,
              int offset)Gets all the parameter definitions indexed by their names in the surrounding stored procedure | 
| abstract  java.util.ArrayList | getPrefix(java.util.ArrayList tokenLists,
          Node node)Gets prefix name of result. | 
|  java.util.ArrayList | getReferencedTables() | 
|  IASTStart | getRootNode() | 
|  int | getScope()Gets the current scope at the position where content assist is invoked. | 
| abstract  java.util.ArrayList | getUnSharableTempTables(org.eclipse.jface.text.IDocument document,
                        int offset)Gets non-sharable temp tables referenced in sp/trigger which have not been defined explicitly in sp/trigger,not in annotation. | 
|  java.util.HashMap | getVariables(org.eclipse.jface.text.IDocument document,
             int offset)Gets all the variable definitions indexed by their names that can be used at the position indicated by offset | 
| abstract  boolean | isValidObjectsFormats(java.util.ArrayList tokenLists)Checks whether the token list represents a valiad database object. | 
| abstract  boolean | isVarOrPara(java.util.ArrayList tokenLists)Checks whether the token list is variable or parameter. | 
|  void | setExceptions(java.util.ArrayList exceptions)/** Accumulates all the exceptions during the parsing process | 
|  void | setRootNode(Node rootNode) | 
|  void | setScope(int scope)Sets the current scope | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ParsingResult()
public ParsingResult(Node rootNode,
                     java.util.ArrayList exceptions)
| Method Detail | 
|---|
public java.util.ArrayList getExceptions()
public IASTStart getRootNode()
public void setExceptions(java.util.ArrayList exceptions)
public void setRootNode(Node rootNode)
public java.util.List getExpectedUnreservedKeywords()
public void addExpectedUnreservedKeywords(java.lang.String unReservedKeyword)
public java.util.ArrayList getCursorNames(org.eclipse.jface.text.IDocument document,
                                          int offset)
document - offset - rootNode - 
public java.util.HashMap getVariables(org.eclipse.jface.text.IDocument document,
                                      int offset)
document - offset - 
public java.util.HashMap getParameters(org.eclipse.jface.text.IDocument document,
                                       int offset)
document - offset - 
public Node findParentCompound(org.eclipse.jface.text.IDocument document,
                               int offset,
                               Node rootNode)
document - offset - 
public static Node findNode(org.eclipse.jface.text.IDocument document,
                            int offset,
                            Node rootNode,
                            boolean inclusive)
document - offset - rootNode - the outmost node to search forinclusive - whether to include the trailing spaces
public Node findContainingDeployable(org.eclipse.jface.text.IDocument document,
                                     int offset,
                                     IASTStart start)
document - offset - start - TODO
public java.util.HashMap getCursors(org.eclipse.jface.text.IDocument document,
                                    int offset)
document - offset - 
public int getScope()
SQLParserConstantsSQLParserConstantspublic void setScope(int scope)
public java.util.List getCurrentTables()
public void addCurrentTables(Node simpleNode,
                             Token token,
                             boolean isContentAssist)
simpleNode - the node's text which is the table name.token - the token's image which is the alias name of table.isContentAssist - true for content assist.
 TODO revisit the necessity of isContentAssist
public void addCurrentTables(java.lang.String tableName,
                             java.lang.String aliasName,
                             boolean isContentAssist)
tableName - the table name.aliasName - the alias name of the table.isContentAssist - true for content assist.public void clearCurrentTableNames(boolean isContentAssist)
isContentAssist - true for content assist.public abstract boolean isValidObjectsFormats(java.util.ArrayList tokenLists)
tokenLists - 
public abstract boolean isVarOrPara(java.util.ArrayList tokenLists)
tokenLists - 
public abstract java.util.ArrayList getPrefix(java.util.ArrayList tokenLists,
                                              Node node)
tokenLists - node - 
public abstract java.util.ArrayList getUnSharableTempTables(org.eclipse.jface.text.IDocument document,
                                                            int offset)
document - offset - 
public java.util.ArrayList getReferencedTables()
public void addEntry(java.lang.Object t,
                     java.lang.String type)
public java.lang.String[] getEntries(java.lang.String type)
type - defined in SQLParserConstants
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||