String command parser for message based systems
First Claim
1. A method of sending a command from a first program running on a computer to a second program controlling a logical device that is connected to said computer, with said command being executed by said logical device, said method being implemented on said computer, comprising the steps of:
- a) providing a command string containing said command;
b) building a command structure for use with said command, said command structure indicating an information structure that can be utilized by said logical device, said information structure including a data structure and a flag portion; and
c) parsing said command structure with reference to said command string, said step of parsing including the step of inserting data from said command string into said data structure and the step of inserting at least one flag into said flag portion of said information structure.
1 Assignment
0 Petitions
Accused Products
Abstract
A logical device that is coupled to a computer can be controlled using string commands. The logical device requires flags and a data structure to operate properly. A string command with tokens for operating a specific logical device is provided. A linked list of the tokens is created. A command table for the specified logical device is found. The command table contains possible commands for the logical device, which commands are able to provide the required flags and data structure for the logical device. Each command in the command table contains key words or tokens or multiword tokens. The command table tokens are parsed, one at a time, against the command string tokens. If no match between the command table token and a command string token occurs, then the next command table token is parsed against the command string tokens. If a match between a command table token and a command string token occurs, then the flag that is associated with the command string token is provided and data from either the command string token or the command table token is inserted into the data structure in its proper place.
-
Citations
20 Claims
-
1. A method of sending a command from a first program running on a computer to a second program controlling a logical device that is connected to said computer, with said command being executed by said logical device, said method being implemented on said computer, comprising the steps of:
-
a) providing a command string containing said command;
b) building a command structure for use with said command, said command structure indicating an information structure that can be utilized by said logical device, said information structure including a data structure and a flag portion; and
c) parsing said command structure with reference to said command string, said step of parsing including the step of inserting data from said command string into said data structure and the step of inserting at least one flag into said flag portion of said information structure. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
a) said step of building a command structure for use with said command further comprises the step of building a command structure with plural possible second commands, with each of said second commands comprising a token; and
b) said step of parsing further comprises the step of searching said linked list of tokens for a match with a first one of said possible second commands and then with each subsequent possible second command in said command structure, and if a match is found, then inserting information associated with said matched second command into said information structure in accordance with each respective matched second command.
-
-
5. The method of claim 4, wherein said string comprises a multiword string token.
-
6. The method of claim 1, wherein said computer is connected to plural logical devices, wherein:
-
(a) said step of providing a command string containing said command further comprises the step of providing a command string identifying the particular logical device to which the command is to be passed; and
(b) said step of building a command structure for use with said command further comprises the step of finding the appropriate command structure for the particular logical device.
-
-
7. The method of claim 1, wherein said step of providing a command string containing said command includes the step of providing a command string including a constant block that indicates that said command string includes at least a second command nested within a first command.
-
8. The apparatus of claim 7, wherein said means for parsing further comprises:
-
means for attempting to match each of said plurality of tokens within said command structure with an identical token in said textual string; and
means, only responsive to a match, for processing a matched token in response to a command line identifier associated in said command structure with said matched token, wherein said means for processing includes said means for inserting information from said textual string and said flags into said information structure.
-
-
9. The method of claim 1, said method further comprising:
converting a return code supplied by said logical device in response to execution of said command into a string utilizing return code information supplied by said command structure.
-
10. An apparatus for sending a command from a first program running on a computer to a second program controlling a logical device that is connected to said computer, with said command being executed by said logical device, said apparatus comprising:
-
a) means for providing a command string containing said command;
b) means for building a command structure for use with said command, said command structure indicating an information structure that can be utilized by said logical device, said information structure including a data structure and a flag portion; and
c) means for parsing said command structure with reference to said command string, said means for parsing further comprising means for inserting data from said command string into said data structure and means for inserting at least one flag into said flag portion of said information structure. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
a) said means for building a command structure for use with said command further comprises means for building a command structure with plural possible second commands, with each of said second commands comprising a token; and
b) said means for parsing further comprises means for searching said linked list of tokens for a match with a first one of said possible second commands and then with each subsequent possible second command in said command structure, and if a match is found, then inserting information associated with said matched second command into said information structure in accordance with each respective matched second command.
-
-
14. The apparatus of claim 13, wherein said string comprises a multiword string token.
-
15. The apparatus of claim 10, wherein said computer is connected to plural logical devices, wherein:
-
(a) said means for providing a command string containing said command further comprises means for providing a command string identifying the particular logical device to which the command is to be passed; and
(b) said means for building a command structure for use with said command further comprises means for finding the appropriate command structure for the particular logical device.
-
-
16. The apparatus of claim 10, wherein said means for providing a command string containing said command includes means for providing a command string including a constant block that indicates that said command string includes at least a second command nested within a first command.
-
17. The apparatus of claim 10, said apparatus further comprising:
means for converting a return code supplied by said logical device in response to execution of said command into a string utilizing return code information supplied by said command structure.
-
18. A method of sending a command from a first programming interface running on a computer to a second programming interface controlling a logical device that is connected to said computer, with said command being executed by said logical device, said method being implemented on said computer and comprising:
-
a) providing a textual string specifying both a command and a logical device that is to execute said command;
b) accessing a command structure in response to said command and said logical device, said command structure specifying an information structure that can be utilized by said logical device and a plurality of tokens that can validly be associated with said command in said textual string; and
c) parsing said command structure with reference to said textual string, said step of parsing including the steps of inserting information from said textual string into said information structure, inserting at least one flag into said information structure, and passing said information structure from said computer to said logical device.
-
-
19. An apparatus for sending a command from a first program running on a computer to a second program controlling a logical device that is connected to said computer, with said command being executed by said logical device, said apparatus being implemented on said computer and comprising:
-
a) means for providing a textual string specifying both a command and a logical device that is to execute said command;
b) means for accessing a command structure in response to said command and said logical device, said command structure specifying an information structure that can be utilized by said logical device and a plurality of tokens that can validly be associated with said command in said textual string; and
c) means for parsing said command structure with reference to said textual string, said means for parsing including means for inserting information from said textual string and at least one flag into said information structure and means for passing said information structure from said computer to said logical device. - View Dependent Claims (20)
attempting to match each of said plurality of tokens within said command structure with an identical token in said textual string; and
only in response to a match, processing a matched token in response to a command line identifier associated in said command structure with said matched token, wherein said processing step includes said step of inserting information from said textual string into said information structure and said step of inserting flags into said information structure.
-
Specification