From 164ed9a8cdb327408559e704ea43fb542e6797f1 Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Mon, 22 Nov 2021 11:18:58 +0100 Subject: [PATCH 1/6] removed generated files --- src/Core/QueryParser/Generated/lexer.cpp | 1890 -------------------- src/Core/QueryParser/Generated/location.hh | 334 ---- src/Core/QueryParser/Generated/parser.cpp | 1412 --------------- src/Core/QueryParser/Generated/parser.hpp | 738 -------- src/Core/QueryParser/Generated/position.hh | 11 - src/Core/QueryParser/Generated/stack.hh | 8 - 6 files changed, 4393 deletions(-) delete mode 100644 src/Core/QueryParser/Generated/lexer.cpp delete mode 100644 src/Core/QueryParser/Generated/location.hh delete mode 100644 src/Core/QueryParser/Generated/parser.cpp delete mode 100644 src/Core/QueryParser/Generated/parser.hpp delete mode 100644 src/Core/QueryParser/Generated/position.hh delete mode 100644 src/Core/QueryParser/Generated/stack.hh diff --git a/src/Core/QueryParser/Generated/lexer.cpp b/src/Core/QueryParser/Generated/lexer.cpp deleted file mode 100644 index 2542603..0000000 --- a/src/Core/QueryParser/Generated/lexer.cpp +++ /dev/null @@ -1,1890 +0,0 @@ -#line 2 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" - -#line 4 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" - -#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 YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* 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. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#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; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - 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 - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - 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. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* 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". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -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) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define yywrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 23 -#define YY_END_OF_BUFFER 24 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[51] = - { 0, - 0, 0, 24, 23, 1, 2, 10, 23, 17, 18, - 21, 19, 20, 3, 11, 13, 16, 22, 22, 22, - 22, 22, 22, 23, 22, 22, 1, 2, 7, 3, - 12, 14, 15, 22, 22, 22, 22, 6, 22, 6, - 5, 4, 7, 22, 10, 22, 22, 8, 9, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 1, 1, 1, 1, 5, 1, 6, - 7, 8, 9, 1, 10, 1, 1, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 1, 1, 12, - 13, 14, 1, 1, 15, 16, 16, 16, 17, 18, - 19, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 16, 1, 20, 16, 16, 21, - - 22, 23, 16, 16, 16, 16, 16, 24, 16, 25, - 26, 16, 16, 27, 28, 29, 30, 16, 16, 16, - 16, 16, 1, 31, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[32] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1 - } ; - -static const flex_int16_t yy_base[52] = - { 0, - 0, 17, 60, 61, 57, 55, 61, 52, 61, 61, - 61, 61, 61, 45, 42, 41, 40, 0, 27, 31, - 24, 22, 21, 16, 27, 27, 42, 40, 61, 31, - 61, 61, 61, 0, 20, 16, 10, 0, 8, 61, - 0, 0, 0, 9, 0, 14, 13, 0, 0, 61, - 31 - } ; - -static const flex_int16_t yy_def[52] = - { 0, - 50, 1, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 51, 51, 51, - 51, 51, 51, 50, 51, 51, 50, 50, 50, 50, - 50, 50, 50, 51, 51, 51, 51, 51, 51, 50, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, - 50 - } ; - -static const flex_int16_t yy_nxt[93] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 18, 18, 18, 18, 19, - 18, 18, 20, 18, 21, 22, 18, 18, 23, 18, - 24, 25, 34, 26, 49, 48, 47, 46, 45, 44, - 43, 30, 28, 27, 42, 41, 40, 39, 38, 37, - 36, 35, 33, 32, 31, 30, 29, 28, 27, 50, - 3, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50 - - } ; - -static const flex_int16_t yy_chk[93] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 51, 2, 47, 46, 44, 39, 37, 36, - 35, 30, 28, 27, 26, 25, 24, 23, 22, 21, - 20, 19, 17, 16, 15, 14, 8, 6, 5, 3, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50 - - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -#line 2 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -# include -# include "../TAPNQueryParser.hpp" -# include "parser.hpp" - -/* Work around an incompatibility in flex (at least versions - 2.5.31 through 2.5.33): it generates code that does - not conform to C89. See Debian bug 333231 - . */ -# undef yywrap -# define yywrap() 1 - -/* By default yylex returns int, we use token_type. - Unfortunately yyterminate by default returns 0, which is - not of token_type. */ -#define yyterminate() return token::END -#line 498 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" -#line 26 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -# define YY_USER_ACTION yylloc->columns (yyleng); -#line 501 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" -#line 502 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" - -#define INITIAL 0 - -#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. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#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. - */ -#ifndef yyterminate -#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) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#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 \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 28 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" - - -#line 31 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" - yylloc->step (); - -#line 726 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 51 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 50 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 33 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylloc->step (); } - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 34 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylloc->lines (yyleng); yylloc->step (); } - YY_BREAK - - typedef VerifyTAPN::Parser::token token; - -case 3: -YY_RULE_SETUP -#line 40 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->number = atoi(yytext); return token::NUMBER; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 41 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::EF; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 42 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::AG; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 43 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::OR; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 44 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::AND; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 45 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::BOOL_TRUE; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 46 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::BOOL_FALSE; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 47 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ return token::NOT; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 48 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::LESS; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 49 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::LESSEQUAL; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 50 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::EQUAL; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 51 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::EQUAL; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 52 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::GREATEREQUAL; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 53 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::GREATER; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 54 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{return token::LPARAN;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{return token::RPARAN;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{return token::PLUS;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 57 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{return token::MINUS;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 58 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{return token::MULTIPLY;} - YY_BREAK -case 22: -YY_RULE_SETUP -#line 60 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -{ yylval->string = new std::string(yytext); return token::IDENTIFIER; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 62 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" -ECHO; - YY_BREAK -#line 899 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - 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)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 51 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 51 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 50); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - 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. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - 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; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 62 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" - -namespace VerifyTAPN -{ - void TAPNQueryParser::scan_begin () - { - if (!(yyin = fopen (file.c_str (), "r"))) - { - error (std::string ("cannot open ") + file); - std::cout << errno; - exit (1); - } - } - - void TAPNQueryParser::scan_end () - { - fclose (yyin); - } -} - - diff --git a/src/Core/QueryParser/Generated/location.hh b/src/Core/QueryParser/Generated/location.hh deleted file mode 100644 index 712b027..0000000 --- a/src/Core/QueryParser/Generated/location.hh +++ /dev/null @@ -1,334 +0,0 @@ -// A Bison parser, made by GNU Bison 3.5.1. - -// Locations for Bison parsers in C++ - -// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -/** - ** \file /home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/location.hh - ** Define the VerifyTAPN::location class. - */ - -#ifndef YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED -# define YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED - -# include -# include - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -namespace VerifyTAPN { -#line 59 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/location.hh" - - /// A point in a source file. - class position - { - public: - /// Type for line and column numbers. - typedef int counter_type; - - /// Construct a position. - explicit position (std::string* f = YY_NULLPTR, - counter_type l = 1, - counter_type c = 1) - : filename (f) - , line (l) - , column (c) - {} - - - /// Initialization. - void initialize (std::string* fn = YY_NULLPTR, - counter_type l = 1, - counter_type c = 1) - { - filename = fn; - line = l; - column = c; - } - - /** \name Line and Column related manipulators - ** \{ */ - /// (line related) Advance to the COUNT next lines. - void lines (counter_type count = 1) - { - if (count) - { - column = 1; - line = add_ (line, count, 1); - } - } - - /// (column related) Advance to the COUNT next columns. - void columns (counter_type count = 1) - { - column = add_ (column, count, 1); - } - /** \} */ - - /// File name to which this position refers. - std::string* filename; - /// Current line number. - counter_type line; - /// Current column number. - counter_type column; - - private: - /// Compute max (min, lhs+rhs). - static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min) - { - return lhs + rhs < min ? min : lhs + rhs; - } - }; - - /// Add \a width columns, in place. - inline position& - operator+= (position& res, position::counter_type width) - { - res.columns (width); - return res; - } - - /// Add \a width columns. - inline position - operator+ (position res, position::counter_type width) - { - return res += width; - } - - /// Subtract \a width columns, in place. - inline position& - operator-= (position& res, position::counter_type width) - { - return res += -width; - } - - /// Subtract \a width columns. - inline position - operator- (position res, position::counter_type width) - { - return res -= width; - } - - /// Compare two position objects. - inline bool - operator== (const position& pos1, const position& pos2) - { - return (pos1.line == pos2.line - && pos1.column == pos2.column - && (pos1.filename == pos2.filename - || (pos1.filename && pos2.filename - && *pos1.filename == *pos2.filename))); - } - - /// Compare two position objects. - inline bool - operator!= (const position& pos1, const position& pos2) - { - return !(pos1 == pos2); - } - - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param pos a reference to the position to redirect - */ - template - std::basic_ostream& - operator<< (std::basic_ostream& ostr, const position& pos) - { - if (pos.filename) - ostr << *pos.filename << ':'; - return ostr << pos.line << '.' << pos.column; - } - - /// Two points in a source file. - class location - { - public: - /// Type for line and column numbers. - typedef position::counter_type counter_type; - - /// Construct a location from \a b to \a e. - location (const position& b, const position& e) - : begin (b) - , end (e) - {} - - /// Construct a 0-width location in \a p. - explicit location (const position& p = position ()) - : begin (p) - , end (p) - {} - - /// Construct a 0-width location in \a f, \a l, \a c. - explicit location (std::string* f, - counter_type l = 1, - counter_type c = 1) - : begin (f, l, c) - , end (f, l, c) - {} - - - /// Initialization. - void initialize (std::string* f = YY_NULLPTR, - counter_type l = 1, - counter_type c = 1) - { - begin.initialize (f, l, c); - end = begin; - } - - /** \name Line and Column related manipulators - ** \{ */ - public: - /// Reset initial location to final location. - void step () - { - begin = end; - } - - /// Extend the current location to the COUNT next columns. - void columns (counter_type count = 1) - { - end += count; - } - - /// Extend the current location to the COUNT next lines. - void lines (counter_type count = 1) - { - end.lines (count); - } - /** \} */ - - - public: - /// Beginning of the located region. - position begin; - /// End of the located region. - position end; - }; - - /// Join two locations, in place. - inline location& - operator+= (location& res, const location& end) - { - res.end = end.end; - return res; - } - - /// Join two locations. - inline location - operator+ (location res, const location& end) - { - return res += end; - } - - /// Add \a width columns to the end position, in place. - inline location& - operator+= (location& res, location::counter_type width) - { - res.columns (width); - return res; - } - - /// Add \a width columns to the end position. - inline location - operator+ (location res, location::counter_type width) - { - return res += width; - } - - /// Subtract \a width columns to the end position, in place. - inline location& - operator-= (location& res, location::counter_type width) - { - return res += -width; - } - - /// Subtract \a width columns to the end position. - inline location - operator- (location res, location::counter_type width) - { - return res -= width; - } - - /// Compare two location objects. - inline bool - operator== (const location& loc1, const location& loc2) - { - return loc1.begin == loc2.begin && loc1.end == loc2.end; - } - - /// Compare two location objects. - inline bool - operator!= (const location& loc1, const location& loc2) - { - return !(loc1 == loc2); - } - - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param loc a reference to the location to redirect - ** - ** Avoid duplicate information. - */ - template - std::basic_ostream& - operator<< (std::basic_ostream& ostr, const location& loc) - { - location::counter_type end_col - = 0 < loc.end.column ? loc.end.column - 1 : 0; - ostr << loc.begin; - if (loc.end.filename - && (!loc.begin.filename - || *loc.begin.filename != *loc.end.filename)) - ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; - else if (loc.begin.line < loc.end.line) - ostr << '-' << loc.end.line << '.' << end_col; - else if (loc.begin.column < end_col) - ostr << '-' << end_col; - return ostr; - } - -#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -} // VerifyTAPN -#line 333 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/location.hh" - -#endif // !YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED diff --git a/src/Core/QueryParser/Generated/parser.cpp b/src/Core/QueryParser/Generated/parser.cpp deleted file mode 100644 index 3c44c1b..0000000 --- a/src/Core/QueryParser/Generated/parser.cpp +++ /dev/null @@ -1,1412 +0,0 @@ -// A Bison parser, made by GNU Bison 3.5.1. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - -// Undocumented macros, especially those whose name start with YY_, -// are private implementation details. Do not rely on them. - - - - - -#include "parser.hpp" - - -// Unqualified %code blocks. -#line 38 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - - #include "../TAPNQueryParser.hpp" - -#line 49 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include // FIXME: INFRINGES ON USER NAME SPACE. -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -// Whether we are compiled with exception support. -#ifndef YY_EXCEPTIONS -# if defined __GNUC__ && !defined __EXCEPTIONS -# define YY_EXCEPTIONS 0 -# else -# define YY_EXCEPTIONS 1 -# endif -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -# ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (false) -# endif - - -// Enable debugging if requested. -#if YYDEBUG - -// A pseudo ostream that takes yydebug_ into account. -# define YYCDEBUG if (yydebug_) (*yycdebug_) - -# define YY_SYMBOL_PRINT(Title, Symbol) \ - do { \ - if (yydebug_) \ - { \ - *yycdebug_ << Title << ' '; \ - yy_print_ (*yycdebug_, Symbol); \ - *yycdebug_ << '\n'; \ - } \ - } while (false) - -# define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug_) \ - yy_reduce_print_ (Rule); \ - } while (false) - -# define YY_STACK_PRINT() \ - do { \ - if (yydebug_) \ - yystack_print_ (); \ - } while (false) - -#else // !YYDEBUG - -# define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) -# define YY_REDUCE_PRINT(Rule) static_cast (0) -# define YY_STACK_PRINT() static_cast (0) - -#endif // !YYDEBUG - -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yyla.clear ()) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus_) - -#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -namespace VerifyTAPN { -#line 141 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - - - /* Return YYSTR after stripping away unnecessary quotes and - backslashes, so that it's suitable for yyerror. The heuristic is - that double-quoting is unnecessary unless the string contains an - apostrophe, a comma, or backslash (other than backslash-backslash). - YYSTR is taken from yytname. */ - std::string - Parser::yytnamerr_ (const char *yystr) - { - if (*yystr == '"') - { - std::string yyr; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - yyr += *yyp; - break; - - case '"': - return yyr; - } - do_not_strip_quotes: ; - } - - return yystr; - } - - - /// Build a parser object. - Parser::Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg) -#if YYDEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - driver (driver_yyarg) - {} - - Parser::~Parser () - {} - - Parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------------. - | Symbol types. | - `---------------*/ - - // basic_symbol. -#if 201103L <= YY_CPLUSPLUS - template - Parser::basic_symbol::basic_symbol (basic_symbol&& that) - : Base (std::move (that)) - , value (std::move (that.value)) - , location (std::move (that.location)) - {} -#endif - - template - Parser::basic_symbol::basic_symbol (const basic_symbol& that) - : Base (that) - , value (that.value) - , location (that.location) - {} - - - /// Constructor for valueless symbols. - template - Parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_MOVE_REF (location_type) l) - : Base (t) - , value () - , location (l) - {} - - template - Parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v, YY_RVREF (location_type) l) - : Base (t) - , value (YY_MOVE (v)) - , location (YY_MOVE (l)) - {} - - template - bool - Parser::basic_symbol::empty () const YY_NOEXCEPT - { - return Base::type_get () == empty_symbol; - } - - template - void - Parser::basic_symbol::move (basic_symbol& s) - { - super_type::move (s); - value = YY_MOVE (s.value); - location = YY_MOVE (s.location); - } - - // by_type. - Parser::by_type::by_type () - : type (empty_symbol) - {} - -#if 201103L <= YY_CPLUSPLUS - Parser::by_type::by_type (by_type&& that) - : type (that.type) - { - that.clear (); - } -#endif - - Parser::by_type::by_type (const by_type& that) - : type (that.type) - {} - - Parser::by_type::by_type (token_type t) - : type (yytranslate_ (t)) - {} - - void - Parser::by_type::clear () - { - type = empty_symbol; - } - - void - Parser::by_type::move (by_type& that) - { - type = that.type; - that.clear (); - } - - int - Parser::by_type::type_get () const YY_NOEXCEPT - { - return type; - } - - - // by_state. - Parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - Parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - Parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - Parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - Parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - Parser::symbol_number_type - Parser::by_state::type_get () const YY_NOEXCEPT - { - if (state == empty_state) - return empty_symbol; - else - return yystos_[+state]; - } - - Parser::stack_symbol_type::stack_symbol_type () - {} - - Parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.value), YY_MOVE (that.location)) - { -#if 201103L <= YY_CPLUSPLUS - // that is emptied. - that.state = empty_state; -#endif - } - - Parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) - : super_type (s, YY_MOVE (that.value), YY_MOVE (that.location)) - { - // that is emptied. - that.type = empty_symbol; - } - -#if YY_CPLUSPLUS < 201103L - Parser::stack_symbol_type& - Parser::stack_symbol_type::operator= (const stack_symbol_type& that) - { - state = that.state; - value = that.value; - location = that.location; - return *this; - } - - Parser::stack_symbol_type& - Parser::stack_symbol_type::operator= (stack_symbol_type& that) - { - state = that.state; - value = that.value; - location = that.location; - // that is emptied. - that.state = empty_state; - return *this; - } -#endif - - template - void - Parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const - { - if (yymsg) - YY_SYMBOL_PRINT (yymsg, yysym); - - // User destructor. - switch (yysym.type_get ()) - { - case 3: // IDENTIFIER -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 385 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 4: // LESS -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 391 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 5: // LESSEQUAL -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 397 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 6: // EQUAL -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 403 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 7: // GREATEREQUAL -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 409 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 8: // GREATER -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 415 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 23: // query -#line 57 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.query); } -#line 421 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 24: // expression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 427 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 25: // arithmeticExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.arexpr); } -#line 433 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 26: // multiplyExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.arexpr); } -#line 439 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 27: // arithmeticParantheses -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.arexpr); } -#line 445 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 28: // parExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 451 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 29: // notExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 457 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 30: // orExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 463 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 31: // andExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 469 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 32: // boolExpression -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 475 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 33: // atomicProposition -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.expr); } -#line 481 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 34: // compareOp -#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { delete (yysym.value.string); } -#line 487 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - default: - break; - } - } - -#if YYDEBUG - template - void - Parser::yy_print_ (std::ostream& yyo, - const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YYUSE (yyoutput); - symbol_number_type yytype = yysym.type_get (); -#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408 - // Avoid a (spurious) G++ 4.8 warning about "array subscript is - // below array bounds". - if (yysym.empty ()) - std::abort (); -#endif - yyo << (yytype < yyntokens_ ? "token" : "nterm") - << ' ' << yytname_[yytype] << " (" - << yysym.location << ": "; - YYUSE (yytype); - yyo << ')'; - } -#endif - - void - Parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - Parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - Parser::yypop_ (int n) - { - yystack_.pop (n); - } - -#if YYDEBUG - std::ostream& - Parser::debug_stream () const - { - return *yycdebug_; - } - - void - Parser::set_debug_stream (std::ostream& o) - { - yycdebug_ = &o; - } - - - Parser::debug_level_type - Parser::debug_level () const - { - return yydebug_; - } - - void - Parser::set_debug_level (debug_level_type l) - { - yydebug_ = l; - } -#endif // YYDEBUG - - Parser::state_type - Parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - yyntokens_] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - yyntokens_]; - } - - bool - Parser::yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - bool - Parser::yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - - int - Parser::operator() () - { - return parse (); - } - - int - Parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - // User initialization code. -#line 21 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -{ - // Initialize the initial location. - yyla.location.begin.filename = yyla.location.end.filename = &driver.file; -} - -#line 632 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token: "; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - yyla.type = yytranslate_ (yylex (&yyla.value, &yyla.location, driver)); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.type_get (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ()) - { - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* If YYLEN is nonzero, implement the default value of the - action: '$$ = $1'. Otherwise, use the top of the stack. - - Otherwise, the following line sets YYLHS.VALUE to garbage. - This behavior is undocumented and Bison users should not rely - upon it. */ - if (yylen) - yylhs.value = yystack_[yylen - 1].value; - else - yylhs.value = yystack_[0].value; - - // Default location. - { - stack_type::slice range (yystack_, yylen); - YYLLOC_DEFAULT (yylhs.location, range, yylen); - yyerror_range[1].location = yylhs.location; - } - - // Perform the reduction. - YY_REDUCE_PRINT (yyn); -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - switch (yyn) - { - case 2: -#line 61 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EF, (yystack_[0].value.expr)); driver.SetAST((yylhs.value.query)); } -#line 759 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 3: -#line 62 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AG, (yystack_[0].value.expr)); driver.SetAST((yylhs.value.query)); } -#line 765 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 4: -#line 65 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[0].value.expr); } -#line 771 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 5: -#line 66 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[0].value.expr); } -#line 777 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 6: -#line 67 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[0].value.expr); } -#line 783 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 7: -#line 68 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[0].value.expr); } -#line 789 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 8: -#line 69 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[0].value.expr); } -#line 795 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 9: -#line 70 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[0].value.expr); } -#line 801 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 10: -#line 76 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = new VerifyTAPN::AST::PlusExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } -#line 807 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 11: -#line 77 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = new VerifyTAPN::AST::SubtractExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } -#line 813 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 12: -#line 78 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = new VerifyTAPN::AST::MinusExpression((yystack_[0].value.arexpr)); } -#line 819 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 13: -#line 79 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); } -#line 825 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 14: -#line 82 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = new VerifyTAPN::AST::MultiplyExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } -#line 831 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 15: -#line 83 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); } -#line 837 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 16: -#line 86 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = (yystack_[1].value.arexpr); } -#line 843 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 17: -#line 87 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.arexpr) = new VerifyTAPN::AST::NumberExpression((yystack_[0].value.number));} -#line 849 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 18: -#line 88 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { - int placeIndex = driver.net.GetPlaceIndex(*(yystack_[0].value.string)); - delete (yystack_[0].value.string); - if(placeIndex == -1) error(yystack_[0].location, "unknown place"); - (yylhs.value.arexpr) = new VerifyTAPN::AST::IdentifierExpression(placeIndex); - } -#line 860 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 19: -#line 96 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = (yystack_[1].value.expr); } -#line 866 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 20: -#line 97 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = new VerifyTAPN::AST::NotExpression((yystack_[0].value.expr)); } -#line 872 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 21: -#line 98 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = new VerifyTAPN::AST::OrExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); } -#line 878 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 22: -#line 99 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = new VerifyTAPN::AST::AndExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); } -#line 884 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 23: -#line 100 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(true); } -#line 890 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 24: -#line 101 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(false); } -#line 896 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 25: -#line 103 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.expr) = new VerifyTAPN::AST::AtomicProposition((yystack_[2].value.arexpr), (yystack_[1].value.string), (yystack_[0].value.arexpr)); } -#line 902 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 26: -#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.string) = (yystack_[0].value.string); } -#line 908 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 27: -#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.string) = (yystack_[0].value.string); } -#line 914 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 28: -#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.string) = (yystack_[0].value.string); } -#line 920 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 29: -#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.string) = (yystack_[0].value.string); } -#line 926 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - case 30: -#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - { (yylhs.value.string) = (yystack_[0].value.string); } -#line 932 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - break; - - -#line 936 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.type_get () == yyeof_) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - { - stack_symbol_type error_token; - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yy_error_token_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - Parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - // Generate an error message. - std::string - Parser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const - { - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - std::ptrdiff_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (!yyla.empty ()) - { - symbol_number_type yytoken = yyla.type_get (); - yyarg[yycount++] = yytname_[yytoken]; - - int yyn = yypact_[+yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yy_error_token_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } - } - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += yytnamerr_ (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const signed char Parser::yypact_ninf_ = -10; - - const signed char Parser::yytable_ninf_ = -1; - - const signed char - Parser::yypact_[] = - { - -2, 2, 2, 16, -10, -10, 2, -9, -10, -10, - 1, 13, 41, -4, -10, -10, -10, -10, -10, -10, - -10, 13, -10, 11, 31, 2, -10, 3, -4, 2, - 2, -10, -10, -10, -10, -10, 1, 1, 3, 1, - -10, -10, 39, 27, -10, -4, -4, 21, -10 - }; - - const signed char - Parser::yydefact_[] = - { - 0, 0, 0, 0, 18, 17, 0, 0, 23, 24, - 0, 2, 0, 13, 15, 4, 5, 6, 7, 9, - 8, 3, 1, 0, 0, 0, 20, 0, 12, 0, - 0, 26, 27, 28, 29, 30, 0, 0, 0, 0, - 19, 16, 0, 21, 22, 10, 11, 25, 14 - }; - - const signed char - Parser::yypgoto_[] = - { - -10, -10, 0, -6, -3, -8, 36, -10, -10, -10, - -10, -10, -10 - }; - - const signed char - Parser::yydefgoto_[] = - { - -1, 3, 23, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 38 - }; - - const signed char - Parser::yytable_[] = - { - 24, 11, 21, 25, 4, 4, 4, 28, 1, 2, - 5, 5, 5, 27, 6, 27, 22, 39, 7, 8, - 9, 42, 10, 10, 40, 29, 30, 29, 30, 43, - 44, 48, 47, 45, 46, 31, 32, 33, 34, 35, - 36, 37, 30, 26, 41, 31, 32, 33, 34, 35, - 36, 37, 41, 0, 0, 0, 0, 0, 36, 37, - 36, 37 - }; - - const signed char - Parser::yycheck_[] = - { - 6, 1, 2, 12, 3, 3, 3, 10, 10, 11, - 9, 9, 9, 12, 12, 12, 0, 21, 16, 17, - 18, 27, 20, 20, 13, 14, 15, 14, 15, 29, - 30, 39, 38, 36, 37, 4, 5, 6, 7, 8, - 19, 20, 15, 7, 13, 4, 5, 6, 7, 8, - 19, 20, 13, -1, -1, -1, -1, -1, 19, 20, - 19, 20 - }; - - const signed char - Parser::yystos_[] = - { - 0, 10, 11, 23, 3, 9, 12, 16, 17, 18, - 20, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 24, 0, 24, 25, 12, 28, 12, 26, 14, - 15, 4, 5, 6, 7, 8, 19, 20, 34, 21, - 13, 13, 25, 24, 24, 26, 26, 25, 27 - }; - - const signed char - Parser::yyr1_[] = - { - 0, 22, 23, 23, 24, 24, 24, 24, 24, 24, - 25, 25, 25, 25, 26, 26, 27, 27, 27, 28, - 29, 30, 31, 32, 32, 33, 34, 34, 34, 34, - 34 - }; - - const signed char - Parser::yyr2_[] = - { - 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, - 3, 3, 2, 1, 3, 1, 3, 1, 1, 3, - 2, 3, 3, 1, 1, 3, 1, 1, 1, 1, - 1 - }; - - - - // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - // First, the terminals, then, starting at \a yyntokens_, nonterminals. - const char* - const Parser::yytname_[] = - { - "END", "error", "$undefined", "IDENTIFIER", "LESS", "LESSEQUAL", - "EQUAL", "GREATEREQUAL", "GREATER", "NUMBER", "EF", "AG", "LPARAN", - "RPARAN", "OR", "AND", "NOT", "BOOL_TRUE", "BOOL_FALSE", "PLUS", "MINUS", - "MULTIPLY", "$accept", "query", "expression", "arithmeticExpression", - "multiplyExpression", "arithmeticParantheses", "parExpression", - "notExpression", "orExpression", "andExpression", "boolExpression", - "atomicProposition", "compareOp", YY_NULLPTR - }; - -#if YYDEBUG - const signed char - Parser::yyrline_[] = - { - 0, 61, 61, 62, 65, 66, 67, 68, 69, 70, - 76, 77, 78, 79, 82, 83, 86, 87, 88, 96, - 97, 98, 99, 100, 101, 103, 105, 105, 105, 105, - 105 - }; - - // Print the state stack on the debug stream. - void - Parser::yystack_print_ () - { - *yycdebug_ << "Stack now"; - for (stack_type::const_iterator - i = yystack_.begin (), - i_end = yystack_.end (); - i != i_end; ++i) - *yycdebug_ << ' ' << int (i->state); - *yycdebug_ << '\n'; - } - - // Report on the debug stream that the rule \a yyrule is going to be reduced. - void - Parser::yy_reduce_print_ (int yyrule) - { - int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - // Print the symbols being reduced, and their result. - *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):\n"; - // The symbols being reduced. - for (int yyi = 0; yyi < yynrhs; yyi++) - YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", - yystack_[(yynrhs) - (yyi + 1)]); - } -#endif // YYDEBUG - - Parser::token_number_type - Parser::yytranslate_ (int t) - { - // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to - // TOKEN-NUM as returned by yylex. - static - const token_number_type - translate_table[] = - { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21 - }; - const int user_token_number_max_ = 276; - - if (t <= 0) - return yyeof_; - else if (t <= user_token_number_max_) - return translate_table[t]; - else - return yy_undef_token_; - } - -#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -} // VerifyTAPN -#line 1402 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" - -#line 107 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - - -void -VerifyTAPN::Parser::error (const VerifyTAPN::Parser::location_type& l, - const std::string& m) -{ - driver.error (l, m); - exit(1); -} diff --git a/src/Core/QueryParser/Generated/parser.hpp b/src/Core/QueryParser/Generated/parser.hpp deleted file mode 100644 index 07acb36..0000000 --- a/src/Core/QueryParser/Generated/parser.hpp +++ /dev/null @@ -1,738 +0,0 @@ -// A Bison parser, made by GNU Bison 3.5.1. - -// Skeleton interface for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// As a special exception, you may create a larger work that contains -// part or all of the Bison parser skeleton and distribute that work -// under terms of your choice, so long as that work isn't itself a -// parser generator using the skeleton or a modified version thereof -// as a parser skeleton. Alternatively, if you modify or redistribute -// the parser skeleton itself, you may (at your option) remove this -// special exception, which will cause the skeleton and the resulting -// Bison output files to be licensed under the GNU General Public -// License without this special exception. - -// This special exception was added by the Free Software Foundation in -// version 2.2 of Bison. - - -/** - ** \file /home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp - ** Define the VerifyTAPN::parser class. - */ - -// C++ LALR(1) parser skeleton written by Akim Demaille. - -// Undocumented macros, especially those whose name start with YY_, -// are private implementation details. Do not rely on them. - -#ifndef YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED -# define YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED -// "%code requires" blocks. -#line 7 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - -# include -#include "../AST.hpp" -namespace VerifyTAPN{ - class TAPNQueryParser; -} - -#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" - - -# include // std::abort -# include -# include -# include -# include - -#if defined __cplusplus -# define YY_CPLUSPLUS __cplusplus -#else -# define YY_CPLUSPLUS 199711L -#endif - -// Support move semantics when possible. -#if 201103L <= YY_CPLUSPLUS -# define YY_MOVE std::move -# define YY_MOVE_OR_COPY move -# define YY_MOVE_REF(Type) Type&& -# define YY_RVREF(Type) Type&& -# define YY_COPY(Type) Type -#else -# define YY_MOVE -# define YY_MOVE_OR_COPY copy -# define YY_MOVE_REF(Type) Type& -# define YY_RVREF(Type) const Type& -# define YY_COPY(Type) const Type& -#endif - -// Support noexcept when possible. -#if 201103L <= YY_CPLUSPLUS -# define YY_NOEXCEPT noexcept -# define YY_NOTHROW -#else -# define YY_NOEXCEPT -# define YY_NOTHROW throw () -#endif - -// Support constexpr when possible. -#if 201703 <= YY_CPLUSPLUS -# define YY_CONSTEXPR constexpr -#else -# define YY_CONSTEXPR -#endif -# include "location.hh" - - -#ifndef YY_ATTRIBUTE_PURE -# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define YY_ATTRIBUTE_PURE -# endif -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -# else -# define YY_ATTRIBUTE_UNUSED -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ -# define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") -# define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") -#endif -#ifndef YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_END -#endif - -# ifndef YY_CAST -# ifdef __cplusplus -# define YY_CAST(Type, Val) static_cast (Val) -# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) -# else -# define YY_CAST(Type, Val) ((Type) (Val)) -# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) -# endif -# endif -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -namespace VerifyTAPN { -#line 186 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" - - - - - /// A Bison parser. - class Parser - { - public: -#ifndef YYSTYPE - /// Symbol semantic values. - union semantic_type - { -#line 30 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" - - int number; - std::string* string; - VerifyTAPN::AST::Expression* expr; - VerifyTAPN::AST::ArithmeticExpression* arexpr; - VerifyTAPN::AST::Query* query; - -#line 207 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" - - }; -#else - typedef YYSTYPE semantic_type; -#endif - /// Symbol locations. - typedef location location_type; - - /// Syntax errors thrown from user actions. - struct syntax_error : std::runtime_error - { - syntax_error (const location_type& l, const std::string& m) - : std::runtime_error (m) - , location (l) - {} - - syntax_error (const syntax_error& s) - : std::runtime_error (s.what ()) - , location (s.location) - {} - - ~syntax_error () YY_NOEXCEPT YY_NOTHROW; - - location_type location; - }; - - /// Tokens. - struct token - { - enum yytokentype - { - END = 0, - IDENTIFIER = 258, - LESS = 259, - LESSEQUAL = 260, - EQUAL = 261, - GREATEREQUAL = 262, - GREATER = 263, - NUMBER = 264, - EF = 265, - AG = 266, - LPARAN = 267, - RPARAN = 268, - OR = 269, - AND = 270, - NOT = 271, - BOOL_TRUE = 272, - BOOL_FALSE = 273, - PLUS = 274, - MINUS = 275, - MULTIPLY = 276 - }; - }; - - /// (External) token type, as returned by yylex. - typedef token::yytokentype token_type; - - /// Symbol type: an internal symbol number. - typedef int symbol_number_type; - - /// The symbol type number to denote an empty symbol. - enum { empty_symbol = -2 }; - - /// Internal symbol number for tokens (subsumed by symbol_number_type). - typedef signed char token_number_type; - - /// A complete symbol. - /// - /// Expects its Base type to provide access to the symbol type - /// via type_get (). - /// - /// Provide access to semantic value and location. - template - struct basic_symbol : Base - { - /// Alias to Base. - typedef Base super_type; - - /// Default constructor. - basic_symbol () - : value () - , location () - {} - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - basic_symbol (basic_symbol&& that); -#endif - - /// Copy constructor. - basic_symbol (const basic_symbol& that); - /// Constructor for valueless symbols. - basic_symbol (typename Base::kind_type t, - YY_MOVE_REF (location_type) l); - - /// Constructor for symbols with semantic value. - basic_symbol (typename Base::kind_type t, - YY_RVREF (semantic_type) v, - YY_RVREF (location_type) l); - - /// Destroy the symbol. - ~basic_symbol () - { - clear (); - } - - /// Destroy contents, and record that is empty. - void clear () - { - Base::clear (); - } - - /// Whether empty. - bool empty () const YY_NOEXCEPT; - - /// Destructive move, \a s is emptied into this. - void move (basic_symbol& s); - - /// The semantic value. - semantic_type value; - - /// The location. - location_type location; - - private: -#if YY_CPLUSPLUS < 201103L - /// Assignment operator. - basic_symbol& operator= (const basic_symbol& that); -#endif - }; - - /// Type access provider for token (enum) based symbols. - struct by_type - { - /// Default constructor. - by_type (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_type (by_type&& that); -#endif - - /// Copy constructor. - by_type (const by_type& that); - - /// The symbol type as needed by the constructor. - typedef token_type kind_type; - - /// Constructor from (external) token numbers. - by_type (kind_type t); - - /// Record that this symbol is empty. - void clear (); - - /// Steal the symbol type from \a that. - void move (by_type& that); - - /// The (internal) type number (corresponding to \a type). - /// \a empty when empty. - symbol_number_type type_get () const YY_NOEXCEPT; - - /// The symbol type. - /// \a empty_symbol when empty. - /// An int, not token_number_type, to be able to store empty_symbol. - int type; - }; - - /// "External" symbols: returned by the scanner. - struct symbol_type : basic_symbol - {}; - - /// Build a parser object. - Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg); - virtual ~Parser (); - - /// Parse. An alias for parse (). - /// \returns 0 iff parsing succeeded. - int operator() (); - - /// Parse. - /// \returns 0 iff parsing succeeded. - virtual int parse (); - -#if YYDEBUG - /// The current debugging stream. - std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; - /// Set the current debugging stream. - void set_debug_stream (std::ostream &); - - /// Type for debugging levels. - typedef int debug_level_type; - /// The current debugging level. - debug_level_type debug_level () const YY_ATTRIBUTE_PURE; - /// Set the current debugging level. - void set_debug_level (debug_level_type l); -#endif - - /// Report a syntax error. - /// \param loc where the syntax error is found. - /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); - - /// Report a syntax error. - void error (const syntax_error& err); - - - - private: - /// This class is not copyable. - Parser (const Parser&); - Parser& operator= (const Parser&); - - /// Stored state numbers (used for stacks). - typedef signed char state_type; - - /// Generate an error message. - /// \param yystate the state where the error occurred. - /// \param yyla the lookahead token. - virtual std::string yysyntax_error_ (state_type yystate, - const symbol_type& yyla) const; - - /// Compute post-reduction state. - /// \param yystate the current state - /// \param yysym the nonterminal to push on the stack - static state_type yy_lr_goto_state_ (state_type yystate, int yysym); - - /// Whether the given \c yypact_ value indicates a defaulted state. - /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); - - /// Whether the given \c yytable_ value indicates a syntax error. - /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); - - static const signed char yypact_ninf_; - static const signed char yytable_ninf_; - - /// Convert a scanner token number \a t to a symbol number. - /// In theory \a t should be a token_type, but character literals - /// are valid, yet not members of the token_type enum. - static token_number_type yytranslate_ (int t); - - // Tables. - // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - // STATE-NUM. - static const signed char yypact_[]; - - // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - // Performed when YYTABLE does not specify something else to do. Zero - // means the default is an error. - static const signed char yydefact_[]; - - // YYPGOTO[NTERM-NUM]. - static const signed char yypgoto_[]; - - // YYDEFGOTO[NTERM-NUM]. - static const signed char yydefgoto_[]; - - // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - // positive, shift that token. If negative, reduce the rule whose - // number is the opposite. If YYTABLE_NINF, syntax error. - static const signed char yytable_[]; - - static const signed char yycheck_[]; - - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. - static const signed char yystos_[]; - - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. - static const signed char yyr1_[]; - - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. - static const signed char yyr2_[]; - - - /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n); - - - /// For a symbol, its name in clear. - static const char* const yytname_[]; -#if YYDEBUG - // YYRLINE[YYN] -- Source line where rule number YYN was defined. - static const signed char yyrline_[]; - /// Report on the debug stream that the rule \a r is going to be reduced. - virtual void yy_reduce_print_ (int r); - /// Print the state stack on the debug stream. - virtual void yystack_print_ (); - - /// Debugging level. - int yydebug_; - /// Debug stream. - std::ostream* yycdebug_; - - /// \brief Display a symbol type, value and location. - /// \param yyo The output stream. - /// \param yysym The symbol. - template - void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; -#endif - - /// \brief Reclaim the memory associated to a symbol. - /// \param yymsg Why this token is reclaimed. - /// If null, print nothing. - /// \param yysym The symbol. - template - void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; - - private: - /// Type access provider for state based symbols. - struct by_state - { - /// Default constructor. - by_state () YY_NOEXCEPT; - - /// The symbol type as needed by the constructor. - typedef state_type kind_type; - - /// Constructor. - by_state (kind_type s) YY_NOEXCEPT; - - /// Copy constructor. - by_state (const by_state& that) YY_NOEXCEPT; - - /// Record that this symbol is empty. - void clear () YY_NOEXCEPT; - - /// Steal the symbol type from \a that. - void move (by_state& that); - - /// The (internal) type number (corresponding to \a state). - /// \a empty_symbol when empty. - symbol_number_type type_get () const YY_NOEXCEPT; - - /// The state number used to denote an empty symbol. - /// We use the initial state, as it does not have a value. - enum { empty_state = 0 }; - - /// The state. - /// \a empty when empty. - state_type state; - }; - - /// "Internal" symbol: element of the stack. - struct stack_symbol_type : basic_symbol - { - /// Superclass. - typedef basic_symbol super_type; - /// Construct an empty symbol. - stack_symbol_type (); - /// Move or copy construction. - stack_symbol_type (YY_RVREF (stack_symbol_type) that); - /// Steal the contents from \a sym to build this. - stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); -#if YY_CPLUSPLUS < 201103L - /// Assignment, needed by push_back by some old implementations. - /// Moves the contents of that. - stack_symbol_type& operator= (stack_symbol_type& that); - - /// Assignment, needed by push_back by other implementations. - /// Needed by some other old implementations. - stack_symbol_type& operator= (const stack_symbol_type& that); -#endif - }; - - /// A stack with random access from its top. - template > - class stack - { - public: - // Hide our reversed order. - typedef typename S::reverse_iterator iterator; - typedef typename S::const_reverse_iterator const_iterator; - typedef typename S::size_type size_type; - typedef typename std::ptrdiff_t index_type; - - stack (size_type n = 200) - : seq_ (n) - {} - - /// Random access. - /// - /// Index 0 returns the topmost element. - const T& - operator[] (index_type i) const - { - return seq_[size_type (size () - 1 - i)]; - } - - /// Random access. - /// - /// Index 0 returns the topmost element. - T& - operator[] (index_type i) - { - return seq_[size_type (size () - 1 - i)]; - } - - /// Steal the contents of \a t. - /// - /// Close to move-semantics. - void - push (YY_MOVE_REF (T) t) - { - seq_.push_back (T ()); - operator[] (0).move (t); - } - - /// Pop elements from the stack. - void - pop (std::ptrdiff_t n = 1) YY_NOEXCEPT - { - for (; 0 < n; --n) - seq_.pop_back (); - } - - /// Pop all elements from the stack. - void - clear () YY_NOEXCEPT - { - seq_.clear (); - } - - /// Number of elements on the stack. - index_type - size () const YY_NOEXCEPT - { - return index_type (seq_.size ()); - } - - std::ptrdiff_t - ssize () const YY_NOEXCEPT - { - return std::ptrdiff_t (size ()); - } - - /// Iterator on top of the stack (going downwards). - const_iterator - begin () const YY_NOEXCEPT - { - return seq_.rbegin (); - } - - /// Bottom of the stack. - const_iterator - end () const YY_NOEXCEPT - { - return seq_.rend (); - } - - /// Present a slice of the top of a stack. - class slice - { - public: - slice (const stack& stack, index_type range) - : stack_ (stack) - , range_ (range) - {} - - const T& - operator[] (index_type i) const - { - return stack_[range_ - i]; - } - - private: - const stack& stack_; - index_type range_; - }; - - private: - stack (const stack&); - stack& operator= (const stack&); - /// The wrapped container. - S seq_; - }; - - - /// Stack type. - typedef stack stack_type; - - /// The stack. - stack_type yystack_; - - /// Push a new state on the stack. - /// \param m a debug message to display - /// if null, no trace is output. - /// \param sym the symbol - /// \warning the contents of \a s.value is stolen. - void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); - - /// Push a new look ahead token on the state on the stack. - /// \param m a debug message to display - /// if null, no trace is output. - /// \param s the state - /// \param sym the symbol (for its value and location). - /// \warning the contents of \a sym.value is stolen. - void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); - - /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); - - /// Some specific tokens. - static const token_number_type yy_error_token_ = 1; - static const token_number_type yy_undef_token_ = 2; - - /// Constants. - enum - { - yyeof_ = 0, - yylast_ = 61, ///< Last index in yytable_. - yynnts_ = 13, ///< Number of nonterminal symbols. - yyfinal_ = 22, ///< Termination state number. - yyntokens_ = 22 ///< Number of tokens. - }; - - - // User arguments. - VerifyTAPN::TAPNQueryParser& driver; - }; - - -#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" -} // VerifyTAPN -#line 733 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" - - - - - -#endif // !YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED diff --git a/src/Core/QueryParser/Generated/position.hh b/src/Core/QueryParser/Generated/position.hh deleted file mode 100644 index bf34c1c..0000000 --- a/src/Core/QueryParser/Generated/position.hh +++ /dev/null @@ -1,11 +0,0 @@ -// A Bison parser, made by GNU Bison 3.5.1. - -// Starting with Bison 3.2, this file is useless: the structure it -// used to define is now defined in "location.hh". -// -// To get rid of this file: -// 1. add '%require "3.2"' (or newer) to your grammar file -// 2. remove references to this file from your build system -// 3. if you used to include it, include "location.hh" instead. - -#include "location.hh" diff --git a/src/Core/QueryParser/Generated/stack.hh b/src/Core/QueryParser/Generated/stack.hh deleted file mode 100644 index c15d84c..0000000 --- a/src/Core/QueryParser/Generated/stack.hh +++ /dev/null @@ -1,8 +0,0 @@ -// A Bison parser, made by GNU Bison 3.5.1. - -// Starting with Bison 3.2, this file is useless: the structure it -// used to define is now defined with the parser itself. -// -// To get rid of this file: -// 1. add '%require "3.2"' (or newer) to your grammar file -// 2. remove references to this file from your build system. From cffd761d215f4d58d4fc164076cc31b2d11ba31f Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Mon, 22 Nov 2021 11:19:58 +0100 Subject: [PATCH 2/6] using vectors instead of naked/ublas arrays/matrix --- .../SuccessorGenerator.cpp | 38 ++++------------ .../SuccessorGenerator.hpp | 45 +++++++++---------- 2 files changed, 28 insertions(+), 55 deletions(-) diff --git a/src/ReachabilityChecker/SuccessorGenerator.cpp b/src/ReachabilityChecker/SuccessorGenerator.cpp index ba361e0..39a0436 100644 --- a/src/ReachabilityChecker/SuccessorGenerator.cpp +++ b/src/ReachabilityChecker/SuccessorGenerator.cpp @@ -2,6 +2,7 @@ #include "../Core/TAPN/TimedInputArc.hpp" #include "../Core/TAPN/Pairing.hpp" #include "../Core/SymbolicMarking/SymbolicMarking.hpp" + #include #include @@ -36,7 +37,7 @@ namespace VerifyTAPN { assert(nTokensFromCurrInputPlace <= static_cast(options.GetKBound())); arcsArray[currInputArcIdx] = arcsArray[currInputArcIdx] + 1; - tokenIndices->insert_element(currInputArcIdx,nTokensFromCurrInputPlace, i); + tokenIndices[toIndex(currInputArcIdx, nTokensFromCurrInputPlace)] = i; nTokensFromCurrInputPlace++; } } @@ -103,7 +104,7 @@ namespace VerifyTAPN { // Generate next permutation of input tokens int j = presetSize - 1; - if (j<0) { break; } + if (j<0) { break; } while(true) { @@ -171,7 +172,7 @@ namespace VerifyTAPN { boost::shared_ptr ta = transition.GetTransportArcs()[i].lock(); const TAPN::TimeInterval& ti = ta->Interval(); - int tokenIndex = tokenIndices->at_element(currentTransitionIndex+i, currentPermutationindices[i]); + int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+i, currentPermutationindices[i])]; int outputPlaceIndex = tapn.GetPlaceIndex(ta->Destination()); // constrain dbm with the guard of the input arc @@ -201,7 +202,7 @@ namespace VerifyTAPN { for(std::list::const_iterator opIter = outputPlaces.begin(); opIter != outputPlaces.end(); ++opIter) { // change placement - int tokenIndex = tokenIndices->at_element(currentTransitionIndex+offset+i, currentPermutationindices[offset+i]); + int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+offset+i, currentPermutationindices[offset+i])]; int outputPlaceIndex = *opIter; // constrain dbm with the guard of the input arc @@ -222,7 +223,7 @@ namespace VerifyTAPN { // reset clocks of moved tokens for (unsigned int i = transition.NumberOfTransportArcs(); i < presetSize; ++i) { - int tokenIndex = tokenIndices->at_element(currentTransitionIndex+i, currentPermutationindices[i]); + int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+i, currentPermutationindices[i])]; next->Reset(tokenIndex); } @@ -278,7 +279,7 @@ namespace VerifyTAPN { // handle transport arcs for(unsigned int i = 0; i < transition.NumberOfTransportArcs(); i++) { - int tokenIndex = tokenIndices->at_element(currentTransitionIndex+i, currentPermutationindices[i]); + int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+i, currentPermutationindices[i])]; boost::shared_ptr ia = transition.GetTransportArcs()[i].lock(); const TAPN::TimeInterval& ti = ia->Interval(); int indexAfterFiring = tokenIndex; @@ -297,7 +298,7 @@ namespace VerifyTAPN { // handle normal arcs for(unsigned int i = 0; i < transition.NumberOfInputArcs(); ++i) { - int tokenIndex = tokenIndices->at_element(currentTransitionIndex+offset+i, currentPermutationindices[offset+i]); + int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+offset+i, currentPermutationindices[offset+i])]; boost::shared_ptr ia = preset[i].lock(); const TAPN::TimeInterval& ti = ia->Interval(); int indexAfterFiring = tokenIndex; @@ -389,29 +390,6 @@ namespace VerifyTAPN { // mapping.swap(inverted); // } - - void SuccessorGenerator::Print(std::ostream& out) const - { - out << "\nArcs Array:\n"; - out << "------------------\n"; - - for(unsigned int i = 0; i < nInputArcs; i++) - { - out << i << ": " << arcsArray[i] << "\n"; - } - - out << "\nTransitions Array:\n"; - out << "------------------\n"; - for(int j =0;j< numberOfTransitions;j++){ - out << j << ": " << transitionStatistics[j] << "\n"; - } - - out << "\n\nToken Indices:\n"; - out << "----------------------\n"; - - out << *tokenIndices << "\n"; - } - void SuccessorGenerator::PrintTransitionStatistics(std::ostream& out) const { out << std::endl << "TRANSITION STATISTICS"; for (int i=0;i #include -#include -#include namespace VerifyTAPN { class SymbolicMarking; @@ -17,29 +15,25 @@ namespace VerifyTAPN { class SuccessorGenerator { public: SuccessorGenerator(const TAPN::TimedArcPetriNet & tapn, const MarkingFactory & factory, const VerificationOptions & options, unsigned int tokensInInitialMarking) - :tapn(tapn), factory(factory), arcsArray(), nInputArcs(tapn.GetNumberOfConsumingArcs()), transitionStatistics(), numberOfTransitions(tapn.GetNumberOfTransitions()), options(options), tokenIndices(), maxUsedTokens(tokensInInitialMarking) + :tapn(tapn), factory(factory), arcsArray(tapn.GetNumberOfConsumingArcs()), + nInputArcs(tapn.GetNumberOfConsumingArcs()), + transitionStatistics(tapn.GetNumberOfTransitions()), + numberOfTransitions(tapn.GetNumberOfTransitions()), + options(options), + tokenIndices(nInputArcs * options.GetKBound()), + maxUsedTokens(tokensInInitialMarking) { - arcsArray = new unsigned [nInputArcs]; - transitionStatistics = new unsigned [numberOfTransitions]; - tokenIndices = new boost::numeric::ublas::matrix(nInputArcs, options.GetKBound()); ClearTransitionsArray(); } ; virtual ~SuccessorGenerator() - { - delete [] arcsArray; - delete tokenIndices; - delete [] transitionStatistics; - } + {} ; public: void GenerateDiscreteTransitionsSuccessors(const SymbolicMarking & marking, std::vector & succ); - public: - void Print(std::ostream & out) const; void PrintTransitionStatistics(std::ostream & out) const; - public: inline void ClearAll() { ClearArcsArray(); @@ -48,16 +42,16 @@ namespace VerifyTAPN { inline void ClearArcsArray() { - memset(arcsArray, 0, nInputArcs * sizeof (arcsArray[0])); + std::fill(arcsArray.begin(), arcsArray.end(), 0); } inline void ClearTransitionsArray() { - memset(transitionStatistics, 0, numberOfTransitions * sizeof (transitionStatistics[0])); + std::fill(transitionStatistics.begin(), transitionStatistics.end(), 0); } inline void ClearTokenIndices() { - tokenIndices->clear(); + std::fill(tokenIndices.begin(), tokenIndices.end(), 0); } unsigned int MaxUsedTokens() const @@ -74,22 +68,23 @@ namespace VerifyTAPN { void MakeIdentity(IndirectionTable& mapping, unsigned int size) const; void UpdateTraceMapping(IndirectionTable& mapping, unsigned int tokenToRemove) const; + uint64_t toIndex(int currInputArcIdx, int nTokensFromCurrInputPlace) { + return currInputArcIdx*options.GetKBound() + nTokensFromCurrInputPlace; + } + int getIndicy(int currInputArcIdx, uint32_t nTokensFromCurrInputPlace) { + return tokenIndices[toIndex(currInputArcIdx, nTokensFromCurrInputPlace)]; + } private: const TAPN::TimedArcPetriNet& tapn; const MarkingFactory& factory; - unsigned int* arcsArray; + std::vector arcsArray; unsigned int nInputArcs; - unsigned int* transitionStatistics; + std::vector transitionStatistics; const int numberOfTransitions; const VerificationOptions& options; - boost::numeric::ublas::matrix* tokenIndices; + std::vector tokenIndices; unsigned int maxUsedTokens; }; - inline std::ostream& operator<<(std::ostream& out, const VerifyTAPN::SuccessorGenerator& succGen) - { - succGen.Print( out ); - return out; - } } #endif /* SUCCESSORGENERATOR_HPP_ */ From 799ef3ac837747792a5a8d46ec0a6f4ed6da9879 Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Mon, 22 Nov 2021 11:29:40 +0100 Subject: [PATCH 3/6] Revert "removed generated files" This reverts commit 164ed9a8cdb327408559e704ea43fb542e6797f1. --- src/Core/QueryParser/Generated/lexer.cpp | 1890 ++++++++++++++++++++ src/Core/QueryParser/Generated/location.hh | 334 ++++ src/Core/QueryParser/Generated/parser.cpp | 1412 +++++++++++++++ src/Core/QueryParser/Generated/parser.hpp | 738 ++++++++ src/Core/QueryParser/Generated/position.hh | 11 + src/Core/QueryParser/Generated/stack.hh | 8 + 6 files changed, 4393 insertions(+) create mode 100644 src/Core/QueryParser/Generated/lexer.cpp create mode 100644 src/Core/QueryParser/Generated/location.hh create mode 100644 src/Core/QueryParser/Generated/parser.cpp create mode 100644 src/Core/QueryParser/Generated/parser.hpp create mode 100644 src/Core/QueryParser/Generated/position.hh create mode 100644 src/Core/QueryParser/Generated/stack.hh diff --git a/src/Core/QueryParser/Generated/lexer.cpp b/src/Core/QueryParser/Generated/lexer.cpp new file mode 100644 index 0000000..2542603 --- /dev/null +++ b/src/Core/QueryParser/Generated/lexer.cpp @@ -0,0 +1,1890 @@ +#line 2 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" + +#line 4 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" + +#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 YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* 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. + */ +#define BEGIN (yy_start) = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#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; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern int yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + 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 + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + 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. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ + +/* 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". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = NULL; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); + +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); + +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) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define yywrap() (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +FILE *yyin = NULL, *yyout = NULL; + +typedef int yy_state_type; + +extern int yylineno; +int yylineno = 1; + +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; +#define YY_NUM_RULES 23 +#define YY_END_OF_BUFFER 24 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[51] = + { 0, + 0, 0, 24, 23, 1, 2, 10, 23, 17, 18, + 21, 19, 20, 3, 11, 13, 16, 22, 22, 22, + 22, 22, 22, 23, 22, 22, 1, 2, 7, 3, + 12, 14, 15, 22, 22, 22, 22, 6, 22, 6, + 5, 4, 7, 22, 10, 22, 22, 8, 9, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 1, 1, 1, 1, 5, 1, 6, + 7, 8, 9, 1, 10, 1, 1, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 1, 1, 12, + 13, 14, 1, 1, 15, 16, 16, 16, 17, 18, + 19, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 1, 1, 1, 1, 16, 1, 20, 16, 16, 21, + + 22, 23, 16, 16, 16, 16, 16, 24, 16, 25, + 26, 16, 16, 27, 28, 29, 30, 16, 16, 16, + 16, 16, 1, 31, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[32] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1 + } ; + +static const flex_int16_t yy_base[52] = + { 0, + 0, 17, 60, 61, 57, 55, 61, 52, 61, 61, + 61, 61, 61, 45, 42, 41, 40, 0, 27, 31, + 24, 22, 21, 16, 27, 27, 42, 40, 61, 31, + 61, 61, 61, 0, 20, 16, 10, 0, 8, 61, + 0, 0, 0, 9, 0, 14, 13, 0, 0, 61, + 31 + } ; + +static const flex_int16_t yy_def[52] = + { 0, + 50, 1, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 51, 51, 51, + 51, 51, 51, 50, 51, 51, 50, 50, 50, 50, + 50, 50, 50, 51, 51, 51, 51, 51, 51, 50, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, + 50 + } ; + +static const flex_int16_t yy_nxt[93] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 18, 18, 18, 18, 19, + 18, 18, 20, 18, 21, 22, 18, 18, 23, 18, + 24, 25, 34, 26, 49, 48, 47, 46, 45, 44, + 43, 30, 28, 27, 42, 41, 40, 39, 38, 37, + 36, 35, 33, 32, 31, 30, 29, 28, 27, 50, + 3, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50 + + } ; + +static const flex_int16_t yy_chk[93] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 51, 2, 47, 46, 44, 39, 37, 36, + 35, 30, 28, 27, 26, 25, 24, 23, 22, 21, + 20, 19, 17, 16, 15, 14, 8, 6, 5, 3, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50 + + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +#line 2 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +# include +# include "../TAPNQueryParser.hpp" +# include "parser.hpp" + +/* Work around an incompatibility in flex (at least versions + 2.5.31 through 2.5.33): it generates code that does + not conform to C89. See Debian bug 333231 + . */ +# undef yywrap +# define yywrap() 1 + +/* By default yylex returns int, we use token_type. + Unfortunately yyterminate by default returns 0, which is + not of token_type. */ +#define yyterminate() return token::END +#line 498 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" +#line 26 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +# define YY_USER_ACTION yylloc->columns (yyleng); +#line 501 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" +#line 502 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" + +#define INITIAL 0 + +#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. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals ( void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( void ); + +int yyget_debug ( void ); + +void yyset_debug ( int debug_flag ); + +YY_EXTRA_TYPE yyget_extra ( void ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in ( void ); + +void yyset_in ( FILE * _in_str ); + +FILE *yyget_out ( void ); + +void yyset_out ( FILE * _out_str ); + + int yyget_leng ( void ); + +char *yyget_text ( void ); + +int yyget_lineno ( void ); + +void yyset_lineno ( int _line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( void ); +#else +extern int yywrap ( void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * ); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( void ); +#else +static int input ( void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#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. + */ +#ifndef yyterminate +#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) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#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 \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { +#line 28 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" + + +#line 31 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" + yylloc->step (); + +#line 726 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 51 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 50 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 33 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylloc->step (); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 34 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylloc->lines (yyleng); yylloc->step (); } + YY_BREAK + + typedef VerifyTAPN::Parser::token token; + +case 3: +YY_RULE_SETUP +#line 40 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->number = atoi(yytext); return token::NUMBER; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 41 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::EF; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 42 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::AG; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 43 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::OR; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 44 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::AND; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 45 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::BOOL_TRUE; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 46 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::BOOL_FALSE; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 47 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ return token::NOT; } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 48 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::LESS; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 49 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::LESSEQUAL; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 50 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::EQUAL; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 51 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::EQUAL; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 52 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::GREATEREQUAL; } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 53 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::GREATER; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 54 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{return token::LPARAN;} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{return token::RPARAN;} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{return token::PLUS;} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 57 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{return token::MINUS;} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 58 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{return token::MULTIPLY;} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 60 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +{ yylval->string = new std::string(yytext); return token::IDENTIFIER; } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 62 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" +ECHO; + YY_BREAK +#line 899 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/lexer.cpp" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + 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)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 51 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 51 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 50); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf ); + + 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. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + 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; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr ) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg ) +{ + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param _line_number line number + * + */ +void yyset_lineno (int _line_number ) +{ + + yylineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str ) +{ + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str ) +{ + yyout = _out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int _bdebug ) +{ + yy_flex_debug = _bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n ) +{ + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 62 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/flex.ll" + +namespace VerifyTAPN +{ + void TAPNQueryParser::scan_begin () + { + if (!(yyin = fopen (file.c_str (), "r"))) + { + error (std::string ("cannot open ") + file); + std::cout << errno; + exit (1); + } + } + + void TAPNQueryParser::scan_end () + { + fclose (yyin); + } +} + + diff --git a/src/Core/QueryParser/Generated/location.hh b/src/Core/QueryParser/Generated/location.hh new file mode 100644 index 0000000..712b027 --- /dev/null +++ b/src/Core/QueryParser/Generated/location.hh @@ -0,0 +1,334 @@ +// A Bison parser, made by GNU Bison 3.5.1. + +// Locations for Bison parsers in C++ + +// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +/** + ** \file /home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/location.hh + ** Define the VerifyTAPN::location class. + */ + +#ifndef YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED +# define YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED + +# include +# include + +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +namespace VerifyTAPN { +#line 59 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/location.hh" + + /// A point in a source file. + class position + { + public: + /// Type for line and column numbers. + typedef int counter_type; + + /// Construct a position. + explicit position (std::string* f = YY_NULLPTR, + counter_type l = 1, + counter_type c = 1) + : filename (f) + , line (l) + , column (c) + {} + + + /// Initialization. + void initialize (std::string* fn = YY_NULLPTR, + counter_type l = 1, + counter_type c = 1) + { + filename = fn; + line = l; + column = c; + } + + /** \name Line and Column related manipulators + ** \{ */ + /// (line related) Advance to the COUNT next lines. + void lines (counter_type count = 1) + { + if (count) + { + column = 1; + line = add_ (line, count, 1); + } + } + + /// (column related) Advance to the COUNT next columns. + void columns (counter_type count = 1) + { + column = add_ (column, count, 1); + } + /** \} */ + + /// File name to which this position refers. + std::string* filename; + /// Current line number. + counter_type line; + /// Current column number. + counter_type column; + + private: + /// Compute max (min, lhs+rhs). + static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min) + { + return lhs + rhs < min ? min : lhs + rhs; + } + }; + + /// Add \a width columns, in place. + inline position& + operator+= (position& res, position::counter_type width) + { + res.columns (width); + return res; + } + + /// Add \a width columns. + inline position + operator+ (position res, position::counter_type width) + { + return res += width; + } + + /// Subtract \a width columns, in place. + inline position& + operator-= (position& res, position::counter_type width) + { + return res += -width; + } + + /// Subtract \a width columns. + inline position + operator- (position res, position::counter_type width) + { + return res -= width; + } + + /// Compare two position objects. + inline bool + operator== (const position& pos1, const position& pos2) + { + return (pos1.line == pos2.line + && pos1.column == pos2.column + && (pos1.filename == pos2.filename + || (pos1.filename && pos2.filename + && *pos1.filename == *pos2.filename))); + } + + /// Compare two position objects. + inline bool + operator!= (const position& pos1, const position& pos2) + { + return !(pos1 == pos2); + } + + /** \brief Intercept output stream redirection. + ** \param ostr the destination output stream + ** \param pos a reference to the position to redirect + */ + template + std::basic_ostream& + operator<< (std::basic_ostream& ostr, const position& pos) + { + if (pos.filename) + ostr << *pos.filename << ':'; + return ostr << pos.line << '.' << pos.column; + } + + /// Two points in a source file. + class location + { + public: + /// Type for line and column numbers. + typedef position::counter_type counter_type; + + /// Construct a location from \a b to \a e. + location (const position& b, const position& e) + : begin (b) + , end (e) + {} + + /// Construct a 0-width location in \a p. + explicit location (const position& p = position ()) + : begin (p) + , end (p) + {} + + /// Construct a 0-width location in \a f, \a l, \a c. + explicit location (std::string* f, + counter_type l = 1, + counter_type c = 1) + : begin (f, l, c) + , end (f, l, c) + {} + + + /// Initialization. + void initialize (std::string* f = YY_NULLPTR, + counter_type l = 1, + counter_type c = 1) + { + begin.initialize (f, l, c); + end = begin; + } + + /** \name Line and Column related manipulators + ** \{ */ + public: + /// Reset initial location to final location. + void step () + { + begin = end; + } + + /// Extend the current location to the COUNT next columns. + void columns (counter_type count = 1) + { + end += count; + } + + /// Extend the current location to the COUNT next lines. + void lines (counter_type count = 1) + { + end.lines (count); + } + /** \} */ + + + public: + /// Beginning of the located region. + position begin; + /// End of the located region. + position end; + }; + + /// Join two locations, in place. + inline location& + operator+= (location& res, const location& end) + { + res.end = end.end; + return res; + } + + /// Join two locations. + inline location + operator+ (location res, const location& end) + { + return res += end; + } + + /// Add \a width columns to the end position, in place. + inline location& + operator+= (location& res, location::counter_type width) + { + res.columns (width); + return res; + } + + /// Add \a width columns to the end position. + inline location + operator+ (location res, location::counter_type width) + { + return res += width; + } + + /// Subtract \a width columns to the end position, in place. + inline location& + operator-= (location& res, location::counter_type width) + { + return res += -width; + } + + /// Subtract \a width columns to the end position. + inline location + operator- (location res, location::counter_type width) + { + return res -= width; + } + + /// Compare two location objects. + inline bool + operator== (const location& loc1, const location& loc2) + { + return loc1.begin == loc2.begin && loc1.end == loc2.end; + } + + /// Compare two location objects. + inline bool + operator!= (const location& loc1, const location& loc2) + { + return !(loc1 == loc2); + } + + /** \brief Intercept output stream redirection. + ** \param ostr the destination output stream + ** \param loc a reference to the location to redirect + ** + ** Avoid duplicate information. + */ + template + std::basic_ostream& + operator<< (std::basic_ostream& ostr, const location& loc) + { + location::counter_type end_col + = 0 < loc.end.column ? loc.end.column - 1 : 0; + ostr << loc.begin; + if (loc.end.filename + && (!loc.begin.filename + || *loc.begin.filename != *loc.end.filename)) + ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; + else if (loc.begin.line < loc.end.line) + ostr << '-' << loc.end.line << '.' << end_col; + else if (loc.begin.column < end_col) + ostr << '-' << end_col; + return ostr; + } + +#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +} // VerifyTAPN +#line 333 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/location.hh" + +#endif // !YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED diff --git a/src/Core/QueryParser/Generated/parser.cpp b/src/Core/QueryParser/Generated/parser.cpp new file mode 100644 index 0000000..3c44c1b --- /dev/null +++ b/src/Core/QueryParser/Generated/parser.cpp @@ -0,0 +1,1412 @@ +// A Bison parser, made by GNU Bison 3.5.1. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// Undocumented macros, especially those whose name start with YY_, +// are private implementation details. Do not rely on them. + + + + + +#include "parser.hpp" + + +// Unqualified %code blocks. +#line 38 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + + #include "../TAPNQueryParser.hpp" + +#line 49 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if YYDEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yystack_print_ (); \ + } while (false) + +#else // !YYDEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !YYDEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +namespace VerifyTAPN { +#line 141 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + + + /* Return YYSTR after stripping away unnecessary quotes and + backslashes, so that it's suitable for yyerror. The heuristic is + that double-quoting is unnecessary unless the string contains an + apostrophe, a comma, or backslash (other than backslash-backslash). + YYSTR is taken from yytname. */ + std::string + Parser::yytnamerr_ (const char *yystr) + { + if (*yystr == '"') + { + std::string yyr; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + yyr += *yyp; + break; + + case '"': + return yyr; + } + do_not_strip_quotes: ; + } + + return yystr; + } + + + /// Build a parser object. + Parser::Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg) +#if YYDEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + driver (driver_yyarg) + {} + + Parser::~Parser () + {} + + Parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | Symbol types. | + `---------------*/ + + // basic_symbol. +#if 201103L <= YY_CPLUSPLUS + template + Parser::basic_symbol::basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value (std::move (that.value)) + , location (std::move (that.location)) + {} +#endif + + template + Parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value (that.value) + , location (that.location) + {} + + + /// Constructor for valueless symbols. + template + Parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_MOVE_REF (location_type) l) + : Base (t) + , value () + , location (l) + {} + + template + Parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v, YY_RVREF (location_type) l) + : Base (t) + , value (YY_MOVE (v)) + , location (YY_MOVE (l)) + {} + + template + bool + Parser::basic_symbol::empty () const YY_NOEXCEPT + { + return Base::type_get () == empty_symbol; + } + + template + void + Parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + value = YY_MOVE (s.value); + location = YY_MOVE (s.location); + } + + // by_type. + Parser::by_type::by_type () + : type (empty_symbol) + {} + +#if 201103L <= YY_CPLUSPLUS + Parser::by_type::by_type (by_type&& that) + : type (that.type) + { + that.clear (); + } +#endif + + Parser::by_type::by_type (const by_type& that) + : type (that.type) + {} + + Parser::by_type::by_type (token_type t) + : type (yytranslate_ (t)) + {} + + void + Parser::by_type::clear () + { + type = empty_symbol; + } + + void + Parser::by_type::move (by_type& that) + { + type = that.type; + that.clear (); + } + + int + Parser::by_type::type_get () const YY_NOEXCEPT + { + return type; + } + + + // by_state. + Parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + Parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + Parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + Parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + Parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + Parser::symbol_number_type + Parser::by_state::type_get () const YY_NOEXCEPT + { + if (state == empty_state) + return empty_symbol; + else + return yystos_[+state]; + } + + Parser::stack_symbol_type::stack_symbol_type () + {} + + Parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.value), YY_MOVE (that.location)) + { +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + Parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.value), YY_MOVE (that.location)) + { + // that is emptied. + that.type = empty_symbol; + } + +#if YY_CPLUSPLUS < 201103L + Parser::stack_symbol_type& + Parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + value = that.value; + location = that.location; + return *this; + } + + Parser::stack_symbol_type& + Parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + value = that.value; + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + Parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + + // User destructor. + switch (yysym.type_get ()) + { + case 3: // IDENTIFIER +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 385 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 4: // LESS +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 391 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 5: // LESSEQUAL +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 397 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 6: // EQUAL +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 403 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 7: // GREATEREQUAL +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 409 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 8: // GREATER +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 415 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 23: // query +#line 57 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.query); } +#line 421 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 24: // expression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 427 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 25: // arithmeticExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.arexpr); } +#line 433 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 26: // multiplyExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.arexpr); } +#line 439 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 27: // arithmeticParantheses +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.arexpr); } +#line 445 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 28: // parExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 451 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 29: // notExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 457 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 30: // orExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 463 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 31: // andExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 469 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 32: // boolExpression +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 475 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 33: // atomicProposition +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.expr); } +#line 481 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 34: // compareOp +#line 55 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { delete (yysym.value.string); } +#line 487 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + default: + break; + } + } + +#if YYDEBUG + template + void + Parser::yy_print_ (std::ostream& yyo, + const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YYUSE (yyoutput); + symbol_number_type yytype = yysym.type_get (); +#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408 + // Avoid a (spurious) G++ 4.8 warning about "array subscript is + // below array bounds". + if (yysym.empty ()) + std::abort (); +#endif + yyo << (yytype < yyntokens_ ? "token" : "nterm") + << ' ' << yytname_[yytype] << " (" + << yysym.location << ": "; + YYUSE (yytype); + yyo << ')'; + } +#endif + + void + Parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + Parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + Parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if YYDEBUG + std::ostream& + Parser::debug_stream () const + { + return *yycdebug_; + } + + void + Parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + Parser::debug_level_type + Parser::debug_level () const + { + return yydebug_; + } + + void + Parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // YYDEBUG + + Parser::state_type + Parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - yyntokens_] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - yyntokens_]; + } + + bool + Parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + Parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + Parser::operator() () + { + return parse (); + } + + int + Parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + // User initialization code. +#line 21 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +{ + // Initialize the initial location. + yyla.location.begin.filename = yyla.location.end.filename = &driver.file; +} + +#line 632 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token: "; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + yyla.type = yytranslate_ (yylex (&yyla.value, &yyla.location, driver)); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.type_get (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ()) + { + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* If YYLEN is nonzero, implement the default value of the + action: '$$ = $1'. Otherwise, use the top of the stack. + + Otherwise, the following line sets YYLHS.VALUE to garbage. + This behavior is undocumented and Bison users should not rely + upon it. */ + if (yylen) + yylhs.value = yystack_[yylen - 1].value; + else + yylhs.value = yystack_[0].value; + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: +#line 61 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EF, (yystack_[0].value.expr)); driver.SetAST((yylhs.value.query)); } +#line 759 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 3: +#line 62 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AG, (yystack_[0].value.expr)); driver.SetAST((yylhs.value.query)); } +#line 765 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 4: +#line 65 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[0].value.expr); } +#line 771 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 5: +#line 66 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[0].value.expr); } +#line 777 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 6: +#line 67 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[0].value.expr); } +#line 783 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 7: +#line 68 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[0].value.expr); } +#line 789 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 8: +#line 69 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[0].value.expr); } +#line 795 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 9: +#line 70 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[0].value.expr); } +#line 801 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 10: +#line 76 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = new VerifyTAPN::AST::PlusExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } +#line 807 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 11: +#line 77 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = new VerifyTAPN::AST::SubtractExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } +#line 813 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 12: +#line 78 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = new VerifyTAPN::AST::MinusExpression((yystack_[0].value.arexpr)); } +#line 819 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 13: +#line 79 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); } +#line 825 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 14: +#line 82 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = new VerifyTAPN::AST::MultiplyExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } +#line 831 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 15: +#line 83 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); } +#line 837 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 16: +#line 86 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = (yystack_[1].value.arexpr); } +#line 843 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 17: +#line 87 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.arexpr) = new VerifyTAPN::AST::NumberExpression((yystack_[0].value.number));} +#line 849 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 18: +#line 88 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { + int placeIndex = driver.net.GetPlaceIndex(*(yystack_[0].value.string)); + delete (yystack_[0].value.string); + if(placeIndex == -1) error(yystack_[0].location, "unknown place"); + (yylhs.value.arexpr) = new VerifyTAPN::AST::IdentifierExpression(placeIndex); + } +#line 860 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 19: +#line 96 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = (yystack_[1].value.expr); } +#line 866 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 20: +#line 97 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = new VerifyTAPN::AST::NotExpression((yystack_[0].value.expr)); } +#line 872 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 21: +#line 98 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = new VerifyTAPN::AST::OrExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); } +#line 878 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 22: +#line 99 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = new VerifyTAPN::AST::AndExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); } +#line 884 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 23: +#line 100 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(true); } +#line 890 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 24: +#line 101 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(false); } +#line 896 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 25: +#line 103 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.expr) = new VerifyTAPN::AST::AtomicProposition((yystack_[2].value.arexpr), (yystack_[1].value.string), (yystack_[0].value.arexpr)); } +#line 902 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 26: +#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.string) = (yystack_[0].value.string); } +#line 908 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 27: +#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.string) = (yystack_[0].value.string); } +#line 914 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 28: +#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.string) = (yystack_[0].value.string); } +#line 920 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 29: +#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.string) = (yystack_[0].value.string); } +#line 926 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + case 30: +#line 105 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + { (yylhs.value.string) = (yystack_[0].value.string); } +#line 932 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + break; + + +#line 936 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.type_get () == yyeof_) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + { + stack_symbol_type error_token; + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += yy_error_token_; + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + Parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + // Generate an error message. + std::string + Parser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const + { + // Number of reported tokens (one for the "unexpected", one per + // "expected"). + std::ptrdiff_t yycount = 0; + // Its maximum. + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + // Arguments of yyformat. + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (!yyla.empty ()) + { + symbol_number_type yytoken = yyla.type_get (); + yyarg[yycount++] = yytname_[yytoken]; + + int yyn = yypact_[+yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + // Stay within bounds of both yycheck and yytname. + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck_[yyx + yyn] == yyx && yyx != yy_error_token_ + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + break; + } + else + yyarg[yycount++] = yytname_[yyx]; + } + } + } + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += yytnamerr_ (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const signed char Parser::yypact_ninf_ = -10; + + const signed char Parser::yytable_ninf_ = -1; + + const signed char + Parser::yypact_[] = + { + -2, 2, 2, 16, -10, -10, 2, -9, -10, -10, + 1, 13, 41, -4, -10, -10, -10, -10, -10, -10, + -10, 13, -10, 11, 31, 2, -10, 3, -4, 2, + 2, -10, -10, -10, -10, -10, 1, 1, 3, 1, + -10, -10, 39, 27, -10, -4, -4, 21, -10 + }; + + const signed char + Parser::yydefact_[] = + { + 0, 0, 0, 0, 18, 17, 0, 0, 23, 24, + 0, 2, 0, 13, 15, 4, 5, 6, 7, 9, + 8, 3, 1, 0, 0, 0, 20, 0, 12, 0, + 0, 26, 27, 28, 29, 30, 0, 0, 0, 0, + 19, 16, 0, 21, 22, 10, 11, 25, 14 + }; + + const signed char + Parser::yypgoto_[] = + { + -10, -10, 0, -6, -3, -8, 36, -10, -10, -10, + -10, -10, -10 + }; + + const signed char + Parser::yydefgoto_[] = + { + -1, 3, 23, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 38 + }; + + const signed char + Parser::yytable_[] = + { + 24, 11, 21, 25, 4, 4, 4, 28, 1, 2, + 5, 5, 5, 27, 6, 27, 22, 39, 7, 8, + 9, 42, 10, 10, 40, 29, 30, 29, 30, 43, + 44, 48, 47, 45, 46, 31, 32, 33, 34, 35, + 36, 37, 30, 26, 41, 31, 32, 33, 34, 35, + 36, 37, 41, 0, 0, 0, 0, 0, 36, 37, + 36, 37 + }; + + const signed char + Parser::yycheck_[] = + { + 6, 1, 2, 12, 3, 3, 3, 10, 10, 11, + 9, 9, 9, 12, 12, 12, 0, 21, 16, 17, + 18, 27, 20, 20, 13, 14, 15, 14, 15, 29, + 30, 39, 38, 36, 37, 4, 5, 6, 7, 8, + 19, 20, 15, 7, 13, 4, 5, 6, 7, 8, + 19, 20, 13, -1, -1, -1, -1, -1, 19, 20, + 19, 20 + }; + + const signed char + Parser::yystos_[] = + { + 0, 10, 11, 23, 3, 9, 12, 16, 17, 18, + 20, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 24, 0, 24, 25, 12, 28, 12, 26, 14, + 15, 4, 5, 6, 7, 8, 19, 20, 34, 21, + 13, 13, 25, 24, 24, 26, 26, 25, 27 + }; + + const signed char + Parser::yyr1_[] = + { + 0, 22, 23, 23, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 26, 26, 27, 27, 27, 28, + 29, 30, 31, 32, 32, 33, 34, 34, 34, 34, + 34 + }; + + const signed char + Parser::yyr2_[] = + { + 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, + 3, 3, 2, 1, 3, 1, 3, 1, 1, 3, + 2, 3, 3, 1, 1, 3, 1, 1, 1, 1, + 1 + }; + + + + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + // First, the terminals, then, starting at \a yyntokens_, nonterminals. + const char* + const Parser::yytname_[] = + { + "END", "error", "$undefined", "IDENTIFIER", "LESS", "LESSEQUAL", + "EQUAL", "GREATEREQUAL", "GREATER", "NUMBER", "EF", "AG", "LPARAN", + "RPARAN", "OR", "AND", "NOT", "BOOL_TRUE", "BOOL_FALSE", "PLUS", "MINUS", + "MULTIPLY", "$accept", "query", "expression", "arithmeticExpression", + "multiplyExpression", "arithmeticParantheses", "parExpression", + "notExpression", "orExpression", "andExpression", "boolExpression", + "atomicProposition", "compareOp", YY_NULLPTR + }; + +#if YYDEBUG + const signed char + Parser::yyrline_[] = + { + 0, 61, 61, 62, 65, 66, 67, 68, 69, 70, + 76, 77, 78, 79, 82, 83, 86, 87, 88, 96, + 97, 98, 99, 100, 101, 103, 105, 105, 105, 105, + 105 + }; + + // Print the state stack on the debug stream. + void + Parser::yystack_print_ () + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + // Report on the debug stream that the rule \a yyrule is going to be reduced. + void + Parser::yy_reduce_print_ (int yyrule) + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // YYDEBUG + + Parser::token_number_type + Parser::yytranslate_ (int t) + { + // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to + // TOKEN-NUM as returned by yylex. + static + const token_number_type + translate_table[] = + { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21 + }; + const int user_token_number_max_ = 276; + + if (t <= 0) + return yyeof_; + else if (t <= user_token_number_max_) + return translate_table[t]; + else + return yy_undef_token_; + } + +#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +} // VerifyTAPN +#line 1402 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.cpp" + +#line 107 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + + +void +VerifyTAPN::Parser::error (const VerifyTAPN::Parser::location_type& l, + const std::string& m) +{ + driver.error (l, m); + exit(1); +} diff --git a/src/Core/QueryParser/Generated/parser.hpp b/src/Core/QueryParser/Generated/parser.hpp new file mode 100644 index 0000000..07acb36 --- /dev/null +++ b/src/Core/QueryParser/Generated/parser.hpp @@ -0,0 +1,738 @@ +// A Bison parser, made by GNU Bison 3.5.1. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file /home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp + ** Define the VerifyTAPN::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// Undocumented macros, especially those whose name start with YY_, +// are private implementation details. Do not rely on them. + +#ifndef YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED +# define YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 7 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + +# include +#include "../AST.hpp" +namespace VerifyTAPN{ + class TAPNQueryParser; +} + +#line 56 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" + + +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif +# include "location.hh" + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +namespace VerifyTAPN { +#line 186 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" + + + + + /// A Bison parser. + class Parser + { + public: +#ifndef YYSTYPE + /// Symbol semantic values. + union semantic_type + { +#line 30 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" + + int number; + std::string* string; + VerifyTAPN::AST::Expression* expr; + VerifyTAPN::AST::ArithmeticExpression* arexpr; + VerifyTAPN::AST::Query* query; + +#line 207 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" + + }; +#else + typedef YYSTYPE semantic_type; +#endif + /// Symbol locations. + typedef location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Tokens. + struct token + { + enum yytokentype + { + END = 0, + IDENTIFIER = 258, + LESS = 259, + LESSEQUAL = 260, + EQUAL = 261, + GREATEREQUAL = 262, + GREATER = 263, + NUMBER = 264, + EF = 265, + AG = 266, + LPARAN = 267, + RPARAN = 268, + OR = 269, + AND = 270, + NOT = 271, + BOOL_TRUE = 272, + BOOL_FALSE = 273, + PLUS = 274, + MINUS = 275, + MULTIPLY = 276 + }; + }; + + /// (External) token type, as returned by yylex. + typedef token::yytokentype token_type; + + /// Symbol type: an internal symbol number. + typedef int symbol_number_type; + + /// The symbol type number to denote an empty symbol. + enum { empty_symbol = -2 }; + + /// Internal symbol number for tokens (subsumed by symbol_number_type). + typedef signed char token_number_type; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol type + /// via type_get (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that); +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + /// Constructor for valueless symbols. + basic_symbol (typename Base::kind_type t, + YY_MOVE_REF (location_type) l); + + /// Constructor for symbols with semantic value. + basic_symbol (typename Base::kind_type t, + YY_RVREF (semantic_type) v, + YY_RVREF (location_type) l); + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () + { + Base::clear (); + } + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_type + { + /// Default constructor. + by_type (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_type (by_type&& that); +#endif + + /// Copy constructor. + by_type (const by_type& that); + + /// The symbol type as needed by the constructor. + typedef token_type kind_type; + + /// Constructor from (external) token numbers. + by_type (kind_type t); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_type& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_number_type type_get () const YY_NOEXCEPT; + + /// The symbol type. + /// \a empty_symbol when empty. + /// An int, not token_number_type, to be able to store empty_symbol. + int type; + }; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + {}; + + /// Build a parser object. + Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg); + virtual ~Parser (); + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if YYDEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + + + private: + /// This class is not copyable. + Parser (const Parser&); + Parser& operator= (const Parser&); + + /// Stored state numbers (used for stacks). + typedef signed char state_type; + + /// Generate an error message. + /// \param yystate the state where the error occurred. + /// \param yyla the lookahead token. + virtual std::string yysyntax_error_ (state_type yystate, + const symbol_type& yyla) const; + + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const signed char yypact_ninf_; + static const signed char yytable_ninf_; + + /// Convert a scanner token number \a t to a symbol number. + /// In theory \a t should be a token_type, but character literals + /// are valid, yet not members of the token_type enum. + static token_number_type yytranslate_ (int t); + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const signed char yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const signed char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const signed char yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const signed char yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const signed char yytable_[]; + + static const signed char yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const signed char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const signed char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + + /// Convert the symbol name \a n to a form suitable for a diagnostic. + static std::string yytnamerr_ (const char *n); + + + /// For a symbol, its name in clear. + static const char* const yytname_[]; +#if YYDEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const signed char yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r); + /// Print the state stack on the debug stream. + virtual void yystack_print_ (); + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol type, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol type as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol type from \a that. + void move (by_state& that); + + /// The (internal) type number (corresponding to \a state). + /// \a empty_symbol when empty. + symbol_number_type type_get () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::reverse_iterator iterator; + typedef typename S::const_reverse_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + std::ptrdiff_t + ssize () const YY_NOEXCEPT + { + return std::ptrdiff_t (size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.rbegin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.rend (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: + stack (const stack&); + stack& operator= (const stack&); + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Some specific tokens. + static const token_number_type yy_error_token_ = 1; + static const token_number_type yy_undef_token_ = 2; + + /// Constants. + enum + { + yyeof_ = 0, + yylast_ = 61, ///< Last index in yytable_. + yynnts_ = 13, ///< Number of nonterminal symbols. + yyfinal_ = 22, ///< Termination state number. + yyntokens_ = 22 ///< Number of tokens. + }; + + + // User arguments. + VerifyTAPN::TAPNQueryParser& driver; + }; + + +#line 5 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/grammar.yy" +} // VerifyTAPN +#line 733 "/home/kyrke/projects/verifytapn/src/Core/QueryParser/Generated/parser.hpp" + + + + + +#endif // !YY_YY_HOME_KYRKE_PROJECTS_VERIFYTAPN_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED diff --git a/src/Core/QueryParser/Generated/position.hh b/src/Core/QueryParser/Generated/position.hh new file mode 100644 index 0000000..bf34c1c --- /dev/null +++ b/src/Core/QueryParser/Generated/position.hh @@ -0,0 +1,11 @@ +// A Bison parser, made by GNU Bison 3.5.1. + +// Starting with Bison 3.2, this file is useless: the structure it +// used to define is now defined in "location.hh". +// +// To get rid of this file: +// 1. add '%require "3.2"' (or newer) to your grammar file +// 2. remove references to this file from your build system +// 3. if you used to include it, include "location.hh" instead. + +#include "location.hh" diff --git a/src/Core/QueryParser/Generated/stack.hh b/src/Core/QueryParser/Generated/stack.hh new file mode 100644 index 0000000..c15d84c --- /dev/null +++ b/src/Core/QueryParser/Generated/stack.hh @@ -0,0 +1,8 @@ +// A Bison parser, made by GNU Bison 3.5.1. + +// Starting with Bison 3.2, this file is useless: the structure it +// used to define is now defined with the parser itself. +// +// To get rid of this file: +// 1. add '%require "3.2"' (or newer) to your grammar file +// 2. remove references to this file from your build system. From b8284992906a0802b667a5d0d0ae8fac39fa3195 Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Mon, 22 Nov 2021 11:55:34 +0100 Subject: [PATCH 4/6] rempving shared ptr --- src/Core/ArgsParser.cpp | 18 +++---- src/Core/ArgsParser.hpp | 3 +- src/Core/QueryParser/ToStringVisitor.hpp | 4 +- src/Core/SymbolicMarking/DBMMarking.cpp | 2 +- src/Core/SymbolicMarking/DBMMarking.hpp | 2 +- .../DiscreteInclusionMarkingFactory.hpp | 4 +- .../UppaalDBMMarkingFactory.hpp | 2 +- src/Core/TAPN/InhibitorArc.hpp | 11 ++-- src/Core/TAPN/OutputArc.hpp | 11 ++-- src/Core/TAPN/Pairing.cpp | 12 ++--- src/Core/TAPN/TimedArcPetriNet.cpp | 10 ++-- src/Core/TAPN/TimedInputArc.hpp | 13 +++-- src/Core/TAPN/TimedPlace.hpp | 3 +- src/Core/TAPN/TimedTransition.cpp | 16 +++--- src/Core/TAPN/TimedTransition.hpp | 26 +++++----- src/Core/TAPN/TransportArc.hpp | 16 +++--- src/Core/TAPNParser/TAPNXmlParser.cpp | 37 +++++++------- src/Core/TAPNParser/TAPNXmlParser.hpp | 17 +++---- .../SuccessorGenerator.cpp | 50 +++++-------------- src/main.cpp | 6 +-- 20 files changed, 118 insertions(+), 145 deletions(-) diff --git a/src/Core/ArgsParser.cpp b/src/Core/ArgsParser.cpp index 5949d6d..a3329c9 100644 --- a/src/Core/ArgsParser.cpp +++ b/src/Core/ArgsParser.cpp @@ -138,18 +138,18 @@ namespace VerifyTAPN { // NOTE: The Help() function only splits and indents descriptions based on newlines. // Each line in the description is assumed to fit within the remaining width // of the console, so keep descriptions short, or implement manual word-wrapping :). - parsers.push_back(boost::make_shared("k", KBOUND_OPTION, "Max tokens to use during exploration.",0)); - parsers.push_back(boost::make_shared("o", SEARCH_OPTION, "Specify the desired search strategy.\n - 0: Breadth-First Search\n - 1: Depth-First Search\n - 2: Random Search\n - 3: Maximum Cover Search",3)); - parsers.push_back(boost::make_shared("t", TRACE_OPTION, "Specify the desired trace option.\n - 0: none\n - 1: some",0)); + parsers.push_back(std::make_shared("k", KBOUND_OPTION, "Max tokens to use during exploration.",0)); + parsers.push_back(std::make_shared("o", SEARCH_OPTION, "Specify the desired search strategy.\n - 0: Breadth-First Search\n - 1: Depth-First Search\n - 2: Random Search\n - 3: Maximum Cover Search",3)); + parsers.push_back(std::make_shared("t", TRACE_OPTION, "Specify the desired trace option.\n - 0: none\n - 1: some",0)); - parsers.push_back(boost::make_shared("g",MAX_CONSTANT_OPTION, "Use global maximum constant for \nextrapolation (as opposed to local \nconstants).")); - parsers.push_back(boost::make_shared("u",UNTIMED_PLACES_OPTION, "Disables the untimed place optimization.")); - parsers.push_back(boost::make_shared("s",SYMMETRY_OPTION, "Disables symmetry reduction.")); + parsers.push_back(std::make_shared("g",MAX_CONSTANT_OPTION, "Use global maximum constant for \nextrapolation (as opposed to local \nconstants).")); + parsers.push_back(std::make_shared("u",UNTIMED_PLACES_OPTION, "Disables the untimed place optimization.")); + parsers.push_back(std::make_shared("s",SYMMETRY_OPTION, "Disables symmetry reduction.")); - parsers.push_back(boost::make_shared("x",XML_TRACE_OPTION, "Output trace in xml format for TAPAAL.")); + parsers.push_back(std::make_shared("x",XML_TRACE_OPTION, "Output trace in xml format for TAPAAL.")); - parsers.push_back(boost::make_shared("f", FACTORY_OPTION, "Specify the desired marking factory.\n - 0: Default\n - 1: Discrete-inclusion\n - 2: Old factory",0)); - parsers.push_back(boost::make_shared("i", INCLUSION_PLACES, "Specify a list of places to consider \nfor discrete inclusion. No spaces after\nthe commas!\nSpecial values: *ALL*, *NONE*", "*ALL*")); + parsers.push_back(std::make_shared("f", FACTORY_OPTION, "Specify the desired marking factory.\n - 0: Default\n - 1: Discrete-inclusion\n - 2: Old factory",0)); + parsers.push_back(std::make_shared("i", INCLUSION_PLACES, "Specify a list of places to consider \nfor discrete inclusion. No spaces after\nthe commas!\nSpecial values: *ALL*, *NONE*", "*ALL*")); }; void ArgsParser::Help() const diff --git a/src/Core/ArgsParser.hpp b/src/Core/ArgsParser.hpp index 2216c35..4d5a6b7 100644 --- a/src/Core/ArgsParser.hpp +++ b/src/Core/ArgsParser.hpp @@ -5,7 +5,6 @@ #include #include #include -#include "boost/smart_ptr.hpp" #include "VerificationOptions.hpp" #include "boost/lexical_cast.hpp" @@ -78,7 +77,7 @@ namespace VerifyTAPN }; class ArgsParser { - typedef std::vector< boost::shared_ptr > parser_vec; + typedef std::vector< std::shared_ptr > parser_vec; public: ArgsParser() : parsers(), version(1,3,1) { Initialize(); }; virtual ~ArgsParser() {}; diff --git a/src/Core/QueryParser/ToStringVisitor.hpp b/src/Core/QueryParser/ToStringVisitor.hpp index 60f356f..461882d 100644 --- a/src/Core/QueryParser/ToStringVisitor.hpp +++ b/src/Core/QueryParser/ToStringVisitor.hpp @@ -13,7 +13,7 @@ namespace VerifyTAPN class ToStringVisitor : public Visitor { public: - ToStringVisitor(const boost::shared_ptr& tapn) : tapn(tapn) { }; + ToStringVisitor(const std::shared_ptr& tapn) : tapn(tapn) { }; virtual ~ToStringVisitor() {} virtual void Visit(const NotExpression& expr, boost::any& context); virtual void Visit(const OrExpression& expr, boost::any& context); @@ -30,7 +30,7 @@ namespace VerifyTAPN void Print(const Query& query) { boost::any any; query.Accept(*this, any); }; private: - const boost::shared_ptr tapn; + const std::shared_ptr tapn; }; } } diff --git a/src/Core/SymbolicMarking/DBMMarking.cpp b/src/Core/SymbolicMarking/DBMMarking.cpp index d656335..945fd5b 100644 --- a/src/Core/SymbolicMarking/DBMMarking.cpp +++ b/src/Core/SymbolicMarking/DBMMarking.cpp @@ -4,7 +4,7 @@ namespace VerifyTAPN { - boost::shared_ptr DBMMarking::tapn; + std::shared_ptr DBMMarking::tapn; // Add a token in each output place of placesOfTokensToAdd // and add placesOfTokensToAdd.size() clocks to the DBM. diff --git a/src/Core/SymbolicMarking/DBMMarking.hpp b/src/Core/SymbolicMarking/DBMMarking.hpp index bf13772..5fac43f 100644 --- a/src/Core/SymbolicMarking/DBMMarking.hpp +++ b/src/Core/SymbolicMarking/DBMMarking.hpp @@ -15,7 +15,7 @@ namespace VerifyTAPN { friend class UppaalDBMMarkingFactory; friend class DiscreteInclusionMarkingFactory; public: - static boost::shared_ptr tapn; + static std::shared_ptr tapn; public: DBMMarking(const DiscretePart& dp, const dbm::dbm_t& dbm) : DiscreteMarking(dp), dbm(dbm), mapping() { InitMapping(); assert(IsConsistent()); }; DBMMarking(const DiscretePart& dp, const TokenMapping& mapping, const dbm::dbm_t& dbm) : DiscreteMarking(dp), dbm(dbm), mapping(mapping) { assert(IsConsistent()); }; diff --git a/src/Core/SymbolicMarking/DiscreteInclusionMarkingFactory.hpp b/src/Core/SymbolicMarking/DiscreteInclusionMarkingFactory.hpp index a5bef1d..36d9d5d 100644 --- a/src/Core/SymbolicMarking/DiscreteInclusionMarkingFactory.hpp +++ b/src/Core/SymbolicMarking/DiscreteInclusionMarkingFactory.hpp @@ -13,7 +13,7 @@ namespace VerifyTAPN { class DiscreteInclusionMarkingFactory : public UppaalDBMMarkingFactory { public: - DiscreteInclusionMarkingFactory(const boost::shared_ptr& tapn, const VerificationOptions& options) + DiscreteInclusionMarkingFactory(const std::shared_ptr& tapn, const VerificationOptions& options) : UppaalDBMMarkingFactory(tapn), tapn(tapn), inc_places(tapn->NumberOfPlaces(), false), empty_inc(options.GetFactory() == DEFAULT) { MarkPlacesForInclusion(options.GetIncPlaces()); }; virtual ~DiscreteInclusionMarkingFactory() {}; @@ -310,7 +310,7 @@ class DiscreteInclusionMarkingFactory : public UppaalDBMMarkingFactory { } }; private: - boost::shared_ptr tapn; + std::shared_ptr tapn; std::vector inc_places; bool empty_inc; }; diff --git a/src/Core/SymbolicMarking/UppaalDBMMarkingFactory.hpp b/src/Core/SymbolicMarking/UppaalDBMMarkingFactory.hpp index aaddf2d..9287c8a 100644 --- a/src/Core/SymbolicMarking/UppaalDBMMarkingFactory.hpp +++ b/src/Core/SymbolicMarking/UppaalDBMMarkingFactory.hpp @@ -11,7 +11,7 @@ namespace VerifyTAPN { protected: static id_type nextId; public: - UppaalDBMMarkingFactory(const boost::shared_ptr& tapn) + UppaalDBMMarkingFactory(const std::shared_ptr& tapn) { DBMMarking::tapn = tapn; }; diff --git a/src/Core/TAPN/InhibitorArc.hpp b/src/Core/TAPN/InhibitorArc.hpp index 1d1b6e4..deb1c18 100644 --- a/src/Core/TAPN/InhibitorArc.hpp +++ b/src/Core/TAPN/InhibitorArc.hpp @@ -3,7 +3,6 @@ #include #include "TimeInterval.hpp" -#include "boost/smart_ptr.hpp" namespace VerifyTAPN { namespace TAPN { @@ -12,10 +11,10 @@ namespace VerifyTAPN { class InhibitorArc { public: // typedefs - typedef std::vector< boost::shared_ptr > Vector; - typedef std::vector< boost::weak_ptr > WeakPtrVector; + typedef std::vector< std::shared_ptr > Vector; + typedef std::vector< InhibitorArc* > NakedPtrVector; public: - InhibitorArc(const boost::shared_ptr& place, const boost::shared_ptr& transition) : place(place), transition(transition) { }; + InhibitorArc(const std::shared_ptr& place, const std::shared_ptr& transition) : place(place), transition(transition) { }; virtual ~InhibitorArc() { /* empty */ } public: // modifiers @@ -25,8 +24,8 @@ namespace VerifyTAPN { public: // Inspectors void Print(std::ostream& out) const; private: - const boost::shared_ptr place; - const boost::shared_ptr transition; + const std::shared_ptr place; + const std::shared_ptr transition; }; inline std::ostream& operator<<(std::ostream& out, const InhibitorArc& arc) diff --git a/src/Core/TAPN/OutputArc.hpp b/src/Core/TAPN/OutputArc.hpp index 1272aa8..2a36238 100644 --- a/src/Core/TAPN/OutputArc.hpp +++ b/src/Core/TAPN/OutputArc.hpp @@ -2,7 +2,6 @@ #define VERIFYTAPN_TAPN_OUTPUTARC_HPP_ #include -#include "boost/smart_ptr.hpp" namespace VerifyTAPN { namespace TAPN { @@ -12,10 +11,10 @@ namespace VerifyTAPN { class OutputArc { public: // typedefs - typedef std::vector< boost::shared_ptr > Vector; - typedef std::vector< boost::weak_ptr > WeakPtrVector; + typedef std::vector< std::shared_ptr > Vector; + typedef std::vector< OutputArc* > NakedPtrVector; public: - OutputArc(const boost::shared_ptr& transition, const boost::shared_ptr& place) + OutputArc(const std::shared_ptr& transition, const std::shared_ptr& place) : transition(transition), place(place) { }; virtual ~OutputArc() { /* empty */ } @@ -26,8 +25,8 @@ namespace VerifyTAPN { public: // inspectors void Print(std::ostream& out) const; private: - const boost::shared_ptr transition; - const boost::shared_ptr place; + const std::shared_ptr transition; + const std::shared_ptr place; }; inline std::ostream& operator<<(std::ostream& out, const OutputArc& arc) diff --git a/src/Core/TAPN/Pairing.cpp b/src/Core/TAPN/Pairing.cpp index 065ab8f..e94fb81 100644 --- a/src/Core/TAPN/Pairing.cpp +++ b/src/Core/TAPN/Pairing.cpp @@ -7,8 +7,8 @@ namespace VerifyTAPN { using namespace TAPN; void Pairing::GeneratePairingFor(const TimedArcPetriNet& tapn, const TAPN::TimedTransition& t) { - TimedInputArc::WeakPtrVector preset = t.GetPreset(); - OutputArc::WeakPtrVector postset = t.GetPostset(); + TimedInputArc::NakedPtrVector preset = t.GetPreset(); + OutputArc::NakedPtrVector postset = t.GetPostset(); unsigned int sizeOfPairing = preset.size() >= postset.size() ? preset.size() : postset.size(); @@ -19,8 +19,8 @@ using namespace TAPN; { if(i < preset.size() && i < postset.size()) { - boost::shared_ptr tiaPtr = preset[i].lock(); - boost::shared_ptr oaPtr = postset[i].lock(); + TimedInputArc* tiaPtr = preset[i]; + OutputArc* oaPtr = postset[i]; inputPlace = tapn.GetPlaceIndex(tiaPtr->InputPlace()); outputPlace = tapn.GetPlaceIndex(oaPtr->OutputPlace()); @@ -28,14 +28,14 @@ using namespace TAPN; Add(inputPlace, outputPlace); } else if(i < preset.size() && i >= postset.size()){ - boost::shared_ptr tiaPtr = preset[i].lock(); + TimedInputArc* tiaPtr = preset[i]; inputPlace = tapn.GetPlaceIndex(tiaPtr->InputPlace()); Add(inputPlace, TimedPlace::BottomIndex()); } else if(i >= preset.size() && i < postset.size()) { - boost::shared_ptr oaPtr = postset[i].lock(); + OutputArc* oaPtr = postset[i]; outputPlace = tapn.GetPlaceIndex(oaPtr->OutputPlace()); diff --git a/src/Core/TAPN/TimedArcPetriNet.cpp b/src/Core/TAPN/TimedArcPetriNet.cpp index 39099c3..6563416 100644 --- a/src/Core/TAPN/TimedArcPetriNet.cpp +++ b/src/Core/TAPN/TimedArcPetriNet.cpp @@ -25,27 +25,27 @@ namespace VerifyTAPN { for(TimedInputArc::Vector::const_iterator iter = inputArcs.begin(); iter != inputArcs.end(); ++iter) { - const boost::shared_ptr& arc = *iter; + const std::shared_ptr& arc = *iter; arc->OutputTransition().AddToPreset(arc); UpdateMaxConstant(arc->Interval()); } for(TransportArc::Vector::const_iterator iter = transportArcs.begin(); iter != transportArcs.end(); ++iter) { - const boost::shared_ptr& arc = *iter; + const std::shared_ptr& arc = *iter; arc->Transition().AddTransportArcGoingThrough(arc); UpdateMaxConstant(arc->Interval()); } for(InhibitorArc::Vector::const_iterator iter = inhibitorArcs.begin(); iter != inhibitorArcs.end(); ++iter) { - const boost::shared_ptr& arc = *iter; + const std::shared_ptr& arc = *iter; arc->OutputTransition().AddIncomingInhibitorArc(arc); arc->InputPlace().SetHasInhibitorArcs(true); } for(OutputArc::Vector::const_iterator iter = outputArcs.begin(); iter != outputArcs.end(); ++iter) { - const boost::shared_ptr& arc = *iter; + const std::shared_ptr& arc = *iter; arc->InputTransition().AddToPostset(arc); } @@ -115,7 +115,7 @@ namespace VerifyTAPN { { if((*arcIter)->InputPlace() == **iter) { - boost::shared_ptr ia = *arcIter; + std::shared_ptr ia = *arcIter; const TAPN::TimeInterval& interval = ia->Interval(); const int lowerBound = interval.GetLowerBound(); diff --git a/src/Core/TAPN/TimedInputArc.hpp b/src/Core/TAPN/TimedInputArc.hpp index dbe41e3..5456a2a 100644 --- a/src/Core/TAPN/TimedInputArc.hpp +++ b/src/Core/TAPN/TimedInputArc.hpp @@ -3,7 +3,6 @@ #include #include "TimeInterval.hpp" -#include "boost/smart_ptr.hpp" namespace VerifyTAPN { namespace TAPN { @@ -13,11 +12,11 @@ namespace VerifyTAPN { class TimedInputArc { public: // typedefs - typedef std::vector< boost::shared_ptr > Vector; - typedef std::vector< boost::weak_ptr > WeakPtrVector; + typedef std::vector< std::shared_ptr > Vector; + typedef std::vector< TimedInputArc* > NakedPtrVector; public: - TimedInputArc(const boost::shared_ptr& place, const boost::shared_ptr& transition) : interval(), place(place), transition(transition) { }; - TimedInputArc(const boost::shared_ptr& place, const boost::shared_ptr& transition, const TimeInterval& interval) : interval(interval), place(place), transition(transition) { }; + TimedInputArc(const std::shared_ptr& place, const std::shared_ptr& transition) : interval(), place(place), transition(transition) { }; + TimedInputArc(const std::shared_ptr& place, const std::shared_ptr& transition, const TimeInterval& interval) : interval(interval), place(place), transition(transition) { }; virtual ~TimedInputArc() { /* empty */} public: // modifiers @@ -29,8 +28,8 @@ namespace VerifyTAPN { void Print(std::ostream& out) const; private: const TimeInterval interval; - const boost::shared_ptr place; - const boost::shared_ptr transition; + const std::shared_ptr place; + const std::shared_ptr transition; }; inline std::ostream& operator<<(std::ostream& out, const TimedInputArc& arc) diff --git a/src/Core/TAPN/TimedPlace.hpp b/src/Core/TAPN/TimedPlace.hpp index 6e869a8..d82d058 100644 --- a/src/Core/TAPN/TimedPlace.hpp +++ b/src/Core/TAPN/TimedPlace.hpp @@ -8,7 +8,6 @@ #include "TimeInvariant.hpp" #include "TimedInputArc.hpp" #include "OutputArc.hpp" -#include "boost/shared_ptr.hpp" namespace VerifyTAPN{ namespace TAPN{ @@ -26,7 +25,7 @@ namespace VerifyTAPN{ static const std::string BOTTOM_NAME; public: // typedefs - typedef std::vector< boost::shared_ptr > Vector; + typedef std::vector< std::shared_ptr > Vector; public: // construction / destruction TimedPlace(const std::string& name, const std::string& id, const TimeInvariant timeInvariant) diff --git a/src/Core/TAPN/TimedTransition.cpp b/src/Core/TAPN/TimedTransition.cpp index 834e78d..31dd9ab 100644 --- a/src/Core/TAPN/TimedTransition.cpp +++ b/src/Core/TAPN/TimedTransition.cpp @@ -7,35 +7,35 @@ namespace VerifyTAPN { out << GetName() << "(" << index << ")"; } - void TimedTransition::AddToPreset(const boost::shared_ptr& arc) + void TimedTransition::AddToPreset(const std::shared_ptr& arc) { if(arc) { - preset.push_back(arc); + preset.push_back(arc.get()); } } - void TimedTransition::AddTransportArcGoingThrough(const boost::shared_ptr& arc) + void TimedTransition::AddTransportArcGoingThrough(const std::shared_ptr& arc) { if(arc) { - transportArcs.push_back(arc); + transportArcs.push_back(arc.get()); } } - void TimedTransition::AddIncomingInhibitorArc(const boost::shared_ptr& arc) + void TimedTransition::AddIncomingInhibitorArc(const std::shared_ptr& arc) { if(arc) { - inhibitorArcs.push_back(arc); + inhibitorArcs.push_back(arc.get()); } } - void TimedTransition::AddToPostset(const boost::shared_ptr& arc) + void TimedTransition::AddToPostset(const std::shared_ptr& arc) { if(arc) { - postset.push_back(arc); + postset.push_back(arc.get()); } } } diff --git a/src/Core/TAPN/TimedTransition.hpp b/src/Core/TAPN/TimedTransition.hpp index f18ba31..b69e850 100644 --- a/src/Core/TAPN/TimedTransition.hpp +++ b/src/Core/TAPN/TimedTransition.hpp @@ -19,28 +19,28 @@ class SymMarking; class TimedTransition { public: // typedefs - typedef std::vector< boost::shared_ptr > Vector; + typedef std::vector< std::shared_ptr > Vector; public: TimedTransition(const std::string& name, const std::string& id) : name(name), id(id), preset(), postset(), transportArcs(), index(-1) { }; TimedTransition() : name("*EMPTY*"), id("-1"), preset(), postset(), transportArcs(), index(-1) { }; virtual ~TimedTransition() { /* empty */ } public: // modifiers - void AddToPreset(const boost::shared_ptr& arc); - void AddToPostset(const boost::shared_ptr& arc); - void AddTransportArcGoingThrough(const boost::shared_ptr& arc); - void AddIncomingInhibitorArc(const boost::shared_ptr& arc); + void AddToPreset(const std::shared_ptr& arc); + void AddToPostset(const std::shared_ptr& arc); + void AddTransportArcGoingThrough(const std::shared_ptr& arc); + void AddIncomingInhibitorArc(const std::shared_ptr& arc); inline void SetIndex(int i) { index = i; }; public: // inspectors inline const std::string& GetName() const { return name; }; inline const std::string& GetId() const { return id; }; void Print(std::ostream&) const; - inline const TimedInputArc::WeakPtrVector& GetPreset() const { return preset; } - inline const TransportArc::WeakPtrVector& GetTransportArcs() const { return transportArcs; } - inline const InhibitorArc::WeakPtrVector& GetInhibitorArcs() const { return inhibitorArcs; } + inline const TimedInputArc::NakedPtrVector& GetPreset() const { return preset; } + inline const TransportArc::NakedPtrVector& GetTransportArcs() const { return transportArcs; } + inline const InhibitorArc::NakedPtrVector& GetInhibitorArcs() const { return inhibitorArcs; } inline const unsigned int GetPresetSize() const { return NumberOfInputArcs() + NumberOfTransportArcs(); } - inline const OutputArc::WeakPtrVector& GetPostset() const { return postset; } + inline const OutputArc::NakedPtrVector& GetPostset() const { return postset; } inline const unsigned int GetPostsetSize() const { return postset.size() + transportArcs.size(); } inline unsigned int NumberOfInputArcs() const { return preset.size(); }; inline unsigned int NumberOfTransportArcs() const { return transportArcs.size(); }; @@ -51,10 +51,10 @@ class SymMarking; private: // data std::string name; std::string id; - TimedInputArc::WeakPtrVector preset; - OutputArc::WeakPtrVector postset; - TransportArc::WeakPtrVector transportArcs; - InhibitorArc::WeakPtrVector inhibitorArcs; + TimedInputArc::NakedPtrVector preset; + OutputArc::NakedPtrVector postset; + TransportArc::NakedPtrVector transportArcs; + InhibitorArc::NakedPtrVector inhibitorArcs; unsigned int index; }; diff --git a/src/Core/TAPN/TransportArc.hpp b/src/Core/TAPN/TransportArc.hpp index 281a93e..b2b933a 100644 --- a/src/Core/TAPN/TransportArc.hpp +++ b/src/Core/TAPN/TransportArc.hpp @@ -15,13 +15,13 @@ namespace VerifyTAPN class TransportArc { public: - typedef std::vector< boost::shared_ptr > Vector; - typedef std::vector< boost::weak_ptr > WeakPtrVector; + typedef std::vector< std::shared_ptr > Vector; + typedef std::vector< TransportArc* > NakedPtrVector; public: TransportArc( - const boost::shared_ptr& source, - const boost::shared_ptr& transition, - const boost::shared_ptr& destination, + const std::shared_ptr& source, + const std::shared_ptr& transition, + const std::shared_ptr& destination, const TAPN::TimeInterval& interval ) : interval(interval), source(source), transition(transition), destination(destination) {}; @@ -36,9 +36,9 @@ namespace VerifyTAPN void Print(std::ostream& out) const; private: const TAPN::TimeInterval interval; - const boost::shared_ptr source; - const boost::shared_ptr transition; - const boost::shared_ptr destination; + const std::shared_ptr source; + const std::shared_ptr transition; + const std::shared_ptr destination; }; inline std::ostream& operator<<(std::ostream& out, const TransportArc& arc) diff --git a/src/Core/TAPNParser/TAPNXmlParser.cpp b/src/Core/TAPNParser/TAPNXmlParser.cpp index 808cfd5..f5330b0 100644 --- a/src/Core/TAPNParser/TAPNXmlParser.cpp +++ b/src/Core/TAPNParser/TAPNXmlParser.cpp @@ -1,6 +1,9 @@ #include "TAPNXmlParser.hpp" + #include #include +#include + #include "boost/bind.hpp" #include "boost/algorithm/string.hpp" #include "boost/lexical_cast.hpp" @@ -11,7 +14,7 @@ namespace VerifyTAPN { using namespace rapidxml; - boost::shared_ptr TAPNXmlParser::Parse(const std::string & filename) const + std::shared_ptr TAPNXmlParser::Parse(const std::string & filename) const { const std::string contents = VerifyTAPN::ReadFile(filename); std::vector charArray(contents.begin(), contents.end()); @@ -43,14 +46,14 @@ namespace VerifyTAPN { return ParseInitialMarking(*root, tapn); } - boost::shared_ptr TAPNXmlParser::ParseTAPN(const xml_node<>& root) const + std::shared_ptr TAPNXmlParser::ParseTAPN(const xml_node<>& root) const { TimedPlace::Vector places = ParsePlaces(root); TimedTransition::Vector transitions = ParseTransitions(root); TAPNXmlParser::ArcCollections arcs = ParseArcs(root, places, transitions); - boost::shared_ptr tapn = boost::make_shared(places, transitions, arcs.inputArcs, arcs.outputArcs, arcs.transportArcs, arcs.inhibitorArcs); + std::shared_ptr tapn = std::make_shared(places, transitions, arcs.inputArcs, arcs.outputArcs, arcs.transportArcs, arcs.inhibitorArcs); return tapn; } @@ -61,7 +64,7 @@ namespace VerifyTAPN { xml_node<>* placeNode = root.first_node("place"); while(placeNode != NULL){ - boost::shared_ptr place = ParsePlace(*placeNode); + std::shared_ptr place = ParsePlace(*placeNode); places.push_back(place); placeNode = placeNode->next_sibling("place"); } @@ -69,14 +72,14 @@ namespace VerifyTAPN { return places; } - boost::shared_ptr TAPNXmlParser::ParsePlace(const xml_node<>& placeNode) const + std::shared_ptr TAPNXmlParser::ParsePlace(const xml_node<>& placeNode) const { std::string id(placeNode.first_attribute("id")->value()); std::string name(placeNode.first_attribute("name")->value()); std::string invariantNode = placeNode.first_attribute("invariant")->value(); TimeInvariant timeInvariant = TimeInvariant::CreateFor(invariantNode); - return boost::make_shared(name, id, timeInvariant); + return std::make_shared(name, id, timeInvariant); } TimedTransition::Vector TAPNXmlParser::ParseTransitions(const xml_node<>& root) const @@ -85,7 +88,7 @@ namespace VerifyTAPN { xml_node<>* transitionNode = root.first_node("transition"); while(transitionNode != NULL){ - boost::shared_ptr transition = ParseTransition(*transitionNode); + std::shared_ptr transition = ParseTransition(*transitionNode); transitions.push_back(transition); transitionNode = transitionNode->next_sibling("transition"); } @@ -93,11 +96,11 @@ namespace VerifyTAPN { return transitions; } - boost::shared_ptr TAPNXmlParser::ParseTransition(const xml_node<>& transitionNode) const + std::shared_ptr TAPNXmlParser::ParseTransition(const xml_node<>& transitionNode) const { std::string id(transitionNode.first_attribute("id")->value()); std::string name(transitionNode.first_attribute("name")->value()); - return boost::make_shared(name, id); + return std::make_shared(name, id); } TAPNXmlParser::ArcCollections TAPNXmlParser::ParseArcs(const xml_node<>& root, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const @@ -157,7 +160,7 @@ namespace VerifyTAPN { return outputArcs; } - boost::shared_ptr TAPNXmlParser::ParseInputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const + std::shared_ptr TAPNXmlParser::ParseInputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const { std::string source = arcNode.first_attribute("source")->value(); std::string target = arcNode.first_attribute("target")->value(); @@ -166,10 +169,10 @@ namespace VerifyTAPN { TimedPlace::Vector::const_iterator place = find_if(places.begin(), places.end(), boost::bind(boost::mem_fn(&TimedPlace::GetId), _1) == source); TimedTransition::Vector::const_iterator transition = find_if(transitions.begin(), transitions.end(), boost::bind(boost::mem_fn(&TimedTransition::GetId), _1) == target); - return boost::make_shared(*place, *transition, TimeInterval::CreateFor(interval)); + return std::make_shared(*place, *transition, TimeInterval::CreateFor(interval)); } - boost::shared_ptr TAPNXmlParser::ParseTransportArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const + std::shared_ptr TAPNXmlParser::ParseTransportArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const { std::string sourceName = arcNode.first_attribute("source")->value(); std::string transitionName = arcNode.first_attribute("transition")->value(); @@ -179,10 +182,10 @@ namespace VerifyTAPN { TimedPlace::Vector::const_iterator source = find_if(places.begin(), places.end(), boost::bind(boost::mem_fn(&TimedPlace::GetId), _1) == sourceName); TimedTransition::Vector::const_iterator transition = find_if(transitions.begin(), transitions.end(), boost::bind(boost::mem_fn(&TimedTransition::GetId), _1) == transitionName); TimedPlace::Vector::const_iterator target = find_if(places.begin(), places.end(), boost::bind(boost::mem_fn(&TimedPlace::GetId), _1) == targetName); - return boost::make_shared(*source, *transition, *target, TimeInterval::CreateFor(interval)); + return std::make_shared(*source, *transition, *target, TimeInterval::CreateFor(interval)); } - boost::shared_ptr TAPNXmlParser::ParseInhibitorArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const + std::shared_ptr TAPNXmlParser::ParseInhibitorArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const { std::string source = arcNode.first_attribute("source")->value(); std::string target = arcNode.first_attribute("target")->value(); @@ -190,10 +193,10 @@ namespace VerifyTAPN { TimedPlace::Vector::const_iterator place = find_if(places.begin(), places.end(), boost::bind(boost::mem_fn(&TimedPlace::GetId), _1) == source); TimedTransition::Vector::const_iterator transition = find_if(transitions.begin(), transitions.end(), boost::bind(boost::mem_fn(&TimedTransition::GetId), _1) == target); - return boost::make_shared(*place, *transition); + return std::make_shared(*place, *transition); } - boost::shared_ptr TAPNXmlParser::ParseOutputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const + std::shared_ptr TAPNXmlParser::ParseOutputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const { std::string source = arcNode.first_attribute("source")->value(); std::string target = arcNode.first_attribute("target")->value(); @@ -201,7 +204,7 @@ namespace VerifyTAPN { TimedTransition::Vector::const_iterator transition = find_if(transitions.begin(), transitions.end(), boost::bind(boost::mem_fn(&TimedTransition::GetId), _1) == source); TimedPlace::Vector::const_iterator place = find_if(places.begin(), places.end(), boost::bind(boost::mem_fn(&TimedPlace::GetId), _1) == target); - return boost::make_shared(*transition, *place); + return std::make_shared(*transition, *place); } diff --git a/src/Core/TAPNParser/TAPNXmlParser.hpp b/src/Core/TAPNParser/TAPNXmlParser.hpp index b734472..96d5289 100644 --- a/src/Core/TAPNParser/TAPNXmlParser.hpp +++ b/src/Core/TAPNParser/TAPNXmlParser.hpp @@ -3,7 +3,6 @@ #include "../TAPN/TAPN.hpp" -#include #include namespace VerifyTAPN { @@ -28,26 +27,26 @@ namespace VerifyTAPN { virtual ~TAPNXmlParser() { /* empty */ }; public: - boost::shared_ptr Parse(const std::string & filename) const; + std::shared_ptr Parse(const std::string & filename) const; std::vector ParseMarking(const std::string & filename, const TimedArcPetriNet& tapn) const; private: - boost::shared_ptr ParseTAPN(const rapidxml::xml_node<> & root) const; + std::shared_ptr ParseTAPN(const rapidxml::xml_node<> & root) const; TimedPlace::Vector ParsePlaces(const rapidxml::xml_node<>& root) const; - boost::shared_ptr ParsePlace(const rapidxml::xml_node<>& placeNode) const; + std::shared_ptr ParsePlace(const rapidxml::xml_node<>& placeNode) const; TimedTransition::Vector ParseTransitions(const rapidxml::xml_node<>& root) const; - boost::shared_ptr ParseTransition(const rapidxml::xml_node<>& transitionNode) const; + std::shared_ptr ParseTransition(const rapidxml::xml_node<>& transitionNode) const; ArcCollections ParseArcs(const rapidxml::xml_node<>& root, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; TransportArc::Vector ParseTransportArcs(const rapidxml::xml_node<>& root, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; InhibitorArc::Vector ParseInhibitorArcs(const rapidxml::xml_node<>& root, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; TimedInputArc::Vector ParseInputArcs(const rapidxml::xml_node<>& root, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; OutputArc::Vector ParseOutputArcs(const rapidxml::xml_node<>& root, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; - boost::shared_ptr ParseInputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; - boost::shared_ptr ParseInhibitorArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; - boost::shared_ptr ParseTransportArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; - boost::shared_ptr ParseOutputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; + std::shared_ptr ParseInputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; + std::shared_ptr ParseInhibitorArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; + std::shared_ptr ParseTransportArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; + std::shared_ptr ParseOutputArc(const rapidxml::xml_node<>& arcNode, const TimedPlace::Vector& places, const TimedTransition::Vector& transitions) const; std::vector ParseInitialMarking(const rapidxml::xml_node<>& root, const TimedArcPetriNet& tapn) const; }; } diff --git a/src/ReachabilityChecker/SuccessorGenerator.cpp b/src/ReachabilityChecker/SuccessorGenerator.cpp index 39a0436..3cb50bd 100644 --- a/src/ReachabilityChecker/SuccessorGenerator.cpp +++ b/src/ReachabilityChecker/SuccessorGenerator.cpp @@ -51,12 +51,10 @@ namespace VerifyTAPN { { unsigned int currInputArcIdx = 0; - for(TAPN::TimedTransition::Vector::const_iterator iter = transitions.begin(); iter != transitions.end(); ++iter) + for(auto& trans : transitions) { - const TAPN::TransportArc::WeakPtrVector& transportArcs = (*iter)->GetTransportArcs(); - for(TAPN::TransportArc::WeakPtrVector::const_iterator presetIter = transportArcs.begin(); presetIter != transportArcs.end(); ++presetIter) + for(auto* ta : trans->GetTransportArcs()) { - boost::shared_ptr ta = (*presetIter).lock(); const TAPN::TimeInterval& ti = ta->Interval(); int currInputPlaceIndex = tapn.GetPlaceIndex(ta->Source()); @@ -64,10 +62,8 @@ namespace VerifyTAPN { currInputArcIdx++; } - const TAPN::TimedInputArc::WeakPtrVector& preset = (*iter)->GetPreset(); - for(TAPN::TimedInputArc::WeakPtrVector::const_iterator presetIter = preset.begin(); presetIter != preset.end(); ++presetIter) + for(auto* ia : trans->GetPreset()) { - boost::shared_ptr ia = (*presetIter).lock(); const TAPN::TimeInterval& ti = ia->Interval(); int currInputPlaceIndex = tapn.GetPlaceIndex(ia->InputPlace()); @@ -135,10 +131,8 @@ namespace VerifyTAPN { // along with the size of the preset of the transition bool SuccessorGenerator::IsTransitionEnabled(const TAPN::TimedTransition& transition, const SymbolicMarking* marking, unsigned int currTransitionIndex, unsigned int presetSize) const { - const TAPN::InhibitorArc::WeakPtrVector& inhibitorArcs = transition.GetInhibitorArcs(); - for(TAPN::InhibitorArc::WeakPtrVector::const_iterator iter = inhibitorArcs.begin(); iter != inhibitorArcs.end(); ++iter) + for(auto* ia : transition.GetInhibitorArcs()) { - boost::shared_ptr ia = iter->lock(); int sourcePlaceIndex = ia->InputPlace().GetIndex(); for(unsigned int i = 0; i < marking->NumberOfTokens(); i++) @@ -163,13 +157,13 @@ namespace VerifyTAPN { bool trace = options.GetTrace() != NONE; const Pairing& pairing = tapn.GetPairing(transition); - const TAPN::TimedInputArc::WeakPtrVector& preset = transition.GetPreset(); + const TAPN::TimedInputArc::NakedPtrVector& preset = transition.GetPreset(); std::set tokensToRemove; // sets are sorted internally in ascending order. THIS MUST BE THE CASE OR THE CODE WONT WORK! SymbolicMarking* next = factory.Clone(*marking); for(unsigned int i = 0; i < transition.NumberOfTransportArcs(); ++i) { - boost::shared_ptr ta = transition.GetTransportArcs()[i].lock(); + TAPN::TransportArc* ta = transition.GetTransportArcs()[i]; const TAPN::TimeInterval& ti = ta->Interval(); int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+i, currentPermutationindices[i])]; @@ -191,7 +185,7 @@ namespace VerifyTAPN { // move all tokens that are currently in the net for(unsigned int i = 0; i < transition.NumberOfInputArcs(); ++i) { - boost::shared_ptr inputArc = preset[i].lock(); + auto* inputArc = preset[i]; int inputPlace = tapn.GetPlaceIndex(inputArc->InputPlace()); const TAPN::TimeInterval& ti = inputArc->Interval(); const std::list& outputPlaces = pairing.GetOutputPlacesFor(inputPlace); @@ -199,11 +193,10 @@ namespace VerifyTAPN { // only BOTTOM is allowed to have more than 1 associated output place assert(outputPlaces.size() <= 1); - for(std::list::const_iterator opIter = outputPlaces.begin(); opIter != outputPlaces.end(); ++opIter) + for(auto outputPlaceIndex : outputPlaces) { // change placement int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+offset+i, currentPermutationindices[offset+i])]; - int outputPlaceIndex = *opIter; // constrain dbm with the guard of the input arc next->Constrain(tokenIndex, ti); @@ -280,13 +273,13 @@ namespace VerifyTAPN { for(unsigned int i = 0; i < transition.NumberOfTransportArcs(); i++) { int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+i, currentPermutationindices[i])]; - boost::shared_ptr ia = transition.GetTransportArcs()[i].lock(); + TAPN::TransportArc* ia = transition.GetTransportArcs()[i]; const TAPN::TimeInterval& ti = ia->Interval(); int indexAfterFiring = tokenIndex; - for(std::set::iterator iter = tokensToRemove.begin(); iter != tokensToRemove.end(); ++iter) + for(auto to_remove : tokensToRemove) { - if(*iter < tokenIndex) indexAfterFiring--; - assert(*iter != tokenIndex); + if(to_remove < tokenIndex) indexAfterFiring--; + assert(to_remove != tokenIndex); } assert(tokenIndex < static_cast(marking->NumberOfTokens())); assert(indexAfterFiring < static_cast(next->NumberOfTokens())); @@ -299,7 +292,7 @@ namespace VerifyTAPN { for(unsigned int i = 0; i < transition.NumberOfInputArcs(); ++i) { int tokenIndex = tokenIndices[toIndex(currentTransitionIndex+offset+i, currentPermutationindices[offset+i])]; - boost::shared_ptr ia = preset[i].lock(); + TAPN::TimedInputArc* ia = preset[i]; const TAPN::TimeInterval& ti = ia->Interval(); int indexAfterFiring = tokenIndex; for(std::set::iterator iter = tokensToRemove.begin(); iter != tokensToRemove.end(); ++iter) @@ -373,23 +366,6 @@ namespace VerifyTAPN { mapping.Swap(table); } -// void SuccessorGenerator::InvertMapping(std::vector& mapping) const -// { -// std::vector inverted(mapping.size(),-1); -// unsigned int count = 0; -// for(unsigned int i = 0; i < mapping.size(); ++i) -// { -// int index = mapping[i]; -// if(index >= 0) -// { -// inverted[index] = i; -// count++; -// } -// } -// inverted.resize(count); -// mapping.swap(inverted); -// } - void SuccessorGenerator::PrintTransitionStatistics(std::ostream& out) const { out << std::endl << "TRANSITION STATISTICS"; for (int i=0;i& tapn) +MarkingFactory* CreateFactory(const VerificationOptions& options, const std::shared_ptr& tapn) { switch(options.GetFactory()) { @@ -37,7 +37,7 @@ MarkingFactory* CreateFactory(const VerificationOptions& options, const boost::s }; } -SearchStrategy* CreateSearchStrategy(const boost::shared_ptr& tapn, SymbolicMarking* initialMarking, AST::Query* query, const VerificationOptions& options, MarkingFactory* factory) +SearchStrategy* CreateSearchStrategy(const std::shared_ptr& tapn, SymbolicMarking* initialMarking, AST::Query* query, const VerificationOptions& options, MarkingFactory* factory) { SearchStrategy* strategy; @@ -98,7 +98,7 @@ int main(int argc, char* argv[]) VerificationOptions options = parser.Parse(argc, argv); TAPNXmlParser modelParser; - boost::shared_ptr tapn; + std::shared_ptr tapn; try{ tapn = modelParser.Parse(options.GetInputFile()); From c57ba1e3e206c9777353a2105a38af940e246f88 Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Mon, 22 Nov 2021 12:04:54 +0100 Subject: [PATCH 5/6] removed smart pointers --- src/Core/ArgsParser.cpp | 1 - src/Core/ArgsParser.hpp | 6 ++++-- src/Core/TAPN/InhibitorArc.hpp | 4 +++- src/Core/TAPN/OutputArc.hpp | 1 + src/Core/TAPN/TimedArcPetriNet.hpp | 1 - src/Core/TAPN/TimedInputArc.hpp | 4 +++- src/Core/TAPN/TimedTransition.hpp | 8 +++++--- src/Core/TAPN/TransportArc.hpp | 5 +++-- src/ReachabilityChecker/SuccessorGenerator.hpp | 1 - src/main.cpp | 1 - 10 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Core/ArgsParser.cpp b/src/Core/ArgsParser.cpp index a3329c9..ac913bd 100644 --- a/src/Core/ArgsParser.cpp +++ b/src/Core/ArgsParser.cpp @@ -3,7 +3,6 @@ #include #include "boost/algorithm/string.hpp" #include "boost/lexical_cast.hpp" -#include "boost/make_shared.hpp" #include #include "boost/tokenizer.hpp" diff --git a/src/Core/ArgsParser.hpp b/src/Core/ArgsParser.hpp index 4d5a6b7..f11f07e 100644 --- a/src/Core/ArgsParser.hpp +++ b/src/Core/ArgsParser.hpp @@ -1,12 +1,14 @@ #ifndef ARGSPARSER_HPP_ #define ARGSPARSER_HPP_ +#include "VerificationOptions.hpp" +#include "boost/lexical_cast.hpp" + #include #include #include #include -#include "VerificationOptions.hpp" -#include "boost/lexical_cast.hpp" +#include namespace VerifyTAPN { diff --git a/src/Core/TAPN/InhibitorArc.hpp b/src/Core/TAPN/InhibitorArc.hpp index deb1c18..e0cf0db 100644 --- a/src/Core/TAPN/InhibitorArc.hpp +++ b/src/Core/TAPN/InhibitorArc.hpp @@ -1,9 +1,11 @@ #ifndef INHIBITORARC_HPP_ #define INHIBITORARC_HPP_ -#include #include "TimeInterval.hpp" +#include +#include + namespace VerifyTAPN { namespace TAPN { class TimedTransition; diff --git a/src/Core/TAPN/OutputArc.hpp b/src/Core/TAPN/OutputArc.hpp index 2a36238..3843f78 100644 --- a/src/Core/TAPN/OutputArc.hpp +++ b/src/Core/TAPN/OutputArc.hpp @@ -2,6 +2,7 @@ #define VERIFYTAPN_TAPN_OUTPUTARC_HPP_ #include +#include namespace VerifyTAPN { namespace TAPN { diff --git a/src/Core/TAPN/TimedArcPetriNet.hpp b/src/Core/TAPN/TimedArcPetriNet.hpp index 2464ab7..b1f5ec5 100644 --- a/src/Core/TAPN/TimedArcPetriNet.hpp +++ b/src/Core/TAPN/TimedArcPetriNet.hpp @@ -8,7 +8,6 @@ #include "TransportArc.hpp" #include "InhibitorArc.hpp" #include "OutputArc.hpp" -#include "boost/make_shared.hpp" #include "google/sparse_hash_map" #include "boost/functional/hash.hpp" #include "Pairing.hpp" diff --git a/src/Core/TAPN/TimedInputArc.hpp b/src/Core/TAPN/TimedInputArc.hpp index 5456a2a..0489fe7 100644 --- a/src/Core/TAPN/TimedInputArc.hpp +++ b/src/Core/TAPN/TimedInputArc.hpp @@ -1,9 +1,11 @@ #ifndef VERIFYTAPN_TAPN_TIMEDINPUTARC_HPP_ #define VERIFYTAPN_TAPN_TIMEDINPUTARC_HPP_ -#include #include "TimeInterval.hpp" +#include +#include + namespace VerifyTAPN { namespace TAPN { class TimedTransition; diff --git a/src/Core/TAPN/TimedTransition.hpp b/src/Core/TAPN/TimedTransition.hpp index b69e850..a2a6026 100644 --- a/src/Core/TAPN/TimedTransition.hpp +++ b/src/Core/TAPN/TimedTransition.hpp @@ -1,13 +1,15 @@ #ifndef VERIFYTAPN_TAPN_TIMEDTRANSITION_HPP_ #define VERIFYTAPN_TAPN_TIMEDTRANSITION_HPP_ -#include -#include #include "TimedInputArc.hpp" #include "TransportArc.hpp" #include "InhibitorArc.hpp" #include "OutputArc.hpp" -#include "boost/shared_ptr.hpp" + +#include +#include +#include + namespace VerifyTAPN { diff --git a/src/Core/TAPN/TransportArc.hpp b/src/Core/TAPN/TransportArc.hpp index b2b933a..95349b3 100644 --- a/src/Core/TAPN/TransportArc.hpp +++ b/src/Core/TAPN/TransportArc.hpp @@ -1,9 +1,10 @@ #ifndef TRANSPORTARC_HPP_ #define TRANSPORTARC_HPP_ -#include #include "TimeInterval.hpp" -#include "boost/smart_ptr.hpp" + +#include +#include namespace VerifyTAPN { diff --git a/src/ReachabilityChecker/SuccessorGenerator.hpp b/src/ReachabilityChecker/SuccessorGenerator.hpp index 225c6e9..e91c66b 100644 --- a/src/ReachabilityChecker/SuccessorGenerator.hpp +++ b/src/ReachabilityChecker/SuccessorGenerator.hpp @@ -7,7 +7,6 @@ #include "../Core/SymbolicMarking/MarkingFactory.hpp" #include -#include namespace VerifyTAPN { class SymbolicMarking; diff --git a/src/main.cpp b/src/main.cpp index 464173b..96d3258 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,4 @@ #include -#include "boost/smart_ptr.hpp" #include "Core/TAPNParser/TAPNXmlParser.hpp" #include "Core/VerificationOptions.hpp" #include "Core/ArgsParser.hpp" From eea8a5130ea17a8c700e0895a42b33aa07b70f7a Mon Sep 17 00:00:00 2001 From: "Peter G. Jensen" Date: Mon, 22 Nov 2021 13:29:30 +0100 Subject: [PATCH 6/6] fixing cmake --- CMakeLists.txt | 12 ++++++------ src/CMakeLists.txt | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7235660..0c8c464 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,12 +31,12 @@ set(VERIFYTAPN_OSX_DEPLOYMENT_TARGET 10.8 CACHE STRING "Specify the minimum vers if (VERIFYTAPN_Static) set(BUILD_SHARED_LIBS OFF) #It seems linking -static does not work - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") - #if (NOT APPLE) - # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") - #else () - # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") - #endif() + #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") + if (NOT APPLE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + else () + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") + endif() endif () ## Configure Traget Platform diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b67ad39..6d36bd5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,8 +3,8 @@ add_subdirectory(Core) add_subdirectory(ReachabilityChecker) add_executable(verifytapn-${ARCH_TYPE} main.cpp) -target_link_libraries(verifytapn-${ARCH_TYPE} +target_link_libraries(verifytapn-${ARCH_TYPE} PRIVATE Core ReachabilityChecker - libdbm.a libbase.a libudebug.a libhash.a + -ldbm -lbase -ludebug -lhash )