Functions
ParseFunctions

Functions

int mdlParse_changeTargetTask (AppCommandTable *commandTable, WCharCP taskIdP)
 A target task ID is associated with every command table. More...
 
AppCommandTable * mdlParse_findTableByName (WCharCP nameP)
 
The mdlParse_findTableByName function returns a pointer to the table

descriptor from a pointer to a task ID. More...

 
WCharCP mdlParse_getTableName (AppCommandTable *commandTable)
 
  The mdlParse_getTableName function returns a pointer to the task ID

associated with a specified table. More...

 
int mdlParse_keyWord (AppCommandTable *tableIdentifierP, int tableNumber, WCharCP keyWord)
 
  The mdlParse_keyWord function parses the string that keywordP points to using the

parse table specified by tableIdentifierP and tableNumber. More...

 
AppCommandTable * mdlParse_loadCommandTable (WCharCP pTableName)
 
  The mdlParse_loadCommandTable function loads an application command table

from the resource file specified by pTableName. More...

 
AppCommandTable * mdlParse_loadCommandTableByNumber (WCharCP tableNameP, UInt32 tableNum)
 
  The mdlParse_loadCommandTableByNumber function loads an application command

table from the resource file specified by TableNameP. More...

 
AppCommandTable * mdlParse_loadKeywordTable (WCharCP tableNameP, UInt32 tableNum)
 
  The mdlParse_loadKeywordTable function loads an entire parse tree from the

resource file specified by pTableName. More...

 
void mdlParse_reconstructFullKeyin (WStringR commandString, WCharCP taskName, CommandNumber commandNum, WCharCP unparsed)
 
  The mdlParse_reconstructFullKeyin function constructs a keyin that would

invoke the specified command. More...

 
void mdlParse_unloadTable (AppCommandTable *commandTable)
 
  The command table is unloaded automatically when the MDL application

is unloaded. More...

 

Detailed Description

Function Documentation

int mdlParse_changeTargetTask ( AppCommandTable *  commandTable,
WCharCP  taskIdP 
)

A target task ID is associated with every command table.

When a task loads a command table, MDL sets the table's target task ID to the MDL task's task ID.

Parameters
[in]commandTablepointer to command table
[in]taskIdPtask ID to save with table
Returns
The mdlParse_changeTargetTask function returns zero if it is successful. It returns a non-zero value if the target task ID is already assigned to a command table.
Remarks
The mdlParse_changeTargetTask function modifies the target task ID associated with a command table. This function is useful if one task needs to load a table for another task.
See also
mdlParse_findTableByName mdlParse_getTableName
Remarks
Required Library: mdlbltin.lib
AppCommandTable* mdlParse_findTableByName ( WCharCP  nameP)

The mdlParse_findTableByName function returns a pointer to the table

descriptor from a pointer to a task ID.

The table descriptor can be used as an argument to mdlParse_changeTargetTask or mdlParse_unloadTable. It has the same value as that returned by mdlParse_loadCommandTable.

Parameters
[in]namePname of the command table to find.
Returns
The mdlParse_findTableByName function returns a pointer to a table descriptor if the table is found. Otherwise, it returns NULL.
See also
mdlParse_changeTargetTask mdlParse_getTableName
Remarks
Required Library: mdlbltin.lib
WCharCP mdlParse_getTableName ( AppCommandTable *  commandTable)

  The mdlParse_getTableName function returns a pointer to the task ID

associated with a specified table.

Parameters
[in]commandTableThe command table
Returns
The mdlParse_getTableName function returns a pointer to the table's target task ID.
See also
mdlParse_changeTargetTask mdlParse_findTableByName
Remarks
Required Library: mdlbltin.lib
int mdlParse_keyWord ( AppCommandTable *  tableIdentifierP,
int  tableNumber,
WCharCP  keyWord 
)

  The mdlParse_keyWord function parses the string that keywordP points to using the

parse table specified by tableIdentifierP and tableNumber.

Parameters
[in]tableIdentifierPis a table descriptor obtained from mdlParse_loadCommandTable, mdlParse_loadKeywordTable or mdlParse_loadCommandTableByNumber.
[in]tableNumberis the resource ID of the table to be used for parsing.
[in]keyWordpoints to the word to be parsed.
Returns
If the keyword is a substring of exactly one of the keywords, the mdlParse_keyWord function returns the command number of the entry it matches. If the keyword is not a keyword substring, mdlParse_keyWord returns MDLERR_NOMATCH. If the keyword is a substring of more than one keyword, mdlParse_keyWord returns MDLERR_AMBIGUOUS. Since MDLERR_NOMATCH and MDLERR_AMBIGUOUS are negative, they cannot be confused with valid return values.
Remarks
mdlParse_keyWord converts the string to upper case and then compares it to all keywords specified in the table.
Required Library: mdlbltin.lib
AppCommandTable* mdlParse_loadCommandTable ( WCharCP  pTableName)

  The mdlParse_loadCommandTable function loads an application command table

from the resource file specified by pTableName.

