Skip to content

Commit

Permalink
clang warning for lex scanners.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed Aug 4, 2021
1 parent 6bc160e commit be3a8c0
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 122 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pomdp 0.99.2.1 (xx/xx/2021)

* moved Ternary and visNetwork to SUGGESTED.
* removed clang warning for lex scanners.

# pomdp 0.99.2 (05/14/2021)

Expand Down
4 changes: 4 additions & 0 deletions src/pomdp-solve/lp-solve/lex.l
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

%option noinput
%option nounput

%{
//#include "lp.c"
//#include "y.tab.c"
Expand Down
90 changes: 26 additions & 64 deletions src/pomdp-solve/lp-solve/lex.yy.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ int yy_flex_debug = 0;
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "lex.l"
#line 2 "lex.l"
#define YY_NO_INPUT 1
#line 6 "lex.l"
//#include "lp.c"
//#include "y.tab.c"
#include "y.tab.h"
Expand All @@ -492,9 +493,9 @@ extern int isign;
extern int make_neg;
extern int Within_int_decl;

#line 496 "lex.yy.c"
#line 497 "lex.yy.c"

#line 498 "lex.yy.c"
#line 499 "lex.yy.c"

#define INITIAL 0
#define COMMENT 1
Expand Down Expand Up @@ -556,8 +557,6 @@ extern int yywrap ( void );

#ifndef YY_NO_UNPUT

static void yyunput ( int c, char *buf_ptr );

#endif

#ifndef yytext_ptr
Expand Down Expand Up @@ -712,9 +711,9 @@ YY_DECL
}

{
#line 31 "lex.l"
#line 35 "lex.l"

#line 718 "lex.yy.c"
#line 717 "lex.yy.c"

while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
Expand Down Expand Up @@ -773,62 +772,62 @@ YY_DECL

case 1:
YY_RULE_SETUP
#line 32 "lex.l"
#line 36 "lex.l"
{
BEGIN COMMENT;
} /* begin skip comment */
YY_BREAK
case 2:
YY_RULE_SETUP
#line 36 "lex.l"
#line 40 "lex.l"
{
BEGIN INITIAL;
} /* end skip comment */
YY_BREAK
case 3:
YY_RULE_SETUP
#line 40 "lex.l"
#line 44 "lex.l"
{
}
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 43 "lex.l"
#line 47 "lex.l"
{
}
YY_BREAK
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
#line 46 "lex.l"
#line 50 "lex.l"
{
}
YY_BREAK
case 6:
YY_RULE_SETUP
#line 49 "lex.l"
#line 53 "lex.l"
{
return(COMMA);
}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 53 "lex.l"
#line 57 "lex.l"
{
return(MINIMISE);
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 57 "lex.l"
#line 61 "lex.l"
{
return(MAXIMISE);
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 61 "lex.l"
#line 65 "lex.l"
{
f = atof((char *)yytext);
return(CONS);
Expand All @@ -837,7 +836,7 @@ YY_RULE_SETUP
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
#line 66 "lex.l"
#line 70 "lex.l"
{
Sign = 0;
for(x = 0; x < yyleng; x++)
Expand All @@ -851,62 +850,62 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
#line 77 "lex.l"
#line 81 "lex.l"
{
Within_int_decl = TRUE;
return(VAR);
}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 82 "lex.l"
#line 86 "lex.l"
{
strcpy(Last_var, (char *)yytext);
return(VAR);
}
YY_BREAK
case 13:
YY_RULE_SETUP
#line 87 "lex.l"
#line 91 "lex.l"
{
return (COLON);
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 91 "lex.l"
#line 95 "lex.l"
{
return(AR_M_OP);
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 95 "lex.l"
#line 99 "lex.l"
{
return(RE_OP);
}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 99 "lex.l"
#line 103 "lex.l"
{
Within_int_decl = FALSE;
return(END_C);
}
YY_BREAK
case 17:
YY_RULE_SETUP
#line 104 "lex.l"
#line 108 "lex.l"
{
fprintf(stderr,"LEX ERROR : %s lineno %d \n" ,yytext,yylineno);
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 108 "lex.l"
#line 112 "lex.l"
ECHO;
YY_BREAK
#line 910 "lex.yy.c"
#line 909 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT):
yyterminate();
Expand Down Expand Up @@ -1243,43 +1242,6 @@ static int yy_get_next_buffer (void)

#ifndef YY_NO_UNPUT

static void yyunput (int c, char * yy_bp )
{
char *yy_cp;

yy_cp = (yy_c_buf_p);

/* undo effects of setting up yytext */
*yy_cp = (yy_hold_char);

if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
int number_to_move = (yy_n_chars) + 2;
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];

while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;

yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
(yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;

if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}

*--yy_cp = (char) c;

(yytext_ptr) = yy_bp;
(yy_hold_char) = *yy_cp;
(yy_c_buf_p) = yy_cp;
}

#endif

#ifndef YY_NO_INPUT
Expand Down Expand Up @@ -1912,6 +1874,6 @@ void yyfree (void * ptr )

#define YYTABLES_NAME "yytables"

#line 108 "lex.l"
#line 112 "lex.l"

Loading

0 comments on commit be3a8c0

Please sign in to comment.