# SignatureHelper.java

    /*
    ** Module   : SignatureHelper
    ** Abstract : Signature helper method.
    **
    ** Copyright (c) 2013-2025, Golden Code Development Corporation.
    **
    ** -#- -I- --Date-- ---------------------------------Description----------------------------------
    ** 001 EVL 20130304 Created initial version.
    ** 002 CA  20130313 Fixed signature of KW_SUBSTIT.
    ** 003 SVL 20130319 Fixed signature of KW_LENGTH and KW_STRING, added "fuzzy" matching for
    **                  getSignature.
    ** 004 OM  20130325 Fixed signature of KW_DATETIME and KW_DATE_TZ.
    ** 005 OM  20130712 Fixed signature of KW_NEXT_VAL.
    ** 006 OM  20150922 Fixed signature of KW_SCR_2ITM method. Added mapping for attribute types.
    ** 007 CA  20160421 Added P2J-REMOTE-CALL function (language extension, not real 4GL).
    ** 008 HC  20170819 Added extension widget method GET-MOUSE-POSITION.
    ** 009 SVL 20171030 Added KW_RPT_DSGN and KW_RPT_QRY.
    ** 010 CA  20171111 Added WIDGET:BGCOLOR-RGB and WIDGET:FGCOLOR-RGB FWD extension attributes
    ** 011 SVL 20180208 Added KW_REPORT and KW_RPT_SRC.
    ** 012 CA  20180323 Added SESSION:SUPPRESS-WARNINGS-LIST.
    **                  Added BUFFER:DATA-SOURCE-ROWID attribute.
    ** 013 GES 20180511 Added DISABLE-REDRAW().
    ** 014 CA  20181029 Add all attributes and methods from the ProgressParser, no need to maintain a
    **                  separate map.
    ** 015 CA  20181128 Added GET-DB-CLIENT signature.
    ** 016 HC  20181128 Implemented TREEVIEW widget and related changes.
    ** 017 HC  20181228 Extended TREEEVIEW interface with new methods and attributes needed by a
    **                  real-world application of the widget.
    ** 018 HC  20181220 Added additional TREEVIEW methods.
    **     CA  20181220 GET-CODEPAGE must use BDT and default to 'longchar' for unknown.
    **     HC  20190110 Fixed signature of TreeList.createSubNode method.
    ** 019 HC  20190206 Added very early stage of TABSET widget implementation only providing public
    **                  interface and to allow conversion of legacy code.
    **         20190213 Fixed signature entry for REMOVE-NODE method.
    **     HC  20190313 Initial implementation of TREELIST widget. TREEVIEW widget refactored to make
    **                  it the base for the TREELIST widget.
    ** 020 OM  20190411 Added methods related to DataSet. Sorted the methods alphabetically.
    ** 021 CA  20190423 ASC is an INT function, not INT64.
    ** 022 IAS 20190501 Added SECURITY-POLICY support.
    ** 023 CA  20190508 MAX() and MIN() have BDT parameters, not INT.
    ** 024 EVL 20191126 Adding support for CreateSubNode2 TREE widget based feature.
    **     HC  20191127 Implemented tooltips for TREEVIEW and TREELIST widgets.
    **     HC  20200108 Added conversion support for widget attribute SCROLL-WHEEL-LINES, and methods
    **                  GET-NODE-FGCOLOR and SET-NODE-FGCOLOR.
    **     CA  20200304 Added SIGNATURE methods.
    ** 025 CA  20200331 GET-CODEPAGE and GET-CODEPAGES are the same token, and behave both as a
    **                  builtin variable or function.
    ** 026 CA  20200428 Added PROFILER:WRITE-DATA and USER-DATA mthd signatures.
    ** 027 CA  20200910 Added BUFFER:SERIALIZE-ROW() method signature.  Fixed WRITE-JSON() signature.
    ** 028 CA  20220514 KEYLABEL and KEYFUNCTION have an INT64 argument, not INTEGER.
    **                  Added signature for SESSION:MESSAGE-AREA-MSG().
    ** 029 GBB 20231121 Added SESSION:NEW-SESSION.
    ** 030 GBB 20240515 Added SESSION:GET-LOGIN-PARAMETER.
    ** 031 PMP 20250218 Registered button list related methods.
    ** 032 CA  20250130 Fixed signature for WEB-CONTEXT methods.  WEB-CONTEXT:URL-ENCODE is not yet fixed.
    ** 033 ICP 20250416 Added HASH-CODE built-in function.
    **     ICP 20250312 Added TENANT-NAME and TENANT-ID methods.
    */

    /*
    ** This program is free software: you can redistribute it and/or modify
    ** it under the terms of the GNU Affero General Public License as
    ** published by the Free Software Foundation, either version 3 of the
    ** License, or (at your option) any later version.
    **
    ** This program is distributed in the hope that it will be useful,
    ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ** GNU Affero General Public License for more details.
    **
    ** You may find a copy of the GNU Affero GPL version 3 at the following
    ** location: https://www.gnu.org/licenses/agpl-3.0.en.html
    **
    ** Additional terms under GNU Affero GPL version 3 section 7:
    **
    **   Under Section 7 of the GNU Affero GPL version 3, the following additional
    **   terms apply to the works covered under the License.  These additional terms
    **   are non-permissive additional terms allowed under Section 7 of the GNU
    **   Affero GPL version 3 and may not be removed by you.
    **
    **   0. Attribution Requirement.
    **
    **     You must preserve all legal notices or author attributions in the covered
    **     work or Appropriate Legal Notices displayed by works containing the covered
    **     work.  You may not remove from the covered work any author or developer
    **     credit already included within the covered work.
    **
    **   1. No License To Use Trademarks.
    **
    **     This license does not grant any license or rights to use the trademarks
    **     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
    **     of Golden Code Development Corporation. You are not authorized to use the
    **     name Golden Code, FWD, or the names of any author or contributor, for
    **     publicity purposes without written authorization.
    **
    **   2. No Misrepresentation of Affiliation.
    **
    **     You may not represent yourself as Golden Code Development Corporation or FWD.
    **
    **     You may not represent yourself for publicity purposes as associated with
    **     Golden Code Development Corporation, FWD, or any author or contributor to
    **     the covered work, without written authorization.
    **
    **   3. No Misrepresentation of Source or Origin.
    **
    **     You may not represent the covered work as solely your work.  All modified
    **     versions of the covered work must be marked in a reasonable way to make it
    **     clear that the modified work is not originating from Golden Code Development
    **     Corporation or FWD.  All modified versions must contain the notices of
    **     attribution required in this license.
    */

    package com.goldencode.p2j.convert;

    import java.util.*;
    import com.goldencode.p2j.uast.*;

    /**
     * Encodes the signatures of all Progress built-in functions (FUNC_*) and handle-based
     * methods (METH_*).  Provides methods to inspect these signatures. This is used during
     * conversion to do type analysis of expressions and for other tasks such as knowing the
     * proper type to emit for an unknown literal used as a parameter to a built-in.
     */
    public class SignatureHelper
    implements ProgressParserTokenTypes
    {
       /** Stores the core mapping data for built-in functions by keyword token type. */
       private static final HashMap<Integer, FuncDef> map_func = new HashMap<>();

       /** Stores the core mapping data for handle related methods by keyword token type. */
       private static final HashMap<Integer, FuncDef> map_meth = new HashMap<>();

       /** Stores the datatypes of each attribute/widget option. */
       private static final HashMap<Integer, Integer> map_attr = new HashMap<>();

       static
       {  // The 98 column restriction is not followed here because this form is much more readable.
          map_func.put(KW_ABS,      new FuncDef(FUNC_POLY        , KW_ABS      , 1, new ParmType[] { ParmType.NUM }));
          map_func.put(KW_CBIT,     new FuncDef(FUNC_LOGICAL     , KW_CBIT     , 2, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_func.put(KW_U_MSG,    new FuncDef(FUNC_INT         , KW_U_MSG    , 1, new ParmType[] { ParmType.NUM }));

          // add the rest of the FUNC_* and METH_* built-ins here!
          map_func.put(KW_ACCUM,    new FuncDef(FUNC_POLY        , KW_ACCUM    , 2, new ParmType[] { ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_ADD_INVL, new FuncDef(FUNC_POLY        , KW_ADD_INVL , 3, new ParmType[] { ParmType.DATE, ParmType.INT, ParmType.CHAR }));
          map_func.put(KW_ALIAS,    new FuncDef(FUNC_CHAR        , KW_ALIAS    , 1, new ParmType[] { ParmType.INT }));
          map_func.put(KW_AMBIG,    new FuncDef(FUNC_LOGICAL     , KW_AMBIG    , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_ASC,      new FuncDef(FUNC_INT         , KW_ASC      , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_AUD_ENAB, new FuncDef(FUNC_LOGICAL     , KW_AUD_ENAB , 0, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_AVAIL,    new FuncDef(FUNC_LOGICAL     , KW_AVAIL    , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_BASE64_D, new FuncDef(FUNC_MEMPTR      , KW_BASE64_D , 1, new ParmType[] { ParmType.TEXT }));
          map_func.put(KW_BASE64_E, new FuncDef(FUNC_LONGCHAR    , KW_BASE64_E , 1, new ParmType[] { ParmType.BIN }));
          map_func.put(KW_BL_G_GR,  new FuncDef(FUNC_HANDLE      , KW_BL_G_GR  , 1, new ParmType[] { ParmType.INT }));
          map_func.put(KW_BL_G_GRI, new FuncDef(FUNC_HANDLE      , KW_BL_G_GRI , 1, new ParmType[] { ParmType.INT }));
          map_func.put(KW_BL_G_KEY, new FuncDef(FUNC_CHAR        , KW_BL_G_KEY , 0, null));
          map_func.put(KW_BL_GADD,  new FuncDef(FUNC_HANDLE      , KW_BL_GADD  , 3, new ParmType[] { ParmType.NUM, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_BL_GCLR,  new FuncDef(FUNC_LOGICAL     , KW_BL_GCLR  , 0, null));
          map_func.put(KW_BL_GIFP,  new FuncDef(FUNC_HANDLE      , KW_BL_GIFP  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_func.put(KW_BL_IADD,  new FuncDef(FUNC_HANDLE      , KW_BL_IADD  , 4, new ParmType[] { ParmType.INT, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_BOX,      new FuncDef(FUNC_CLASS       , KW_BOX      , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_func.put(KW_CAN_DO,   new FuncDef(FUNC_LOGICAL     , KW_CAN_DO   , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_func.put(KW_CAN_FIND, new FuncDef(FUNC_LOGICAL     , KW_CAN_FIND , 1, new ParmType[] { ParmType.RECORD, ParmType.RECORD, ParmType.LOG, ParmType.INT, ParmType.HANDLE, ParmType.WID, ParmType.HANDLE, ParmType.WID, ParmType.INT, ParmType.LOG, ParmType.LOG }));
          map_func.put(KW_CAN_QRY,  new FuncDef(FUNC_LOGICAL     , KW_CAN_QRY  , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR }));
          map_func.put(KW_CAN_SET,  new FuncDef(FUNC_LOGICAL     , KW_CAN_SET  , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR }));
          map_func.put(KW_CAPS,     new FuncDef(FUNC_CHAR        , KW_CAPS     , 1, new ParmType[] { ParmType.TEXT }));
          // Function UPPER() has the same mapping as CAPS()
          map_func.put(KW_CAST,     new FuncDef(FUNC_CLASS       , KW_CAST     , 2, new ParmType[] { ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_CHR,      new FuncDef(FUNC_CHAR        , KW_CHR      , 1, new ParmType[] { ParmType.INT, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_CLR_NODS, new FuncDef(METH_VOID        , KW_CLR_NODS , 0, null));
          map_func.put(KW_CP_CVT,   new FuncDef(FUNC_CHAR        , KW_CP_CVT   , 1, new ParmType[] { ParmType.TEXT, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_COMPARE,  new FuncDef(FUNC_LOGICAL     , KW_COMPARE  , 4, new ParmType[] { ParmType.TEXT, ParmType.CHAR, ParmType.TEXT, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_CONN_ED,  new FuncDef(FUNC_LOGICAL     , KW_CONN_ED  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_COUNT_OF, new FuncDef(FUNC_INT         , KW_COUNT_OF , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_CUR_CHG,  new FuncDef(FUNC_LOGICAL     , KW_CUR_CHG  , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_CUR_RES,  new FuncDef(FUNC_INT         , KW_CUR_RES  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_CUR_VAL,  new FuncDef(FUNC_INT64       , KW_CUR_VAL  , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.INT }));
          map_func.put(KW_DATA_SM,  new FuncDef(FUNC_LOGICAL     , KW_DATA_SM  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_DATE,     new FuncDef(FUNC_DATE        , KW_DATE     , new SignDef[] { new SignDef(3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT } ), new SignDef(1, new ParmType[] { ParmType.BDT } ) } ));
          map_func.put(KW_DATETIME, new FuncDef(FUNC_DATETIME    , KW_DATETIME , new SignDef[] { new SignDef(1, new ParmType[] { ParmType.DATE, ParmType.INT } ), new SignDef(1, new ParmType[] { ParmType.CHAR } ), new SignDef(5, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT } ) } ));
          map_func.put(KW_DATE_TZ,  new FuncDef(FUNC_DATETIME_TZ , KW_DATE_TZ  , new SignDef[] { new SignDef(1, new ParmType[] { ParmType.DATE, ParmType.INT, ParmType.INT } ), new SignDef(1, new ParmType[] { ParmType.DT, ParmType.INT } ), new SignDef(5, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT } ), new SignDef(1, new ParmType[] { ParmType.CHAR } ) } ));
          map_func.put(KW_DAY,      new FuncDef(FUNC_INT         , KW_DAY      , 1, new ParmType[] { ParmType.DATE }));
          map_func.put(KW_DBCP,     new FuncDef(FUNC_CHAR        , KW_DBCP     , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DBCOLL,   new FuncDef(FUNC_CHAR        , KW_DBCOLL   , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DBPARAM,  new FuncDef(FUNC_CHAR        , KW_DBPARAM  , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DB_REM_H, new FuncDef(FUNC_CHAR        , KW_DB_REM_H , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DBREST,   new FuncDef(FUNC_CHAR        , KW_DBREST   , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_func.put(KW_DBTASKID, new FuncDef(FUNC_INT         , KW_DBTASKID , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DBTYPE,   new FuncDef(FUNC_CHAR        , KW_DBTYPE   , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DBVERS,   new FuncDef(FUNC_CHAR        , KW_DBVERS   , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_DEC,      new FuncDef(FUNC_DEC         , KW_DEC      , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_DECRYPT,  new FuncDef(FUNC_MEMPTR      , KW_DECRYPT  , 1, new ParmType[] { ParmType.BIN, ParmType.RAW, ParmType.RAW, ParmType.CHAR }));
          map_func.put(KW_DIS_REDR, new FuncDef(FUNC_LOGICAL     , KW_DIS_REDR , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_func.put(KW_DYN_CAST, new FuncDef(FUNC_CLASS       , KW_DYN_CAST , 2, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_func.put(KW_DYN_CURV, new FuncDef(FUNC_INT64       , KW_DYN_CURV , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.INT }));
          map_func.put(KW_DYN_FUNC, new FuncDef(FUNC_POLY        , KW_DYN_FUNC , new SignDef[] { new SignDef(1, new ParmType[] { ParmType.CHAR, ParmType.BDT_VARARGS } ), new SignDef(2, new ParmType[] { ParmType.CHAR, ParmType.HANDLE, ParmType.BDT_VARARGS } ) } ));
          map_func.put(KW_DYN_INVK, new FuncDef(FUNC_POLY        , KW_DYN_INVK , 2, new ParmType[] { ParmType.BDT, ParmType.CHAR, ParmType.BDT_VARARGS }));
          map_func.put(KW_DYN_NEXV, new FuncDef(FUNC_INT64       , KW_DYN_NEXV , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.INT }));
          map_func.put(KW_ENCODE,   new FuncDef(FUNC_CHAR        , KW_ENCODE   , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_ENCRYPT,  new FuncDef(FUNC_MEMPTR      , KW_ENCRYPT  , 1, new ParmType[] { ParmType.BDT, ParmType.RAW, ParmType.RAW, ParmType.CHAR }));
          map_func.put(KW_ENTERED,  new FuncDef(FUNC_LOGICAL     , KW_ENTERED  , 1, new ParmType[] { ParmType.WID }));
          map_func.put(KW_ENTRY,    new FuncDef(FUNC_CHAR        , KW_ENTRY    , 2, new ParmType[] { ParmType.INT, ParmType.TEXT, ParmType.CHAR }));
          map_func.put(KW_ERROR,    new FuncDef(FUNC_LOGICAL     , KW_ERROR    , 1, new ParmType[] { ParmType.BIN }));
          map_func.put(KW_ETIME,    new FuncDef(FUNC_INT         , KW_ETIME    , 0, new ParmType[] { ParmType.LOG }));
          map_func.put(KW_EXP,      new FuncDef(FUNC_DEC         , KW_EXP      , 2, new ParmType[] { ParmType.NUM, ParmType.NUM }));
          map_func.put(KW_EXTENT,   new FuncDef(FUNC_INT         , KW_EXTENT   , 1, new ParmType[] { ParmType.BDT_ARRAY }));
          map_func.put(KW_FILL,     new FuncDef(FUNC_CHAR        , KW_FILL     , 2, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_func.put(KW_FIRST,    new FuncDef(FUNC_LOGICAL     , KW_FIRST    , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_FIRST_OF, new FuncDef(FUNC_LOGICAL     , KW_FIRST_OF , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_FR_COL,   new FuncDef(FUNC_DEC         , KW_FR_COL   , 0, new ParmType[] { ParmType.WID }));
          map_func.put(KW_FR_DOWN,  new FuncDef(FUNC_INT         , KW_FR_DOWN  , 0, new ParmType[] { ParmType.WID }));
          map_func.put(KW_FR_LINE,  new FuncDef(FUNC_INT         , KW_FR_LINE  , 0, new ParmType[] { ParmType.WID }));
          map_func.put(KW_FR_ROW,   new FuncDef(FUNC_DEC         , KW_FR_ROW   , 0, new ParmType[] { ParmType.WID }));
          map_func.put(KW_GEN_PBEK, new FuncDef(FUNC_RAW         , KW_GEN_PBEK , 1, new ParmType[] { ParmType.BIN, ParmType.RAW }));
          map_func.put(KW_GET_BITS, new FuncDef(FUNC_INT         , KW_GET_BITS , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT }));
          map_func.put(KW_GET_BYTE, new FuncDef(FUNC_INT         , KW_GET_BYTE , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_B_OR, new FuncDef(FUNC_INT         , KW_GET_B_OR , 1, new ParmType[] { ParmType.MEM }));
          map_func.put(KW_GET_BYTS, new FuncDef(FUNC_POLY        , KW_GET_BYTS , 3, new ParmType[] { ParmType.BIN, ParmType.INT, ParmType.INT }));
          map_func.put(KW_GET_CODP, new FuncDef(FUNC_CHAR        , KW_GET_CODP , 0, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_GET_CLL,  new FuncDef(FUNC_CHAR        , KW_GET_CLL  , 1, new ParmType[] { ParmType.CLOB }));
          map_func.put(KW_GET_COLL, new FuncDef(FUNC_CHAR        , KW_GET_COLL , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_GET_DBCL, new FuncDef(FUNC_LOGICAL     , KW_GET_DBCL , 0, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_GET_DBL,  new FuncDef(FUNC_DEC         , KW_GET_DBL  , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_FLT,  new FuncDef(FUNC_DEC         , KW_GET_FLT  , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_I64,  new FuncDef(FUNC_INT64       , KW_GET_I64  , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_LONG, new FuncDef(FUNC_INT         , KW_GET_LONG , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_PTR,  new FuncDef(FUNC_INT64       , KW_GET_PTR  , 1, new ParmType[] { ParmType.MEM }));
          map_func.put(KW_GET_SHRT, new FuncDef(FUNC_INT         , KW_GET_SHRT , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_SZ,   new FuncDef(FUNC_INT64       , KW_GET_SZ   , 1, new ParmType[] { ParmType.MEM }));
          map_func.put(KW_GET_STR,  new FuncDef(FUNC_CHAR        , KW_GET_STR  , 2, new ParmType[] { ParmType.BIN, ParmType.INT, ParmType.INT }));
          map_func.put(KW_GET_TNOD, new FuncDef(FUNC_HANDLE      , KW_GET_TNOD , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_GET_UL,   new FuncDef(FUNC_INT64       , KW_GET_UL   , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GET_USHT, new FuncDef(FUNC_INT         , KW_GET_USHT , 2, new ParmType[] { ParmType.BIN, ParmType.INT }));
          map_func.put(KW_GUID,     new FuncDef(FUNC_CHAR        , KW_GUID     , 0, new ParmType[] { ParmType.RAW }));
          map_func.put(KW_HANDLE,   new FuncDef(FUNC_HANDLE      , KW_HANDLE   , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_HASHCODE, new FuncDef(FUNC_INT         , KW_HASHCODE , 0, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_HEX_DECD, new FuncDef(FUNC_RAW         , KW_HEX_DECD , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_HEX_ENCD, new FuncDef(FUNC_CHAR        , KW_HEX_ENCD , 1, new ParmType[] { ParmType.RAW }));
          map_func.put(KW_IF,       new FuncDef(FUNC_POLY        , KW_IF       , 1, new ParmType[] { ParmType.LOG, ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_INDEX,    new FuncDef(FUNC_INT         , KW_INDEX    , 2, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.INT }));
          map_func.put(KW_INPUT,    new FuncDef(FUNC_POLY        , KW_INPUT    , 1, new ParmType[] { ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_INT,      new FuncDef(FUNC_INT         , KW_INT      , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_INT64,    new FuncDef(FUNC_INT64       , KW_INT64    , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_INTERVAL, new FuncDef(FUNC_INT64       , KW_INTERVAL , 3, new ParmType[] { ParmType.DATE, ParmType.DATE, ParmType.CHAR }));
          map_func.put(KW_IS_CP_FX, new FuncDef(FUNC_LOGICAL     , KW_IS_CP_FX , 1, new ParmType[] { ParmType.LC }));
          map_func.put(KW_IS_COLCP, new FuncDef(FUNC_LOGICAL     , KW_IS_COLCP , 1, new ParmType[] { ParmType.CLOB }));
          map_func.put(KW_IS_LEAD,  new FuncDef(FUNC_LOGICAL     , KW_IS_LEAD  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_ISO_DATE, new FuncDef(FUNC_CHAR        , KW_ISO_DATE , 1, new ParmType[] { ParmType.DATE }));
          map_func.put(KW_KBLABEL,  new FuncDef(FUNC_CHAR        , KW_KBLABEL  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_KEYCODE,  new FuncDef(FUNC_INT         , KW_KEYCODE  , 1, new ParmType[] { ParmType.CHAR }));
    //      map_func.put("key-code"             , FUNC_INT        , true );
          map_func.put(KW_KEYFUNC,  new FuncDef(FUNC_CHAR        , KW_KEYFUNC  , 1, new ParmType[] { ParmType.INT64 }));
    //      map_func.put("key-function"         , FUNC_CHAR       , true );
          map_func.put(KW_KEYLAB,   new FuncDef(FUNC_CHAR        , KW_KEYLAB   , 1, new ParmType[] { ParmType.INT64 }));
    //      map_func.put("key-label"            , FUNC_CHAR       , true );
          map_func.put(KW_KW,       new FuncDef(FUNC_CHAR        , KW_KW       , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_KW_ALL,   new FuncDef(FUNC_CHAR        , KW_KW_ALL   , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_LAST,     new FuncDef(FUNC_LOGICAL     , KW_LAST     , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_LAST_OF,  new FuncDef(FUNC_LOGICAL     , KW_LAST_OF  , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_LC,       new FuncDef(FUNC_CHAR        , KW_LC       , 1, new ParmType[] { ParmType.TEXT }));
          // Function LOWER() has the same mapping as LC()
          map_func.put(KW_LDBNAME,  new FuncDef(FUNC_CHAR        , KW_LDBNAME  , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_L_TRIM,   new FuncDef(FUNC_CHAR        , KW_L_TRIM   , 1, new ParmType[] { ParmType.TEXT, ParmType.CHAR }));
          map_func.put(KW_LENGTH,   new FuncDef(FUNC_INT         , KW_LENGTH   , new SignDef[] { new SignDef(1, new ParmType[] { ParmType.CHAR, ParmType.CHAR }), new SignDef(1, new ParmType[] { ParmType.RAW, ParmType.CHAR })}));
          map_func.put(KW_LIB,      new FuncDef(FUNC_CHAR        , KW_LIB      , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_LINE_CNT, new FuncDef(FUNC_INT         , KW_LINE_CNT , 0, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_LST_EVNT, new FuncDef(FUNC_CHAR        , KW_LST_EVNT , 1, new ParmType[] { ParmType.HANDLE, ParmType.CHAR }));
          map_func.put(KW_LST_QRY,  new FuncDef(FUNC_CHAR        , KW_LST_QRY  , 1, new ParmType[] { ParmType.HANDLE }));
          map_func.put(KW_LST_SET,  new FuncDef(FUNC_CHAR        , KW_LST_SET  , 1, new ParmType[] { ParmType.HANDLE }));
          map_func.put(KW_LST_WID,  new FuncDef(FUNC_CHAR        , KW_LST_WID  , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_LOAD_PIC, new FuncDef(FUNC_COM_HANDLE  , KW_LOAD_PIC , 0, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_LOCKED,   new FuncDef(FUNC_LOGICAL     , KW_LOCKED   , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_LOG,      new FuncDef(FUNC_DEC         , KW_LOG      , 1, new ParmType[] { ParmType.DEC, ParmType.NUM }));
          map_func.put(KW_LOGICAL,  new FuncDef(FUNC_LOGICAL     , KW_LOGICAL  , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_func.put(KW_LOOKUP,   new FuncDef(FUNC_INT         , KW_LOOKUP   , 2, new ParmType[] { ParmType.CHAR, ParmType.TEXT, ParmType.CHAR }));
          map_func.put(KW_MAX,      new FuncDef(FUNC_POLY        , KW_MAX      , 2, new ParmType[] { ParmType.BDT, ParmType.BDT, ParmType.BDT_VARARGS }));
          map_func.put(KW_MD5_DIG,  new FuncDef(FUNC_RAW         , KW_MD5_DIG  , 1, new ParmType[] { ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_MEMBER,   new FuncDef(FUNC_CHAR        , KW_MEMBER   , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_MIN,      new FuncDef(FUNC_POLY        , KW_MIN      , 2, new ParmType[] { ParmType.BDT, ParmType.BDT, ParmType.NUM_VARARGS }));
          map_func.put(KW_MONTH,    new FuncDef(FUNC_INT         , KW_MONTH    , 1, new ParmType[] { ParmType.DATE }));
          map_func.put(KW_MTIME,    new FuncDef(FUNC_INT         , KW_MTIME    , 0, new ParmType[] { ParmType.DT }));
          map_func.put(KW_NEW,      new FuncDef(FUNC_LOGICAL     , KW_NEW      , 1, new ParmType[] { ParmType.RECORD }));// Only new record function TODO: NEW object function??
          map_func.put(KW_NEXT_VAL, new FuncDef(FUNC_INT64       , KW_NEXT_VAL , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.INT }));
          map_func.put(KW_NORMALZE, new FuncDef(FUNC_POLY        , KW_NORMALZE , 2, new ParmType[] { ParmType.TEXT, ParmType.CHAR }));
          map_func.put(NOT_ENTERED, new FuncDef(FUNC_LOGICAL     , NOT_ENTERED , 1, new ParmType[] { ParmType.WID }));
          map_func.put(KW_NOW,      new FuncDef(FUNC_DATETIME_TZ , KW_NOW      , 0, null));
          map_func.put(KW_NUM_ENT,  new FuncDef(FUNC_INT         , KW_NUM_ENT  , 1, new ParmType[] { ParmType.TEXT, ParmType.CHAR }));
          map_func.put(KW_NUM_RES,  new FuncDef(FUNC_INT         , KW_NUM_RES  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_OS_G_ENV, new FuncDef(FUNC_CHAR        , KW_OS_G_ENV , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_P2J_RC,   new FuncDef(FUNC_CHAR        , KW_P2J_RC   , 1, new ParmType[] { ParmType.CHAR })); // P2J-extension, not real 4GL!
          map_func.put(KW_PAGE_NUM, new FuncDef(FUNC_INT         , KW_PAGE_NUM , 0, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_PAGE_SZ,  new FuncDef(FUNC_INT         , KW_PAGE_SZ  , 0, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_PDBNAME,  new FuncDef(FUNC_CHAR        , KW_PDBNAME  , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_PROGNAME, new FuncDef(FUNC_CHAR        , KW_PROGNAME , 1, new ParmType[] { ParmType.INT }));
          map_func.put(KW_QRY_OFF,  new FuncDef(FUNC_LOGICAL     , KW_QRY_OFF  , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_QUOTER,   new FuncDef(FUNC_CHAR        , KW_QUOTER   , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_R_INDEX,  new FuncDef(FUNC_INT         , KW_R_INDEX  , 2, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.INT }));
          map_func.put(KW_RAW,      new FuncDef(FUNC_RAW         , KW_RAW      , 1, new ParmType[] { ParmType.BDT, ParmType.INT, ParmType.INT }));
          map_func.put(KW_RANDOM,   new FuncDef(FUNC_INT         , KW_RANDOM   , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_func.put(KW_RECID,    new FuncDef(FUNC_RECID       , KW_RECID    , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_REC_LEN,  new FuncDef(FUNC_INT         , KW_REC_LEN  , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_REJECTED, new FuncDef(FUNC_LOGICAL     , KW_REJECTED , 1, new ParmType[] { ParmType.RECORD }));// Temptable buffer??
          map_func.put(KW_REPLACE,  new FuncDef(FUNC_CHAR        , KW_REPLACE  , 3, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.TEXT }));
          map_func.put(KW_RETRY,    new FuncDef(FUNC_LOGICAL     , KW_RETRY    , 0, null));
          map_func.put(KW_RGB_VAL,  new FuncDef(FUNC_INT         , KW_RGB_VAL  , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT }));
          map_func.put(KW_R_TRIM,   new FuncDef(FUNC_CHAR        , KW_R_TRIM   , 1, new ParmType[] { ParmType.TEXT, ParmType.CHAR }));
          map_func.put(KW_ROUND,    new FuncDef(FUNC_DEC         , KW_ROUND    , 2, new ParmType[] { ParmType.DEC, ParmType.INT }));
          map_func.put(KW_ROWID,    new FuncDef(FUNC_ROWID       , KW_ROWID    , 1, new ParmType[] { ParmType.RECORD }));
          map_func.put(KW_ROW_STAT, new FuncDef(FUNC_INT         , KW_ROW_STAT , 1, new ParmType[] { ParmType.RECORD }));// Temptable buffer??
          map_func.put(KW_SDBNAME,  new FuncDef(FUNC_CHAR        , KW_SDBNAME  , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_SEARCH,   new FuncDef(FUNC_CHAR        , KW_SEARCH   , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_SEEK,     new FuncDef(FUNC_INT         , KW_SEEK     , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_SETUSER,  new FuncDef(FUNC_LOGICAL     , KW_SETUSER  , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_SET_DBCL, new FuncDef(FUNC_LOGICAL     , KW_SET_DBCL , 1, new ParmType[] { ParmType.HANDLE, ParmType.BDT }));
          map_func.put(KW_SHA1_DIG, new FuncDef(FUNC_RAW         , KW_SHA1_DIG , 1, new ParmType[] { ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_SQRT,     new FuncDef(FUNC_DEC         , KW_SQRT     , 1, new ParmType[] { ParmType.NUM }));
          map_func.put(KW_SSL_SRVN, new FuncDef(FUNC_CHAR        , KW_SSL_SRVN , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_STRING,   new FuncDef(FUNC_CHAR        , KW_STRING   , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_func.put(KW_SUBSTIT,  new FuncDef(FUNC_CHAR        , KW_SUBSTIT  , 1, new ParmType[] { ParmType.TEXT, ParmType.TEXT_VARARGS }));
          map_func.put(KW_SUBSTR,   new FuncDef(FUNC_CHAR        , KW_SUBSTR   , 2, new ParmType[] { ParmType.TEXT, ParmType.INT, ParmType.INT, ParmType.CHAR }));
          map_func.put(KW_SUPER,    new FuncDef(FUNC_POLY        , KW_SUPER    , 0, new ParmType[] { ParmType.BDT_VARARGS }));
          map_func.put(KW_TIME,     new FuncDef(FUNC_INT         , KW_TIME     , 0, null));
          map_func.put(KW_TIMEZONE, new FuncDef(FUNC_INT         , KW_TIMEZONE , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_TO_ROWID, new FuncDef(FUNC_ROWID       , KW_TO_ROWID , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_TODAY,    new FuncDef(FUNC_DATE        , KW_TODAY    , 0, null));
          map_func.put(KW_TRANS,    new FuncDef(FUNC_LOGICAL     , KW_TRANS    , 0, null));
          map_func.put(KW_TRIM,     new FuncDef(FUNC_CHAR        , KW_TRIM     , 1, new ParmType[] { ParmType.TEXT, ParmType.CHAR }));
          map_func.put(KW_TRUNC,    new FuncDef(FUNC_DEC         , KW_TRUNC    , 2, new ParmType[] { ParmType.DEC, ParmType.INT }));
          map_func.put(KW_TYPE_OF,  new FuncDef(FUNC_LOGICAL     , KW_TYPE_OF  , 2, new ParmType[] { ParmType.BDT, ParmType.BDT }));
          map_func.put(KW_USERID,   new FuncDef(FUNC_CHAR        , KW_USERID   , 0, new ParmType[] { ParmType.CHAR }));
    //      map_func.put("user"               , FUNC_CHAR           , false); The same as userid function
          map_func.put(KW_VAL_EVT,  new FuncDef(FUNC_LOGICAL     , KW_VAL_EVT  , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR }));
          map_func.put(KW_VAL_HND,  new FuncDef(FUNC_LOGICAL     , KW_VAL_HND  , 1, new ParmType[] { ParmType.HANDLE }));
          map_func.put(KW_VAL_OBJ,  new FuncDef(FUNC_LOGICAL     , KW_VAL_OBJ  , 1, new ParmType[] { ParmType.BDT }));
          map_func.put(KW_WEEK,     new FuncDef(FUNC_INT         , KW_WEEK     , 1, new ParmType[] { ParmType.DATE }));
          map_func.put(KW_WID_HAND, new FuncDef(FUNC_HANDLE      , KW_WID_HAND , 1, new ParmType[] { ParmType.CHAR }));
          map_func.put(KW_YEAR,     new FuncDef(FUNC_INT         , KW_YEAR     , 1, new ParmType[] { ParmType.DATE }));

          // Methods added below
          map_meth.put(KW_ACC_CHG,  new FuncDef(METH_LOGICAL     , KW_ACC_CHG  , 0, null));
          map_meth.put(KW_ACC_RCHG, new FuncDef(METH_LOGICAL     , KW_ACC_RCHG , 0, null));
          map_meth.put(KW_ADD_1ST,  new FuncDef(METH_LOGICAL     , KW_ADD_1ST  , 1, new ParmType[] { ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_ADD_BUF,  new FuncDef(METH_LOGICAL     , KW_ADD_BUF  , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_ADD_C_C,  new FuncDef(METH_HANDLE      , KW_ADD_C_C  , 4, new ParmType[] { ParmType.BDT, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_ADD_C_F,  new FuncDef(METH_LOGICAL     , KW_ADD_C_F  , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_meth.put(KW_ADD_C_N,  new FuncDef(METH_HANDLE      , KW_ADD_C_N  , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_EVTP, new FuncDef(METH_LOGICAL     , KW_ADD_EVTP , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_ADD_F_F,  new FuncDef(METH_LOGICAL     , KW_ADD_F_F  , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_meth.put(KW_ADD_F_N,  new FuncDef(METH_HANDLE      , KW_ADD_F_N  , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_HENT, new FuncDef(METH_LOGICAL     , KW_ADD_HENT , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_ADD_IDXF, new FuncDef(METH_LOGICAL     , KW_ADD_IDXF , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_L_C,  new FuncDef(METH_HANDLE      , KW_ADD_L_C  , 1, new ParmType[] { ParmType.BDT, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_ADD_L_N,  new FuncDef(METH_HANDLE      , KW_ADD_L_N  , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_LAST, new FuncDef(METH_LOGICAL     , KW_ADD_LAST , 1, new ParmType[] { ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_ADD_LIKF, new FuncDef(METH_LOGICAL     , KW_ADD_LIKF , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_LIKI, new FuncDef(METH_LOGICAL     , KW_ADD_LIKI , 3, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_N_N,  new FuncDef(METH_HANDLE      , KW_ADD_N_N  , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_NEWF, new FuncDef(METH_LOGICAL     , KW_ADD_NEWF , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.INT, ParmType.CHAR, ParmType.BDT, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_NEWI, new FuncDef(METH_LOGICAL     , KW_ADD_NEWI , 1, new ParmType[] { ParmType.CHAR, ParmType.LOG, ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_ADD_PREL, new FuncDef(METH_HANDLE      , KW_ADD_PREL , 2, new ParmType[] { ParmType.HANDLE, ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_REL,  new FuncDef(METH_HANDLE      , KW_ADD_REL  , 2, new ParmType[] { ParmType.HANDLE, ParmType.HANDLE, ParmType.CHAR, ParmType.LOG, ParmType.LOG, ParmType.LOG, ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_ADD_SLOC, new FuncDef(METH_LOGICAL     , KW_ADD_SLOC , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_ADD_SRCB, new FuncDef(METH_LOGICAL     , KW_ADD_SRCB , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR }));
          map_meth.put(KW_ADD_SUP,  new FuncDef(METH_LOGICAL     , KW_ADD_SUP  , 1, new ParmType[] { ParmType.HANDLE, ParmType.INT }));
          map_meth.put(KW_ADD_TAB,  new FuncDef(METH_VOID        , KW_ADD_TAB  , 3, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_APPEND_C, new FuncDef(METH_LOGICAL     , KW_APPEND_C , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_APPL_CBK, new FuncDef(METH_LOGICAL     , KW_APPL_CBK , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_ATT_DSRC, new FuncDef(METH_LOGICAL     , KW_ATT_DSRC , 1, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_AUTHEN_F, new FuncDef(METH_LOGICAL     , KW_AUTHEN_F , 0, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_BEG_EV_G, new FuncDef(METH_CHAR        , KW_BEG_EV_G , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_BUF_COMP, new FuncDef(METH_LOGICAL     , KW_BUF_COMP , 1, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR, ParmType.LOG }));
          map_meth.put(KW_BUF_COPY, new FuncDef(METH_LOGICAL     , KW_BUF_COPY , 1, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR, ParmType.LOG }));
          map_meth.put(KW_BUF_CREA, new FuncDef(METH_LOGICAL     , KW_BUF_CREA , 0, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_BUF_DEL,  new FuncDef(METH_LOGICAL     , KW_BUF_DEL  , 0, null));
          map_meth.put(KW_BUF_FLD,  new FuncDef(METH_LOGICAL     , KW_BUF_FLD  , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_BUF_REL,  new FuncDef(METH_LOGICAL     , KW_BUF_REL  , 0, null));
          map_meth.put(KW_BUF_VAL,  new FuncDef(METH_POLY        , KW_BUF_VAL  , 0, new ParmType[] { ParmType.INT }));// New method
          map_meth.put(KW_BUF_VLID, new FuncDef(METH_LOGICAL     , KW_BUF_VLID , 0, null));
          map_meth.put(KW_CANC_BRK, new FuncDef(METH_LOGICAL     , KW_CANC_BRK , 0, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_CANCEL_R, new FuncDef(METH_LOGICAL     , KW_CANCEL_R , 0, null));
          map_meth.put(KW_CLEAR,    new FuncDef(METH_LOGICAL     , KW_CLEAR    , 0, null));
          map_meth.put(KW_CLEA_TAB, new FuncDef(METH_VOID        , KW_CLEA_TAB , 0, null)); // FWD-extension, not real 4GL!
          map_meth.put(KW_CLEA_WIN, new FuncDef(METH_VOID        , KW_CLEA_WIN , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_CLONE_ND, new FuncDef(METH_LOGICAL     , KW_CLONE_ND , 2, new ParmType[] { ParmType.HANDLE, ParmType.LOG }));
          map_meth.put(KW_CLOSE_LG, new FuncDef(METH_LOGICAL     , KW_CLOSE_LG , 0, null));
          map_meth.put(KW_CLR_ALL,  new FuncDef(METH_VOID        , KW_CLR_ALL  , 0, null));
          map_meth.put(KW_CLR_AP_C, new FuncDef(METH_LOGICAL     , KW_CLR_AP_C , 0, null));
          map_meth.put(KW_CLR_LOG,  new FuncDef(METH_LOGICAL     , KW_CLR_LOG  , 0, null));
          map_meth.put(KW_CLR_S_AR, new FuncDef(METH_LOGICAL     , KW_CLR_S_AR , 0, null));
          map_meth.put(KW_CLR_SEL,  new FuncDef(METH_LOGICAL     , KW_CLR_SEL  , 0, null));
          map_meth.put(KW_CLR_TABS, new FuncDef(METH_VOID        , KW_CLR_TABS , 0, null));
          map_meth.put(KW_CNCL_R_A, new FuncDef(METH_LOGICAL     , KW_CNCL_R_A , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_COL_NODE, new FuncDef(METH_VOID        , KW_COL_NODE , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_COLL_A_E, new FuncDef(METH_VOID        , KW_COLL_A_E , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_COLL_ALL, new FuncDef(METH_VOID        , KW_COLL_ALL , 0, null));
          map_meth.put(KW_CONN_ED,  new FuncDef(METH_LOGICAL     , KW_CONN_ED  , 0, null));
          map_meth.put(KW_CONN,     new FuncDef(METH_LOGICAL     , KW_CONN     , 0, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_CPY_DSET, new FuncDef(METH_LOGICAL     , KW_CPY_DSET , 1, new ParmType[] { ParmType.HANDLE, ParmType.LOG, ParmType.LOG, ParmType.LOG, ParmType.CHAR, ParmType.LOG, ParmType.CHAR  }));
          map_meth.put(KW_CPY_SATR, new FuncDef(METH_LOGICAL     , KW_CPY_SATR , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_CPY_TTBL, new FuncDef(METH_LOGICAL     , KW_CPY_TTBL , 1, new ParmType[] { ParmType.HANDLE, ParmType.LOG, ParmType.LOG, ParmType.LOG, ParmType.CHAR }));
          map_meth.put(KW_CR_LK_SQ, new FuncDef(METH_LOGICAL     , KW_CR_LK_SQ , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_meth.put(KW_CRE_IMAG, new FuncDef(METH_INT         , KW_CRE_IMAG , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_CREAT_LK, new FuncDef(METH_LOGICAL     , KW_CREAT_LK , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_meth.put(KW_CREAT_ND, new FuncDef(METH_LOGICAL     , KW_CREAT_ND , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_meth.put(KW_CREAT_NN, new FuncDef(METH_LOGICAL     , KW_CREAT_NN , 4, new ParmType[] { ParmType.HANDLE, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_CREAT_RL, new FuncDef(METH_LOGICAL     , KW_CREAT_RL , 0, null));
          map_meth.put(KW_CREAT_SN, new FuncDef(METH_VOID        , KW_CREAT_SN , 7, new ParmType[] { ParmType.NUM, ParmType.CHAR, ParmType.CHAR, ParmType.LOG, ParmType.NUM, ParmType.NUM, ParmType.INT }));
          map_meth.put(KW_CRT_COL,  new FuncDef(METH_INT         , KW_CRT_COL  , 6, new ParmType[] { ParmType.TEXT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_CUR_QRY,  new FuncDef(METH_HANDLE      , KW_CUR_QRY  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_CVT_2OFF, new FuncDef(METH_INT         , KW_CVT_2OFF , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_DEBUG,    new FuncDef(METH_LOGICAL     , KW_DEBUG    , 0, null));
          map_meth.put(KW_DECL_NSP, new FuncDef(METH_LOGICAL     , KW_DECL_NSP , 1, new ParmType[] { ParmType.TEXT, ParmType.TEXT }));
          map_meth.put(KW_DEL_C_R,  new FuncDef(METH_LOGICAL     , KW_DEL_C_R  , 0, null));
          map_meth.put(KW_DEL_CHAR, new FuncDef(METH_LOGICAL     , KW_DEL_CHAR , 0, null));
          map_meth.put(KW_DEL_H_EN, new FuncDef(METH_LOGICAL     , KW_DEL_H_EN , 0, null));
          map_meth.put(KW_DEL_LINE, new FuncDef(METH_LOGICAL     , KW_DEL_LINE , 0, null));
          map_meth.put(KW_DEL_NODE, new FuncDef(METH_LOGICAL     , KW_DEL_NODE , 0, null));
          map_meth.put(KW_DEL_R_L,  new FuncDef(METH_LOGICAL     , KW_DEL_R_L  , 0, null));
          map_meth.put(KW_DEL_S_R,  new FuncDef(METH_LOGICAL     , KW_DEL_S_R  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_DEL_S_RS, new FuncDef(METH_LOGICAL     , KW_DEL_S_RS , 0, null));
          map_meth.put(KW_DELETE,   new FuncDef(METH_LOGICAL     , KW_DELETE   , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_DESEL_FR, new FuncDef(METH_LOGICAL     , KW_DESEL_FR , 0, null));
          map_meth.put(KW_DESEL_R,  new FuncDef(METH_LOGICAL     , KW_DESEL_R  , 0, null));
          map_meth.put(KW_DESEL_SR, new FuncDef(METH_LOGICAL     , KW_DESEL_SR , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_DET_DSRC, new FuncDef(METH_LOGICAL     , KW_DET_DSRC , 0, null));
          map_meth.put(KW_DIS_D_TR, new FuncDef(METH_LOGICAL     , KW_DIS_D_TR , 0, null));
          map_meth.put(KW_DIS_L_TR, new FuncDef(METH_LOGICAL     , KW_DIS_L_TR , 1, new ParmType[] { ParmType.LOG }));
          map_meth.put(KW_DISABL_C, new FuncDef(METH_LOGICAL     , KW_DISABL_C , 0, null));
          map_meth.put(KW_DISABLE,  new FuncDef(METH_LOGICAL     , KW_DISABLE  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_DISCONN,  new FuncDef(METH_LOGICAL     , KW_DISCONN  , 0, null));
          map_meth.put(KW_DISP_MSG, new FuncDef(METH_LOGICAL     , KW_DISP_MSG , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_DUMP_LGN, new FuncDef(METH_LOGICAL     , KW_DUMP_LGN , 1, new ParmType[] { ParmType.LOG }));
          map_meth.put(KW_EDIT_CLR, new FuncDef(METH_LOGICAL     , KW_EDIT_CLR , 0, null));
          map_meth.put(KW_EDIT_CPY, new FuncDef(METH_LOGICAL     , KW_EDIT_CPY , 0, null));
          map_meth.put(KW_EDIT_CUT, new FuncDef(METH_LOGICAL     , KW_EDIT_CUT , 0, null));
          map_meth.put(KW_EDIT_PAS, new FuncDef(METH_LOGICAL     , KW_EDIT_PAS , 0, null));
          map_meth.put(KW_EDIT_UND, new FuncDef(METH_LOGICAL     , KW_EDIT_UND , 0, null));
          map_meth.put(KW_EMPTY_DS, new FuncDef(METH_LOGICAL     , KW_EMPTY_DS , 0, null));
          map_meth.put(KW_EMPTY_TT, new FuncDef(METH_LOGICAL     , KW_EMPTY_TT , 0, null));
          map_meth.put(KW_ENABLE_C, new FuncDef(METH_LOGICAL     , KW_ENABLE_C , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_ENABLE_E, new FuncDef(METH_LOGICAL     , KW_ENABLE_E , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_ENABLE,   new FuncDef(METH_LOGICAL     , KW_ENABLE   , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_ENC_AMK,  new FuncDef(METH_LOGICAL     , KW_ENC_AMK  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_END_DOC,  new FuncDef(METH_LOGICAL     , KW_END_DOC  , 0, null));
          map_meth.put(KW_END_ELEM, new FuncDef(METH_LOGICAL     , KW_END_ELEM , 1, new ParmType[] { ParmType.TEXT, ParmType.TEXT }));
          map_meth.put(KW_END_EV_G, new FuncDef(METH_LOGICAL     , KW_END_EV_G , 0, null));
          map_meth.put(KW_END_F_D,  new FuncDef(METH_LOGICAL     , KW_END_F_D  , 0, null));
          map_meth.put(KW_ENS_N_V,  new FuncDef(METH_VOID        , KW_ENS_N_V  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_ENTRY,    new FuncDef(METH_LOGICAL     , KW_ENTRY    , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_EXP_NODE, new FuncDef(METH_VOID        , KW_EXP_NODE , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_EXPA_ALL, new FuncDef(METH_VOID        , KW_EXPA_ALL , 0, null));
          map_meth.put(KW_EXPORT_P, new FuncDef(METH_LOGICAL     , KW_EXPORT_P , 0, null));
          map_meth.put(KW_EXPORT,   new FuncDef(METH_LOGICAL     , KW_EXPORT   , 0, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_FETCH_SR, new FuncDef(METH_LOGICAL     , KW_FETCH_SR , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_FILL,     new FuncDef(METH_LOGICAL     , KW_FILL     , 0, null));
          map_meth.put(KW_FIND_1ST, new FuncDef(METH_LOGICAL     , KW_FIND_1ST , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_FIND_BR,  new FuncDef(METH_LOGICAL     , KW_FIND_BR  , 1, new ParmType[] { ParmType.ROWID, ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_FIND_CUR, new FuncDef(METH_LOGICAL     , KW_FIND_CUR , 0, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_FIND_LST, new FuncDef(METH_LOGICAL     , KW_FIND_LST , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_FIND_UNI, new FuncDef(METH_LOGICAL     , KW_FIND_UNI , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_FIX_C_L,  new FuncDef(METH_VOID        , KW_FIX_C_L  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_G_C_BGCO, new FuncDef(METH_INT         , KW_G_C_BGCO , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_G_C_FGCO, new FuncDef(METH_INT         , KW_G_C_FGCO , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_G_COL_P,  new FuncDef(METH_INT         , KW_G_COL_P  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_G_COL_W,  new FuncDef(METH_INT         , KW_G_COL_W  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_A_N,  new FuncDef(METH_LOGICAL     , KW_GET_A_N  , 2, new ParmType[] { ParmType.HANDLE, ParmType.CHAR }));
          map_meth.put(KW_GET_ATTR, new FuncDef(METH_LOGICAL     , KW_GET_ATTR , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_B_A,  new FuncDef(METH_INT         , KW_GET_B_A  , 0, null));
          map_meth.put(KW_GET_BDAT, new FuncDef(METH_MEMPTR      , KW_GET_BDAT , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_BLUE, new FuncDef(METH_INT         , KW_GET_BLUE , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_BR_C, new FuncDef(METH_HANDLE      , KW_GET_BR_C , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_BUFH, new FuncDef(METH_HANDLE      , KW_GET_BUFH , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_GET_C_S,  new FuncDef(METH_VOID        , KW_GET_C_S  , 3, new ParmType[] { ParmType.NUM, ParmType.NUM, ParmType.CHAR }));
          map_meth.put(KW_GET_CBPC, new FuncDef(METH_HANDLE      , KW_GET_CBPC , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_CBPN, new FuncDef(METH_CHAR        , KW_GET_CBPN , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_CGIL, new FuncDef(METH_CHAR        , KW_GET_CGIL , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_CGIV, new FuncDef(METH_CHAR        , KW_GET_CGIV , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_GET_CGLV, new FuncDef(METH_LONGCHAR    , KW_GET_CGLV , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_GET_CHG,  new FuncDef(METH_LOGICAL     , KW_GET_CHG  , 1, new ParmType[] { ParmType.HANDLE, ParmType.LOG }));
          map_meth.put(KW_GET_CHLD, new FuncDef(METH_LOGICAL     , KW_GET_CHLD , 2, new ParmType[] { ParmType.HANDLE, ParmType.INT }));
          map_meth.put(KW_GET_CREL, new FuncDef(METH_HANDLE      , KW_GET_CREL , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_CLNT, new FuncDef(METH_HANDLE      , KW_GET_CLNT , 0, null));
          // GET-COLUMN(n)
          map_meth.put(KW_GET_CFGV, new FuncDef(METH_CHAR        , KW_GET_CFGV , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_1ST,  new FuncDef(METH_LOGICAL     , KW_GET_1ST  , 1, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_GET_CUR,  new FuncDef(METH_LOGICAL     , KW_GET_CUR  , 1, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_GET_D_E,  new FuncDef(METH_LOGICAL     , KW_GET_D_E  , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_GET_D_F,  new FuncDef(METH_CHAR        , KW_GET_D_F  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_DS_B, new FuncDef(METH_HANDLE      , KW_GET_DS_B , 0, null));
          map_meth.put(KW_GET_DYN,  new FuncDef(METH_LOGICAL     , KW_GET_DYN  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_ERRC, new FuncDef(METH_INT         , KW_GET_ERRC , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_ERRR, new FuncDef(METH_INT         , KW_GET_ERRR , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_FCN,  new FuncDef(METH_VOID        , KW_GET_FCN  , 2, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_GET_FNAM, new FuncDef(METH_CHAR        , KW_GET_FNAM , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_FOFF, new FuncDef(METH_INT         , KW_GET_FOFF , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_GRN,  new FuncDef(METH_INT         , KW_GET_GRN  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_HD_E, new FuncDef(METH_LOGICAL     , KW_GET_HD_E , 2, new ParmType[] { ParmType.HANDLE, ParmType.INT }));
          map_meth.put(KW_GET_IBNN, new FuncDef(METH_INT         , KW_GET_IBNN , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_GET_IBQN, new FuncDef(METH_INT         , KW_GET_IBQN , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_ITER, new FuncDef(METH_HANDLE      , KW_GET_ITER , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_LAST, new FuncDef(METH_LOGICAL     , KW_GET_LAST , 1, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_GET_LNBI, new FuncDef(METH_CHAR        , KW_GET_LNBI , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_LPRM, new FuncDef(METH_CHAR        , KW_GET_LPRM , 1, new ParmType[] { ParmType.CHAR, ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_GET_MSG,  new FuncDef(METH_CHAR        , KW_GET_MSG  , 1, new ParmType[] { ParmType.INT }));
          // GET-MESSAGE-TYPE(n)
          map_meth.put(KW_GET_N_AT, new FuncDef(METH_CHAR        , KW_GET_N_AT , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_GET_MOP,  new FuncDef(METH_POLY        , KW_GET_MOP  , 1, null));
          map_meth.put(KW_GET_N_BG, new FuncDef(METH_INT         , KW_GET_N_BG , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_N_FG, new FuncDef(METH_INT         , KW_GET_N_FG , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_N_HC, new FuncDef(METH_LOGICAL     , KW_GET_N_HC , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_N_N , new FuncDef(METH_INT         , KW_GET_N_N  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_NEXT, new FuncDef(METH_LOGICAL     , KW_GET_NEXT , 1, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_GET_NLEV, new FuncDef(METH_INT         , KW_GET_NLEV , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_NODE, new FuncDef(METH_LOGICAL     , KW_GET_NODE , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_GET_NSN,  new FuncDef(METH_VOID        , KW_GET_NSN  , 2, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_GET_NUM,  new FuncDef(METH_INT         , KW_GET_NUM  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_NVV,  new FuncDef(METH_LOGICAL     , KW_GET_NVV  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_PAR,  new FuncDef(METH_LOGICAL     , KW_GET_PAR  , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_GET_PARN, new FuncDef(METH_VOID        , KW_GET_PARN , 2, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_GET_PREV, new FuncDef(METH_LOGICAL     , KW_GET_PREV , 1, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_GET_PROP, new FuncDef(METH_CHAR        , KW_GET_PROP , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_PRT,  new FuncDef(METH_CHAR        , KW_GET_PRT  , 0, null));
          map_meth.put(KW_GET_PSN,  new FuncDef(METH_VOID        , KW_GET_PSN  , 2, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_GET_QNBI, new FuncDef(METH_CHAR        , KW_GET_QNBI , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_R_R,  new FuncDef(METH_INT         , KW_GET_R_R  , 0, null));
          map_meth.put(KW_GET_RED,  new FuncDef(METH_INT         , KW_GET_RED  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_REL,  new FuncDef(METH_HANDLE      , KW_GET_REL  , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_GET_RGB,  new FuncDef(METH_INT         , KW_GET_RGB  , 1, new ParmType[] { ParmType.INT }));
          // GET-ROW()
          map_meth.put(KW_GET_SNC,  new FuncDef(METH_VOID        , KW_GET_SNC  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_GET_S_O,  new FuncDef(METH_CHAR        , KW_GET_S_O  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_SELW, new FuncDef(METH_HANDLE      , KW_GET_SELW , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_SER,  new FuncDef(METH_LONGCHAR    , KW_GET_SER  , 0, null));
          map_meth.put(KW_GET_SIG,  new FuncDef(METH_CHAR        , KW_GET_SIG  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_SIMG, new FuncDef(METH_MEMPTR      , KW_GET_SIMG , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR })); // FWD-extension, not real 4GL!
          map_meth.put(KW_GET_SRCB, new FuncDef(METH_HANDLE      , KW_GET_SRCB , 0, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_TBI,  new FuncDef(METH_CHAR        , KW_GET_TBI  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_TBNN, new FuncDef(METH_CHAR        , KW_GET_TBNN , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_GET_TBQN, new FuncDef(METH_CHAR        , KW_GET_TBQN , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_THCH, new FuncDef(METH_DEC         , KW_GET_THCH , 0, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_THPX, new FuncDef(METH_INT         , KW_GET_THPX , 0, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_TI,   new FuncDef(METH_HANDLE      , KW_GET_TI   , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_TOPB, new FuncDef(METH_HANDLE      , KW_GET_TOPB , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_TWCH, new FuncDef(METH_DEC         , KW_GET_TWCH , 1, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_GET_TWPX, new FuncDef(METH_INT         , KW_GET_TWPX , 1, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_GET_UBI,  new FuncDef(METH_CHAR        , KW_GET_UBI  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_VBI,  new FuncDef(METH_CHAR        , KW_GET_VBI  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_GET_VBNN, new FuncDef(METH_CHAR        , KW_GET_VBNN , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_GET_VBQN, new FuncDef(METH_CHAR        , KW_GET_VBQN , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_GET_WAIT, new FuncDef(METH_CHAR        , KW_GET_WAIT , 0, null));
          map_meth.put(KW_IDX_INFO, new FuncDef(METH_CHAR        , KW_IDX_INFO , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_IMP_NODE, new FuncDef(METH_LOGICAL     , KW_IMP_NODE , 3, new ParmType[] { ParmType.HANDLE, ParmType.HANDLE, ParmType.LOG }));
          map_meth.put(KW_IMP_PRNC, new FuncDef(METH_LOGICAL     , KW_IMP_PRNC , 1, new ParmType[] { ParmType.RAW }));
          map_meth.put(KW_INC_EX_I, new FuncDef(METH_INT         , KW_INC_EX_I , 1, new ParmType[] { ParmType.INT }));
          // INITIALIZE()
          map_meth.put(KW_INIT_D_T, new FuncDef(METH_LOGICAL     , KW_INIT_D_T , 4, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_INITIATE, new FuncDef(METH_LOGICAL     , KW_INITIATE , 0, null));
          map_meth.put(KW_INS_ATTR, new FuncDef(METH_LOGICAL     , KW_INS_ATTR , 2, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.TEXT }));
          map_meth.put(KW_INS_B4,   new FuncDef(METH_LOGICAL     , KW_INS_B4   , 2, new ParmType[] { ParmType.HANDLE, ParmType.HANDLE }));
          map_meth.put(KW_INS_BTAB, new FuncDef(METH_LOGICAL     , KW_INS_BTAB , 0, null));
          map_meth.put(KW_INS_FILE, new FuncDef(METH_LOGICAL     , KW_INS_FILE , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_INS_ROW,  new FuncDef(METH_LOGICAL     , KW_INS_ROW  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_INS_STR,  new FuncDef(METH_LOGICAL     , KW_INS_STR  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_INS_TAB,  new FuncDef(METH_LOGICAL     , KW_INS_TAB  , 0, null));
          map_meth.put(KW_INSERT,   new FuncDef(METH_LOGICAL     , KW_INSERT   , new SignDef[] { new SignDef(2, new ParmType[] { ParmType.CHAR, ParmType.BDT } ), new SignDef(3, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.BDT } ) } ));
          map_meth.put(KW_INVOKE,   new FuncDef(METH_VOID        , KW_INVOKE   , 0, null));
          map_meth.put(KW_IS_C_VIS, new FuncDef(METH_LOGICAL     , KW_IS_C_VIS , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_IS_MSEL,  new FuncDef(METH_LOGICAL     , KW_IS_MSEL  , 1, new ParmType[] { ParmType.LOG }));
          map_meth.put(KW_IS_N_EXP, new FuncDef(METH_LOGICAL     , KW_IS_N_EXP , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_IS_P_SET, new FuncDef(METH_LOGICAL     , KW_IS_P_SET , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_IS_R_SEL, new FuncDef(METH_LOGICAL     , KW_IS_R_SEL , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_IS_SEL,   new FuncDef(METH_LOGICAL     , KW_IS_SEL   , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_KPAD_HOT, new FuncDef(METH_VOID        , KW_KPAD_HOT , 6, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_KPAD_CLE, new FuncDef(METH_VOID        , KW_KPAD_CLE , 0, null)); // FWD-extension, not real 4GL!
          map_meth.put(KW_KPAD_QRY, new FuncDef(METH_INT         , KW_KPAD_QRY , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_LAST_OF,  new FuncDef(METH_LOGICAL     , KW_LAST_OF  , 1, new ParmType[] { ParmType.INT }));// Not defined in progress.g
          map_meth.put(KW_LCD_REFR, new FuncDef(METH_VOID        , KW_LCD_REFR , 5, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_LCD_SWIN, new FuncDef(METH_VOID        , KW_LCD_SWIN , 4, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_LCD_WSTR, new FuncDef(METH_VOID        , KW_LCD_WSTR , 6, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.CHAR, ParmType.CHAR })); // FWD-extension, not real 4GL!
          map_meth.put(KW_LCHR_2NV, new FuncDef(METH_LOGICAL     , KW_LCHR_2NV , 1, new ParmType[] { ParmType.LC }));
          map_meth.put(KW_LIST_PNM, new FuncDef(METH_CHAR        , KW_LIST_PNM , 0, null));
          map_meth.put(KW_LOAD_DMN, new FuncDef(METH_LOGICAL     , KW_LOAD_DMN , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_LOAD_I_D, new FuncDef(METH_LOGICAL     , KW_LOAD_I_D , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_LOAD_I_I, new FuncDef(METH_LOGICAL     , KW_LOAD_I_I , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_LOAD_I_U, new FuncDef(METH_LOGICAL     , KW_LOAD_I_U , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_LOAD_ICO, new FuncDef(METH_LOGICAL     , KW_LOAD_ICO , 1, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_LOAD_IMG, new FuncDef(METH_LOGICAL     , KW_LOAD_IMG , 1, new ParmType[] { ParmType.CHAR, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_LOAD_M_P, new FuncDef(METH_LOGICAL     , KW_LOAD_M_P , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_LOAD_S_I, new FuncDef(METH_LOGICAL     , KW_LOAD_S_I , 1, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_LOAD,     new FuncDef(METH_LOGICAL     , KW_LOAD     , 3, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.LOG }));// Not defined in progress.g
          map_meth.put(KW_LOCK_REG, new FuncDef(METH_LOGICAL     , KW_LOCK_REG , 0, null));
          map_meth.put(KW_LOG_A_EV, new FuncDef(METH_CHAR        , KW_LOG_A_EV , 2, new ParmType[] { ParmType.INT, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_LOGOUT,   new FuncDef(METH_LOGICAL     , KW_LOGOUT   , 0, null));
          map_meth.put(KW_LOOKUP,   new FuncDef(METH_INT         , KW_LOOKUP   , 1, new ParmType[] { ParmType.CHAR }));
          // MARK-NEW()
          // MARK-ROW-STATE()
          map_meth.put(KW_M_D_I_P,  new FuncDef(METH_VOID        , KW_M_D_I_P  , 0, null));
          map_meth.put(KW_M_U_I_P,  new FuncDef(METH_VOID        , KW_M_U_I_P  , 0, null));
          map_meth.put(KW_MERGE_CH, new FuncDef(METH_LOGICAL     , KW_MERGE_CH , 1, new ParmType[] { ParmType.HANDLE, ParmType.LOG }));
          map_meth.put(KW_MERGE_RC, new FuncDef(METH_LOGICAL     , KW_MERGE_RC , 0, new ParmType[] { ParmType.HANDLE, ParmType.LOG }));
          map_meth.put(KW_MSG_AMSG, new FuncDef(METH_CHAR        , KW_MSG_AMSG , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_MOV_2_B,  new FuncDef(METH_LOGICAL     , KW_MOV_2_B  , 0, null));
          map_meth.put(KW_MOV_2_T,  new FuncDef(METH_LOGICAL     , KW_MOV_2_T  , 0, null));
          map_meth.put(KW_MOV_2EOF, new FuncDef(METH_LOGICAL     , KW_MOV_2EOF , 0, null));
          map_meth.put(KW_MOV_A_T,  new FuncDef(METH_LOGICAL     , KW_MOV_A_T  , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_MOV_B_T,  new FuncDef(METH_LOGICAL     , KW_MOV_B_T  , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_MOV_COL,  new FuncDef(METH_LOGICAL     , KW_MOV_COL  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_MPTR_2NV, new FuncDef(METH_LOGICAL     , KW_MPTR_2NV , 1, new ParmType[] { ParmType.MEM }));
          map_meth.put(KW_NEW_SESS, new FuncDef(METH_VOID        , KW_NEW_SESS , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR })); // FWD-extension, not real 4GL!
          map_meth.put(KW_NODE_V2M, new FuncDef(METH_LOGICAL     , KW_NODE_V2M , 1, new ParmType[] { ParmType.MEM }));
          map_meth.put(KW_NODV_2LC, new FuncDef(METH_LOGICAL     , KW_NODV_2LC , 1, new ParmType[] { ParmType.LC, ParmType.CHAR }));
          map_meth.put(KW_NORMALZE, new FuncDef(METH_LOGICAL     , KW_NORMALZE , 0, null));
          map_meth.put(KW_NUM_PNTS, new FuncDef(METH_INT         , KW_NUM_PNTS , 0, null)); // FWD-extension, not real 4GL!
          map_meth.put(KW_QRY_CLOS, new FuncDef(METH_LOGICAL     , KW_QRY_CLOS , 0, null));
          map_meth.put(KW_QRY_OPEN, new FuncDef(METH_LOGICAL     , KW_QRY_OPEN , 0, null));
          map_meth.put(KW_QRY_PREP, new FuncDef(METH_LOGICAL     , KW_QRY_PREP , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_RAW_TRAN, new FuncDef(METH_LOGICAL     , KW_RAW_TRAN , 2, new ParmType[] { ParmType.LOG, ParmType.HANDLE }));
          map_meth.put(KW_READ_FIL, new FuncDef(METH_LOGICAL     , KW_READ_FIL , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_READ_JSN,  new FuncDef(METH_LOGICAL    , KW_READ_JSN , 2, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.CHAR}));
          map_meth.put(KW_READ_XML, new FuncDef(METH_LOGICAL     , KW_READ_XML , 5, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.CHAR, ParmType.CHAR, ParmType.LOG, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_READ_XSC, new FuncDef(METH_LOGICAL     , KW_READ_XSC , 3, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.LOG, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_READ,     new FuncDef(METH_LOGICAL     , KW_READ     , 3, new ParmType[] { ParmType.MEM, ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_REFR_A_P, new FuncDef(METH_LOGICAL     , KW_REFR_A_P , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_REFRESH,  new FuncDef(METH_LOGICAL     , KW_REFRESH  , 0, null));
          map_meth.put(KW_REG_DMN,  new FuncDef(METH_LOGICAL     , KW_REG_DMN  , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_REJ_CHGS, new FuncDef(METH_LOGICAL     , KW_REJ_CHGS , 0, null));
          map_meth.put(KW_REJ_RCHG, new FuncDef(METH_LOGICAL     , KW_REJ_RCHG , 0, null));
          map_meth.put(KW_REM_ATTR, new FuncDef(METH_LOGICAL     , KW_REM_ATTR , 1, new ParmType[] { ParmType.BDT, ParmType.CHAR }));
          map_meth.put(KW_REM_CHLD, new FuncDef(METH_LOGICAL     , KW_REM_CHLD , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_REM_EVTP, new FuncDef(METH_LOGICAL     , KW_REM_EVTP , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_REM_NODE, new FuncDef(METH_VOID        , KW_REM_NODE , 1, new ParmType[] { ParmType.NUM }));
          map_meth.put(KW_REM_SUP,  new FuncDef(METH_LOGICAL     , KW_REM_SUP  , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_REP_CHLD, new FuncDef(METH_LOGICAL     , KW_REP_CHLD , 2, new ParmType[] { ParmType.HANDLE, ParmType.HANDLE }));
          map_meth.put(KW_REP_STXT, new FuncDef(METH_LOGICAL     , KW_REP_STXT , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_REPLACE,  new FuncDef(METH_LOGICAL     , KW_REPLACE  , new SignDef[] { new SignDef(2, new ParmType[] { ParmType.CHAR, ParmType.BDT } ), new SignDef(3, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.BDT } ) } ));
          map_meth.put(KW_REPOS_2I, new FuncDef(METH_LOGICAL     , KW_REPOS_2I , 1, new ParmType[] { ParmType.ROWID_ARRAY, ParmType.INT }));
          map_meth.put(KW_REPOS_2R, new FuncDef(METH_LOGICAL     , KW_REPOS_2R , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_REPOS_B,  new FuncDef(METH_LOGICAL     , KW_REPOS_B  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_REPOS_F,  new FuncDef(METH_LOGICAL     , KW_REPOS_F  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_RESET,    new FuncDef(METH_LOGICAL     , KW_RESET    , 0, null));
          map_meth.put(KW_RESORT,   new FuncDef(METH_VOID        , KW_RESORT   , 0, null));
          map_meth.put(KW_S_C_BGCO, new FuncDef(METH_VOID        , KW_S_C_BGCO , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_S_C_FGCO, new FuncDef(METH_VOID        , KW_S_C_FGCO , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_S_COL_C,  new FuncDef(METH_VOID        , KW_S_COL_C  , 2, new ParmType[] { ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_S_COL_W,  new FuncDef(METH_VOID        , KW_S_COL_W  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SAVE_FIL, new FuncDef(METH_LOGICAL     , KW_SAVE_FIL , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_SAVE_RCH, new FuncDef(METH_LOGICAL     , KW_SAVE_RCH , 0, new ParmType[] { ParmType.BDT, ParmType.CHAR, ParmType.LOG }));
          map_meth.put(KW_SAVE,     new FuncDef(METH_LOGICAL     , KW_SAVE     , 1, new ParmType[] { ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_SAX_PARF, new FuncDef(METH_VOID        , KW_SAX_PARF , 0, null));
          map_meth.put(KW_SAX_PARN, new FuncDef(METH_VOID        , KW_SAX_PARN , 0, null));
          map_meth.put(KW_SAX_PARS, new FuncDef(METH_VOID        , KW_SAX_PARS , 0, null));
          map_meth.put(KW_SCR_2CR,  new FuncDef(METH_LOGICAL     , KW_SCR_2CR  , 0, null));
          map_meth.put(KW_SCR_2ITM, new FuncDef(METH_LOGICAL     , KW_SCR_2ITM , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_SCR_2SR,  new FuncDef(METH_LOGICAL     , KW_SCR_2SR  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_SCR_NTOP, new FuncDef(METH_VOID        , KW_SCR_NTOP , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_SCR_VERT, new FuncDef(METH_VOID        , KW_SCR_VERT , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_SEAL,     new FuncDef(METH_LOGICAL     , KW_SEAL     , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_SEARCH,   new FuncDef(METH_LOGICAL     , KW_SEARCH   , 2, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_SEL_ALL,  new FuncDef(METH_LOGICAL     , KW_SEL_ALL  , 0, new ParmType[] { ParmType.ROWID_ARRAY, ParmType.ROWID_ARRAY }));
          map_meth.put(KW_SEL_FOCR, new FuncDef(METH_LOGICAL     , KW_SEL_FOCR , 0, null));
          map_meth.put(KW_SEL_NEXT, new FuncDef(METH_LOGICAL     , KW_SEL_NEXT , 0, null));
          map_meth.put(KW_SEL_PREV, new FuncDef(METH_LOGICAL     , KW_SEL_PREV , 0, null));
          map_meth.put(KW_SEL_ROW,  new FuncDef(METH_LOGICAL     , KW_SEL_ROW  , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_SEL_SFVN, new FuncDef(METH_VOID        , KW_SEL_SFVN , 1, new ParmType[] { ParmType.INT }));
          map_meth.put(KW_SERIALZR, new FuncDef(METH_LOGICAL     , KW_SERIALZR , 3, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.BDT,ParmType.LOG, ParmType.CHAR, ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_SET_ACTR, new FuncDef(METH_LOGICAL     , KW_SET_ACTR , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_SET_A_N,  new FuncDef(METH_LOGICAL     , KW_SET_A_N  , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_SET_ACTX, new FuncDef(METH_CHAR        , KW_SET_ACTX , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_SET_ATTR, new FuncDef(METH_LOGICAL     , KW_SET_ATTR , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_SET_BLUE, new FuncDef(METH_LOGICAL     , KW_SET_BLUE , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_BRK,  new FuncDef(METH_LOGICAL     , KW_SET_BRK  , 0, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_SET_BUF,  new FuncDef(METH_LOGICAL     , KW_SET_BUF  , 1, new ParmType[] { ParmType.BDT_VARARGS }));
          map_meth.put(KW_SET_C_IC, new FuncDef(METH_VOID        , KW_SET_C_IC , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_C_P,  new FuncDef(METH_LOGICAL     , KW_SET_C_P  , 1, new ParmType[] { ParmType.CHAR, ParmType.HANDLE }));
          map_meth.put(KW_SET_C_S,  new FuncDef(METH_VOID        , KW_SET_C_S  , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_SET_C_VI, new FuncDef(METH_VOID        , KW_SET_C_VI , 2, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_SET_CB_P, new FuncDef(METH_LOGICAL     , KW_SET_CB_P , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.HANDLE }));
          map_meth.put(KW_SET_CBAC, new FuncDef(METH_LOGICAL     , KW_SET_CBAC , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_SET_CLNT, new FuncDef(METH_LOGICAL     , KW_SET_CLNT , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_SET_COMM, new FuncDef(METH_LOGICAL     , KW_SET_COMM , 0, null));
          map_meth.put(KW_SET_CPTM, new FuncDef(METH_VOID        , KW_SET_CPTM , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_DYN,  new FuncDef(METH_LOGICAL     , KW_SET_DYN  , 2, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_SET_F_D,  new FuncDef(METH_VOID        , KW_SET_F_D  , 2, new ParmType[] { ParmType.CHAR, ParmType.INT }));
          map_meth.put(KW_SET_GRN,  new FuncDef(METH_LOGICAL     , KW_SET_GRN  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_IMGF, new FuncDef(METH_VOID        , KW_SET_IMGF , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_IMGH, new FuncDef(METH_VOID        , KW_SET_IMGH , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_IMGW, new FuncDef(METH_VOID        , KW_SET_IMGW , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_ISRC, new FuncDef(METH_LOGICAL     , KW_SET_ISRC , 2, new ParmType[] { ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_SET_JMOD, new FuncDef(METH_VOID        , KW_SET_JMOD , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_JSTX, new FuncDef(METH_VOID        , KW_SET_JSTX , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_JSTY, new FuncDef(METH_VOID        , KW_SET_JSTY , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_M_UN, new FuncDef(METH_LOGICAL     , KW_SET_M_UN , 1, new ParmType[] { ParmType.LOG }));
          map_meth.put(KW_SET_MSEL, new FuncDef(METH_VOID        , KW_SET_MSEL , 2, new ParmType[] { ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_SET_N_BG, new FuncDef(METH_VOID        , KW_SET_N_BG , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_N_FG, new FuncDef(METH_VOID        , KW_SET_N_FG , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_N_F,  new FuncDef(METH_LOGICAL     , KW_SET_N_F  , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_SET_N_HC, new FuncDef(METH_VOID        , KW_SET_N_HC , 2, new ParmType[] { ParmType.INT, ParmType.LOG }));
          map_meth.put(KW_SET_NODE, new FuncDef(METH_LOGICAL     , KW_SET_NODE , 1, new ParmType[] { ParmType.HANDLE }));
          map_meth.put(KW_SET_ODST, new FuncDef(METH_LOGICAL     , KW_SET_ODST , 2, new ParmType[] { ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_SET_PARM, new FuncDef(METH_LOGICAL     , KW_SET_PARM , 4, new ParmType[] { ParmType.INT, ParmType.CHAR, ParmType.CHAR, ParmType.BDT }));
          map_meth.put(KW_SET_PENW, new FuncDef(METH_VOID        , KW_SET_PENW , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_PROP, new FuncDef(METH_LOGICAL     , KW_SET_PROP , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_SET_RED,  new FuncDef(METH_LOGICAL     , KW_SET_RED  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_RGB,  new FuncDef(METH_LOGICAL     , KW_SET_RGB  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_ROLL, new FuncDef(METH_LOGICAL     , KW_SET_ROLL , 0, null));
          map_meth.put(KW_SET_RPOS, new FuncDef(METH_LOGICAL     , KW_SET_RPOS , 2, new ParmType[] { ParmType.INT, ParmType.CHAR }));
          map_meth.put(KW_SET_RRP,  new FuncDef(METH_LOGICAL     , KW_SET_RRP  , 1, new ParmType[] { ParmType.CHAR, ParmType.HANDLE }));
          map_meth.put(KW_SET_S_AR, new FuncDef(METH_LOGICAL     , KW_SET_S_AR , 2, new ParmType[] { ParmType.INT, ParmType.LOG, ParmType.INT }));
          map_meth.put(KW_SET_S_O,  new FuncDef(METH_LOGICAL     , KW_SET_S_O  , 2, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_SET_SEL,  new FuncDef(METH_LOGICAL     , KW_SET_SEL  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_SERD, new FuncDef(METH_LOGICAL     , KW_SET_SERD , 1, new ParmType[] { ParmType.LC }));
          map_meth.put(KW_SET_SNC,  new FuncDef(METH_VOID        , KW_SET_SNC  , 2, new ParmType[] { ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_SWIN, new FuncDef(METH_VOID        , KW_SET_SWIN , 5, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT, ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_TBME, new FuncDef(METH_VOID        , KW_SET_TBME , 1, new ParmType[] { ParmType.LOG })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_TN_I, new FuncDef(METH_VOID        , KW_SET_TN_I , 3, new ParmType[] { ParmType.INT, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_SET_TSTA, new FuncDef(METH_VOID        , KW_SET_TSTA , 1, new ParmType[] { ParmType.INT })); // FWD-extension, not real 4GL!
          map_meth.put(KW_SET_WAIT, new FuncDef(METH_LOGICAL     , KW_SET_WAIT , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_START_DC, new FuncDef(METH_LOGICAL     , KW_START_DC , 0, null));
          map_meth.put(KW_START_EL, new FuncDef(METH_LOGICAL     , KW_START_EL , 1, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.HANDLE }));
          map_meth.put(KW_STOP_PRS, new FuncDef(METH_LOGICAL     , KW_STOP_PRS , 0, null));
          map_meth.put(KW_STR_VAL,  new FuncDef(METH_CHAR        , KW_STR_VAL  , 1, new ParmType[] { ParmType.INT })); // Not defined in progress.g
          map_meth.put(KW_SYNCHRON, new FuncDef(METH_LOGICAL     , KW_SYNCHRON , 0, null));
          map_meth.put(KW_TT_PREP,  new FuncDef(METH_LOGICAL     , KW_TT_PREP  , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_TEN_ID,   new FuncDef(METH_INT         , KW_TEN_ID   , 0, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_TENNAME,  new FuncDef(METH_CHAR        , KW_TENNAME  , 0, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_UPD_ATTR, new FuncDef(METH_LOGICAL     , KW_UPD_ATTR , 2, new ParmType[] { ParmType.BDT, ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_URL_DECO, new FuncDef(METH_CHAR        , KW_URL_DECO , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_URL_ENCO, new FuncDef(METH_CHAR        , KW_URL_ENCO , 0, null));  // TODO: find the number of arguments
          map_meth.put(KW_USR_DATA, new FuncDef(METH_LOGICAL     , KW_USR_DATA , 1, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_V_N_CNT , new FuncDef(METH_INT         , KW_V_N_CNT  , 0, null));
          map_meth.put(KW_VAL_SEAL, new FuncDef(METH_LOGICAL     , KW_VAL_SEAL , 0, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_VALIDATE, new FuncDef(METH_LOGICAL     , KW_VALIDATE , 0, new ParmType[] { ParmType.CHAR }));
          map_meth.put(KW_WR_CDATA, new FuncDef(METH_LOGICAL     , KW_WR_CDATA , 1, new ParmType[] { ParmType.TEXT }));
          map_meth.put(KW_WR_CHARS, new FuncDef(METH_LOGICAL     , KW_WR_CHARS , 1, new ParmType[] { ParmType.TEXT }));
          map_meth.put(KW_WR_CMNT,  new FuncDef(METH_LOGICAL     , KW_WR_CMNT  , 1, new ParmType[] { ParmType.TEXT }));
          map_meth.put(KW_WR_D_ELM, new FuncDef(METH_LOGICAL     , KW_WR_D_ELM , 2, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.TEXT, ParmType.HANDLE }));
          map_meth.put(KW_WR_E_ELM, new FuncDef(METH_LOGICAL     , KW_WR_E_ELM , 1, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.HANDLE }));
          map_meth.put(KW_WR_ENT_R, new FuncDef(METH_LOGICAL     , KW_WR_ENT_R , 1, new ParmType[] { ParmType.TEXT }));
          map_meth.put(KW_WR_EXDTD, new FuncDef(METH_LOGICAL     , KW_WR_EXDTD , 2, new ParmType[] { ParmType.TEXT, ParmType.TEXT, ParmType.TEXT }));
          map_meth.put(KW_WR_FRAGM, new FuncDef(METH_LOGICAL     , KW_WR_FRAGM , 1, new ParmType[] { ParmType.BDT }));
          map_meth.put(KW_WR_JSON,  new FuncDef(METH_LOGICAL     , KW_WR_JSON  , 2, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.LOG, ParmType.CHAR, ParmType.LOG, ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_WR_MSG,   new FuncDef(METH_LOGICAL     , KW_WR_MSG   , 1, new ParmType[] { ParmType.CHAR, ParmType.CHAR }));
          map_meth.put(KW_WR_PRINS, new FuncDef(METH_LOGICAL     , KW_WR_PRINS , 2, new ParmType[] { ParmType.TEXT, ParmType.TEXT }));
          map_meth.put(KW_WR_XML,   new FuncDef(METH_LOGICAL     , KW_WR_XML   , 2, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.LOG, ParmType.CHAR, ParmType.CHAR, ParmType.LOG, ParmType.LOG, ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_WR_XMLSC, new FuncDef(METH_LOGICAL     , KW_WR_XMLSC , 2, new ParmType[] { ParmType.CHAR, ParmType.BDT, ParmType.LOG, ParmType.CHAR, ParmType.LOG, ParmType.LOG }));
          map_meth.put(KW_WRITE,    new FuncDef(METH_LOGICAL     , KW_WRITE    , 3, new ParmType[] { ParmType.MEM, ParmType.INT, ParmType.INT }));
          map_meth.put(KW_WR_DATA,  new FuncDef(METH_LOGICAL     , KW_WR_DATA  , 0, null));

          // add all attributes and methods from the ProgressParser, no need to maintain a separate map
          Map<Integer, Integer> attrsAndMeths = ProgressParser.getAttributesAndMethods();
          for (Integer key : attrsAndMeths.keySet())
          {
             int type = attrsAndMeths.get(key);
             if (type >= ProgressParser.BEGIN_ATTR && type <= ProgressParser.END_ATTR)
             {
                map_attr.put(key, type);
             }
          }
       }

       /**
        * Lookup the parameter at the specified index position for the function or method
        * specified by keyword.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        * @param    mand
        *           The numbers of mandatory parameters to search.
        * @param    idx
        *           The zero-based index position of the parameter to lookup.
        *
        * @return   The Java class name of the wrapper class for that parameter or
        *           null if there is no match found for any reason.
        */
       public static String parameterTypeName(int kw, int type, int mand, int idx)
       {
          String cls = null;
          ParmType[] signature = getSignature(kw, type, mand);

          if (idx >= 0 && idx < signature.length)
          {
             cls = signature[idx].toString();
          }

          return cls;
       }

       /**
        * Check if the function/method has multiple signatures.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        *
        * @return   <code>true</code> if this function/method accepts multiple signatures.
        */
       public static boolean isMultiSignature(int kw, int type)
       {
          FuncDef function = getDefinition(kw, type);

          return function != null && function.signatures.length > 1;
       }

       /**
        * Resolve the signature of the specified function or method.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        *
        * @return   The signature.
        */
       public static ParmType[] getSignature(int kw, int type)
       {
          ParmType[] signature = null;
          FuncDef function = getDefinition(kw, type);

          if (function != null)
          {
             if (function.signatures.length != 1)
             {
                // TODO: only one signature expected - throw exception
             }

             signature = function.signatures[0].parms;
             if (signature == null)
             {
                signature = new ParmType[0];
             }
          }

          return signature;
       }

       /**
        * Resolve the signature of the specified function or method.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        * @param    mand
        *           The numbers of mandatory parameters to search.
        *
        * @return   The signature.
        */
       public static ParmType[] getSignature(int kw, int type, int mand)
       {
          ParmType[] signature = null;
          FuncDef function = getDefinition(kw, type);
          if (function != null)
          {
             for (int i = 0; i < function.signatures.length; i++)
             {
                SignDef def = function.signatures[i];

                // Scan inside functions with same name but different kind of parameters. The last
                // resort is the mandatory number should identify required function exactly.
                if (def.mand == mand)
                {
                   signature = def.parms;
                   break;
                }
             }
          }

          return signature;
       }

       /**
        * Get the signature of the specified function or method, using the number of passed parameters
        * and the parameter list as a match.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        * @param    ptypes
        *           String representation of the passed parameters.
        *
        * @return   The signature.
        */
       public static ParmType[] getSignature(int kw, int type, String[] ptypes)
       {
          return getSignature(kw, type, ptypes, false);
       }

       /**
        * Get the signature of the specified function or method, using the number of passed parameters
        * and the parameter list as a match.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        * @param    ptypes
        *           String representation of the passed parameters.
        * @param    fuzzyMatch
        *           If it is <code>true</code> and there are no matching signatures, return the first
        *           signature which has an appropriate number of parameters regardless of the
        *           parameter types.
        *
        * @return   The signature.
        */
       public static ParmType[] getSignature(int kw, int type, String[] ptypes, boolean fuzzyMatch)
       {
          ParmType[] signature = null;
          FuncDef function = getDefinition(kw, type);

          if (function != null)
          {
             // first pass - match against the definition with the same number of parameters
             signature = lookupSignature(function.signatures, ptypes, true);
             if (signature == null)
             {
                // second pass - match against the definition with more parameters than provided
                signature = lookupSignature(function.signatures, ptypes, false);
             }

             // third pass - try to find "fuzzy" match
             if (fuzzyMatch && signature == null)
             {
                for (SignDef def : function.signatures)
                {
                   if (ptypes.length >= def.mand && ptypes.length <= def.parms.length)
                   {
                      signature = def.parms;
                      break;
                   }
                }
             }
          }

          return signature;
       }

       /**
        * Get the type of an attribute.
        *
        * @param   attr
        *          The attribute id.
        *
        * @return  the type of the attribute. If argument is not a known attribute {@code null} is
        *          returned.
        */
       public static Integer getAttributeType(int attr)
       {
          return map_attr.get(attr);
       }

       /**
        * Get the {@link FuncDef} instance associated with the specified function or method.
        *
        * @param    kw
        *           The keyword (oldtype annotation) for this function or method.
        * @param    type
        *           The type of the return value for function of method requested.
        *
        * @return   The {@link FuncDef} instance.
        */
       private static FuncDef getDefinition(int kw, int type)
       {
          FuncDef function = null;

          if (type > BEGIN_FUNCTYPES && type < END_FUNCTYPES)
          {
             function = map_func.get(kw);
          }
          else if (type > BEGIN_METH && type < END_METH)
          {
             function = map_meth.get(kw);
          }
          else
          {
             // Action for unknown type value provided
          }

          return function;
       }

       /**
        * Search through the given definitions and lookup the one which matches the candidate
        * parameter types.
        *
        * @param    signatures
        *           The list of signatures to search.
        * @param    ptypes
        *           The candidate parameter list, with its type specified using the string
        *           representation of the P2J wrapper type.
        * @param    exact
        *           <code>true</code> to search only the definitions with the same number of
        *           parameters as the candidate list. Else, it will search all the definitions with
        *           more parameters than the candidate list.
        *
        * @return   The found signature or <code>null</code> if not found.
        */
       private static ParmType[] lookupSignature(SignDef[] signatures, String[] ptypes, boolean exact)
       {
          ParmType[] signature = null;

          // first pass - match against the definition with the same number of parameters
          for (int i = 0; i < signatures.length; i++)
          {
             SignDef def = signatures[i];

             // TODO: check if varargs

             if ((ptypes.length == def.parms.length && exact) ||
                 (ptypes.length < def.parms.length && !exact && def.mand < def.parms.length))
             {
                boolean ok = true;
                for (int j = 0; j < ptypes.length; j++)
                {
                   boolean unknownCandidate = ptypes[j].equals("unknown");
                   if (unknownCandidate)
                   {
                      // unknown matches with everything
                      continue;
                   }

                   // match the types
                   ParmType candidate = ParmType.fromString(ptypes[j]);
                   ParmType expected = def.parms[j];

                   if (!expected.equals(candidate) && !ParmType.typesMatch(candidate, expected))
                   {
                      ok = false;
                      break;
                   }
                }

                if (ok)
                {
                   if (signature == null)
                   {
                      signature = def.parms;
                   }
                   else
                   {
                      // TODO: more than one signature found, ambiguous case, throw exception
                   }
                }
             }
          }

          return signature;
       }

       /**
        * A simple structure to contain each function or method definition.
        */
       private static class FuncDef
       {
          /** Return type (one of the FUNC_* or METH_* constants). */
          int ret = -1;

          /** Type of the original keyword, stored in the tree as the "oldtype" annotation. */
          int kw = -1;

          /** All possible signatures for this entity. */
          SignDef[] signatures = null;

          /**
           * Construct an instance (convenience version).  This form can only be used
           * for functions or methods that don't have multiple conflicting signatures.
           *
           * @param    ret
           *           The return type.
           * @param    kw
           *           The keyword type (from the "oldtype" annotation).
           * @param    mand
           *           Number of parameters that are mandatory (e.g. if there are 5
           *           possible parms and the last 2 are optional, then this will be
           *           3).
           * @param    parms
           *           The specific parameter signature for this function or method.
           */
          public FuncDef(int ret, int kw, int mand, ParmType[] parms)
          {
             this(ret, kw, new SignDef[] { new SignDef(mand, parms) });
          }

          /**
           * Construct an instance.
           *
           * @param    ret
           *           The return type.
           * @param    kw
           *           The keyword type (from the "oldtype" annotation).
           * @param    signatures
           *           An array of signature definitions.
           */
          public FuncDef(int ret, int kw, SignDef[] signatures)
          {
             this.ret        = ret;
             this.kw         = kw;
             this.signatures = signatures;
          }
       }

       /**
        * A simple structure to contain a function or methods parameter signature.
        */
       private static class SignDef
       {
          /** Parameter list codes from leftmost (0 index) to rightmost (highest index). */
          ParmType[] parms = null;

          /**
           * Number of parameters that are mandatory (e.g. if there are 5 possible parms and the
           * last 2 are optional, then this will be 3).
           */
          int mand = -1;

          /**
           * Construct an instance.
           */
          public SignDef(int mand, ParmType[] parms)
          {
             this.mand  = mand;
             this.parms = parms;
          }
       }
    }