public final class SchemaDictionary extends java.lang.Object implements SchemaParserTokenTypes
SymbolResolver
to
perform lookups of database entity names. Defines an API to load one or
more Progress schemas into the primary lookup scope, to add arbitrary
database, table, and field name hierarchies into additional lookup scopes,
and to remove scopes in the reverse order of that in which they were added.
Allows lookups of abbreviated table and field names, and of qualified and
unqualified (see namespace class description
) database,
table, and field names.
Using qualified or unqualified names (abbreviated as well for tables and fields), callers can:
A set of default database schemas, as defined by the schema configuration,
is loaded into the dictionary upon construction. If a caller wishes to
add additional schema information dynamically, a new scope should first
be created with the addScope()
method. This ensures the dynamically
added schema information is easily removed when it goes out of scope, with
a subsequent call to removeScope()
.
The most recently added scope may be removed in its entirety via the
removeScope()
method. The outermost scopes -- the schema global and
user global scopes -- are protected from removal. Individual entries may
not be removed from the schema global scope. Namespaces for each
non-protected scope are maintained by the promoteTable(java.lang.String)
method
which adds name nodes to the namespaces of the top-most scope. This changes
the lookup processing, making some normally ambiguous names unambiguous
within the current scope's context. As scopes are removed, the namespace
contents of the removed scope are propagated into the corresponding
namespace of the enclosing scope. This duplicates Progress' behavior such
that subsequent code in the enclosing block can be disambiguated too.
This dictionary manages requests to store and retrieve other schema information as well, such as field and table options and table indices. This data is stored internally as a set of ASTs rooted at the database level.
Known issues/limitations:
Modifier and Type | Class and Description |
---|---|
private class |
SchemaDictionary.Scope
Encapsulates several namespaces into a specific lookup scope.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
aliases
Map of database aliases to database names
|
private java.util.Map<java.lang.String,Aast> |
databases
Database ASTs, mapped by database name
|
private static java.lang.String |
DICTDB
Implicit DICTDB alias
|
private static int |
EXT_PROC_SCOPE
Index of external procedure scope
|
private static int[] |
FIELD_PROPS
Token types which represent permitted properties for copy purposes
|
private static java.util.ArrayList<java.lang.Integer> |
FIELD_TYPE_LIST
List of all non-metadata field types
|
private SchemaLoader |
loader
Object which loads namespace data from persistent storage
|
private static ContextLocal<SchemaDictionary> |
localDict
Context-local SchemaDictionary instance.
|
private boolean |
markPreferred
A flag indicating that all fields should be marked as preferred.
|
private Aast |
modelTable
Table which defines state being copied in a temp-table "like" clause
|
private static int[] |
NS_LIST
List of namespaces by entity type.
|
private static java.util.Map<java.lang.String,java.lang.String> |
pristineAliases
Original unmodified map of aliases to database names.
|
private static java.util.Map<java.lang.String,Aast> |
pristineDbs
Original unmodified map of database ASTs.
|
private static SchemaDictionary.Scope |
pristineScope
Original unmodified schema global scope.
|
private int |
protectedScopeCount
Number of protected scopes (i.e., those which cannot be removed)
|
private ScopedDictionary<NameNode,java.lang.String> |
qualifiers
Map of promoted buffers to explicit database qualifiers
|
private static int |
SCHEMA_GLOBAL_SCOPE
Index of schema global scope in stack
|
private java.util.Map<NameNode,java.lang.ref.WeakReference<SchemaDictionary.Scope>> |
scopeMap
Map of weak references to scopes, indexed by name nodes
|
private java.util.Stack<SchemaDictionary.Scope> |
scopes
Stack of namespace scopes for contextual changes to dictionary
|
(package private) static java.lang.String |
TEMP_DB
Reserved name of temp-table parent database
|
(package private) static java.lang.String |
TEMP_TABLE_DB
Temporary table database name which is persisted in ASTs
|
static int |
UNKNOWN
Indicates that a token type cannot be determined
|
private static int |
USER_GLOBAL_SCOPE
Index of user global scope in stack
|
(package private) static java.lang.String |
WORK_DB
Reserved name of work-table parent database
|
ABBREVIATED, AGGREGATE, ALTER_TABLE, AMBIGUOUS, ANY_LOCK, AREA, ARGUMENTS, AS_BUTTON, ASSIGN, ASSIGNMENT, AST_NODE, AT, ATTR_CHAR, ATTR_CLASS, ATTR_COM_HANDLE, ATTR_DATE, ATTR_DATETIME, ATTR_DATETIME_TZ, ATTR_DEC, ATTR_HANDLE, ATTR_INT, ATTR_INT64, ATTR_LOGICAL, ATTR_LONGCHAR, ATTR_MEMPTR, ATTR_POLY, ATTR_RAW, ATTR_RECID, ATTR_ROWID, BACKSLASH, BEGIN_ATTR, BEGIN_ATTR_METH, BEGIN_BUFFERTYPES, BEGIN_CALLGRAPH, BEGIN_FIELDTYPES, BEGIN_FUNCTYPES, BEGIN_FWD_EXTENSION, BEGIN_INDEX_MATCH_TYPES, BEGIN_LVALUE, BEGIN_METATYPES, BEGIN_METH, BEGIN_MULTIWORD, BEGIN_NATIVE_VARTYPES, BEGIN_RECORDTYPES, BEGIN_RESERVED, BEGIN_SCHEMA, BEGIN_SCHEMAKW, BEGIN_UNRESERVED, BEGIN_VARTYPES, BEGIN_WIDGETS, BEGINS_MATCH, BLOCK, BOGUS, BOOL_FALSE, BOOL_TRUE, BUFFER, BUFFER_SCOPE, CARET, CHILD_PROCESS, CLASS_DEF, CLASS_EVENT, CLASS_NAME, CLIENT_WHERE, CLIENT_WHERE_SUBST, CLOSE_CURSOR, CLOSE_QUERY, CLOSE_STORED_PROCEDURE, CMT_CLOSE, CMT_OPEN, COLON, COLOR_PHRASE, COLUMN_LIST, COLUMN_REF, COM_INVOCATION, COM_METHOD, COM_OBJECT, COM_PARAMETER, COM_PROPERTY, COMMA, COMMAND_TEXT, COMMAND_TOKENS, COMMENT, CONNECT_OPTIONS, CONNECT_TEXT, CONSTRUCTOR, CONTENT_ARRAY, COPY_FROM_SB, COPY_TO_SB, CREATE_ALIAS, CREATE_BROWSE, CREATE_BUFFER, CREATE_CALL, CREATE_CLIENT_PRINCIPAL, CREATE_DATA_SOURCE, CREATE_DATABASE, CREATE_DATASET, CREATE_INDEX, CREATE_OBJECT, CREATE_QUERY, CREATE_SAX_ATTRIBUTES, CREATE_SAX_READER, CREATE_SAX_WRITER, CREATE_SERVER, CREATE_SOAP_HEADER, CREATE_SOAP_HEADER_ENTRYREF, CREATE_SOCKET, CREATE_SRV_SOCKET, CREATE_TABLE, CREATE_TEMP_TABLE, CREATE_TIMER, CREATE_VIEW, CREATE_WIDGET, CREATE_WIDGET_POOL, CREATE_X_DOCUMENT, CREATE_X_NODEREF, CUSTOMER_SPECIFIC, CYCLE_ON_LIMIT, DATA_RELATION, DATA_SET, DATA_SOURCE, DATABASE, DATE_LITERAL, DATETIME_LITERAL, DATETIME_TZ_LITERAL, DB_EVENT, DB_REF_NON_STATIC, DB_SYMBOL, DDE_ADVISE, DDE_EXECUTE, DDE_GET, DDE_INITIATE, DDE_REQUEST, DDE_SEND, DDE_SERVER, DDE_TERMINATE, DEC_LITERAL, DECLARE_CURSOR, DEFINE_BROWSE, DEFINE_BUFFER, DEFINE_BUTTON, DEFINE_DATA_SOURCE, DEFINE_DATASET, DEFINE_EVENT, DEFINE_FIELD, DEFINE_FRAME, DEFINE_IMAGE, DEFINE_MENU, DEFINE_PARAMETER, DEFINE_PROPERTY, DEFINE_PROPERTY_GET, DEFINE_PROPERTY_SET, DEFINE_QUERY, DEFINE_RECTANGLE, DEFINE_STREAM, DEFINE_SUB_MENU, DEFINE_TEMP_TABLE, DEFINE_VARIABLE, DEFINE_WORK_TABLE, DELETE_ALIAS, DELETE_FROM, DELETE_OBJECT, DELETE_PROCEDURE, DELETE_WIDGET, DELETE_WIDGET_POOL, DESCRIPTION, DESTRUCTOR, DIGIT, DISABLE_TRIGGERS, DIVIDE, DOT, DOTNET_DELEGATE, DROP_INDEX, DROP_TABLE, DROP_VIEW, DSTRING, DUMP_NAME, DYNAMIC, EDITING_BLOCK, EMBEDDED_ASSIGNMENT, EMBEDDED_SQL, EMPTY_TEMP_TABLE, END_ATTR, END_ATTR_METH, END_BUFFERTYPES, END_CALLGRAPH, END_FIELDTYPES, END_FUNCTYPES, END_FWD_EXTENSION, END_INDEX_MATCH_TYPES, END_LVALUE, END_METATYPES, END_METH, END_MULTIWORD, END_NATIVE_VARTYPES, END_RECORDTYPES, END_RESERVED, END_SCHEMA, END_SCHEMAKW, END_UNRESERVED, END_VARTYPES, END_WIDGETS, EOF, EQUALITY_MATCH, EQUALS, EVENT, EVENT_LIST, EVENT_SIGNATURE, EXCLUSIVE_LOCK_LITERAL, EXPANDED_SCOPE, EXPORT_FIELD, EXPRESSION, EXTERNAL_PROCEDURE, FIELD_BIGINT, FIELD_BLOB, FIELD_BYTE, FIELD_CHAR, FIELD_CLASS, FIELD_CLOB, FIELD_COM_HANDLE, FIELD_DATE, FIELD_DATETIME, FIELD_DATETIME_TZ, FIELD_DEC, FIELD_DOUBLE, FIELD_FIXCHAR, FIELD_FLOAT, FIELD_HANDLE, FIELD_INT, FIELD_INT64, FIELD_LOGICAL, FIELD_RAW, FIELD_RECID, FIELD_ROWID, FIELD_SHORT, FIELD_TIME, FIELD_TIMESTAMP, FILE_RESOURCE, FILENAME, FILEROOT, FILTER_SPEC, FORM_ITEM, FORMAT_PHRASE, FRAME_ALLOC, FRAME_ELEMENT, FRAME_LOCK, FRAME_PHRASE, FRAME_SCOPE, FRAME_UNLOCK, FREE_REFERENCE, FROZEN, FUNC_CHAR, FUNC_CLASS, FUNC_COM_HANDLE, FUNC_DATE, FUNC_DATETIME, FUNC_DATETIME_TZ, FUNC_DEC, FUNC_HANDLE, FUNC_INT, FUNC_INT64, FUNC_LOGICAL, FUNC_LONGCHAR, FUNC_MEMPTR, FUNC_POLY, FUNC_RAW, FUNC_RECID, FUNC_ROWID, FUNCTION, FUNCTION_CALL, GROUP_BY, GT, GTE, HANDLE_TO, HIDDEN, IMPORT_FIELD, IN_WIDGET_POOL, INCLUDE_FILE, INCLUDES, INCREMENT, INDEX, INDEX_FIELD, INLINE_VAR_DEF, INLINE_VAR_DEF_ARRAY, INNER_BLOCK, INNER_JOIN, INPUT_CLEAR, INPUT_CLOSE, INPUT_FROM, INPUT_OUTPUT_CLOSE, INPUT_OUTPUT_THRU, INPUT_THRU, INSERT_INTO, INT_PROC, INTERFACE_DEF, INTERNAL_PROCEDURE, IO_OPTIONS, IPC_RESOURCE, IS_NOT_NULL, IS_NULL, JUNK, KEY_FIELD, KEY_FUNCTION, KW_3D, KW_ABBV, KW_ABORT, KW_ABS, KW_ABSTRACT, KW_ACC_CHG, KW_ACC_RCHG, KW_ACCEL, KW_ACCUM, KW_ACT_FORM, KW_ACT_WIN, KW_ACTIVE, KW_ACTOR, KW_ADD, KW_ADD_1ST, KW_ADD_BUF, KW_ADD_C_C, KW_ADD_C_F, KW_ADD_EVTP, KW_ADD_F_F, KW_ADD_HENT, KW_ADD_IDXF, KW_ADD_INVL, KW_ADD_L_C, KW_ADD_LAST, KW_ADD_LIKF, KW_ADD_LIKI, KW_ADD_NEWF, KW_ADD_NEWI, KW_ADD_PREL, KW_ADD_REL, KW_ADD_SLOC, KW_ADD_SRCB, KW_ADD_SUP, KW_ADM_DATA, KW_ADM_TO, KW_ADVISE, KW_AFT_BUFF, KW_AFT_FILL, KW_AFT_R_F, KW_AFT_ROID, KW_AFT_TBL, KW_ALERT_BX, KW_ALIAS, KW_ALL, KW_ALLW_C_S, KW_ALLW_REP, KW_ALT_KEY, KW_ALTER, KW_ALW_ON_T, KW_AMBIG, KW_ANALYZ, KW_AND, KW_ANSI_ONL, KW_ANY, KW_ANY_KEY, KW_ANY_PRT, KW_ANYWHERE, KW_APP_INFO, KW_APP_PW, KW_APP_UID, KW_APPEND, KW_APPEND_C, KW_APPEND_L, KW_APPL, KW_APPL_A_B, KW_APPL_CBK, KW_APPL_CID, KW_APPLY, KW_AREA, KW_ARR_MSG, KW_AS, KW_ASC, KW_ASCEND, KW_ASCII_2H, KW_ASK_OVER, KW_ASSEMBLY, KW_ASSIGN, KW_ASYNC, KW_ASYNC_RC, KW_ASYNC_RH, KW_AT, KW_ATT_DSRC, KW_ATT_PLST, KW_ATTR, KW_ATTR_NAM, KW_AUD_CTRL, KW_AUD_ENAB, KW_AUD_EV_C, KW_AUD_POL, KW_AUTHEN_F, KW_AUTHORZN, KW_AUTO_COM, KW_AUTO_D_X, KW_AUTO_DEL, KW_AUTO_END, KW_AUTO_GO, KW_AUTO_IND, KW_AUTO_RES, KW_AUTO_RET, KW_AUTO_SYN, KW_AUTO_VAL, KW_AUTO_ZAP, KW_AUTOMATC, KW_AVAIL, KW_AVERAGE, KW_AVG, KW_AVL_FMTS, KW_AVL_MSGS, KW_B_ENDIAN, KW_B4_BUFF, KW_B4_FILL, KW_B4_HIDE, KW_B4_R_F, KW_B4_ROWID, KW_B4_TABLE, KW_BACK_TAB, KW_BACKGRND, KW_BACKSP, KW_BACKWARD, KW_BAS_LOGG, KW_BASE_ADE, KW_BASE_KEY, KW_BASE64_D, KW_BASE64_E, KW_BATCH_MO, KW_BATCH_SZ, KW_BEG_EV_G, KW_BEGINS, KW_BELL, KW_BETWEEN, KW_BGCOLOR, KW_BIGINT, KW_BINARY, KW_BIND, KW_BIND_WH, KW_BLANK, KW_BLK_IT_D, KW_BLK_LVL, KW_BLOB, KW_BLOCK, KW_BORD_B_C, KW_BORD_B_P, KW_BORD_L_C, KW_BORD_L_P, KW_BORD_R_C, KW_BORD_R_P, KW_BORD_T_C, KW_BORD_T_P, KW_BOTH, KW_BOTTOM, KW_BOTTOM_C, KW_BOX, KW_BOX_SEL, KW_BREAK, KW_BREAK_L, KW_BROWSE, KW_BTOS, KW_BUF_COMP, KW_BUF_COPY, KW_BUF_CREA, KW_BUF_DEL, KW_BUF_FLD, KW_BUF_HNDL, KW_BUF_NAME, KW_BUF_REL, KW_BUF_VAL, KW_BUF_VLID, KW_BUFFER, KW_BUFFER_C, KW_BUFFER_L, KW_BUFPOOL, KW_BUFRPOOL, KW_BUTTON, KW_BY, KW_BY_PTR, KW_BY_REF, KW_BY_VALUE, KW_BY_VAR_P, KW_BYTE, KW_BYTES_R, KW_BYTES_W, KW_CACHE, KW_CACHE_SZ, KW_CALL, KW_CALL_NAM, KW_CALL_TYP, KW_CALLBACK, KW_CAN_CREA, KW_CAN_DEL, KW_CAN_DO, KW_CAN_DUMP, KW_CAN_FIND, KW_CAN_LOAD, KW_CAN_QRY, KW_CAN_READ, KW_CAN_SET, KW_CAN_WRT, KW_CANC_BRK, KW_CANCEL_B, KW_CANCEL_P, KW_CANCEL_R, KW_CANCELLD, KW_CAPS, KW_CARE_PNT, KW_CASE, KW_CASE_SEN, KW_CAST, KW_CATCH, KW_CBIT, KW_CDECL, KW_CEASE, KW_CENTER, KW_CFG_NAME, KW_CHAINED, KW_CHAR, KW_CHAR_LEN, KW_CHARSET, KW_CHECK, KW_CHECK_AM, KW_CHECKED, KW_CHLD_BUF, KW_CHLD_NUM, KW_CHOICES, KW_CHOOSE, KW_CHR, KW_CLASS, KW_CLEAR, KW_CLIP, KW_CLNT_C_I, KW_CLNT_PRL, KW_CLNT_TTY, KW_CLNT_TYP, KW_CLNT_WS, KW_CLOB, KW_CLOB_COL, KW_CLOB_CP, KW_CLOB_TYP, KW_CLONE_ND, KW_CLOSE, KW_CLOSE_AP, KW_CLOSE_LG, KW_CLR_AP_C, KW_CLR_LOG, KW_CLR_S_AR, KW_CLR_SEL, KW_CLS_TYPE, KW_CNCL_R_A, KW_CNTRL_BX, KW_CNTRL_FR, KW_CNTRL_NM, KW_CODE, KW_CODEBASE, KW_COL, KW_COL_BGC, KW_COL_CP, KW_COL_DC, KW_COL_FGC, KW_COL_FONT, KW_COL_LAB, KW_COL_MOV, KW_COL_OF, KW_COL_PFC, KW_COL_R_O, KW_COL_RES, KW_COL_SCR, KW_COLLATE, KW_COLON, KW_COLON_AL, KW_COLOR, KW_COLR_TAB, KW_COLUMNS, KW_COM_HNDL, KW_COM_SELF, KW_COMBO_BX, KW_COMMAND, KW_COMPARE, KW_COMPARES, KW_COMPILE, KW_COMPILER, KW_COMPLETE, KW_CONN, KW_CONN_ED, KW_CONSTRUC, KW_CONTAINS, KW_CONTENTS, KW_CONTROL, KW_CONTROLS, KW_CONVERT, KW_COOKIE_D, KW_COPY, KW_COUNT, KW_COUNT_OF, KW_COVERAGE, KW_CP, KW_CP_CVT, KW_CPCASE, KW_CPCOLL, KW_CPINTERN, KW_CPLOG, KW_CPPRINT, KW_CPRCODEI, KW_CPRCODEO, KW_CPSTREAM, KW_CPTERM, KW_CPY_DSET, KW_CPY_LOB, KW_CPY_SATR, KW_CPY_TTBL, KW_CRC, KW_CRC_VAL, KW_CREAT_LK, KW_CREAT_ND, KW_CREAT_NN, KW_CREAT_OA, KW_CREAT_RL, KW_CREAT_TF, KW_CREATE, KW_CTOS, KW_CTX, KW_CTX_H, KW_CTX_H_F, KW_CTX_H_ID, KW_CTX_POP, KW_CUR_CHAR, KW_CUR_CHG, KW_CUR_COL, KW_CUR_DATE, KW_CUR_DOWN, KW_CUR_ENV, KW_CUR_ITER, KW_CUR_LANG, KW_CUR_LEFT, KW_CUR_LINE, KW_CUR_OFF, KW_CUR_R_M, KW_CUR_RES, KW_CUR_RGHT, KW_CUR_UP, KW_CUR_VAL, KW_CUR_WIN, KW_CURRENCY, KW_CURRENT, KW_CURSOR, KW_CUT, KW_CVT_2OFF, KW_CVT_3D_C, KW_CVT_DT, KW_CYCLE, KW_DATA_BND, KW_DATA_E_R, KW_DATA_REL, KW_DATA_SCM, KW_DATA_SM, KW_DATA_SRC, KW_DATABASE, KW_DATASET, KW_DATASRV, KW_DATATYPE, KW_DATE, KW_DATE_FMT, KW_DATE_TZ, KW_DATETIME, KW_DAY, KW_DB_CTXT, KW_DB_REF, KW_DB_REM_H, KW_DBCOLL, KW_DBCP, KW_DBG_ALRT, KW_DBG_LST, KW_DBNAME, KW_DBPARAM, KW_DBREST, KW_DBTASKID, KW_DBTYPE, KW_DBVERS, KW_DCOLOR, KW_DDE, KW_DDE_ERR, KW_DDE_ID, KW_DDE_ITEM, KW_DDE_NAME, KW_DDE_NOTI, KW_DDE_TOPI, KW_DEBLANK, KW_DEBUG, KW_DEBUGGER, KW_DEC, KW_DECIMALS, KW_DECL_NSP, KW_DECLARE, KW_DECRYPT, KW_DEF_ACTN, KW_DEF_BUFH, KW_DEF_COMM, KW_DEF_EXTN, KW_DEF_NOXL, KW_DEF_POP, KW_DEF_STR, KW_DEF_UEVM, KW_DEF_VAL, KW_DEF_WIN, KW_DEFAULT, KW_DEFINE, KW_DEFLT_BN, KW_DEL_C_R, KW_DEL_CHAR, KW_DEL_COL, KW_DEL_COOK, KW_DEL_E_L, KW_DEL_FLD, KW_DEL_H_EN, KW_DEL_LINE, KW_DEL_NODE, KW_DEL_PROC, KW_DEL_R_L, KW_DEL_S_R, KW_DEL_S_RS, KW_DEL_WORD, KW_DELEGATE, KW_DELETE, KW_DELIMIT, KW_DESCEND, KW_DESCR, KW_DESEL_FR, KW_DESEL_R, KW_DESEL_SR, KW_DESELCTN, KW_DESTRUCT, KW_DET_DSRC, KW_DIALOG, KW_DICT, KW_DIR, KW_DIRECTRY, KW_DIS_A_ZA, KW_DIS_D_TR, KW_DIS_L_TR, KW_DIS_REDR, KW_DISABL_C, KW_DISABLE, KW_DISABLED, KW_DISCONN, KW_DISP, KW_DISP_MSG, KW_DISP_TYP, KW_DISP_TZ, KW_DISPATCH, KW_DISTINCT, KW_DMP_NAME, KW_DO, KW_DOMAIN_D, KW_DOMAIN_N, KW_DOMAIN_T, KW_DOS, KW_DOUBLE, KW_DOWN, KW_DRAG_EN, KW_DROP, KW_DROP_DWN, KW_DROP_FN, KW_DROP_LST, KW_DROP_TAR, KW_DSET_HND, KW_DSL_MGR, KW_DUMP, KW_DUMP_LGN, KW_DYN_CAST, KW_DYN_CURV, KW_DYN_FUNC, KW_DYN_INVK, KW_DYN_NEW, KW_DYN_NEXV, KW_DYNAMIC, KW_E_PROC_C, KW_EACH, KW_ECHO, KW_EDGE_C, KW_EDGE_P, KW_EDIT_B_T, KW_EDIT_C_P, KW_EDIT_C_U, KW_EDIT_CLR, KW_EDIT_CPY, KW_EDIT_CUT, KW_EDIT_PAS, KW_EDIT_TAB, KW_EDIT_UND, KW_EDITING, KW_EDITOR, KW_ELSE, KW_EMPTY, KW_EMPTY_DS, KW_EMPTY_SN, KW_EMPTY_TT, KW_ENABLE, KW_ENABLE_C, KW_ENABLE_E, KW_ENABLED, KW_ENC_AMK, KW_ENC_SALT, KW_ENCODE, KW_ENCODING, KW_ENCRYPT, KW_END, KW_END_B_SN, KW_END_DOC, KW_END_ELEM, KW_END_ERR, KW_END_EV_G, KW_END_F_D, KW_END_MOV, KW_END_RESZ, KW_END_RRES, KW_END_SEAR, KW_END_USER, KW_ENDKEY, KW_ENT_TLST, KW_ENTER_MB, KW_ENTERED, KW_ENTRY, KW_EQ, KW_ERR_CODE, KW_ERR_COL, KW_ERR_OBJD, KW_ERR_ROW, KW_ERR_S_T, KW_ERR_STAT, KW_ERR_STR, KW_ERROR, KW_ESCAPE, KW_ETIME, KW_EVENTS, KW_EVT_GRID, KW_EVT_PROC, KW_EVT_TYPE, KW_EXC_LOCK, KW_EXCEPT, KW_EXCL_ID, KW_EXCL_WEB, KW_EXEC_LOG, KW_EXECUTE, KW_EXISTS, KW_EXIT, KW_EXP, KW_EXPAND, KW_EXPANDBL, KW_EXPLICIT, KW_EXPORT, KW_EXPORT_P, KW_EXTENDED, KW_EXTENT, KW_EXTERN, KW_F_KEY_H, KW_FETCH, KW_FETCH_SR, KW_FGCOLOR, KW_FIELD, KW_FIL_C_D, KW_FIL_C_T, KW_FIL_INFO, KW_FIL_M_D, KW_FIL_M_T, KW_FIL_NAME, KW_FIL_OFF, KW_FIL_SIZE, KW_FIL_TYPE, KW_FILE, KW_FILL, KW_FILL_IN, KW_FILL_MOD, KW_FILL_WST, KW_FILLED, KW_FILTERS, KW_FINAL, KW_FINALLY, KW_FIND, KW_FIND_1ST, KW_FIND_BR, KW_FIND_CS, KW_FIND_CUR, KW_FIND_FD, KW_FIND_GLO, KW_FIND_LST, KW_FIND_NO, KW_FIND_NXT, KW_FIND_PO, KW_FIND_PRV, KW_FIND_SEL, KW_FIND_UNI, KW_FIND_WA, KW_FINDER, KW_FIR_DSET, KW_FIRST, KW_FIRST_AR, KW_FIRST_BU, KW_FIRST_CH, KW_FIRST_CO, KW_FIRST_DS, KW_FIRST_FM, KW_FIRST_OB, KW_FIRST_OF, KW_FIRST_PR, KW_FIRST_QR, KW_FIRST_SO, KW_FIRST_SR, KW_FIRST_SS, KW_FIRST_TI, KW_FIT_LCOL, KW_FIX_CP, KW_FIXCHAR, KW_FIXD_ONL, KW_FLAT_BUT, KW_FLD_TRG, KW_FLOAT, KW_FMT_DT, KW_FOCUS, KW_FOCUS_R, KW_FOCUS_RS, KW_FONT, KW_FONT_TAB, KW_FOR, KW_FORCE_F, KW_FORE, KW_FORM, KW_FORM_INP, KW_FORM_LIN, KW_FORMAT, KW_FORMATTE, KW_FORWARD, KW_FR_COL, KW_FR_DB, KW_FR_DOWN, KW_FR_FIELD, KW_FR_FILE, KW_FR_INDEX, KW_FR_LINE, KW_FR_NAME, KW_FR_ROW, KW_FR_SPACE, KW_FR_VAL, KW_FR_X, KW_FR_Y, KW_FRAGMENT, KW_FRAME, KW_FREQ, KW_FROM, KW_FROM_CHR, KW_FROM_CUR, KW_FROM_PIX, KW_FROZEN, KW_FULL_H_C, KW_FULL_H_P, KW_FULL_W_C, KW_FULL_W_P, KW_FULLPATH, KW_FUNC_C_T, KW_FUNCT, KW_FWD_ONLY, KW_GEN_MD5, KW_GEN_PBEK, KW_GEN_PBES, KW_GEN_RNDK, KW_GEN_UUID, KW_GET, KW_GET_1ST, KW_GET_A_CT, KW_GET_A_N, KW_GET_ATTR, KW_GET_B_A, KW_GET_B_OR, KW_GET_BDAT, KW_GET_BITS, KW_GET_BLUE, KW_GET_BR_C, KW_GET_BUFH, KW_GET_BYTE, KW_GET_BYTS, KW_GET_CBPC, KW_GET_CBPN, KW_GET_CFG, KW_GET_CFGV, KW_GET_CGI, KW_GET_CGIL, KW_GET_CGIV, KW_GET_CGL, KW_GET_CGLV, KW_GET_CHG, KW_GET_CHLD, KW_GET_CLL, KW_GET_CODP, KW_GET_COLL, KW_GET_COOK, KW_GET_CP, KW_GET_CREL, KW_GET_CUR, KW_GET_D_E, KW_GET_D_F, KW_GET_DBL, KW_GET_DIR, KW_GET_DS_B, KW_GET_DYN, KW_GET_ERRC, KW_GET_ERRR, KW_GET_FILE, KW_GET_FLD, KW_GET_FLT, KW_GET_FNAM, KW_GET_FOFF, KW_GET_GRN, KW_GET_HD_E, KW_GET_I64, KW_GET_IBNN, KW_GET_IBQN, KW_GET_ITER, KW_GET_K_V, KW_GET_L_V, KW_GET_LAST, KW_GET_LNBI, KW_GET_LONG, KW_GET_MOP, KW_GET_MSG, KW_GET_MSGG, KW_GET_MSGS, KW_GET_NEXT, KW_GET_NODE, KW_GET_NUM, KW_GET_PAR, KW_GET_PREV, KW_GET_PROP, KW_GET_PRT, KW_GET_PTR, KW_GET_QNBI, KW_GET_R_R, KW_GET_RED, KW_GET_REL, KW_GET_RGB, KW_GET_S_O, KW_GET_SELW, KW_GET_SER, KW_GET_SHRT, KW_GET_SIG, KW_GET_SRCB, KW_GET_STR, KW_GET_SZ, KW_GET_T_S, KW_GET_TBI, KW_GET_TBNN, KW_GET_TBQN, KW_GET_THCH, KW_GET_THPX, KW_GET_TI, KW_GET_TOPB, KW_GET_TWCH, KW_GET_TWPX, KW_GET_U_F, KW_GET_UBI, KW_GET_UL, KW_GET_USHT, KW_GET_VAL, KW_GET_VBI, KW_GET_VBNN, KW_GET_VBQN, KW_GET_WAIT, KW_GETATTRI, KW_GLOBAL, KW_GO, KW_GO_ON, KW_GO_PEND, KW_GOTO, KW_GRANT, KW_GRAPHIC, KW_GRD_F_H, KW_GRD_F_V, KW_GRD_SNAP, KW_GRD_UHC, KW_GRD_UHP, KW_GRD_UWC, KW_GRD_UWP, KW_GRD_VIS, KW_GROUP, KW_GROUP_BX, KW_GT, KW_GTE, KW_GUID, KW_GW, KW_HANDLE, KW_HANDLER, KW_HAS_LOBS, KW_HAS_REC, KW_HAVING, KW_HEADER, KW_HEIGHT_C, KW_HEIGHT_P, KW_HELP, KW_HELP_TOP, KW_HEX_DECD, KW_HEX_ENCD, KW_HID_FLD, KW_HID_FLDL, KW_HIDDEN, KW_HIDE, KW_HINT, KW_HOME, KW_HONOR_PK, KW_HONOR_RK, KW_HORIZ, KW_HOST_B_O, KW_HTML_CHS, KW_HTML_ENC, KW_HTML_EOL, KW_HTML_EOP, KW_HTML_FRB, KW_HTML_FRE, KW_HTML_H_B, KW_HTML_H_E, KW_HTML_T_B, KW_HTML_T_E, KW_HTMLERR, KW_HWND, KW_ICFPARM, KW_ICON, KW_IDEPHWND, KW_IDEWNTYP, KW_IDX_FLD, KW_IDX_HINT, KW_IDX_INFO, KW_IDX_REPO, KW_IF, KW_IGN_CMOD, KW_IMAGE, KW_IMG_DOWN, KW_IMG_INS, KW_IMG_SZ, KW_IMG_SZ_C, KW_IMG_SZ_P, KW_IMG_UP, KW_IMM_DISP, KW_IMP_NODE, KW_IMP_PRNC, KW_IMPLEMTS, KW_IMPORT, KW_IN, KW_IN_HNDL, KW_IN_OUT, KW_INACTIVE, KW_INC_EX_I, KW_INCR, KW_INDEX, KW_INDICAT, KW_INFO, KW_INH_BGC, KW_INH_FGC, KW_INHERITS, KW_INIT, KW_INIT_D_T, KW_INIT_DIR, KW_INIT_FLT, KW_INIT_SES, KW_INITIATE, KW_INNER, KW_INNER_C, KW_INNER_L, KW_INPT_VAL, KW_INPUT, KW_INS_ATTR, KW_INS_B4, KW_INS_BTAB, KW_INS_COL, KW_INS_FILE, KW_INS_FLD, KW_INS_FLDD, KW_INS_FLDL, KW_INS_MODE, KW_INS_ROW, KW_INS_STR, KW_INS_TAB, KW_INSERT, KW_INST_PRC, KW_INT, KW_INT_ENT, KW_INT64, KW_INTERFAC, KW_INTERVAL, KW_INTO, KW_INVOKE, KW_IS, KW_IS_ATTR, KW_IS_CLASS, KW_IS_COLCP, KW_IS_CP_FX, KW_IS_LEAD, KW_IS_OPEN, KW_IS_P_SET, KW_IS_R_SEL, KW_IS_SEL, KW_IS_XML, KW_ISO_DATE, KW_ITEM, KW_ITEM_ROW, KW_ITER_CHG, KW_IUNKNOWN, KW_JOIN, KW_JOIN_BY, KW_KBLABEL, KW_KEEP_CON, KW_KEEP_MSG, KW_KEEP_SEC, KW_KEEP_TAB, KW_KEEP_ZOR, KW_KEY, KW_KEYCODE, KW_KEYFUNC, KW_KEYLAB, KW_KEYS, KW_KW, KW_KW_ALL, KW_L_ENDIAN, KW_L_TRIM, KW_LAB_BGC, KW_LAB_DC, KW_LAB_FGC, KW_LAB_FONT, KW_LAB_PFC, KW_LABEL, KW_LABELS, KW_LANDSCAP, KW_LANGUAGE, KW_LARGE, KW_LAST, KW_LAST_AR, KW_LAST_BAT, KW_LAST_CH, KW_LAST_EVT, KW_LAST_FRM, KW_LAST_OBJ, KW_LAST_OF, KW_LAST_PRC, KW_LAST_SOC, KW_LAST_SRV, KW_LAST_SS, KW_LAST_TI, KW_LASTKEY, KW_LC, KW_LCHR_2NV, KW_LDBNAME, KW_LEAVE, KW_LEFT, KW_LEFT_AL, KW_LEFT_END, KW_LEFT_MC, KW_LEFT_MD, KW_LEFT_MDC, KW_LEFT_MU, KW_LENGTH, KW_LG_2_SM, KW_LIB, KW_LIKE, KW_LIKE_SEQ, KW_LINE, KW_LINE_CNT, KW_LIST_ITM, KW_LIST_PNM, KW_LISTING, KW_LISTINGS, KW_LIT_QSTN, KW_LOAD, KW_LOAD_DMN, KW_LOAD_I_D, KW_LOAD_I_I, KW_LOAD_I_U, KW_LOAD_ICO, KW_LOAD_IMG, KW_LOAD_M_P, KW_LOAD_PIC, KW_LOAD_S_I, KW_LOADCTRL, KW_LOB_AREA, KW_LOB_BYTE, KW_LOB_DIR, KW_LOB_SIZE, KW_LOC_C_N, KW_LOC_HOST, KW_LOC_L_N, KW_LOC_NAME, KW_LOC_P_ID, KW_LOC_PORT, KW_LOC_S_ID, KW_LOC_TYPE, KW_LOCK_REG, KW_LOCKED, KW_LOG, KW_LOG_A_EV, KW_LOG_E_TS, KW_LOG_EN_T, KW_LOG_HOST, KW_LOG_ID, KW_LOG_MGR, KW_LOG_STAT, KW_LOG_THRS, KW_LOGF_NAM, KW_LOGG_LEV, KW_LOGICAL, KW_LOGOUT, KW_LONG, KW_LONGCHAR, KW_LOOKAHD, KW_LOOKUP, KW_LST_EVNT, KW_LST_PAIR, KW_LST_QRY, KW_LST_SET, KW_LST_WID, KW_LT, KW_LTE, KW_MACH_CLS, KW_MAINMENU, KW_MAN_HIGH, KW_MAND, KW_MAP, KW_MARG_EX, KW_MARG_H_C, KW_MARG_H_P, KW_MARG_W_C, KW_MARG_W_P, KW_MATCHES, KW_MAX, KW_MAX_BTN, KW_MAX_CHAR, KW_MAX_D_G, KW_MAX_H_C, KW_MAX_H_P, KW_MAX_HT, KW_MAX_ROWS, KW_MAX_SZ, KW_MAX_VAL, KW_MAX_W_C, KW_MAX_W_P, KW_MAX_WID, KW_MAXIMIZE, KW_MD5_DIG, KW_MD5_VAL, KW_MDL_MC, KW_MDL_MD, KW_MDL_MDC, KW_MDL_MU, KW_MEMBER, KW_MEMPTR, KW_MENU, KW_MENU_BAR, KW_MENU_DRP, KW_MENU_ITM, KW_MENU_KEY, KW_MENU_MOU, KW_MERGE_BF, KW_MERGE_CH, KW_MERGE_RC, KW_MESSAGES, KW_METHOD, KW_MIN, KW_MIN_BTN, KW_MIN_CWCH, KW_MIN_CWPX, KW_MIN_H_C, KW_MIN_H_P, KW_MIN_SCHM, KW_MIN_SZ, KW_MIN_VAL, KW_MIN_W_C, KW_MIN_W_P, KW_MOD, KW_MODIFIED, KW_MONTH, KW_MOU_MC, KW_MOU_MD, KW_MOU_MDC, KW_MOU_MU, KW_MOU_MVC, KW_MOU_MVD, KW_MOU_MVDC, KW_MOU_MVU, KW_MOU_PTR, KW_MOU_SC, KW_MOU_SD, KW_MOU_SDC, KW_MOU_SU, KW_MOU_XC, KW_MOU_XD, KW_MOU_XDC, KW_MOU_XU, KW_MOUSE, KW_MOV_2_B, KW_MOV_2_T, KW_MOV_2EOF, KW_MOV_A_T, KW_MOV_B_T, KW_MOV_COL, KW_MOVABLE, KW_MOVE, KW_MPE, KW_MPTR_2NV, KW_MSG, KW_MSG_AFNT, KW_MSG_AREA, KW_MSG_DIG, KW_MSG_LINE, KW_MTIME, KW_MULT_CMP, KW_MULT_KEY, KW_MULTI_IN, KW_MULTIPLE, KW_MUST_EXI, KW_MUST_UND, KW_NAME, KW_NAMESP_P, KW_NAMESP_U, KW_NATIVE, KW_NE, KW_NEEDS_AP, KW_NEEDS_PR, KW_NESTED, KW_NEW, KW_NEW_INST, KW_NEW_LINE, KW_NEW_ROW, KW_NEXT, KW_NEXT_COL, KW_NEXT_ERR, KW_NEXT_FR, KW_NEXT_PMT, KW_NEXT_RID, KW_NEXT_SIB, KW_NEXT_TAB, KW_NEXT_VAL, KW_NEXTWORD, KW_NNMSP_SL, KW_NO_APPLY, KW_NO_ARMSG, KW_NO_ASSGN, KW_NO_ATTR, KW_NO_ATTRL, KW_NO_AUTOV, KW_NO_BIND, KW_NO_BOX, KW_NO_COLS, KW_NO_CONS, KW_NO_CUR_V, KW_NO_CV_3D, KW_NO_CVT, KW_NO_DEBUG, KW_NO_DRAG, KW_NO_ECHO, KW_NO_EM_SP, KW_NO_ERROR, KW_NO_FILL, KW_NO_FOCUS, KW_NO_HELP, KW_NO_HIDE, KW_NO_IDX_H, KW_NO_INHBG, KW_NO_INHFG, KW_NO_JOIN, KW_NO_LABEL, KW_NO_LOBS, KW_NO_LOCK, KW_NO_LOOKA, KW_NO_MAP, KW_NO_MSG, KW_NO_OVRRD, KW_NO_PAUSE, KW_NO_PRE, KW_NO_RET_V, KW_NO_ROW_M, KW_NO_SCH_M, KW_NO_SCR_V, KW_NO_SEP_C, KW_NO_SEPS, KW_NO_TAB_S, KW_NO_UNDL, KW_NO_UNDO, KW_NO_VALID, KW_NO_WAIT, KW_NO_WRAP, KW_NODE_V2M, KW_NODE_VAL, KW_NODV_2LC, KW_NONE, KW_NORMAL, KW_NORMALZE, KW_NOT, KW_NOT_ACTV, KW_NOT_CS, KW_NOW, KW_NULL, KW_NULLALWD, KW_NUM_2RTN, KW_NUM_ALIA, KW_NUM_BUFF, KW_NUM_BUTT, KW_NUM_CH_R, KW_NUM_CHLN, KW_NUM_COL, KW_NUM_COPY, KW_NUM_D_P, KW_NUM_DBS, KW_NUM_DROP, KW_NUM_ENT, KW_NUM_FLD, KW_NUM_FMT, KW_NUM_FMTS, KW_NUM_HD_E, KW_NUM_ITER, KW_NUM_ITMS, KW_NUM_LK_C, KW_NUM_LNS, KW_NUM_LOGF, KW_NUM_MSG, KW_NUM_PARM, KW_NUM_REF, KW_NUM_REL, KW_NUM_REPL, KW_NUM_RES, KW_NUM_SEP, KW_NUM_SR, KW_NUM_SRCB, KW_NUM_SW, KW_NUM_TABS, KW_NUM_TOPB, KW_NUM_V_C, KW_NUMERIC, KW_OBJECT, KW_OCT_LEN, KW_OF, KW_OFF, KW_OFF_END, KW_OFF_HOME, KW_OK, KW_OK_CAN, KW_OLD, KW_OLE_INVL, KW_OLE_NAML, KW_ON, KW_ON_FR_B, KW_ONLY, KW_OPEN, KW_OPEN_L_A, KW_OPEN_URL, KW_OPSYS, KW_OPTION, KW_OPTIONS, KW_OR, KW_ORD_JOIN, KW_ORDER, KW_ORDINAL, KW_ORG_HAND, KW_ORG_ROID, KW_OS_APPND, KW_OS_CMD, KW_OS_COPY, KW_OS_DEL, KW_OS_DIR, KW_OS_DRV, KW_OS_ERR, KW_OS_G_ENV, KW_OS_MKDIR, KW_OS_REN, KW_OS2, KW_OTHER, KW_OUT_HDR, KW_OUT_HH, KW_OUT_JOIN, KW_OUT_MSGS, KW_OUTER, KW_OUTPUT, KW_OUTPUTCT, KW_OVERLAY, KW_OVERRIDE, KW_OWN_DOC, KW_OWNER, KW_P2J_RC, KW_PAGE, KW_PAGE_B, KW_PAGE_DWN, KW_PAGE_LFT, KW_PAGE_NUM, KW_PAGE_RT, KW_PAGE_SZ, KW_PAGE_T, KW_PAGE_UP, KW_PAGE_WID, KW_PAGED, KW_PAR_BUFF, KW_PAR_FLDA, KW_PAR_FLDB, KW_PAR_IFLD, KW_PAR_IREL, KW_PAR_REL, KW_PAR_W_C, KW_PARENT, KW_PARM, KW_PARSE_ST, KW_PART_KEY, KW_PASCAL, KW_PASSWD_F, KW_PASTE, KW_PATHNAME, KW_PAUSE, KW_PBE_H_AL, KW_PBE_KEYR, KW_PDBNAME, KW_PERF, KW_PERSIST, KW_PFCOLOR, KW_PICK, KW_PICK_ARE, KW_PICK_BTH, KW_PIX_COL, KW_PIX_ROW, KW_PIXELS, KW_POP_MENU, KW_POP_ONLY, KW_PORTRAIT, KW_POS, KW_PRECISN, KW_PREF_DS, KW_PREP_STR, KW_PREPARED, KW_PREPROC, KW_PRESEL, KW_PREV, KW_PREV_COL, KW_PREV_FR, KW_PREV_SIB, KW_PREV_T_I, KW_PREVWORD, KW_PRIMARY, KW_PRINTER, KW_PRIV_DAT, KW_PRIVATE, KW_PRIVILEG, KW_PRMT_FOR, KW_PROC, KW_PROC_C_T, KW_PROC_COM, KW_PROC_HND, KW_PROC_ST, KW_PROC_T_B, KW_PROC_TXT, KW_PROC_W_R, KW_PROCESS, KW_PROCNAME, KW_PRODATAS, KW_PROFILER, KW_PROFILNG, KW_PROG_SRC, KW_PROGNAME, KW_PROGRESS, KW_PROMPT, KW_PROMSGS, KW_PROPATH, KW_PROPERTY, KW_PROTECTD, KW_PROVER, KW_PROX_PWD, KW_PROX_UID, KW_PROXY, KW_PRS_C_D, KW_PRS_PROC, KW_PRT_C_H, KW_PRT_HDC, KW_PRT_NAME, KW_PRT_PORT, KW_PRT_SET, KW_PSC, KW_PUB_EVTS, KW_PUB_ID, KW_PUBLIC, KW_PUBLISH, KW_PUT, KW_PUT_BITS, KW_PUT_BYTE, KW_PUT_BYTS, KW_PUT_DBL, KW_PUT_FLT, KW_PUT_I64, KW_PUT_K_V, KW_PUT_LONG, KW_PUT_SHT, KW_PUT_STR, KW_PUT_UL, KW_PUT_USHT, KW_QRY_CLOS, KW_QRY_OFF, KW_QRY_OPEN, KW_QRY_PREP, KW_QRY_TUNE, KW_QUE_MSG, KW_QUERY, KW_QUEST, KW_QUIT, KW_QUOTER, KW_R_INDEX, KW_R_TRIM, KW_RADIO_B, KW_RADIO_S, KW_RANDOM, KW_RAW, KW_RAW_TRAN, KW_RCOD_INF, KW_READ, KW_READ_AVL, KW_READ_E_N, KW_READ_FIL, KW_READ_JSN, KW_READ_ONL, KW_READ_RES, KW_READ_XML, KW_READ_XSC, KW_READKEY, KW_REAL, KW_REC_LEN, KW_RECALL, KW_RECID, KW_RECT, KW_RECURSE, KW_REF_ONLY, KW_REFR_A_P, KW_REFRABLE, KW_REFRESH, KW_REG_DMN, KW_REJ_CHGS, KW_REJ_RCHG, KW_REJECTED, KW_REL_FLDS, KW_RELEASE, KW_RELS_ACT, KW_REM_ATTR, KW_REM_CHLD, KW_REM_EVTP, KW_REM_HOST, KW_REM_PORT, KW_REM_SUP, KW_REMOTE, KW_REP_CHLD, KW_REP_STXT, KW_REPEAT, KW_REPL_CRE, KW_REPL_DEL, KW_REPL_WRI, KW_REPLACE, KW_REPORTS, KW_REPOS, KW_REPOS_2I, KW_REPOS_2R, KW_REPOS_B, KW_REPOS_F, KW_REPOS_M, KW_REQUEST, KW_RESET, KW_RESIZABL, KW_RESIZE, KW_REST_RID, KW_RESULT, KW_RESUME_D, KW_RET_2SD, KW_RET_INS, KW_RET_SHAP, KW_RET_VAL, KW_RET_VDT, KW_RETAIN, KW_RETRY, KW_RETRY_C, KW_RETURN, KW_RETURNS, KW_REV_FROM, KW_REVERT, KW_REVOKE, KW_RGB_VAL, KW_RIGHT, KW_RIGHT_AL, KW_ROLES, KW_ROUND, KW_ROUNDED, KW_ROUTINEL, KW_ROW, KW_ROW_CRT, KW_ROW_CRTD, KW_ROW_DEL, KW_ROW_DELD, KW_ROW_DISP, KW_ROW_ENTR, KW_ROW_H_C, KW_ROW_H_P, KW_ROW_LEAV, KW_ROW_MARK, KW_ROW_MODD, KW_ROW_OF, KW_ROW_RESZ, KW_ROW_STAT, KW_ROW_UMOD, KW_ROW_UPD, KW_ROWID, KW_RT_END, KW_RT_MC, KW_RT_MD, KW_RT_MDC, KW_RT_MU, KW_RULE, KW_RULE_ROW, KW_RULE_Y, KW_RUN, KW_RUN_PROC, KW_RUN_W_O, KW_SAVE, KW_SAVE_AS, KW_SAVE_FIL, KW_SAVE_RCH, KW_SAVE_WST, KW_SAX_ATTR, KW_SAX_COMP, KW_SAX_PARE, KW_SAX_PARF, KW_SAX_PARN, KW_SAX_PARS, KW_SAX_READ, KW_SAX_RUNN, KW_SAX_UNIN, KW_SAX_WBEG, KW_SAX_WCOM, KW_SAX_WCON, KW_SAX_WELM, KW_SAX_WERR, KW_SAX_WIDL, KW_SAX_WRIT, KW_SAX_WTAG, KW_SCH_CHG, KW_SCH_LOC, KW_SCH_MARS, KW_SCH_PATH, KW_SCHEMA, KW_SCR_2CR, KW_SCR_2ITM, KW_SCR_2SR, KW_SCR_DELT, KW_SCR_LEFT, KW_SCR_MODE, KW_SCR_NOT, KW_SCR_OFFS, KW_SCR_RPOS, KW_SCR_RT, KW_SCREEN, KW_SCRN_IO, KW_SCRN_LNS, KW_SCRN_VAL, KW_SCROLL, KW_SCROLL_H, KW_SCROLL_V, KW_SCROLLBA, KW_SCROLLBL, KW_SCROLLIN, KW_SDBNAME, KW_SEAL, KW_SEAL_TST, KW_SEAR_SLF, KW_SEAR_TRG, KW_SEARCH, KW_SECTION, KW_SECUR_P, KW_SEEK, KW_SEL_ALL, KW_SEL_END, KW_SEL_FOCR, KW_SEL_LST, KW_SEL_NEXT, KW_SEL_PREV, KW_SEL_ROW, KW_SEL_STRT, KW_SEL_TXT, KW_SELECT, KW_SELECTBL, KW_SELECTED, KW_SELECTN, KW_SELF, KW_SEND, KW_SEND_SQL, KW_SENSITIV, KW_SEP_CONN, KW_SEP_FGC, KW_SEPS, KW_SEQUENCE, KW_SERIALZH, KW_SERIALZN, KW_SERIALZR, KW_SERVER, KW_SESS_END, KW_SESSION, KW_SESSN_ID, KW_SET, KW_SET_A_CT, KW_SET_A_L, KW_SET_A_N, KW_SET_ACTR, KW_SET_ACTX, KW_SET_ATTR, KW_SET_B_OR, KW_SET_BLUE, KW_SET_BRK, KW_SET_BUF, KW_SET_C_P, KW_SET_CB_P, KW_SET_CBAC, KW_SET_CLNT, KW_SET_COMM, KW_SET_CONT, KW_SET_COOK, KW_SET_DBCL, KW_SET_DYN, KW_SET_EVMO, KW_SET_GRN, KW_SET_ISRC, KW_SET_M_UN, KW_SET_N_F, KW_SET_NODE, KW_SET_ODST, KW_SET_OPT, KW_SET_PARM, KW_SET_PROP, KW_SET_PTR, KW_SET_RED, KW_SET_RGB, KW_SET_ROLL, KW_SET_RPOS, KW_SET_RRP, KW_SET_S_AR, KW_SET_S_O, KW_SET_SEL, KW_SET_SERD, KW_SET_SZ, KW_SET_T_S, KW_SET_U_F, KW_SET_W_S, KW_SET_WAIT, KW_SETTINGS, KW_SETUSER, KW_SH_LOCK, KW_SHA1_DIG, KW_SHARED, KW_SHORT, KW_SHOW_ITB, KW_SHOW_ST, KW_SIDE_L, KW_SIDE_L_H, KW_SIGNATUR, KW_SILENT, KW_SIMPLE, KW_SINGLE, KW_SIZE, KW_SIZE_C, KW_SIZE_P, KW_SKIP, KW_SKIP_D_R, KW_SLIDER, KW_SMAL_ICO, KW_SMAL_TTL, KW_SMALLINT, KW_SOAP_F, KW_SOAP_F_A, KW_SOAP_F_C, KW_SOAP_F_D, KW_SOAP_F_S, KW_SOAP_HDR, KW_SOAP_HER, KW_SOCKET, KW_SOME, KW_SORT, KW_SORT_ASC, KW_SORT_NUM, KW_SOURCE, KW_SPACE, KW_SQL, KW_SQL_WID, KW_SQRT, KW_SRC_PROC, KW_SRV_C_B, KW_SRV_C_BR, KW_SRV_C_C, KW_SRV_C_I, KW_SRV_OP_M, KW_SRV_SOCK, KW_SSL_SRVN, KW_ST_2_FIT, KW_STANDALN, KW_START, KW_START_BS, KW_START_DC, KW_START_EL, KW_START_MV, KW_START_RR, KW_START_RS, KW_START_SC, KW_STARTING, KW_STAT_A_F, KW_STAT_DET, KW_STATIC, KW_STATUS, KW_STATUS_A, KW_STDCALL, KW_STOP, KW_STOP_AFT, KW_STOP_D, KW_STOP_PRS, KW_STOPPED, KW_STORPROC, KW_STR_VAL, KW_STR_XREF, KW_STREAM, KW_STRICT, KW_STRING, KW_STRM_HND, KW_STRM_IO, KW_STUP_PAR, KW_SUB_AVG, KW_SUB_CNT, KW_SUB_M_H, KW_SUB_MAX, KW_SUB_MENU, KW_SUB_MIN, KW_SUB_TOT, KW_SUBSCRIB, KW_SUBSTIT, KW_SUBSTR, KW_SUBTYPE, KW_SUM, KW_SUP_NS_P, KW_SUP_PROC, KW_SUP_WARN, KW_SUPER, KW_SYM_EN_A, KW_SYM_EN_I, KW_SYM_EN_K, KW_SYM_SUPP, KW_SYNCHRON, KW_SYS_A_B, KW_SYS_DLG, KW_SYS_HELP, KW_SYS_ID, KW_TAB, KW_TAB_CRCL, KW_TAB_HAND, KW_TAB_LIST, KW_TAB_NUM, KW_TAB_POS, KW_TAB_SCAN, KW_TAB_STOP, KW_TAB_TRG, KW_TABLE, KW_TAG, KW_TAR_PROC, KW_TARGET, KW_TEMP_DIR, KW_TEMP_TAB, KW_TERM, KW_TERMINAT, KW_TEXT, KW_THEN, KW_THIS_OBJ, KW_THIS_PRC, KW_THROUGH, KW_THROW, KW_TIC_MARK, KW_TIME, KW_TIME_SRC, KW_TIMER, KW_TIMESTMP, KW_TIMEZONE, KW_TITL_BGC, KW_TITL_DC, KW_TITL_FGC, KW_TITL_FON, KW_TITLE, KW_TO, KW_TO_ROWID, KW_TODAY, KW_TOGGL_BX, KW_TOOLTIP, KW_TOOLTIPS, KW_TOP, KW_TOP_COL, KW_TOP_NAVQ, KW_TOP_ONLY, KW_TOPIC, KW_TOTAL, KW_TRAC_CHG, KW_TRAILING, KW_TRAN_I_P, KW_TRAN_MOD, KW_TRANS, KW_TRANSPAR, KW_TRC_FILT, KW_TRIGGER, KW_TRIGGERS, KW_TRIM, KW_TRUNC, KW_TT_PREP, KW_TTCP, KW_TXT_CURS, KW_TXT_SEG, KW_TXT_SEL, KW_TYPE, KW_TYPE_OF, KW_U_CTRL, KW_U_MSG, KW_U_PCTRL, KW_U_SERIAL, KW_UNBOX, KW_UNBUF, KW_UNDERLIN, KW_UNDO, KW_UNFORMAT, KW_UNION, KW_UNIQ_ID, KW_UNIQ_MAT, KW_UNIQUE, KW_UNIX, KW_UNIX_END, KW_UNL_HID, KW_UNLOAD, KW_UNS_BYTE, KW_UNS_LONG, KW_UNS_SHRT, KW_UNSUBSCR, KW_UP, KW_UPD_ATTR, KW_UPDATE, KW_URL, KW_URL_DECO, KW_URL_ENCO, KW_URL_FLD, KW_URL_FLDL, KW_URL_FMT, KW_URL_PW, KW_URL_UID, KW_USE, KW_USE_DCT, KW_USE_FIL, KW_USE_IDX, KW_USE_REV, KW_USE_TXT, KW_USE_UND, KW_USE_WIDP, KW_USER_ID, KW_USERID, KW_USING, KW_USR_DATA, KW_UTC_OFF, KW_V6DISP, KW_V6FRAME, KW_VAL_CHG, KW_VAL_ENAB, KW_VAL_EVT, KW_VAL_EXPR, KW_VAL_HND, KW_VAL_MSG, KW_VAL_OBJ, KW_VAL_SEAL, KW_VAL_XML, KW_VALEXP, KW_VALIDATE, KW_VALMSG, KW_VALUE, KW_VALUES, KW_VAR, KW_VERBOSE, KW_VERSION, KW_VERT, KW_VIEW, KW_VIEW_AS, KW_VIEW_FCR, KW_VIRT_HC, KW_VIRT_HP, KW_VIRT_WC, KW_VIRT_WP, KW_VISIBLE, KW_VMS, KW_VOID, KW_WA_H_P, KW_WA_W_P, KW_WA_X, KW_WA_Y, KW_WAIT_FOR, KW_WARN, KW_WEB, KW_WEB_CTX, KW_WEB_OUT, KW_WEEK, KW_WHEN, KW_WHERE, KW_WHERE_ST, KW_WHILE, KW_WID_ENT, KW_WID_HAND, KW_WID_ID, KW_WID_LEAV, KW_WID_POOL, KW_WIDGET, KW_WIDTH, KW_WIDTH_C, KW_WIDTH_P, KW_WIN_CLOS, KW_WIN_DMIN, KW_WIN_MAX, KW_WIN_MIN, KW_WIN_NAME, KW_WIN_NORM, KW_WIN_RESI, KW_WIN_REST, KW_WIN_STAT, KW_WIN_SYS, KW_WINDOW, KW_WITH, KW_WORD_IDX, KW_WORD_WRP, KW_WORK_TAB, KW_WR_CDATA, KW_WR_CHARS, KW_WR_CMNT, KW_WR_D_ELM, KW_WR_DATA, KW_WR_E_ELM, KW_WR_ENT_R, KW_WR_EXDTD, KW_WR_FRAGM, KW_WR_JSON, KW_WR_MSG, KW_WR_PRINS, KW_WR_STAT, KW_WR_XML, KW_WR_XMLSC, KW_WRITE, KW_X, KW_X_DOC, KW_X_NODE, KW_X_OF, KW_XCODE, KW_XML_DTYP, KW_XML_NNAM, KW_XML_NTYP, KW_XML_SCHP, KW_XML_SNSP, KW_XREF, KW_XREF_XML, KW_Y, KW_Y_OF, KW_YEAR, KW_YEAR_OFF, KW_YES_NO, KW_YES_NO_C, LABEL, LABEL_DEF, LANGUAGES, LBRACKET, LEFT_OUTER_JOIN, LETTER, LIBRARY_PROCEDURE, LIBRARY_REF, LPARENS, LT, LTE, MANDATORY, MANY_TO_ONE, METH_CHAR, METH_CLASS, METH_COM_HANDLE, METH_DATE, METH_DATETIME, METH_DATETIME_TZ, METH_DEC, METH_HANDLE, METH_INT, METH_INT64, METH_LOGICAL, METH_LONGCHAR, METH_MEMPTR, METH_POLY, METH_RAW, METH_RECID, METH_ROWID, METH_VOID, METHOD_DEF, METHOD_INVOCATION, MINUS, MISSING, MORE, MULTIPLY, NATIVE_API, NATIVE_PROCESS, NATIVE_PROGRAM_RESOURCE, NETWORK_CONNECTION, NO_LOCK_LITERAL, NO_MATCH, NO_REFERENCE, NO_TRANSACTION, NO_WAIT_LITERAL, NOT_BETWEEN, NOT_ENTERED, NOT_EQ, NOT_EXISTS, NOT_IN, NOT_LIKE, NOT_NULL, NULL_TREE_LOOKAHEAD, NUM_LITERAL, OBJECT_INVOCATION, OCX_CONTROL, ONE_TO_MANY, ONE_TO_ONE, OPEN_CURSOR, OPEN_QUERY, OPTION, ORDER, ORDER_BY, OUTPUT_CLOSE, OUTPUT_THRU, OUTPUT_TO, PARAMETER, PARENT_CHILD_RELATION, PARENT_ID_RELATION, PLUS, PORT_TYPE, POSITION, PROCEDURE, PROCEDURE_FILE, PROCESS_EVENTS, PROPERTIES, PROPERTY_INVOCATION, PUT_CURSOR, PUT_FIELD, PUT_SCREEN, QUERY, QUERY_SUBST, RANGE_MATCH, RAW_STRING, RBRACKET, READ_AVAILABLE_LITERAL, READ_EXACT_NUM_LITERAL, RECORD_PHRASE, RELEASE_EXTERNAL, RELEASE_OBJECT, RIGHT_OUTER_JOIN, RPARENS, RSTRING, RUN_FILENAME, RUN_FILENAME_ON_SERVER, RUN_INT_PROC, RUN_INT_PROC_ON_SERVER, RUN_LIBRARY_REF, RUN_LIBRARY_REF_ON_SERVER, RUN_PORT_TYPE_ON_SERVER, RUN_PORT_TYPE_VALUE_ON_SERVER, RUN_STORED_PROCEDURE, RUN_SUPER, RUN_VALUE, RUN_VALUE_ON_SERVER, RUNTIME_BROWSE_OPTIONS, RUNTIME_FRAME_OPTIONS, SAVE_CACHE, SCHEMA_FILE, SEARCH_SELF_LITERAL, SEARCH_TARGET_LITERAL, SELF_REFERENCE, SEQUENCE, SHARE_LOCK_LITERAL, SHARED_LIBRARY, SORT_MATCH, SQL_WIDTH, SSTRING, STATEMENT, STR_OPTIONS, STREAM, STRING, STRONG_REFERENCE, SUB_TRANSACTION, SUPPORT_LVL_FULL, SUPPORT_LVL_FULL_WITH_LIMITATIONS, SUPPORT_LVL_NONE, SUPPORT_LVL_PARTIAL, SYM_CHAR, SYMBOL, SYS_HANDLE, SYSTEM_DIALOG_COLOR, SYSTEM_DIALOG_FONT, SYSTEM_DIALOG_GET_DIR, SYSTEM_DIALOG_GET_FILE, SYSTEM_DIALOG_PRINTER_SETUP, TABLE, TEMP_TABLE, TILDE, TRAILER, TRANSACTION, TRANSACTION_DISTINCT, TRANSACTION_MODE_AUTO, TRIGGER_BLOCK, TRIGGER_PHRASE, TRIGGER_PROCEDURE, UN_MINUS, UN_PLUS, UNKNOWN_RESOURCE, UNKNOWN_TOKEN, UNKNOWN_VAL, UPDATE_SQL, VALEXP, VALID_SYM_CHAR, VALIDATION, VALMSG, VAR_BYTE, VAR_CHAR, VAR_CLASS, VAR_COM_HANDLE, VAR_DATE, VAR_DATETIME, VAR_DATETIME_TZ, VAR_DEC, VAR_DOUBLE, VAR_FLOAT, VAR_HANDLE, VAR_INT, VAR_INT64, VAR_LOGICAL, VAR_LONG, VAR_LONGCHAR, VAR_MEMPTR, VAR_RAW, VAR_RECID, VAR_ROWID, VAR_SHORT, VAR_ULONG, VAR_USHORT, WEAK_REFERENCE, WEB_PROC, WHEN_LIST, WHERE_CURRENT_OF, WID_BROWSE, WID_BROWSE_COL, WID_BUTTON, WID_COMBO, WID_DIALOG, WID_EDITOR, WID_FILL_IN, WID_FRAME, WID_IMAGE, WID_LITERAL, WID_MENU, WID_MENU_ITM, WID_RADIO, WID_RECT, WID_SEL_LST, WID_SLIDER, WID_SUB_MENU, WID_TEXT, WID_TOGGLE, WID_WINDOW, WIDGET_LIST, WIDGET_POOL, WITH_CHECK_OPTION, WITH_GRANT_OPTION, WORD_MATCH, WORK_TABLE, WS, XSTRING
Constructor and Description |
---|
SchemaDictionary()
Default constructor which reads schema configuration data and loads
default namespace schema information into the outermost (global) lookup
scope.
|
SchemaDictionary(Aast root)
Create a schema dictionary based upon a single database schema.
|
SchemaDictionary(java.lang.String database)
Create a schema dictionary based upon a single database schema.
|
Modifier and Type | Method and Description |
---|---|
NameNode |
addDatabaseEntry(java.lang.String name)
Add a dictionary entry for the specified database and return a
NameNode object representing the database name, which can be
used as a parent node for subsequent table entry additions. |
private void |
addEntries(NameNode fromNode,
NameNode toNode,
int type)
Copies all of the child entries currently stored in the global scope
under the parent entity identified by
fromNode into the
specified target table node. |
private void |
addEntries(java.lang.String from,
NameNode fromNode,
NameNode toNode,
int type,
boolean forceTemp)
Copies all of the child entries currently stored in
fromNode into the specified
target table node, and with the exception of buffers, into the global namespace of the
scope containing the parent entity. |
private NameNode |
addEntry(NameNode parent,
Aast ast,
int entityType,
boolean globalScope)
Add a name node entry to a specific scope.
|
void |
addFieldEntries(java.lang.String fromTable,
NameNode fromNode,
NameNode toNode,
boolean forceTemp)
Copies all of the field entries currently stored in
fromNode into the specified
target table node. |
NameNode |
addFieldEntry(NameNode parent,
Aast fnode,
java.lang.String name,
int type,
Aast like)
Add a dictionary entry for a field which is like the field
described by the AST specified by the
like parameter. |
NameNode |
addFieldEntry(NameNode parent,
Aast fnode,
java.lang.String name,
int type,
boolean globalScope)
Add a dictionary entry for the specified field and return a
NameNode object representing the field name. |
NameNode |
addFieldEntry(NameNode parent,
Aast fnode,
java.lang.String name,
NameNode source,
int extent)
Add a dictionary entry for a field which is like an existing
field, and return a
NameNode object representing the field name. |
Aast |
addIndex(NameNode parent,
java.lang.String name,
Aast like)
Create a new table index under table
parent , which is a
copy of the specified index like . |
Aast |
addIndexField(Aast parent,
Aast inode,
java.lang.String name)
Create a new table index field under index
parent . |
void |
addScope()
Push a new scope onto the lookup stack.
|
void |
addScope(boolean mark)
Push a new scope onto the lookup stack.
|
NameNode |
addTableEntry(NameNode parent,
java.lang.String name,
int tokenType,
boolean globalScope,
Aast tnode)
Add a dictionary entry for the specified table and return a
NameNode object representing the table name, which can be
used as a parent node for subsequent field entry additions. |
boolean |
containsNode(NameNode node)
Determines if the given node is contained in this dictionary.
|
private void |
copyFieldProperties(Aast source,
Aast destination)
Copy FIELD properties from a source AST to a destination AST.
|
void |
copyIndex(NameNode destTable,
Aast fnode,
java.lang.String name,
boolean primary)
Copy the index with the given name from the current model, source
table to the specified destination table.
|
private void |
copyTableProperties(Aast source,
Aast destination,
int[] filter)
Copy properties from a source AST to a destination AST.
|
boolean |
createAlias(java.lang.String alias,
java.lang.String database)
Create an alias for a previously loaded database.
|
void |
dump()
Debug method to dump the contents of each scope currently defined in
the dictionary.
|
void |
dump(java.io.PrintStream stream)
Debug method to dump the contents of each scope currently defined in
the dictionary.
|
java.util.Iterator<Aast> |
fields(Aast table)
Get an iterator on all of the field ASTs defined for a given table.
|
void |
finalizeTableDefine(NameNode destTable)
Finalize the definition of a temp-table.
|
private NameNode |
findEntry(java.lang.String name,
int type)
Look up the name node associated with the specified name and entity
type.
|
private NameNode |
findEntry(java.lang.String name,
int type,
int startScope,
int endScope,
boolean exact)
Look up the name node associated with the specified name and entity type.
|
NameNode |
findFieldNode(java.lang.String name)
Look up the name node for the field associated with the specified name.
|
private boolean |
findInternalBuffer(java.lang.String name)
Searches scopes from most nested to least nested to find a
BUFFER node that matches the given table name. |
NameNode |
findTableFromNode(java.lang.String fromTable,
NameNode toNode,
boolean skipGlobal)
Given a table name representing table whose structure is to be copied (e.g., for a LIKE
clause), find the name node associated with that table.
|
private boolean |
findWeakScopedBuffer(NameNode possible)
Searches scopes from most nested to least nested to find a matching
BUFFER node that is associated with a weak scope. |
private void |
forceLineColumnNums(Aast root)
Force all the line and column numbers (for non-artificial nodes in the
tree) to be the same as the root node which is provided here.
|
java.util.Map<Aast,Aast> |
getAllFieldProperties(java.lang.String name,
int tokenType)
Given a table name, retrieve a map of the ASTs corresponding with all
field properties of a particular type.
|
java.lang.String |
getBufferForField(java.lang.String field)
Get the unabbreviated buffer name associated with the possibly
abbreviated name
field . |
java.lang.String |
getBufferForTable(java.lang.String table)
Get the unabbreviated buffer name associated with the possibly
abbreviated name
table . |
private Aast |
getChildAst(Aast parent,
int tokenType,
java.lang.String name)
Iterate through the direct child nodes of
parent and
retrieve the first child whose token type matches tokenType
and whose text matches name . |
Aast |
getField(java.lang.String name)
Get the field AST associated with the given field name.
|
Aast |
getFieldCopy(java.lang.String name,
int extent)
Get a copy of the AST which represents field
name , with
possible modifications. |
int |
getFieldDataType(java.lang.String field)
Perform a search for the specified field name and if found, return the
field's data type.
|
FieldInfo |
getFieldInfo(NameNode tableNode,
java.lang.String fieldName)
Get an object which exposes schema-related information about a field which is referenced in
source code.
|
Aast |
getFieldProperty(java.lang.String name,
int tokenType)
Retrieve the AST corresponding with a field property.
|
int |
getFieldRecordType(java.lang.String name)
Get the Progress parser token type of a table, temp-table, work-table,
or buffer which contains the field represented by
name . |
java.lang.String |
getFullFieldName(java.lang.String field)
Perform a search for the specified field name and if found, return the
field's fully qualified, unabbreviated name.
|
java.lang.String |
getFullTableName(java.lang.String table)
Perform a search for the specified table name and if found, return the
table's fully qualified, unabbreviated name.
|
Aast |
getIndex(NameNode tableNode,
java.lang.String name)
Get a specific index AST for a table.
|
Aast |
getIndex(java.lang.String table,
java.lang.String name)
Get a specific index AST for a table.
|
java.lang.String |
getLogicalDatabaseForField(java.lang.String field)
Get the logical database name for the database associated with the
specified field.
|
java.lang.String |
getLogicalDatabaseForTable(java.lang.String table)
Get the logical database name for the database associated with the
specified table.
|
(package private) java.lang.String |
getQualifiedName(NameNode node)
Compose an entity's fully qualified, unabbreviated name.
|
private java.lang.String |
getQualifiedName(java.lang.String name,
int type,
int startScope,
int endScope)
Perform a search for the specified entity name and if found, return the
entity's fully qualified, unabbreviated name.
|
(package private) java.lang.String |
getRecordName(NameNode node,
int type,
java.lang.String name)
Compose a record name from the given name node, entity type, and raw
name.
|
private SchemaDictionary.Scope |
getScope(NameNode node,
Aast ast,
boolean global)
Get the scope in which
node resides. |
Aast |
getTable(NameNode node)
Get the AST associated with the given table name node.
|
Aast |
getTable(java.lang.String name)
Get the table object associated with the given table name.
|
private NameNode |
getTableNodeIfBuffer(NameNode node)
Special handling for buffer name nodes, which are really aliases to a
backing table definition.
|
Aast |
getTableProperty(java.lang.String name,
int tokenType)
Retrieve the AST corresponding with a table property.
|
int |
getTableRecordType(java.lang.String name)
Get the Progress parser token type of a table, temp-table, work-table,
or buffer.
|
int |
getTableType(java.lang.String name)
Perform a search for the specified table name and if found, return the
table's type (i.e., schema table, temp table, work table, buffer).
|
java.util.Iterator<Aast> |
indices(Aast table)
Get the index ASTs associated with a database table.
|
private void |
initialize(Aast root)
Initialize the schema dictionary by adding a global scope, loading the
schema information in
root into it, then adding a second
scope into which user global data can be loaded (secondary databases,
temp-tables, work-tables, etc.). |
boolean |
isDatabase(java.lang.String database)
Indicate whether the specified name represents a valid database in the
dictionary.
|
boolean |
isField(java.lang.String field)
Indicate whether the specified name represents a valid field in the
dictionary.
|
boolean |
isTable(java.lang.String table)
Indicate whether the specified name represents a valid table in the
dictionary.
|
void |
loadFromAst(Aast root,
boolean dictdb)
Load the schema dictionary from an AST of schema information ultimately
imported from a Progress export file.
|
void |
loadFromPersistence(java.lang.String schemaFile)
Load a persisted schema AST from the specified file.
|
void |
loadSchema(java.lang.String database)
Load a database schema which is identified in the schema configuration
by the specified database name.
|
static SchemaDictionary |
localInstance()
Get the context-local
SchemaDictionary instance. |
static void |
main(java.lang.String[] args)
Test driver for this class.
|
private Aast |
makePropertiesAst(Aast parent)
Create an AST of type
PROPERTIES and insert it as the
first child of parent . |
boolean |
markPreferred(boolean preferred)
Set the
markPreferred flag, so all info for the tables which are weak references
will be collected in the SchemaDictionary.Scope.preferredNodes set for the current scope. |
private int |
nearestEnclosingInternal()
Returns the topmost internal scope index or the lesser of the
EXT_PROC_SCOPE and the last index position in the case
that no scope is marked as internal. |
private Aast |
newDatabase(java.lang.String name)
Add a new database AST to the map of databases.
|
private Aast |
newField(NameNode parent,
Aast fnode,
java.lang.String name,
int tokenType)
Create a field AST and add it as a child of the AST associated with the
parent name node. |
void |
persist(java.lang.String srcFile,
java.lang.String schemaFile)
Persist schema dictionary information which is specific to the source
file currently being parsed.
|
void |
processLikeField(Aast field,
boolean hasValidate,
java.lang.String sourceSchemaName)
Post-process the given field, in terms of honoring the VALIDATE clause, if present.
|
private void |
promoteEntry(java.lang.String name,
int type,
boolean force,
boolean noProp)
Promotes the youngest descendents of
name (field level
entities) from the global scope to the top-most scope. |
void |
promoteTable(java.lang.String table)
Promotes
table and all of its fields from the global scope
to the top-most scope, if not already present there. |
void |
promoteTable(java.lang.String table,
boolean force,
boolean noProp)
Promotes
table and all of its fields from the global scope
to the top-most scope, if not already present there. |
private void |
promoteYoungest(NameNode node,
int type,
SchemaDictionary.Scope scope,
boolean noPropagate)
Promote the youngest descendents of
node (by reference)
to scope . |
private void |
propagate(SchemaDictionary.Scope oldScope,
SchemaDictionary.Scope newScope)
Propagate all namespace contents from the old scope into the
corresponding namespaces in the new scope.
|
void |
removeAllExcept(java.lang.String[] preserve)
Remove all traces of all temp-tables and buffers from the schema dictionary, except for
those with the specified names.
|
void |
removeScope()
Pop the most recently added scope off the lookup stack.
|
void |
removeScope(boolean propagate)
Pop the most recently added scope off the lookup stack.
|
void |
setFieldProperties(java.lang.String name,
Aast like)
Copy a subset of properties from AST
like into the field
AST represented by name . |
void |
setTableProperty(Aast table,
Aast property)
Copy the specified property into the
PROPERTIES child AST
of table . |
java.util.Iterator<Aast> |
tables(java.lang.String databaseName)
Get an iterator on all of the table ASTs defined for a given database.
|
public static final int UNKNOWN
static final java.lang.String TEMP_TABLE_DB
static final java.lang.String TEMP_DB
static final java.lang.String WORK_DB
private static final java.lang.String DICTDB
private static final int SCHEMA_GLOBAL_SCOPE
private static final int USER_GLOBAL_SCOPE
private static final int EXT_PROC_SCOPE
private static final int[] FIELD_PROPS
private static final int[] NS_LIST
private static final java.util.ArrayList<java.lang.Integer> FIELD_TYPE_LIST
private static ContextLocal<SchemaDictionary> localDict
private static SchemaDictionary.Scope pristineScope
private static java.util.Map<java.lang.String,Aast> pristineDbs
private static java.util.Map<java.lang.String,java.lang.String> pristineAliases
private java.util.Map<java.lang.String,Aast> databases
private java.util.Map<java.lang.String,java.lang.String> aliases
private SchemaLoader loader
private java.util.Stack<SchemaDictionary.Scope> scopes
private int protectedScopeCount
private java.util.Map<NameNode,java.lang.ref.WeakReference<SchemaDictionary.Scope>> scopeMap
private ScopedDictionary<NameNode,java.lang.String> qualifiers
private Aast modelTable
private boolean markPreferred
SchemaDictionary(Aast root)
root
- The root node of an AST representing a database schema.SchemaDictionary(java.lang.String database) throws SchemaException
SchemaLoader
to load the schema named database
.database
- Name of logical database whose schema should be loaded.SchemaException
- if any error occurs reading configuration information.public SchemaDictionary() throws SchemaException
Loading the default schema information is quite time consuming, so the first time an instance is created, the loaded default data is backed up to a pristine copy. This copy is duplicated on subsequent runs to ensure a clean slate without the extra load time. This is especially useful since this data is never edited, so it can be (and is) shared among multiple simultaneously used instances of this class.
SchemaException
- if any error occurs reading configuration information.public static SchemaDictionary localInstance()
SchemaDictionary
instance.private void initialize(Aast root)
root
into it, then adding a second
scope into which user global data can be loaded (secondary databases,
temp-tables, work-tables, etc.).root
- AST of primary database to load.public void loadSchema(java.lang.String database) throws SchemaException
database
- Name which identifies in the configuration the namespace data
to be loaded.SchemaException
- if the schema namespace information cannot be loaded for any
reason, including an invalid database name.public boolean createAlias(java.lang.String alias, java.lang.String database)
alias
- Alias to use for the database qualifier portion of a schema
entity name.database
- Logical name of the database for which the alias is being
created. May not be null
.true
if the alias was created; false
if database
could not be found in the dictionary,
or if the caller tried to create an alias for another alias.public NameNode addDatabaseEntry(java.lang.String name)
NameNode
object representing the database name, which can be
used as a parent node for subsequent table entry additions.name
- Database name to be added.public NameNode addTableEntry(NameNode parent, java.lang.String name, int tokenType, boolean globalScope, Aast tnode)
NameNode
object representing the table name, which can be
used as a parent node for subsequent field entry additions.parent
- Database name node which represents this table's parent entity.
May be null
.name
- Table name to be added.tokenType
- Type of table to be added (e.g., normal schema-defined table,
buffer, temp table, work table).globalScope
- true
to add entry to global scope, else
false
to add entry to top scope.tnode
- The node that triggered the table creation.public NameNode addFieldEntry(NameNode parent, Aast fnode, java.lang.String name, int type, boolean globalScope)
NameNode
object representing the field name.parent
- Table name node which represents this field's parent entity.fnode
- The node that triggered the field creation.name
- Field name to be added.type
- Data type of field to be added (e.g., integer, character, raw,
etc.).globalScope
- true
to add entry to global scope, else
false
to add entry to top scope.public NameNode addFieldEntry(NameNode parent, Aast fnode, java.lang.String name, NameNode source, int extent) throws SchemaException
NameNode
object representing the field name.
This is used when processing temp-tables and work-tables.parent
- Table name node which represents this field's parent entity,
a temp-table or work-table. It should not be null
.fnode
- The node that triggered the field creation.name
- Field name to be added.source
- Name node for the existing field which provides the basis of the
definition of the new field. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.extent
- One-based index of the element (for an extent field) after
which the new field entry is to be modelled. This is only
relevant for the initializer, so that we copy the correct
initial value in the case of an initializer list for an extent
field. Will be 0
if the "like" field is not an
extent field, or if the entire extent field is the target of
the like phrase, rather than only a specific element.SchemaException
- if there is an error copying the field's AST.public NameNode addFieldEntry(NameNode parent, Aast fnode, java.lang.String name, int type, Aast like) throws SchemaException
like
parameter.
Return a NameNode
object representing the field name. A copy
of like
is made, irrelevant properties are removed from
the copy, and the resulting AST is grafted onto the schema AST under
the table AST stored in parent
.parent
- Table name node which represents this field's parent entity.
It should not be null
.fnode
- The node that triggered the field creation.name
- Name of field to be added.type
- Token type of field to be added.like
- An AST which describes the properties of the new field. This
AST might not be a field (in fact, it likely represents a
variable). As such, it may contain additional properties
which we do not care about for our field definition. These
are filtered out when a copy of the AST is made and grafted
into the appropriate schema AST.AmbiguousSchemaNameException
- if like
is an ambiguous field reference.SchemaException
- if an error occurs grafting a copy of like
onto
the schema AST.public Aast addIndex(NameNode parent, java.lang.String name, Aast like) throws SchemaException
parent
, which is a
copy of the specified index like
. Normalize the index
field ASTs to look like those provided by the schema directly.parent
- Name node of table with which this index is associated.name
- Name of the index.like
- The original index AST to be copied.SchemaException
- if an error occurs grafting a copy of like
onto
the schema AST.public Aast addIndexField(Aast parent, Aast inode, java.lang.String name)
parent
.parent
- Index object with which this index field is associated.inode
- The node that triggered the index creation.name
- Name of the index field.public void removeAllExcept(java.lang.String[] preserve)
For the entities not in the exception list, all name nodes and children name nodes will be removed from all their respective global and private namespaces, and all associated ASTs will be pruned from their respective schema ASTs.
preserve
- Names of those tables to preserve.public void copyIndex(NameNode destTable, Aast fnode, java.lang.String name, boolean primary) throws SchemaException
The current model source table is set at the beginning of
like
clause processing for a temp-table and is nulled out
when finalizeTableDefine(com.goldencode.p2j.schema.NameNode)
is invoked.
destTable
- Destination temp-table to which the index will be copied.fnode
- The node that triggered the field creation.name
- Name of the index to be copied from the model table.primary
- true
if the index is the primary index for the
target temp-table. Note: the primary property is only set
for the index if this argument is true
.SchemaException
- if no index named name
is found in the source
table or if an error occurs grafting a copy of the source
index onto the destination temp-table AST.public void finalizeTableDefine(NameNode destTable) throws SchemaException
like
clause processing for a temp-table. If the given
temp-table at this point contains no indices, we copy the index
definitions described by the model table. Otherwise, we assume that
this default behavior has been overridden by individual indices
explicitly copied or defined in the Progress source code.destTable
- Name node of the temp-table being defined.SchemaException
addEntries(java.lang.String, com.goldencode.p2j.schema.NameNode, com.goldencode.p2j.schema.NameNode, int, boolean)
,
copyIndex(com.goldencode.p2j.schema.NameNode, com.goldencode.ast.Aast, java.lang.String, boolean)
,
modelTable
public Aast getTable(java.lang.String name) throws SchemaException
name
- Name of the target table. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.name
.SchemaException
- if no table is found with the given name.AmbiguousSchemaNameException
- if name
is an ambiguous table reference.public Aast getTable(NameNode node)
node
- Name node of the target table.public Aast getField(java.lang.String name) throws AmbiguousSchemaNameException
name
- Name of the target field. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.name
.AmbiguousSchemaNameException
- if name
is an ambiguous field reference.public boolean containsNode(NameNode node)
node
- The namenode to check.true
if the given node can be found in this dictionary.public FieldInfo getFieldInfo(NameNode tableNode, java.lang.String fieldName) throws AmbiguousSchemaNameException, SchemaException
tableNode
- Name node asssociated with the field reference. If not null
, only the
private namespace of the given tableNode
is searched (for an exact match)
of fieldName
. If null
, a lenient search (i.e., abbreviations
permitted) is performed across all scopes in the schema dictionary.fieldName
- Unaltered field name, as referenced in source code.AmbiguousSchemaNameException
- if tableNode
is null
and a search for fieldName
finds more
than one result.
SchemaException
if tableNode
is not null
and no field exactly matching fieldName
is found within the private namespace of tableNode
.SchemaException
public Aast getFieldCopy(java.lang.String name, int extent) throws AmbiguousSchemaNameException
name
, with
possible modifications. Specifically, if extent
is
greater than 0 and the source field is an extent field, the copy will
represent a copy of a single element of the original extent field.
The effect of this is to remove the KW_EXTENT child node, and to use
only the initializer (if any) which corresponds with the element at
index extent
.name
- Name of the existing field which provides the basis of the
definition of the copy. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.extent
- One-based index of the element (for an extent field) after
which the new field entry is to be modelled. This is only
relevant for the initializer, so that we copy the correct
initial value in the case of an initializer list for an extent
field. Will be 0
if the "like" field is not an
extent field, or if the entire extent field is the target of
the like phrase, rather than only a specific element.AmbiguousSchemaNameException
- if name
is an ambiguous field reference.public Aast getIndex(java.lang.String table, java.lang.String name) throws AmbiguousSchemaNameException
table
- Node of the target table. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.name
- Name of the target index defined for the target table.null
if not found.AmbiguousSchemaNameException
- if name
is an ambiguous field reference.public Aast getIndex(NameNode tableNode, java.lang.String name)
tableNode
- Name node of the target table.name
- Name of the target index defined for the target table. May be
abbreviated.null
if not found.public java.util.Iterator<Aast> tables(java.lang.String databaseName)
databaseName
- Name of the target database.public java.util.Iterator<Aast> fields(Aast table)
table
- Target table AST.public java.util.Iterator<Aast> indices(Aast table)
table
- Target table AST.public void promoteTable(java.lang.String table) throws SchemaException
table
and all of its fields from the global scope
to the top-most scope, if not already present there. Creates the parent
database node in the same scope if not already present. Name nodes
that already exist in the current scope will no be re-added but any
missing nodes will be added.table
- Name of table to be promoted. Must be an unambiguous reference
within the global scope.AmbiguousSchemaNameException
- if table
matches more than one entry in the
global scope of the dictionary.SchemaException
- if table
does not exist in the global scope or
if there is no scope above the global scope to which this
table may be promoted.public void promoteTable(java.lang.String table, boolean force, boolean noProp) throws SchemaException
table
and all of its fields from the global scope
to the top-most scope, if not already present there. Creates the parent
database node in the same scope if not already present. If the named
table has ever been promoted in the current instance, it will not be
promoted again, unless the force
flag is on.table
- Name of table to be promoted. Must be an unambiguous reference
within the global scope.force
- Override the default promotion behavior and force a refresh
of the promoted table even if it was already promoted
previously.noProp
- true
to force any promoted nodes to have their
no propagate flag set. This disables propagation of these
nodes across the current scope boundary.AmbiguousSchemaNameException
- if table
matches more than one entry in the
global scope of the dictionary.SchemaException
- if table
does not exist in the global scope or
if there is no scope above the global scope to which this
table may be promoted.public void processLikeField(Aast field, boolean hasValidate, java.lang.String sourceSchemaName) throws AmbiguousSchemaNameException
field
- The field which needs to be processed. This is a field defined using a
LIKE table.sourceField
clause, with or without the VALIDATE clause.hasValidate
- When true
, it indicates the VALIDATE clause was present and the
VALEXP node will need to be processed.sourceSchemaName
- The schema name of the source fieldAmbiguousSchemaNameException
public NameNode findTableFromNode(java.lang.String fromTable, NameNode toNode, boolean skipGlobal) throws AmbiguousSchemaNameException
fromTable
- Name of the table whose node is to be found.toNode
- Copy target node.skipGlobal
- if (@code true}, do not look in the global schema scope to find fromTable
.AmbiguousSchemaNameException
- if the lookup results in ambiguity within a scope.public void addFieldEntries(java.lang.String fromTable, NameNode fromNode, NameNode toNode, boolean forceTemp) throws SchemaException
fromNode
into the specified
target table node.fromTable
- Name of table from which field entries are to be copied. Must
be an unambiguous reference within the global scope.toNode
- Name node which represents the table to which the field entries
will be copied.forceTemp
- if (@code true}, do not look in the global schema scope to find a "real" table to
replace the temp/work-table fromNode
previously resolved.AmbiguousSchemaNameException
- if table
matches more than one entry in the
global scope of the dictionary.SchemaException
- if fromTable
does not exist in the global scope.public boolean isDatabase(java.lang.String database)
database
- Case insensitive database name; may not be abbreviated.true
if an entry for this database is found in
the dictionary, else false
.public boolean isTable(java.lang.String table)
table
- Case insensitive table name; may be qualified or not. If
qualified, only the table portion of the name may be
abbreviated.true
if an entry for this table is found in
the dictionary, else false
.public boolean isField(java.lang.String field)
field
- Case insensitive field name; may be qualified or not. If
qualified, only the table and/or field portion of the name may
be abbreviated.true
if an entry for this field is found in
the dictionary, else false
.public java.lang.String getFullTableName(java.lang.String table) throws AmbiguousSchemaNameException
table
- Case insensitive table name; may be qualified or not. If
qualified, only the table portion of the name may be
abbreviated.null
if the lookup produced no match.java.lang.IllegalArgumentException
- if table
is malformed.AmbiguousSchemaNameException
- if table
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
table entry was mistakenly added to the dictionary with the
same name, or (b) table
represents an ambiguous
abbreviation that matches more than one entry.public java.lang.String getFullFieldName(java.lang.String field) throws AmbiguousSchemaNameException
field
- Case insensitive field name; may be qualified or not. If
qualified, only the table and/or field portion of the name may
be abbreviated.null
if the lookup produced no match.java.lang.IllegalArgumentException
- if field
is malformed.AmbiguousSchemaNameException
- if field
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
field entry was mistakenly added to the dictionary with the
same name, or (b) field
represents an ambiguous
abbreviation that matches more than one entry.public java.lang.String getLogicalDatabaseForTable(java.lang.String table) throws AmbiguousSchemaNameException
table
includes a database qualifier,
this is returned. Otherwise, the logical database name is determined
by a lookup.table
- A possibly qualified, possibly abbreviated name of a table,
buffer, temp-table, or work-table.table
. An empty string is returned
if table
represents a temp- or work-table.java.lang.IllegalArgumentException
- if table
is malformed.AmbiguousSchemaNameException
- if table
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
table entry was mistakenly added to the dictionary with the
same name, or (b) table
represents an ambiguous
abbreviation that matches more than one entry.public java.lang.String getLogicalDatabaseForField(java.lang.String field) throws AmbiguousSchemaNameException
field
includes a database qualifier,
this is returned. Otherwise, the logical database name is determined
by a lookup.field
- A possibly qualified, possibly abbreviated name of a field.field
's parent. An empty string is
returned if field
is contained within a temp- or
work-table.java.lang.IllegalArgumentException
- if field
is malformed.AmbiguousSchemaNameException
- if field
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
field entry was mistakenly added to the dictionary with the
same name, or (b) field
represents an ambiguous
abbreviation that matches more than one entry.public java.lang.String getBufferForTable(java.lang.String table) throws AmbiguousSchemaNameException
table
. If a database alias is provided,
it is passed through to the result unaltered. Otherwise, the buffer's
default database qualifier is prepended.table
- A possibly qualified, possibly abbreviated name of a table,
buffer, temp-table, or work-table.table
, using the same
database qualifier, if any.java.lang.IllegalArgumentException
- if table
is malformed.AmbiguousSchemaNameException
- if table
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
table entry was mistakenly added to the dictionary with the
same name, or (b) table
represents an ambiguous
abbreviation that matches more than one entry.public java.lang.String getBufferForField(java.lang.String field) throws AmbiguousSchemaNameException
field
. If a database alias is provided,
it is passed through to the result unaltered. Otherwise, the buffer's
default database qualifier is prepended.field
- A possibly qualified, possibly abbreviated name of a field.field
, using the same
database qualifier, if any, with the field portion discarded.java.lang.IllegalArgumentException
- if field
is malformed.AmbiguousSchemaNameException
- if field
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
field entry was mistakenly added to the dictionary with the
same name, or (b) field
represents an ambiguous
abbreviation that matches more than one entry.public int getTableType(java.lang.String name) throws SchemaException
name
- Case insensitive table name; may be qualified or not. If
qualified, only the table portion of the name may be
abbreviated.UNKNOWN
if the lookup
produced no match.AmbiguousSchemaNameException
- if table
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
table entry was mistakenly added to the dictionary with the
same name, or (b) table
represents an ambiguous
abbreviation that matches more than one entry.SchemaException
- if no lookup scopes exist.public int getTableRecordType(java.lang.String name) throws AmbiguousSchemaNameException
name
represents a buffer, the type of the
backing record is returned. That is, a type of BUFFER
is
never returned, only the type of the record which backs the buffer.name
- Case insensitive record name; may be qualified or not. If
qualified, only the table portion of the name may be
abbreviated.TABLE
,
TEMP_TABLE
, or WORK_TABLE
, or
UNKNOWN
if name
cannot be found.AmbiguousSchemaNameException
- if name
is an ambiguous identifier for the
target record.public int getFieldRecordType(java.lang.String name) throws AmbiguousSchemaNameException
name
. If
the record containing field name
is a buffer, the type of
the backing record is returned. That is, a type of BUFFER
is never returned, only the type of the record which backs the buffer.name
- Case insensitive field name; may be qualified or not. If
qualified, only the table and field portions of the name may
be abbreviated.TABLE
,
TEMP_TABLE
, or WORK_TABLE
, or
UNKNOWN
if name
cannot be found.AmbiguousSchemaNameException
- if name
is an ambiguous identifier for the
target field.public int getFieldDataType(java.lang.String field) throws SchemaException
field
- Case insensitive field name; may be qualified or not. If
qualified, only the table and/or field portion of the name may
be abbreviated.UNKNOWN
if
the lookup produced no match.AmbiguousSchemaNameException
- if field
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
field entry was mistakenly added to the dictionary with the
same name, or (b) field
represents an ambiguous
abbreviation that matches more than one entry.SchemaException
- if no lookup scopes exist.public void addScope()
public void addScope(boolean mark)
mark
- true
to mark the associated scope as one which
is an internal procedure, user-defined function or trigger.
false
for any other case including external
procedures and inner blocks (DO, REPEAT or FOR
).public void removeScope() throws SchemaException
SchemaException
- if the stack is already empty.public void removeScope(boolean propagate) throws SchemaException
propagate
- true
to force the propagation of namespace
contents from the removed scope into the scope that is now
on the top of the stack (the enclosing scope).SchemaException
- if the stack is already empty.public void persist(java.lang.String srcFile, java.lang.String schemaFile) throws AstException
srcFile
- Name of the 4GL source code file containing the schema
definitions being persisted.schemaFile
- Name of schema persistence file.AstException
- if any error occurs writing persistence file.public void dump()
stderr
. Use dump(java.io.PrintStream)
to write to
a specific print stream.public void dump(java.io.PrintStream stream)
stream
- Destination stream.public void loadFromPersistence(java.lang.String schemaFile) throws SchemaException
schemaFile
- The name of a persisted schema file which is associated with
a Progress source code file.SchemaException
- if any error occurs reading the schema data from persistence.public Aast getTableProperty(java.lang.String name, int tokenType) throws SchemaException
name
- Name of the target table. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.tokenType
- Token type of the property to retrieve.null
if the property was not found.AmbiguousSchemaNameException
- if name
is ambiguous as an identifier for the
target table.SchemaException
- if a table with the name name
cannot be found.public java.util.Map<Aast,Aast> getAllFieldProperties(java.lang.String name, int tokenType) throws SchemaException
tokenType
might represent a
table-level property as well. To retrieve a table-level property, use
getTableProperty(java.lang.String, int)
.name
- Name of the table containing the target fields. Can be
qualified or unqualified, abbreviated or unabbreviated, but
must be unambiguous.tokenType
- Token type of the property to retrieve.null
.AmbiguousSchemaNameException
- if name
is ambiguous as an identifier for the
target field.SchemaException
- if a field with the name name
cannot be found.public Aast getFieldProperty(java.lang.String name, int tokenType) throws SchemaException
name
- Name of the target field. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.tokenType
- Token type of the property to retrieve.null
if the property was not found.AmbiguousSchemaNameException
- if name
is ambiguous as an identifier for the
target field.SchemaException
- if a field with the name name
cannot be found.public void setFieldProperties(java.lang.String name, Aast like) throws SchemaException
like
into the field
AST represented by name
. Only those properties which are
relevant to schema fields are copied; all others are discarded.name
- Name of the target field. Can be qualified or unqualified,
abbreviated or unabbreviated, but must be unambiguous.like
- AST containing the field properties to be copied.AmbiguousSchemaNameException
- if name
is ambiguous as an identifier for the
target field.SchemaException
- if a field with the name name
cannot be found.public void setTableProperty(Aast table, Aast property) throws SchemaException
PROPERTIES
child AST
of table
. It is assumed that table
does not
already contain a property of the same type as property
,
as it is expected that this method is invoked only by the Progress
parser as it builds up a temp- or work-table definition from valid
Progress source code.table
- AST representing the target table.property
- AST representing the property to be copied.SchemaException
- if any error occurs copying the property.public boolean markPreferred(boolean preferred)
markPreferred
flag, so all info for the tables which are weak references
will be collected in the SchemaDictionary.Scope.preferredNodes
set for the current scope.preferred
- The new value of the flag.markPreferred
field.public void loadFromAst(Aast root, boolean dictdb)
root
- Root of the AST representing a database. This is added to the
map of databases managed by the dictionary. Its nodes are
walked to create the name node mirror hierarchy.dictdb
- true
to assign the implicit DICTDB alias to this database,
else false
.public NameNode findFieldNode(java.lang.String name) throws AmbiguousSchemaNameException
name
- Case insensitive database, table, or field name; may be
qualified or not. If qualified, only the table and/or field
portion of the name may be abbreviated.AmbiguousSchemaNameException
- if name
matches more than one field entry in the
dictionary. This would indicate that either (a) more than one
entry was mistakenly added to the dictionary with the same
entity name, or (b) name
represents an ambiguous
abbreviation that matches more than one entry.java.lang.String getQualifiedName(NameNode node) throws AmbiguousSchemaNameException
node
- Name node of the entity which will determine the most specific
part of the fully qualified name. Must not be
null
.AmbiguousSchemaNameException
- if node
matches more than one entry in the
dictionary. This can only occur if node
refers
to a buffer, since a lookup only occurs in this case.java.lang.String getRecordName(NameNode node, int type, java.lang.String name)
name
, or will prepend the database qualifier
(if any) in the event name
contains none.node
- Name node for a record or field entity.type
- EntityName
constant indicating whether
name
represents a field or record level entity.name
- Raw name for the schema entity, possibly abbreviated, possibly
qualified, as drawn directly from Progress source code.name
, using the same
database qualifier, if any. If name
represents
a database field, the field portion of the name is discarded.private void forceLineColumnNums(Aast root)
root
- Parent node of the sub-tree which is to be processed.private NameNode findEntry(java.lang.String name, int type) throws AmbiguousSchemaNameException
name
- Case insensitive database, table, or field name; may be
qualified or not. If qualified, only the table and/or field
portion of the name may be abbreviated.type
- EntityName
constant indicating whether name
represents a DATABASE
, TABLE
, or
FIELD
.AmbiguousSchemaNameException
- if name
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
entry was mistakenly added to the dictionary with the same
entity name, or (b) name
represents an ambiguous
abbreviation that matches more than one entry.private Aast getChildAst(Aast parent, int tokenType, java.lang.String name)
parent
and
retrieve the first child whose token type matches tokenType
and whose text matches name
. If name
is
null
, the first child node which matches the given token
type is returned.parent
- AST whose immediate children are checked.tokenType
- Token type of target child node.name
- Text of target child node, or null
to match the
first child of the appropriate token type.null
if no match is found.private Aast newDatabase(java.lang.String name)
name
- Database name.private Aast newField(NameNode parent, Aast fnode, java.lang.String name, int tokenType)
parent
name node.parent
- Table name node which represents this field's parent entity.fnode
- The node that triggered the field creation.name
- Name of field.tokenType
- Data type of field (e.g., integer, character, raw, etc.).private NameNode findEntry(java.lang.String name, int type, int startScope, int endScope, boolean exact) throws AmbiguousSchemaNameException
startScope
to endScope
.name
- Case insensitive database, table, or field name; may be
qualified or not. If qualified, only the table and/or field
portion of the name may be abbreviated.type
- EntityName
constant indicating whether name represents a
DATABASE
, TABLE
, or FIELD
.startScope
- Index of scope at which search begins. Must be greater than or
equal to endScope
.endScope
- Index of scope at which search ends. Must be greater than or
equal to zero.exact
- true
to require an exact match; false
to allow an exact
or an abbreviated name to match.null
.java.lang.IllegalArgumentException
- if the scope index range provided is invalid.AmbiguousSchemaNameException
- if name
matches more than one entry in the dictionary. This would
indicate that either (a) more than one entry was mistakenly added to the
dictionary with the same entity name, or (b) name
represents an
ambiguous abbreviation that matches more than one entry.private boolean findInternalBuffer(java.lang.String name) throws AmbiguousSchemaNameException
BUFFER
node that matches the given table name. If no
match is found, the search stops at the nearest enclosing internal
scope. If no internal scope is or encloses the current scope, then
this search immediately fails.name
- Case insensitive table name; may be qualified or not. The
table portion of the name may be abbreviated.true
if there is a matching buffer scoped to an
enclosing internal block.AmbiguousSchemaNameException
- if name
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
entry was mistakenly added to the dictionary with the same
entity name, or (b) name
represents an ambiguous
abbreviation that matches more than one entry.private boolean findWeakScopedBuffer(NameNode possible) throws AmbiguousSchemaNameException
BUFFER
node that is associated with a weak scope.possible
- Node to test.true
if there is a matching buffer scoped to an
enclosing weak block.AmbiguousSchemaNameException
private NameNode addEntry(NameNode parent, Aast ast, int entityType, boolean globalScope)
parent
resides; or if this parameter
is null
globalScope
: the user global
scope if true
, else the innermost (most recently added)
scope.parent
- New entry's parent name node. If new entry represents a
database, this should be null
; if a table, this
should be a database node or null
(if added by
parser); if a field, this should be a table node or
null
(if added by parser).ast
- AST which backs the new name node and contains property
information specific to the schema entity represented by this
name node.entityType
- EntityName
constant indicating whether the new
entry is a DATABASE
, TABLE
, or
FIELD
.globalScope
- true
to add entry to global scope, else
false
to add entry to top scope. Only considered
if parent
is not specified; otherwise, entry is
added to scope in which parent
resides.private void addEntries(java.lang.String from, NameNode fromNode, NameNode toNode, int type, boolean forceTemp) throws AmbiguousSchemaNameException, SchemaException
fromNode
into the specified
target table node, and with the exception of buffers, into the global namespace of the
scope containing the parent entity.
Record buffer types require some special handling here in the following cases:
from
- Name of entity from which child entries are to be copied.fromNode
- Actual name node which references the data structures to be copied.toNode
- Name node which represents the parent entity to which the child entries will be
copied.type
- Type of the parent entity to which child entries are to be
added (using EntityName
constants).forceTemp
- if (@code true}, do not look in the global schema scope to find a "real" table to
replace the temp/work-table fromNode
previously resolved.AmbiguousSchemaNameException
- if a database lookup produces more than one match.SchemaException
- if there is any error copying fields.private void copyTableProperties(Aast source, Aast destination, int[] filter) throws SchemaException
source
and
destination
are compatible types, such that the general
AST structure is similar between them.source
- AST which is the source of the copy.destination
- AST which is the destination of the copy.filter
- An array of token types in ascending numeric order, which
represents the set of tokens which are to be included in the
copy. Any property with a token type not in this set is
excluded from the copy. If this parameter is null
,
all properties are copied.SchemaException
- if any error occurs during the copy.private void copyFieldProperties(Aast source, Aast destination) throws SchemaException
source
and destination
are compatible
types, such that the general AST structure is similar between them.
If the source
AST contains a type that already exists in
the destination
, the source
AST will take
precedence (the subtree of that same type in the destination will be
overwritten).
source
- AST which is the source of the copy.destination
- AST which is the destination of the copy.SchemaException
- if any error occurs during the copy.private Aast makePropertiesAst(Aast parent)
PROPERTIES
and insert it as the
first child of parent
.parent
- AST node of which the new properties AST will become the
first child.private void addEntries(NameNode fromNode, NameNode toNode, int type) throws SchemaException
fromNode
into the
specified target table node.fromNode
- Name node of entity from which child entries are to be copied.toNode
- Name node which represents the parent entity to which the child
entries will be copied.type
- Type of the parent entity to which child entries are to be
added (using EntityName
constants).SchemaException
- if there is any error copying a field or properties.private void promoteEntry(java.lang.String name, int type, boolean force, boolean noProp) throws AmbiguousSchemaNameException, SchemaException
name
(field level
entities) from the global scope to the top-most scope.
The concept of "promotion" means that the reference to the youngest
descendents of a NameNode
are copied from a lower scope to a
higher scope, so that they enjoy precedence over name nodes in lower
scopes when performing a name lookup. This is how ambiguity is removed
when the source code being processed by the Progress parser refers to a
schema entity by an unqualified or abbreviated (or both) name, which
would otherwise be ambiguous, if its representative name node had not
been promoted.
If name
's youngest descendents are already present in the
top scope, they are not added again. No attempt is made to remove
descendents which no longer exist (which did exist during a
previous promotion of an ancestor), because this would represent an
invalid condition.
name
- Name of entity whose descendents are to be promoted. Must be an
unambiguous reference within one of the "named" scopes (i.e.,
schema global, user global, external procedure, internal
procedure/function).type
- Type of entity to be promoted (using EntityName
constants).force
- Override the default promotion behavior and force a refresh
of the promoted table even if it was already promoted
previously.noProp
- true
to force any promoted nodes to have their
no propagate flag set. This disables propagation of these
nodes across the current scope boundary. This is only set
true
for weak scopes.AmbiguousSchemaNameException
- if name
matches more than one entry in the
global scope of the dictionary.SchemaException
- if name
does not exist in the global scope or
if there is no scope above the global scope to which this
name may be promoted.private void promoteYoungest(NameNode node, int type, SchemaDictionary.Scope scope, boolean noPropagate)
node
(by reference)
to scope
. This adds these nodes to the appropriate global
namespaces of scope
. If the target scope already contains
the node, do not add it again. This method is recursive.node
- Name node whose youngest descendent nodes are to be promoted.type
- Type of node
(using EntityName
constants.scope
- Target scope into which references to descendents of
node
are copied.noPropagate
- true
to force any promoted nodes to have their
no propagate flag set. This disables propagation of these
nodes across an internal scope boundary.promoteEntry(java.lang.String, int, boolean, boolean)
private void propagate(SchemaDictionary.Scope oldScope, SchemaDictionary.Scope newScope)
In the case where the oldScope
is an internal scope, then
any nodes in its namespaces that have been marked as excludable will
not be propagated. This matches a 4GL behavior where promoted nodes
enclosed in internal scopes WHICH ALSO are using a buffer that is
scoped inside that internal scope, are not propagated.
oldScope
- Scope providing the source of the namespace contents.newScope
- Scope providing the target for the namespace contents.private java.lang.String getQualifiedName(java.lang.String name, int type, int startScope, int endScope) throws AmbiguousSchemaNameException
name
- Case insensitive entity name; may be qualified or not. If
qualified, only the table and/or field portion of the name may
be abbreviated.type
- EntityName
constant indicating whether name
represents a DATABASE
, TABLE
, or
FIELD
.null
if the lookup produced no match.java.lang.IllegalArgumentException
- if name
is malformed. An entity name is malformed
if it contains more than two dot delimiters.AmbiguousSchemaNameException
- if name
matches more than one entry in the
dictionary. This would indicate that either (a) more than one
entry was mistakenly added to the dictionary with the same
entity name, or (b) name
represents an ambiguous
abbreviation that matches more than one entry.private NameNode getTableNodeIfBuffer(NameNode node) throws AmbiguousSchemaNameException
Given a name node, detect if the node represents a buffer, and if so, return the node associated with the table which backs that buffer. Otherwise, simply return the reference to the node which was passed in.
node
- A name node which may or may not refer to a buffer.node
, or if node
represents a
buffer, the table node which backs the buffer.AmbiguousSchemaNameException
- if node
matches more than one entry in the
dictionary. This can only occur if node
refers
to a buffer, since a lookup only occurs in this case.private int nearestEnclosingInternal()
EXT_PROC_SCOPE
and the last index position in the case
that no scope is marked as internal.private SchemaDictionary.Scope getScope(NameNode node, Aast ast, boolean global)
node
resides. If node
is null
, get the scope indicated by the global
flag: the user global scope if true
, else the most recently
added (innermost or top) scope in the lookup stack.node
- Name node for which we want to find the enclosing scope. We
look within the global namespace of each scope to find this,
beginning with the most deeply nested (top) scope, and working
our way back to the outermost (bottom) scope. This is usually
the parent of the name node associated with the ast
.ast
- The AST defining the text and token type of the resource being found.global
- true
to get user global scope; false
to get top (innermost) scope. Only considered if
node
argument is null
or if no scope
was found containing node
.public static void main(java.lang.String[] args)
schema.dmp
.args
- Not used.