I am developing a server-side scripting language which I intend to use on my private server. It is similar to PHP, and I know that I could easily use PHP instead but I'm just doing some programming for fun.
The syntax of basic commands in my language is as follows:
command_name "parameter1" : "parameter2" : "parameter3"
But it can also be like this when I want to join values for a parameter:
command_name "parameter1" : "param" & "eter2" : "par" & "amet" & "er3"
How would I go about parsing a string like the ones shown above (it will be perfectly typed, no syntax errors) to an object that has these properties
- Custom class "Request"
- Property "Command" as String, should be the "command_name" part
- Property "Parameters" as String(), should be an array of Parameter objects
- Shared Function FromString(s As String) as Request, this should accept a string in the language above and parse it to a Request object
- Custom class "Parameter"
- Property "Segments" as String(), for example "para", "mete", and "r3"
- Sub New(ParamArray s as String()), this is how it should be generated from the code
It should be done in VB.NET and I am a moderate level programmer, so even if you just have an idea of how to attack this then please share it with me. I am very new to parsing complex data like this so I need a lot of help. Thanks so much!