-/* ------------------------------------------------
-Copyright 2014 AT&T Intellectual Property
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ------------------------------------------- */
-
-/*
- MUST COMPILE WITH
- bison --verbose --defines=nic.tab.cc.h -p NicParser -o nic.tab.cc nic.y
-
- (or equivalent).
-*/
-
-%{
-
-
-#include <stdio.h>
-
-/* Some addn'l includes, necessary but not included by the
- bison generated code.
-*/
-
-#include <stdlib.h>
-
-/* prototypes for the parser callbacks.
-*/
-
-#include "nic_def.h"
-
-extern int NicParserlex();
-void NicParsererror(char *s);
-
-
-extern nic_property *nicp;
-extern std::vector<std::string> nic_attr_vec;
-extern std::vector<std::string> nic_val_vec;
-extern std::string nic_a, nic_v;
-
-
-
-#define YYDEBUG 1
-
-%}
-
-
- /* symbolic tokens */
-
-%union {
- int intval;
- double floatval;
- char *strval;
- int subtok;
-
- /* for FTA definition. */
-
-}
-
-%token <strval> NAME
-%token <strval> STRING_TOKEN
-%token FUNC TYPES UNARY_OPS BINARY_OPS FIELDS OPTIONS
-
-
-
-
-%%
-
-parse_result:
- opts types unary_ops binary_ops fields fcns
- ;
-
-opts:
- OPTIONS opt_val_list ';' {nicp->opta=nic_attr_vec; nicp->optv=nic_val_vec;}
- ;
-
-types:
- TYPES opt_attr_list ';' {nicp->typea=nic_attr_vec;}
- ;
-
-unary_ops:
- UNARY_OPS opt_attr_list ';' {nicp->opua=nic_attr_vec;}
- ;
-
-binary_ops:
- BINARY_OPS opt_attr_list ';' {nicp->opba=nic_attr_vec;}
- ;
-
-fields:
- FIELDS opt_attr_list ';' {nicp->fieldsa=nic_attr_vec;}
- ;
-
-fcns:
- FUNC opt_attr_list ';' {nicp->funca=nic_attr_vec;}
- ;
-
-opt_attr_list:
- attr_list
- | {nic_attr_vec.clear(); }
- ;
-
-attr_list:
- NAME {nic_attr_vec.clear(); nic_attr_vec.push_back($1); }
- | STRING_TOKEN {nic_attr_vec.clear(); nic_attr_vec.push_back($1); }
- | attr_list ',' NAME {nic_attr_vec.push_back($3);}
- | attr_list ',' STRING_TOKEN {nic_attr_vec.push_back($3);}
- ;
-
-opt_val_list:
- val_list
- | {nic_attr_vec.clear(); nic_val_vec.clear();}
- ;
-
-val_list:
- val {nic_attr_vec.clear(); nic_attr_vec.push_back(nic_a);
- nic_val_vec.clear(); nic_val_vec.push_back(nic_v); }
- | val_list ',' val {nic_attr_vec.push_back(nic_a);
- nic_val_vec.push_back(nic_v); }
- ;
-
-val:
- NAME '=' STRING_TOKEN {nic_a = $1; nic_v = $3;}
- | NAME '=' NAME {nic_a = $1; nic_v = $3;}
- ;
-
-
-
-
-
-%%
-
+/* ------------------------------------------------\r
+Copyright 2014 AT&T Intellectual Property\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ ------------------------------------------- */\r
+\r
+/*\r
+ MUST COMPILE WITH\r
+ bison --verbose --defines=nic.tab.cc.h -p NicParser -o nic.tab.cc nic.y\r
+\r
+ (or equivalent).\r
+*/\r
+\r
+%{\r
+\r
+\r
+#include <stdio.h>\r
+\r
+/* Some addn'l includes, necessary but not included by the\r
+ bison generated code.\r
+*/\r
+\r
+#include <stdlib.h>\r
+\r
+/* prototypes for the parser callbacks.\r
+*/\r
+\r
+#include "nic_def.h"\r
+\r
+extern int NicParserlex();\r
+void NicParsererror(char *s);\r
+\r
+\r
+extern nic_property *nicp;\r
+extern std::vector<std::string> nic_attr_vec;\r
+extern std::vector<std::string> nic_val_vec;\r
+extern std::string nic_a, nic_v;\r
+\r
+\r
+\r
+#define YYDEBUG 1\r
+\r
+%}\r
+\r
+\r
+ /* symbolic tokens */\r
+\r
+%union {\r
+ int intval;\r
+ double floatval;\r
+ char *strval;\r
+ int subtok;\r
+\r
+ /* for FTA definition. */\r
+\r
+}\r
+\r
+%token <strval> NAME\r
+%token <strval> STRING_TOKEN\r
+%token FUNC TYPES UNARY_OPS BINARY_OPS FIELDS OPTIONS\r
+\r
+\r
+\r
+\r
+%%\r
+\r
+parse_result:\r
+ opts types unary_ops binary_ops fields fcns \r
+ ;\r
+\r
+opts:\r
+ OPTIONS opt_val_list ';' {nicp->opta=nic_attr_vec; nicp->optv=nic_val_vec;}\r
+ ;\r
+\r
+types:\r
+ TYPES opt_attr_list ';' {nicp->typea=nic_attr_vec;}\r
+ ;\r
+\r
+unary_ops:\r
+ UNARY_OPS opt_attr_list ';' {nicp->opua=nic_attr_vec;}\r
+ ;\r
+\r
+binary_ops:\r
+ BINARY_OPS opt_attr_list ';' {nicp->opba=nic_attr_vec;}\r
+ ;\r
+\r
+fields:\r
+ FIELDS opt_attr_list ';' {nicp->fieldsa=nic_attr_vec;}\r
+ ;\r
+\r
+fcns:\r
+ FUNC opt_attr_list ';' {nicp->funca=nic_attr_vec;}\r
+ ;\r
+\r
+opt_attr_list:\r
+ attr_list\r
+ | {nic_attr_vec.clear(); }\r
+ ;\r
+\r
+attr_list:\r
+ NAME {nic_attr_vec.clear(); nic_attr_vec.push_back($1); }\r
+ | STRING_TOKEN {nic_attr_vec.clear(); nic_attr_vec.push_back($1); }\r
+ | attr_list ',' NAME {nic_attr_vec.push_back($3);}\r
+ | attr_list ',' STRING_TOKEN {nic_attr_vec.push_back($3);}\r
+ ;\r
+\r
+opt_val_list:\r
+ val_list\r
+ | {nic_attr_vec.clear(); nic_val_vec.clear();}\r
+ ;\r
+\r
+val_list:\r
+ val {nic_attr_vec.clear(); nic_attr_vec.push_back(nic_a);\r
+ nic_val_vec.clear(); nic_val_vec.push_back(nic_v); }\r
+ | val_list ',' val {nic_attr_vec.push_back(nic_a);\r
+ nic_val_vec.push_back(nic_v); }\r
+ ;\r
+\r
+val:\r
+ NAME '=' STRING_TOKEN {nic_a = $1; nic_v = $3;}\r
+ | NAME '=' NAME {nic_a = $1; nic_v = $3;}\r
+ ;\r
+ \r
+\r
+\r
+\r
+\r
+%%\r
+\r