]> OCCT Git - occt.git/commitdiff
0032028: Coding Rules, StepFile - eliminate CLang warning -Wmisleading-indentation
authordpasukhi <dpasukhi@opencascade.com>
Wed, 30 Dec 2020 09:20:22 +0000 (12:20 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 12 Jan 2021 10:48:44 +0000 (13:48 +0300)
Regenerated the StepFile/lex.step.cxx using the latest version of WinFlexBison
- Fixed [-Wmisleading-indentation] warning
- Removed empty lines

src/StepFile/lex.step.cxx
src/StepFile/step.lex

index ba0f3101cbe835b8efa91745f5f4446cb723616a..7de3419ca0c9db61e43ac2f6161ccda5fad59753 100644 (file)
@@ -6,21 +6,10 @@
 #include "stdint.h"
 #endif
 
-
-
 #define  YY_INT_ALIGNED short int
 
 /* A lexical scanner generated by flex */
 
-
-
-
-
-
-
-
-
-
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 6
 #define FLEX_BETA
 #endif
 
-
-
-
-
-
-
-
-
-
-
-
-
     /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
      * following macro. This is required in order to pass the c++-multiple-scanners
      * test in the regression suite. We get reports that it breaks inheritance.
      */
     #define yyFlexLexer stepFlexLexer
 
-
-
-
-
-
-
 #ifdef yyalloc
 #define stepalloc_ALREADY_DEFINED
 #else
 #define yyalloc stepalloc
 #endif
 
-    
 #ifdef yyrealloc
 #define steprealloc_ALREADY_DEFINED
 #else
 #define yyrealloc steprealloc
 #endif
 
-    
 #ifdef yyfree
 #define stepfree_ALREADY_DEFINED
 #else
 #define yyfree stepfree
 #endif
 
-
-
-
-
-
-
 /* First, we deal with  platform-specific or compiler-specific issues. */
 
 /* begin standard C headers. */
@@ -155,7 +118,6 @@ typedef unsigned int flex_uint32_t;
 
 #endif /* ! FLEXINT_H */
 
-
 /* begin standard C++ headers. */
 #include <iostream>
 #include <errno.h>
@@ -176,41 +138,11 @@ typedef unsigned int flex_uint32_t;
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
-
 /* Promotes a possibly negative, possibly signed char to an
  *   integer in range [0..255] for use as an array index.
  */
 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 /* Enter a start condition.  This macro really ought to take a parameter,
  * but we do it the disgusting crufty way forced on us by the ()-less
  * definition of BEGIN.
@@ -228,7 +160,6 @@ typedef unsigned int flex_uint32_t;
 #define YY_NEW_FILE yyrestart( yyin  )
 #define YY_END_OF_BUFFER_CHAR 0
 
-
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
 #ifdef __ia64__
@@ -242,13 +173,10 @@ typedef unsigned int flex_uint32_t;
 #endif /* __ia64__ */
 #endif
 
-
 /* The state buf must be large enough to hold one state per character in the main buffer.
  */
 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
-
-
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 #define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
@@ -261,8 +189,6 @@ typedef size_t yy_size_t;
 
 extern int yyleng;
 
-
-
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
@@ -285,7 +211,6 @@ extern int yyleng;
        while ( 0 )
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -293,7 +218,6 @@ struct yy_buffer_state
 
        std::streambuf* yy_input_file;
 
-
        char *yy_ch_buf;                /* input buffer */
        char *yy_buf_pos;               /* current position in input buffer */
 
@@ -329,7 +253,6 @@ struct yy_buffer_state
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
 
-
        /* Whether to try to fill the input buffer when we reach the
         * end of it.
         */
@@ -354,9 +277,6 @@ struct yy_buffer_state
        };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
-
-
-
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
@@ -371,14 +291,10 @@ struct yy_buffer_state
  */
 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
-
-
-
 void *yyalloc ( yy_size_t  );
 void *yyrealloc ( void *, yy_size_t  );
 void yyfree ( void *  );
 
