PostGIS  2.3.7dev-r@@SVN_REVISION@@
while ( )

Definition at line 914 of file lwin_wkt_lex.c.

References CIRCULARSTRING_TOK, COLLECTION_TOK, COMMA_TOK, COMPOUNDCURVE_TOK, CURVEPOLYGON_TOK, DIMENSIONALITY_TOK, DOUBLE_TOK, YYSTYPE::doublevalue, ECHO, EMPTY_TOK, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, INITIAL, YYSTYPE::integervalue, LBRACKET_TOK, LINESTRING_TOK, LWDEBUG, MCURVE_TOK, MLINESTRING_TOK, MPOINT_TOK, MPOLYGON_TOK, MSURFACE_TOK, POINT_TOK, POLYGON_TOK, POLYHEDRALSURFACE_TOK, RBRACKET_TOK, SEMICOLON_TOK, SRID_TOK, YYSTYPE::stringvalue, TIN_TOK, TRIANGLE_TOK, wkt_lexer_read_srid(), wkt_lexer_unknown(), wkt_yyin, wkt_yylval, wkt_yytext, wkt_yywrap, YY_BREAK, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yy_c_buf_p, yy_cp, YY_CURRENT_BUFFER_LVALUE, yy_did_buffer_switch_on_eof, YY_DO_BEFORE_ACTION, YY_END_OF_BUFFER, YY_FATAL_ERROR, yy_get_next_buffer(), yy_get_previous_state(), yy_hold_char, yy_last_accepting_cpos, yy_last_accepting_state, YY_MORE_ADJ, yy_n_chars, YY_NEW_FILE, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, yy_start, YY_STATE_EOF, yy_try_NUL_trans(), yyterminate, and yytext_ptr.

Referenced by pgui_action_handle_file_drop().

