Fixed newline characters throughout the code
[com/gs-lite.git] / src / tools / xml.y
index b4dec9d..01f4c46 100644 (file)
-/* ------------------------------------------------\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 -d -p xmlParser  -o xml.tab.cc xml.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 "xml_t.h"\r
-\r
-\r
-extern xml_t *xml_result;\r
-\r
-extern int xmlParserdebug;\r
-extern void xmlParsererror(char *s);\r
-extern int xmlParserlex();\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
-       struct name_val_pair_t *nvpt;\r
-       struct name_val_list_t *nvpl;\r
-       struct tag_t *tg_t;\r
-       struct xml_list_t *xlist_t;\r
-       struct xml_t *x_t;\r
-}\r
-\r
-%token <strval> NAME\r
-%token <strval> STRING_TOKEN\r
-\r
-%type <nvpt> val\r
-%type <nvpl> val_list\r
-%type <nvpl> opt_val_list\r
-%type <strval> end_tag\r
-%type <tg_t> start_tag\r
-%type <xlist_t> xml_list\r
-%type<x_t> resource\r
-\r
-\r
-%%\r
-\r
-parse_result:  resource        {xml_result = $1;}\r
-       ;\r
-\r
-resource:\r
-       start_tag xml_list end_tag {$$ = new xml_t($1,$2,$3);}\r
-       | start_tag end_tag     {$$=new xml_t($1,$2);}\r
-       | '<' NAME opt_val_list '/' '>' {$$=new xml_t($2,$3);}\r
-       ;\r
-\r
-start_tag:\r
-       '<' NAME opt_val_list '>'       {$$ = new tag_t($2, $3);}\r
-       ;\r
-\r
-end_tag:\r
-       '<' '/' NAME '>'        {$$=$3;}\r
-       ;\r
-\r
-\r
-xml_list:\r
-       resource        {$$=new xml_list_t($1);}\r
-       | xml_list resource     {$$=$1->append($2);}\r
-       ;\r
-\r
-opt_val_list:\r
-       val_list        {$$=$1;}\r
-       |               {$$=new name_val_list_t();}\r
-       ;\r
-\r
-val_list:\r
-       val             {$$ = new name_val_list_t($1);}\r
-       | val_list val {$$ = $1->append($2);}\r
-       ;\r
-\r
-val:\r
-       NAME '=' STRING_TOKEN   {$$ = new name_val_pair_t($1,$3);}\r
-       ;\r
-       \r
-\r
-\r
-\r
-\r
-%%\r
-\r
-\r
+/* ------------------------------------------------
+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 -d -p xmlParser  -o xml.tab.cc xml.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 "xml_t.h"
+
+
+extern xml_t *xml_result;
+
+extern int xmlParserdebug;
+extern void xmlParsererror(char *s);
+extern int xmlParserlex();
+
+
+#define YYDEBUG 1
+
+%}
+
+
+       /* symbolic tokens */
+
+%union {
+       int intval;
+       double floatval;
+       char *strval;
+       int subtok;
+       struct name_val_pair_t *nvpt;
+       struct name_val_list_t *nvpl;
+       struct tag_t *tg_t;
+       struct xml_list_t *xlist_t;
+       struct xml_t *x_t;
+}
+
+%token <strval> NAME
+%token <strval> STRING_TOKEN
+
+%type <nvpt> val
+%type <nvpl> val_list
+%type <nvpl> opt_val_list
+%type <strval> end_tag
+%type <tg_t> start_tag
+%type <xlist_t> xml_list
+%type<x_t> resource
+
+
+%%
+
+parse_result:  resource        {xml_result = $1;}
+       ;
+
+resource:
+       start_tag xml_list end_tag {$$ = new xml_t($1,$2,$3);}
+       | start_tag end_tag     {$$=new xml_t($1,$2);}
+       | '<' NAME opt_val_list '/' '>' {$$=new xml_t($2,$3);}
+       ;
+
+start_tag:
+       '<' NAME opt_val_list '>'       {$$ = new tag_t($2, $3);}
+       ;
+
+end_tag:
+       '<' '/' NAME '>'        {$$=$3;}
+       ;
+
+
+xml_list:
+       resource        {$$=new xml_list_t($1);}
+       | xml_list resource     {$$=$1->append($2);}
+       ;
+
+opt_val_list:
+       val_list        {$$=$1;}
+       |               {$$=new name_val_list_t();}
+       ;
+
+val_list:
+       val             {$$ = new name_val_list_t($1);}
+       | val_list val {$$ = $1->append($2);}
+       ;
+
+val:
+       NAME '=' STRING_TOKEN   {$$ = new name_val_pair_t($1,$3);}
+       ;
+       
+
+
+
+
+%%
+
+