-
 #define yy_new_buffer yy_create_buffer
 #define yy_set_interactive(is_interactive) \
        { \
@@ -400,7 +316,6 @@ void yyfree ( void *  );
        }
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
-
 /* Begin user sect3 */
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
@@ -408,10 +323,9 @@ typedef flex_uint8_t YY_CHAR;
 #define yytext_ptr yytext
 #define YY_INTERACTIVE
 
-
 #include <FlexLexer.h>
 
-int yyFlexLexer::yywrap() { return 1; }
+inline int yyFlexLexer::yywrap() { return 1; }
 int yyFlexLexer::yylex()
        {
        LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" );
@@ -420,11 +334,6 @@ int yyFlexLexer::yylex()
 
 #define YY_DECL int step::scanner::yylex()
 
-
-
-
-
-
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
@@ -698,7 +607,6 @@ static const flex_int16_t yy_chk[503] =
       156,  156
     } ;
 
-
 #define YY_TRAILING_MASK 0x2000
 #define YY_TRAILING_HEAD_MASK 0x4000
 #define REJECT \
@@ -712,7 +620,6 @@ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
 goto find_rule; \
 }
 
-
 #define yymore() ((yy_more_flag) = 1)
 #define YY_MORE_ADJ (yy_more_len)
 #define YY_RESTORE_YY_MORE_OFFSET
@@ -786,23 +693,13 @@ long string in files Henri.stp and 401.stp*/
 // disable GCC warnings in flex code
 #ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wunused-function"
-#if (__GNUC__ > 5)
-#pragma GCC diagnostic ignored "-Wmisleading-indentation"
-#endif
 #endif
 
-
-
-
 #define INITIAL 0
 #define Com 1
 #define End 2
 #define Text 3
 
-
-
-
-    
 #ifndef YY_NO_UNISTD_H
 /* Special case for "unistd.h", since it is non-ANSI. We include it way
  * down here because we want the user's section 1 to have been scanned first.
@@ -811,17 +708,10 @@ long string in files Henri.stp and 401.stp*/
 #include <unistd.h>
 #endif
     
-
-
-
 #ifndef YY_EXTRA_TYPE
 #define YY_EXTRA_TYPE void *
 #endif
 
-
-
-
-
 #ifndef yytext_ptr
 static void yy_flex_strncpy ( char *, const char *, int );
 #endif
@@ -834,8 +724,6 @@ static int yy_flex_strlen ( const char * );
 
 #endif
 
-
-
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
 #ifdef __ia64__
@@ -846,14 +734,11 @@ static int yy_flex_strlen ( const char * );
 #endif /* __ia64__ */
 #endif
 
-
 /* Copy whatever the last rule matched to the standard output. */
 #ifndef ECHO
 #define ECHO LexerOutput( yytext, yyleng )
 #endif
 
-
-
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  * is returned in "result".
  */
@@ -865,8 +750,6 @@ static int yy_flex_strlen ( const char * );
 
 #endif
 
-
-
 /* No semi-colon after return; correct usage is to write "yyterminate();" -
  * we don't want an extra ';' after the "return" because that will cause
  * some compilers to complain about unreachable statements.
@@ -875,24 +758,18 @@ static int yy_flex_strlen ( const char * );
 #define yyterminate() return YY_NULL
 #endif
 
-
 /* Number of entries by which start-condition stack grows. */
 #ifndef YY_START_STACK_INCR
 #define YY_START_STACK_INCR 25
 #endif
 
-
 /* Report a fatal error. */
 #ifndef YY_FATAL_ERROR
 #define YY_FATAL_ERROR(msg) LexerError( msg )
 #endif
 
-
-
 /* end tables serialization structures and prototypes */
 
-
-
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
@@ -901,7 +778,6 @@ static int yy_flex_strlen ( const char * );
 #define YY_DECL int yyFlexLexer::yylex()
 #endif /* !YY_DECL */
 
-
 /* Code executed at the beginning of each rule, after yytext and yyleng
  * have been set up.
  */
