Function list
-
Hi!
I have some questions about function lists, I’ve actually tried to develop a really simple parser for configuration files of abb robots and it works quite fine for my necessities.
Now I was trying to improve a little what I did and I’m getting some difficulties…I have to premise that I’m quite a noob in regular expression so eventually forgive the ignorance
The kind of code on which I’m working is like:
# DEVICENET_DEVICE: -Name "WAGO" -VendorName "40" -ProductName "WAGO 750-306 V04.22"\ -Label "DeviceNet Auto Configuration" -Address 11 -VendorId 40\ -ProductCode 306 -DeviceType 12 -OutputSize 2 -InputSize 4 -Name "B_DN_SIM" -Simulated # DEVICENET_INTERNAL_DEVICE: -Name "DN_Internal_Device" -VendorName "ABB Robotics"\ -ProductName "DeviceNet Internal Slave Device"
The parser I’ve used up to now was:
<parser id="SYSPAR_function" displayName="SYSPAR" commentExpr="(?s:/\*.*?\*/)#(?m-s://.*?$)"> <!-- Only match nodes with at least one attribute --> <function mainExpr="^[A-Z_]+:" displayMode="$functionName"> <functionName> <nameExpr expr="[A-Z0-9_]+"/> </functionName> </function> </parser>
As you see is really simple but worked well for finding the main topics like “DEVICENET_DEVICE” or “DEVICENET_INTERNAL_DEVICE” in the previous code
What I was trying to do now is, instead of using directly function parser, to use a classRange parser for finding the main topics and then class parser for identifying the internal field of each topics like “-name”, “-vendor_name” and so on, so to have a function list like:
--DEVICENET_DEVICE -------Name -------VendorName ... --DEVICENET_INTERNAL_DEVICENET -------Name -------VendorName
So, the first question is if this could be feasible, then some suggestion on how to proceed would be really appreciated.
Thank you in advance!