2
* Copyright (c) 2004 Mellanox Technologies LTD. All rights reserved.
4
* This software is available to you under a choice of one of two
5
* licenses. You may choose to be licensed under the terms of the GNU
6
* General Public License (GPL) Version 2, available from the file
7
* COPYING in the main directory of this source tree, or the
8
* OpenIB.org BSD license below:
10
* Redistribution and use in source and binary forms, with or
11
* without modification, are permitted provided that the following
14
* - Redistributions of source code must retain the above
15
* copyright notice, this list of conditions and the following
18
* - Redistributions in binary form must reproduce the above
19
* copyright notice, this list of conditions and the following
20
* disclaimer in the documentation and/or other materials
21
* provided with the distribution.
23
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
#define yymaxdepth ibnl_maxdepth
39
#define yyparse ibnl_parse
40
#define yylex ibnl_lex
41
#define yyerror ibnl_error
42
#define yylval ibnl_lval
43
#define yychar ibnl_char
44
#define yydebug ibnl_debug
45
#define yypact ibnl_pact
48
#define yydef ibnl_def
49
#define yychk ibnl_chk
50
#define yypgo ibnl_pgo
51
#define yyact ibnl_act
52
#define yyexca ibnl_exca
53
#define yyerrflag ibnl_errflag
54
#define yynerrs ibnl_nerrs
58
#define yy_yys ibnl_yys
59
#define yystate ibnl_state
60
#define yytmp ibnl_tmp
62
#define yy_yyv ibnl_yyv
63
#define yyval ibnl_val
64
#define yylloc ibnl_lloc
65
#define yyreds ibnl_reds
66
#define yytoks ibnl_toks
67
#define yylhs ibnl_yylhs
68
#define yylen ibnl_yylen
69
#define yydefred ibnl_yydefred
70
#define yydgoto ibnl_yydgoto
71
#define yysindex ibnl_yysindex
72
#define yyrindex ibnl_yyrindex
73
#define yygindex ibnl_yygindex
74
#define yytable ibnl_yytable
75
#define yycheck ibnl_yycheck
76
#define yyname ibnl_yyname
77
#define yyrule ibnl_yyrule
82
#include "ibnl_parser.h"
90
yylval.ival = atoi(yytext);
92
printf("INT:%d\n",yylval.ival);
106
yylval.ival = TOPSYSTEM;
108
printf("TOPSYSTEM\n");
122
yylval.sval = (char *)malloc(strlen(yytext) + 1);
123
strcpy(yylval.sval, yytext);
125
printf("WIDTH:%s\n",yylval.sval);
131
yylval.sval = (char *)malloc(strlen(yytext));
132
strncpy(yylval.sval, yytext, strlen(yytext) - 1);
133
strcat(yylval.sval, "");
135
printf("SPEED:%s\n",yylval.sval);
141
yylval.ival = SUBSYSTEM;
143
printf("SUBSYSTEM\n");
157
if (!strcmp(yytext,"SW")) {
158
yylval.tval = IB_SW_NODE;
160
yylval.tval = IB_CA_NODE;
163
printf("%s\n", yytext);
168
[A-Za-z][-\[\]\\\*/A-Za-z0-9_.:%@~]+ {
169
yylval.sval = (char *)malloc(strlen(yytext) + 1);
170
strcpy(yylval.sval, yytext);
172
printf("NAME:%s\n",yylval.sval);
182
if(lineNum % 10000==0)
183
fprintf(stderr,"-I- Parsed %ld lines\r",lineNum);
192
printf("CHAR:%c\n",yytext[0]);