Many electronic devices include embedded software and/or firmware that controls the device's functions and operation. Generally, this device level software or firmware is capable of generating and/or receiving commands that have a specified format and syntax and/or that are written in a particular programming language. It is often desirable, however, to control such an electronic device using a different application running on a separate computer system or on the device itself. For example, in computer networks, networking devices such as switches and routers are routinely controlled by network management applications resident on a server or other computer system. Management functions performed by the network management application include status monitoring (e.g., port status), device configuration, device installation and removal, etc.
To interface an application with the embedded software and/or firmware of an electronic device, the application and device need to be able to communicate with one another (e.g., exchange commands and other data). However, the application and device may use differing syntax, format, programming languages and/or data models. Thus, the exchange of commands and other communications between the device and application generally requires that a communication (e.g., a command) be manipulated, such that the receiving entity can interpret the communication. Returning to the networking example above, network switches typically have a suite of configuration commands understood by the switch's embedded software/firmware and that are used to configure and control operation of the switch. In order for the network management application to both provide commands to the switch and receive commands from the switch (e.g., for displaying configuration information to a user), the commands are reformatted or otherwise converted into a syntax that can be interpreted by the receiving entity (i.e., either the switch or the network management application).
Command parsers, whose function is to parse or separate a command (or other communication) into one or more meaningful parameters or data strings, are known in the art, and these conventional parsers have been used in the translation of command lines during the exchange of communications between an application and a device. However, translation schemes using such parsers are inefficient and exhibit a number of disadvantages. For example, when transmitting commands from an application (e.g., a network management application) to a device (e.g., a network switch), a large amount of hand-written code was necessary to translate the output of the parser into a form consistent with that of the application's data model. Furthermore, the types of configuration operations that could be performed by the application was severely restricted. Typically, only a small, well-defined set of operations could be performed by the application, and each of these operations required hand-written code specific to that operation, again resulting in a large quantity of hand-written code. Because of the vast amount of hand-written code necessary to translate commands and other communications using conventional parsers, prior art methods for manipulating these communications were error prone. For example, there was a high probability of generating incorrect command strings if the destination device is in an unanticipated state, and coding errors were also common.