Parameters
[in]pTableNamename of the command table
Returns
The mdlParse_loadCommandTable function returns NULL and stores an error code in mdlErrno if the table is not loaded successfully. The values for the errors are defined in mdlerrs.r.h. Otherwise, it returns a pointer to a parse table descriptor. The pointer can be used as a parameter to other parse functions.
Remarks
The directories specified by the MS_MDL MicroStation environment variable and MS_EXE are searched for the filename. If pTableName is NULL, MicroStation loads the command table from the same resource file that the application was loaded from. MicroStation starts loading the application parse table and continues loading all subtables needed to parse any command. It starts from the main table, using resource ID 1. Ultimately, mdlParse_loadCommandTable loads the entire tree in memory.
The command table is unloaded automatically when the MDL application is unloaded. The mdlParse_unloadTable function unloads a parse table. This function is not needed unless the application needs to disable the commands or load another table. The input to mdlParse_unloadTable is a table descriptor returned by mdlParse_loadCommandTable.
See also
mdlParse_unloadTable mdlParse_loadCommandTableByNumber userParse_handleString
Remarks
Required Library: mdlbltin.lib
AppCommandTable* mdlParse_loadCommandTableByNumber ( WCharCP  tableNameP,
UInt32  tableNum 
)

  The mdlParse_loadCommandTableByNumber function loads an application command

table from the resource file specified by TableNameP.

Unlike mdlParse_loadCommandTable, this function does not assume that the resource ID of the parse table root is 1. The resource ID of the parse table root is specified by tableNum.

Parameters
[in]tableNamePname of the resource file
[in]tableNumdesired command table
Returns
The mdlParse_loadCommandTableByNumber function returns NULL and stores an error code in mdlErrno if the table is not loaded successfully. The error codes are defined in mdlerrs.r.h. Otherwise, it returns a pointer to a parse table descriptor. The pointer can be used as a parameter to other parse functions.
See also
mdlParse_loadCommandTable
Remarks
Required Library: mdlbltin.lib
AppCommandTable* mdlParse_loadKeywordTable ( WCharCP  tableNameP,
UInt32  tableNum 
)

  The mdlParse_loadKeywordTable function loads an entire parse tree from the

resource file specified by pTableName.

If pTableName is NULL, it loads the table from the same resource file that the application was loaded from.

Parameters
[in]tableNamePname of the resource file
[in]tableNumdesired command table
Returns
mdlParse_loadKeywordTable returns NULL and stores an error code in mdlErrno if the table is not loaded successfully. Otherwise, it returns a pointer to a parse table descriptor. The pointer can be used as a parameter to other parse functions.
Remarks
Tables loaded with mdlParse_loadKeywordTable are not put in the list of tables MicroStation uses when parsing commands. MicroStation uses these tables when parsing a keyword with mdlParse_keyWord.
Required Library: mdlbltin.lib
void mdlParse_reconstructFullKeyin ( WStringR  commandString,
WCharCP  taskName,
CommandNumber  commandNum,
WCharCP  unparsed 
)

  The mdlParse_reconstructFullKeyin function constructs a keyin that would

invoke the specified command.

Parameters
[out]commandStringpoints to the buffer to receive the generated command keyin. The buffer should be at least 256 characters long.
[in]taskNamespecifies the application associated with the command. It specifies the application that loads the command table to be used to parse the command.
[in]commandNumcommand number
[in]unparsedpoints to the unparsed portion of the command. It points to the portion that is passed directly to the function that processes the command.
Returns
mdlParse_reconstructFullKeyin is of type void. It does not return anything.
Remarks
The following code fragment illustrates how the parameters correspond to the field in the Inputq_command structure. In the function call, assume iqelP points to an inputq element and iqelP->hdr.u.cmdtype is CMDNUM.
mdlParse_reconstructFullKeyin(resultBuffer, iqelP->u.cmd.taskId,
iqelP->u.cmd.command, iqelP->u.cmd.unparsedP);
Required Library: mdlbltin.lib
void mdlParse_unloadTable ( AppCommandTable *  commandTable)

  The command table is unloaded automatically when the MDL application

is unloaded.

The mdlParse_unloadTable function unloads a parse table. This function is not needed unless the application needs to disable the commands or load another table. The input to mdlParse_unloadTable is a table descriptor returned by mdlParse_loadCommandTable.

Parameters
[in]commandTableCommand table
Returns
The mdlParse_unloadTable function is of type void. It returns no value.
Remarks
The directories specified by the MS_MDL MicroStation environment variable and MS_EXE are searched for the filename. If pTableName is NULL, MicroStation loads the command table from the same resource file that the application was loaded from. MicroStation starts loading the application parse table and continues loading all subtables needed to parse any command. It starts from the main table, using resource ID 1. Ultimately, mdlParse_loadCommandTable loads the entire tree in memory.
See also
mdlmdlParse_loadCommandTable mdlParse_loadCommandTableByNumber userParse_handleString
Remarks
Required Library: mdlbltin.lib

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.