915  {
916  yy_cp = (yy_c_buf_p);
917 
918  /* Support of wkt_yytext. */
919  *yy_cp = (yy_hold_char);
920 
921  /* yy_bp points to the position in yy_ch_buf of the start of
922  * the current run.
923  */
924  yy_bp = yy_cp;
925 
926  yy_current_state = (yy_start);
927 yy_match:
928  do
929  {
930  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
931  if ( yy_accept[yy_current_state] )
932  {
933  (yy_last_accepting_state) = yy_current_state;
935  }
936  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
937  {
938  yy_current_state = (int) yy_def[yy_current_state];
939  if ( yy_current_state >= 172 )
940  yy_c = yy_meta[(unsigned int) yy_c];
941  }
942  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
943  ++yy_cp;
944  }
945  while ( yy_current_state != 171 );
947  yy_current_state = (yy_last_accepting_state);
948 
949 yy_find_action:
950  yy_act = yy_accept[yy_current_state];
951 
953 
954 do_action: /* This label is used only to access EOF actions. */
955 
956  switch ( yy_act )
957  { /* beginning of action switch */
958  case 0: /* must back up */
959  /* undo the effects of YY_DO_BEFORE_ACTION */
960  *yy_cp = (yy_hold_char);
962  yy_current_state = (yy_last_accepting_state);
963  goto yy_find_action;
964 
965 case 1:
967 #line 69 "lwin_wkt_lex.l"
968 {
969  LWDEBUG(5,"DOUBLE");
971  return DOUBLE_TOK;
972  }
973  YY_BREAK
974 case 2:
976 #line 75 "lwin_wkt_lex.l"
977 {
978  LWDEBUG(5,"SRID");
980  return SRID_TOK;
981  }
982  YY_BREAK
983 case 3:
985 #line 81 "lwin_wkt_lex.l"
986 { return COLLECTION_TOK; }
987  YY_BREAK
988 case 4:
990 #line 82 "lwin_wkt_lex.l"
991 { return MSURFACE_TOK; }
992  YY_BREAK
993 case 5:
995 #line 83 "lwin_wkt_lex.l"
996 { return MPOLYGON_TOK; }
997  YY_BREAK
998 case 6:
1000 #line 84 "lwin_wkt_lex.l"
1001 { return MCURVE_TOK; }
1002  YY_BREAK
1003 case 7:
1005 #line 85 "lwin_wkt_lex.l"
1006 { return MLINESTRING_TOK; }
1007  YY_BREAK
1008 case 8:
1010 #line 86 "lwin_wkt_lex.l"
1011 { return MPOINT_TOK; }
1012  YY_BREAK
1013 case 9:
1015 #line 87 "lwin_wkt_lex.l"
1016 { return CURVEPOLYGON_TOK; }
1017  YY_BREAK
1018 case 10:
1020 #line 88 "lwin_wkt_lex.l"
1021 { return POLYGON_TOK; }
1022  YY_BREAK
1023 case 11:
1025 #line 89 "lwin_wkt_lex.l"
1026 { return COMPOUNDCURVE_TOK; }
1027  YY_BREAK
1028 case 12:
1030 #line 90 "lwin_wkt_lex.l"
1031 { return CIRCULARSTRING_TOK; }
1032  YY_BREAK
1033 case 13:
1035 #line 91 "lwin_wkt_lex.l"
1036 { return LINESTRING_TOK; }
1037  YY_BREAK
1038 case 14:
1040 #line 92 "lwin_wkt_lex.l"
1041 { return POLYHEDRALSURFACE_TOK; }
1042  YY_BREAK
1043 case 15:
1045 #line 93 "lwin_wkt_lex.l"
1046 { return TRIANGLE_TOK; }
1047  YY_BREAK
1048 case 16:
1050 #line 94 "lwin_wkt_lex.l"
1051 { return TIN_TOK; }
1052  YY_BREAK
1053 case 17:
1055 #line 95 "lwin_wkt_lex.l"
1056 { return POINT_TOK; }
1057  YY_BREAK
1058 case 18:
1060 #line 96 "lwin_wkt_lex.l"
1061 { return EMPTY_TOK; }
1062  YY_BREAK
1063 case 19:
1065 #line 98 "lwin_wkt_lex.l"
1066 {
1067  LWDEBUG(5,"DIMENSIONALITY");
1069  return DIMENSIONALITY_TOK;
1070  }
1071  YY_BREAK
1072 case 20:
1074 #line 104 "lwin_wkt_lex.l"
1075 { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; }
1076  YY_BREAK
1077 case 21:
1079 #line 105 "lwin_wkt_lex.l"
1080 { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; }
1081  YY_BREAK
1082 case 22:
1084 #line 106 "lwin_wkt_lex.l"
1085 { LWDEBUG(5,"COMMA"); return COMMA_TOK; }
1086  YY_BREAK
1087 case 23:
1089 #line 107 "lwin_wkt_lex.l"
1090 { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; }
1091  YY_BREAK
1092 case 24:
1093 /* rule 24 can match eol */
1095 #line 109 "lwin_wkt_lex.l"
1096 { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); }
1097  YY_BREAK
1098 case 25:
1100 #line 111 "lwin_wkt_lex.l"
1101 { /* Error out and stop parsing on unknown/unexpected characters */
1102  LWDEBUG(5,"UNKNOWN");
1104  yyterminate();
1105  }
1106  YY_BREAK
1107 case 26:
1109 #line 117 "lwin_wkt_lex.l"
1110 ECHO;
1111  YY_BREAK
1112 #line 1088 "lwin_wkt_lex.c"
1113 case YY_STATE_EOF(INITIAL):
1114  yyterminate();
1115 
1116  case YY_END_OF_BUFFER:
1117  {
1118  /* Amount of text matched not including the EOB char. */
1119  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1120 
1121  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1122  *yy_cp = (yy_hold_char);
1124 
1125  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1126  {
1127  /* We're scanning a new file or input source. It's
1128  * possible that this happened because the user
1129  * just pointed wkt_yyin at a new source and called
1130  * wkt_yylex(). If so, then we have to assure
1131  * consistency between YY_CURRENT_BUFFER and our
1132  * globals. Here is the right place to do so, because
1133  * this is the first action (other than possibly a
1134  * back-up) that will match for the new input source.
1135  */
1136  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1137  YY_CURRENT_BUFFER_LVALUE->yy_input_file = wkt_yyin;
1138  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1139  }
1140 
1141  /* Note that here we test for yy_c_buf_p "<=" to the position
1142  * of the first EOB in the buffer, since yy_c_buf_p will
1143  * already have been incremented past the NUL character
1144  * (since all states make transitions on EOB to the
1145  * end-of-buffer state). Contrast this with the test
1146  * in input().
1147  */
1148  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1149  { /* This was really a NUL. */
1150  yy_state_type yy_next_state;
1151 
1152  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1153 
1154  yy_current_state = yy_get_previous_state( );
1155 
1156  /* Okay, we're now positioned to make the NUL
1157  * transition. We couldn't have
1158  * yy_get_previous_state() go ahead and do it
1159  * for us because it doesn't know how to deal
1160  * with the possibility of jamming (and we don't
1161  * want to build jamming into it because then it
1162  * will run more slowly).
1163  */
1164 
1165  yy_next_state = yy_try_NUL_trans( yy_current_state );
1166 
1168 
1169  if ( yy_next_state )
1170  {
1171  /* Consume the NUL. */
1172  yy_cp = ++(yy_c_buf_p);
1173  yy_current_state = yy_next_state;
1174  goto yy_match;
1175  }
1176 
1177  else
1178  {
1180  yy_current_state = (yy_last_accepting_state);
1181  goto yy_find_action;
1182  }
1183  }
1184 
1185  else switch ( yy_get_next_buffer( ) )
1186  {
1187  case EOB_ACT_END_OF_FILE:
1188  {
1190 
1191  if ( wkt_yywrap( ) )
1192  {
1193  /* Note: because we've taken care in
1194  * yy_get_next_buffer() to have set up
1195  * wkt_yytext, we can now set up
1196  * yy_c_buf_p so that if some total
1197  * hoser (like flex itself) wants to
1198  * call the scanner after we return the
1199  * YY_NULL, it'll still work - another
1200  * YY_NULL will get returned.
1201  */
1203 
1205  goto do_action;
1206  }
1207 
1208  else
1209  {
1210  if ( ! (yy_did_buffer_switch_on_eof) )
1211  YY_NEW_FILE;
1212  }
1213  break;
1214  }
1215 
1216  case EOB_ACT_CONTINUE_SCAN:
1217  (yy_c_buf_p) =
1218  (yytext_ptr) + yy_amount_of_matched_text;
1219 
1220  yy_current_state = yy_get_previous_state( );
1221 
1222  yy_cp = (yy_c_buf_p);
1224  goto yy_match;
1225 
1226  case EOB_ACT_LAST_MATCH:
1227  (yy_c_buf_p) =
1228  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1229 
1230  yy_current_state = yy_get_previous_state( );
1231 
1232  yy_cp = (yy_c_buf_p);
1234  goto yy_find_action;
1235  }
1236  break;
1237  }
1238 
1239  default:
1241  "fatal flex scanner internal error--no action found" );
1242  } /* end of action switch */
1243  } /* end of scanning one token */
static yy_state_type yy_get_previous_state(void)
static int yy_did_buffer_switch_on_eof
Definition: lwin_wkt_lex.c:330
#define EOB_ACT_LAST_MATCH
Definition: lwin_wkt_lex.c:212
static yyconst flex_int16_t yy_nxt[419]
Definition: lwin_wkt_lex.c:531
char * stringvalue
int wkt_lexer_read_srid(char *str)
Read the SRID number from an SRID=<> string.
Definition: lwin_wkt.c:61
static yyconst flex_int32_t yy_meta[53]
Definition: lwin_wkt_lex.c:475
#define YY_STATE_EOF(state)
Definition: lwin_wkt_lex.c:180
#define YY_BUFFER_NORMAL
Definition: lwin_wkt_lex.c:281
static int yy_get_next_buffer(void)
FILE * wkt_yyin
Definition: lwin_wkt_lex.c:385
#define YY_RULE_SETUP
Definition: lwin_wkt_lex.c:872
register char * yy_cp
Definition: lwin_wkt_lex.c:880
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
register char * yy_bp
Definition: lwin_wkt_lex.c:880
static yyconst flex_int16_t yy_chk[419]
Definition: lwin_wkt_lex.c:581
#define YY_BREAK
Definition: lwin_wkt_lex.c:869
#define yyterminate()
Definition: lwin_wkt_lex.c:834
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define YY_SC_TO_UI(c)
Definition: lwin_wkt_lex.c:164
static yyconst flex_int16_t yy_accept[172]
Definition: lwin_wkt_lex.c:420
#define EOB_ACT_END_OF_FILE
Definition: lwin_wkt_lex.c:211
#define YY_END_OF_BUFFER
Definition: lwin_wkt_lex.c:412
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:280
char * wkt_yytext
Definition: lwin_wkt_lex.c:644
static yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:319
unsigned char YY_CHAR
Definition: lwin_wkt_lex.c:383
#define INITIAL
Definition: lwin_wkt_lex.c:705
#define ECHO
Definition: lwin_wkt_lex.c:790
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:844
#define YY_CURRENT_BUFFER_LVALUE
Definition: lwin_wkt_lex.c:315
register int yy_act
Definition: lwin_wkt_lex.c:881
static void wkt_lexer_unknown()
Definition: lwin_wkt_lex.c:678
#define wkt_yywrap()
Definition: lwin_wkt_lex.c:380
int integervalue
double doublevalue
#define YY_MORE_ADJ
Definition: lwin_wkt_lex.c:642
static char * yy_c_buf_p
Definition: lwin_wkt_lex.c:323
int yy_state_type
Definition: lwin_wkt_lex.c:387
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lwin_wkt_lex.c:643
static yy_state_type yy_last_accepting_state
Definition: lwin_wkt_lex.c:631
#define EOB_ACT_CONTINUE_SCAN
Definition: lwin_wkt_lex.c:210
#define YY_NEW_FILE
Definition: lwin_wkt_lex.c:183
#define YY_DO_BEFORE_ACTION
Definition: lwin_wkt_lex.c:404
static yyconst flex_int16_t yy_def[172]
Definition: lwin_wkt_lex.c:508
#define YY_START
Definition: lwin_wkt_lex.c:176
static yyconst flex_int16_t yy_base[172]
Definition: lwin_wkt_lex.c:485
static char * yy_last_accepting_cpos
Definition: lwin_wkt_lex.c:632
static char yy_hold_char
Definition: lwin_wkt_lex.c:318
#define yytext_ptr
Definition: lwin_wkt_lex.c:394
static int yy_start
Definition: lwin_wkt_lex.c:325
YYSTYPE wkt_yylval
static yyconst flex_int32_t yy_ec[256]
Definition: lwin_wkt_lex.c:443

Here is the call graph for this function:

Here is the caller graph for this function: