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 -------VendorNameSo, the first question is if this could be feasible, then some suggestion on how to proceed would be really appreciated.
Thank you in advance!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login