@@ -909,19 +785,14 @@ static int yy_flex_strlen ( const char * );
 #define YY_USER_ACTION
 #endif
 
-
-
 /* Code executed at the end of each rule. */
 #ifndef YY_BREAK
 #define YY_BREAK /*LINTED*/break;
 #endif
 
-
-
 #define YY_RULE_SETUP \
        YY_USER_ACTION
 
-
 /** The main scanner function which does all the work.
  */
 YY_DECL
@@ -930,15 +801,6 @@ YY_DECL
        char *yy_cp, *yy_bp;
        int yy_act;
     
-
-    
-    
-
-
-
-
-
-
        if ( !(yy_init) )
                {
                (yy_init) = 1;
@@ -947,13 +809,11 @@ YY_DECL
                YY_USER_INIT;
 #endif
 
-
         /* Create the reject buffer large enough to save one state per allowed character. */
         if ( ! (yy_state_buf) )
             (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE  );
-            if ( ! (yy_state_buf) )
-                YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
-
+        if ( ! (yy_state_buf) )
+            YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
 
                if ( ! (yy_start) )
                        (yy_start) = 1; /* first start state */
@@ -975,7 +835,6 @@ YY_DECL
 
        {
 
-
        while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
                {
                (yy_more_len) = 0;
@@ -1056,11 +915,8 @@ find_rule: /* we branch to this label when backing up */
 
                YY_DO_BEFORE_ACTION;
 
-
-
 do_action:     /* This label is used only to access EOF actions. */
 
-
                switch ( yy_act )
        { /* beginning of action switch */
 case 1:
@@ -1386,7 +1242,6 @@ YY_FATAL_ERROR( "flex scanner jammed" );
        } /* end of user's declarations */
 } /* end of yylex */
 
-
 /* The contents of this function are C++ specific, so the () macro is not used.
  * This constructor simply maintains backward compatibility.
  * DEPRECATED
@@ -1431,8 +1286,6 @@ void yyFlexLexer::ctor_common()
        yy_buffer_stack_top = 0;
        yy_buffer_stack_max = 0;
 
-
-
        yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE];
 
 }
@@ -1509,8 +1362,6 @@ void yyFlexLexer::LexerOutput( const char* buf, int size )
        (void) yyout.write( buf, size );
 }
 
-
-
 /* yy_get_next_buffer - try to read in a new buffer
  *
  * Returns a code representing an action:
@@ -1624,7 +1475,6 @@ int yyFlexLexer::yy_get_next_buffer()
        return ret_val;
 }
 
-
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
     yy_state_type yyFlexLexer::yy_get_previous_state()
@@ -1637,7 +1487,6 @@ int yyFlexLexer::yy_get_next_buffer()
        (yy_state_ptr) = (yy_state_buf);
        *(yy_state_ptr)++ = yy_current_state;
 
-
        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
                {
                YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 50);
@@ -1654,7 +1503,6 @@ int yyFlexLexer::yy_get_next_buffer()
        return yy_current_state;
 }
 
-
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
@@ -1676,10 +1524,9 @@ int yyFlexLexer::yy_get_next_buffer()
        if ( ! yy_is_jam )
                *(yy_state_ptr)++ = yy_current_state;
 
-               return yy_is_jam ? 0 : yy_current_state;
+       return yy_is_jam ? 0 : yy_current_state;
 }
 
-
 #ifndef YY_NO_UNPUT
     void yyFlexLexer::yyunput( int c, char* yy_bp)
 {
@@ -1713,8 +1560,6 @@ int yyFlexLexer::yy_get_next_buffer()
 
        *--yy_cp = (char) c;
 
-
-
        (yytext_ptr) = yy_bp;
        (yy_hold_char) = *yy_cp;
        (yy_c_buf_p) = yy_cp;
@@ -1785,7 +1630,6 @@ int yyFlexLexer::yy_get_next_buffer()
        *(yy_c_buf_p) = '\0';   /* preserve yytext */
        (yy_hold_char) = *++(yy_c_buf_p);
 
-
        return c;
 }
 
@@ -1855,7 +1699,6 @@ void yyFlexLexer::yyrestart( std::istream* input_file )
        (yy_did_buffer_switch_on_eof) = 1;
 }
 
