[ofa-general] [PATCH] osm: QoS parser - adding support for quoted string

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Oct 15 15:44:52 PDT 2007


Adding support for quoted strings in the policy file parser.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_qos_parser.l |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_qos_parser.l b/opensm/opensm/osm_qos_parser.l
index 60b2d1c..bfc4637 100644
--- a/opensm/opensm/osm_qos_parser.l
+++ b/opensm/opensm/osm_qos_parser.l
@@ -171,6 +171,7 @@ WHITE                   [ \t]+
 NEW_LINE                \n
 COMMENT		            \#.*\n
 WHITE_DOTDOT_WHITE      [ \t]*:[ \t]*
+QUOTED_TEXT             \"[^\"]*\"

 %%

@@ -298,6 +299,13 @@ WHITE_DOTDOT_WHITE      [ \t]*:[ \t]*
                         return TK_ASTERISK;
                     }

+{QUOTED_TEXT}       {
+                        SAVE_POS;
+                        __qos_parser_lval = strdup(&__qos_parser_text[1]);
+                        __qos_parser_lval[strlen(__qos_parser_lval)-1] = '\0';
+                        return TK_TEXT;
+                    }
+
 .                   { SAVE_POS; __qos_parser_lval = strdup(__qos_parser_text); return TK_TEXT;}

 %%
-- 
1.5.1.4




More information about the general mailing list