-
     void yyFlexLexer::yy_load_buffer_state()
 {
        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -1924,7 +1767,6 @@ void yyFlexLexer::yyrestart( std::istream* input_file )
        yyfree( (void *) b  );
 }
 
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a yyrestart() or at EOF.
@@ -2011,7 +1853,6 @@ void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
        (yy_did_buffer_switch_on_eof) = 1;
 }
 
-
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
  *  
@@ -2032,7 +1873,6 @@ void yyFlexLexer::yypop_buffer_state (void)
        }
 }
 
-
 /* Allocates the stack if it does not exist.
  *  Guarantees space for at least one push.
  */
@@ -2053,7 +1893,6 @@ void yyFlexLexer::yyensure_buffer_stack(void)
                if ( ! (yy_buffer_stack) )
                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
 
-
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
 
                (yy_buffer_stack_max) = num_to_alloc;
@@ -2080,22 +1919,6 @@ void yyFlexLexer::yyensure_buffer_stack(void)
        }
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
     void yyFlexLexer::yy_push_state( int _new_state )
 {
        if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
@@ -2121,9 +1944,6 @@ void yyFlexLexer::yyensure_buffer_stack(void)
        BEGIN(_new_state);
 }
 
-
-
-
     void yyFlexLexer::yy_pop_state()
 {
        if ( --(yy_start_stack_ptr) < 0 )
@@ -2132,15 +1952,11 @@ void yyFlexLexer::yyensure_buffer_stack(void)
        BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
 }
 
-
-
-
     int yyFlexLexer::yy_top_state()
 {
        return (yy_start_stack)[(yy_start_stack_ptr) - 1];
 }
 
-
 #ifndef YY_EXIT_FAILURE
 #define YY_EXIT_FAILURE 2
 #endif
@@ -2168,23 +1984,12 @@ void yyFlexLexer::LexerError( const char* msg )
                } \
        while ( 0 )
 
-
-
 /* Accessor  methods (get/set functions) to struct members. */
 
-
-
-
-
-
-
-
 /*
  * Internal utility routines.
  */
 
-
-
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, const char * s2, int n )
 {
@@ -2195,8 +2000,6 @@ static void yy_flex_strncpy (char* s1, const char * s2, int n )
 }
 #endif
 
-
-
 #ifdef YY_NEED_STRLEN
 static int yy_flex_strlen (const char * s )
 {
@@ -2208,15 +2011,11 @@ static int yy_flex_strlen (const char * s )
 }
 #endif
 
-
-
 void *yyalloc (yy_size_t  size )
 {
                        return malloc(size);
 }
 
-
-
 void *yyrealloc  (void * ptr, yy_size_t  size )
 {
                
@@ -2230,23 +2029,13 @@ void *yyrealloc  (void * ptr, yy_size_t  size )
        return realloc(ptr, size);
 }
 
-
-
 void yyfree (void * ptr )
 {
                        free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
 }
 
-
 #define YYTABLES_NAME "yytables"
 
-
-
-
-
-
-
-
 step::scanner::scanner(StepFile_ReadData* theDataModel, std::istream* in, std::ostream* out)
     : stepFlexLexer(in, out), myDataModel(theDataModel)
 {
index 994151ad8b53f2bb8c81d49adde3a71af2e18ce1..54e2d46a0a3e628f92ae66098b169caec4147d9e 100644 (file)
@@ -84,9 +84,6 @@ long string in files Henri.stp and 401.stp*/
 // disable GCC warnings in flex code
 #ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wunused-function"
-#if (__GNUC__ > 5)
-#pragma GCC diagnostic ignored "-Wmisleading-indentation"
-#endif
 #endif
 %}
 %x Com End Text