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

Definition at line 889 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().

890  {
891  yy_cp = (yy_c_buf_p);
892 
893  /* Support of wkt_yytext. */
894  *yy_cp = (yy_hold_char);
895 
896  /* yy_bp points to the position in yy_ch_buf of the start of
897  * the current run.
898  */
899  yy_bp = yy_cp;
900 
901  yy_current_state = (yy_start);
902 yy_match:
903  do
904  {
905  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
906  if ( yy_accept[yy_current_state] )
907  {
908  (yy_last_accepting_state) = yy_current_state;
910  }
911  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
912  {
913  yy_current_state = (int) yy_def[yy_current_state];
914  if ( yy_current_state >= 172 )
915  yy_c = yy_meta[(unsigned int) yy_c];
916  }
917  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
918  ++yy_cp;
919  }
920  while ( yy_current_state != 171 );
922  yy_current_state = (yy_last_accepting_state);
923 
924 yy_find_action:
925  yy_act = yy_accept[yy_current_state];
926 
928 
929 do_action: /* This label is used only to access EOF actions. */
930 
931  switch ( yy_act )
932  { /* beginning of action switch */
933  case 0: /* must back up */
934  /* undo the effects of YY_DO_BEFORE_ACTION */
935  *yy_cp = (yy_hold_char);
937  yy_current_state = (yy_last_accepting_state);
938  goto yy_find_action;
939 
940 case 1:
942 #line 69 "lwin_wkt_lex.l"
943 {
944  LWDEBUG(5,"DOUBLE");
946  return DOUBLE_TOK;
947  }
948  YY_BREAK
949 case 2:
951 #line 75 "lwin_wkt_lex.l"
952 {
953  LWDEBUG(5,"SRID");
955  return SRID_TOK;
956  }
957  YY_BREAK
958 case 3:
960 #line 81 "lwin_wkt_lex.l"
961 { return COLLECTION_TOK; }
962  YY_BREAK
963 case 4:
965 #line 82 "lwin_wkt_lex.l"
966 { return MSURFACE_TOK; }
967  YY_BREAK
968 case 5:
970 #line 83 "lwin_wkt_lex.l"
971 { return MPOLYGON_TOK; }
972  YY_BREAK
973 case 6:
975 #line 84 "lwin_wkt_lex.l"
976 { return MCURVE_TOK; }
977  YY_BREAK
978 case 7:
980 #line 85 "lwin_wkt_lex.l"
981 { return MLINESTRING_TOK; }
982  YY_BREAK
983 case 8:
985 #line 86 "lwin_wkt_lex.l"
986 { return MPOINT_TOK; }
987  YY_BREAK
988 case 9:
990 #line 87 "lwin_wkt_lex.l"
991 { return CURVEPOLYGON_TOK; }
992  YY_BREAK
993 case 10:
995 #line 88 "lwin_wkt_lex.l"
996 { return POLYGON_TOK; }
997  YY_BREAK
998 case 11:
1000 #line 89 "lwin_wkt_lex.l"
1001 { return COMPOUNDCURVE_TOK; }
1002  YY_BREAK
1003 case 12:
1005 #line 90 "lwin_wkt_lex.l"
1006 { return CIRCULARSTRING_TOK; }
1007  YY_BREAK
1008 case 13:
1010 #line 91 "lwin_wkt_lex.l"
1011 { return LINESTRING_TOK; }
1012  YY_BREAK
1013 case 14:
1015 #line 92 "lwin_wkt_lex.l"
1016 { return POLYHEDRALSURFACE_TOK; }
1017  YY_BREAK
1018 case 15:
1020 #line 93 "lwin_wkt_lex.l"
1021 { return TRIANGLE_TOK; }
1022  YY_BREAK
1023 case 16:
1025 #line 94 "lwin_wkt_lex.l"
1026 { return TIN_TOK; }
1027  YY_BREAK
1028 case 17:
1030 #line 95 "lwin_wkt_lex.l"
1031 { return POINT_TOK; }
1032  YY_BREAK
1033 case 18:
1035 #line 96 "lwin_wkt_lex.l"
1036 { return EMPTY_TOK; }
1037  YY_BREAK
1038 case 19:
1040 #line 98 "lwin_wkt_lex.l"
1041 {
1042  LWDEBUG(5,"DIMENSIONALITY");
1044  return DIMENSIONALITY_TOK;
1045  }
1046  YY_BREAK
1047 case 20:
1049 #line 104 "lwin_wkt_lex.l"
1050 { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; }
1051  YY_BREAK
1052 case 21:
1054 #line 105 "lwin_wkt_lex.l"
1055 { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; }
1056  YY_BREAK
1057 case 22:
1059 #line 106 "lwin_wkt_lex.l"
1060 { LWDEBUG(5,"COMMA"); return COMMA_TOK; }
1061  YY_BREAK
1062 case 23:
1064 #line 107 "lwin_wkt_lex.l"
1065 { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; }
1066  YY_BREAK
1067 case 24:
1068 /* rule 24 can match eol */
1070 #line 109 "lwin_wkt_lex.l"
1071 { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); }
1072  YY_BREAK
1073 case 25:
1075 #line 111 "lwin_wkt_lex.l"
1076 { /* Error out and stop parsing on unknown/unexpected characters */
1077  LWDEBUG(5,"UNKNOWN");
1079  yyterminate();
1080  }
1081  YY_BREAK
1082 case 26:
1084 #line 117 "lwin_wkt_lex.l"
1085 ECHO;
1086  YY_BREAK
1087 #line 1088 "lwin_wkt_lex.c"
1088 case YY_STATE_EOF(INITIAL):
1089  yyterminate();
1090 
1091  case YY_END_OF_BUFFER:
1092  {
1093  /* Amount of text matched not including the EOB char. */
1094  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1095 
1096  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1097  *yy_cp = (yy_hold_char);
1099 
1100  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1101  {
1102  /* We're scanning a new file or input source. It's
1103  * possible that this happened because the user
1104  * just pointed wkt_yyin at a new source and called
1105  * wkt_yylex(). If so, then we have to assure
1106  * consistency between YY_CURRENT_BUFFER and our
1107  * globals. Here is the right place to do so, because
1108  * this is the first action (other than possibly a
1109  * back-up) that will match for the new input source.
1110  */
1111  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1112  YY_CURRENT_BUFFER_LVALUE->yy_input_file = wkt_yyin;
1113  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1114  }
1115 
1116  /* Note that here we test for yy_c_buf_p "<=" to the position
1117  * of the first EOB in the buffer, since yy_c_buf_p will
1118  * already have been incremented past the NUL character
1119  * (since all states make transitions on EOB to the
1120  * end-of-buffer state). Contrast this with the test
1121  * in input().
1122  */
1123  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1124  { /* This was really a NUL. */
1125  yy_state_type yy_next_state;
1126 
1127  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1128 
1129  yy_current_state = yy_get_previous_state( );
1130 
1131  /* Okay, we're now positioned to make the NUL
1132  * transition. We couldn't have
1133  * yy_get_previous_state() go ahead and do it
1134  * for us because it doesn't know how to deal
1135  * with the possibility of jamming (and we don't
1136  * want to build jamming into it because then it
1137  * will run more slowly).
1138  */
1139 
1140  yy_next_state = yy_try_NUL_trans( yy_current_state );
1141 
1143 
1144  if ( yy_next_state )
1145  {
1146  /* Consume the NUL. */
1147  yy_cp = ++(yy_c_buf_p);
1148  yy_current_state = yy_next_state;
1149  goto yy_match;
1150  }
1151 
1152  else
1153  {
1155  yy_current_state = (yy_last_accepting_state);
1156  goto yy_find_action;
1157  }
1158  }
1159 
1160  else switch ( yy_get_next_buffer( ) )
1161  {
1162  case EOB_ACT_END_OF_FILE:
1163  {
1165 
1166  if ( wkt_yywrap( ) )
1167  {
1168  /* Note: because we've taken care in
1169  * yy_get_next_buffer() to have set up
1170  * wkt_yytext, we can now set up
1171  * yy_c_buf_p so that if some total
1172  * hoser (like flex itself) wants to
1173  * call the scanner after we return the
1174  * YY_NULL, it'll still work - another
1175  * YY_NULL will get returned.
1176  */
1178 
1180  goto do_action;
1181  }
1182 
1183  else
1184  {
1185  if ( ! (yy_did_buffer_switch_on_eof) )
1186  YY_NEW_FILE;
1187  }
1188  break;
1189  }
1190 
1191  case EOB_ACT_CONTINUE_SCAN:
1192  (yy_c_buf_p) =
1193  (yytext_ptr) + yy_amount_of_matched_text;
1194 
1195  yy_current_state = yy_get_previous_state( );
1196 
1197  yy_cp = (yy_c_buf_p);
1199  goto yy_match;
1200 
1201  case EOB_ACT_LAST_MATCH:
1202  (yy_c_buf_p) =
1203  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1204 
1205  yy_current_state = yy_get_previous_state( );
1206 
1207  yy_cp = (yy_c_buf_p);
1209  goto yy_find_action;
1210  }
1211  break;
1212  }
1213 
1214  default:
1216  "fatal flex scanner internal error--no action found" );
1217  } /* end of action switch */
1218  } /* 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:305
#define EOB_ACT_LAST_MATCH
Definition: lwin_wkt_lex.c:187
static yyconst flex_int16_t yy_nxt[419]
Definition: lwin_wkt_lex.c:506
char * stringvalue
int wkt_lexer_read_srid(char *str)
Read the SRID number from an SRID=<> string.
Definition: lwin_wkt.c:47
static yyconst flex_int32_t yy_meta[53]
Definition: lwin_wkt_lex.c:450
#define YY_STATE_EOF(state)
Definition: lwin_wkt_lex.c:155
#define YY_BUFFER_NORMAL
Definition: lwin_wkt_lex.c:256
static int yy_get_next_buffer(void)
FILE * wkt_yyin
Definition: lwin_wkt_lex.c:360
#define YY_RULE_SETUP
Definition: lwin_wkt_lex.c:847
register char * yy_cp
Definition: lwin_wkt_lex.c:855
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
register char * yy_bp
Definition: lwin_wkt_lex.c:855
static yyconst flex_int16_t yy_chk[419]
Definition: lwin_wkt_lex.c:556
#define YY_BREAK
Definition: lwin_wkt_lex.c:844
#define yyterminate()
Definition: lwin_wkt_lex.c:809
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define YY_SC_TO_UI(c)
Definition: lwin_wkt_lex.c:139
static yyconst flex_int16_t yy_accept[172]
Definition: lwin_wkt_lex.c:395
#define EOB_ACT_END_OF_FILE
Definition: lwin_wkt_lex.c:186
#define YY_END_OF_BUFFER
Definition: lwin_wkt_lex.c:387
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:255
char * wkt_yytext
Definition: lwin_wkt_lex.c:619
static yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:294
unsigned char YY_CHAR
Definition: lwin_wkt_lex.c:358
#define INITIAL
Definition: lwin_wkt_lex.c:680
#define ECHO
Definition: lwin_wkt_lex.c:765
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:819
#define YY_CURRENT_BUFFER_LVALUE
Definition: lwin_wkt_lex.c:290
register int yy_act
Definition: lwin_wkt_lex.c:856
static void wkt_lexer_unknown()
Definition: lwin_wkt_lex.c:653
#define wkt_yywrap()
Definition: lwin_wkt_lex.c:355
int integervalue
double doublevalue
#define YY_MORE_ADJ
Definition: lwin_wkt_lex.c:617
static char * yy_c_buf_p
Definition: lwin_wkt_lex.c:298
int yy_state_type
Definition: lwin_wkt_lex.c:362
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lwin_wkt_lex.c:618
static yy_state_type yy_last_accepting_state
Definition: lwin_wkt_lex.c:606
#define EOB_ACT_CONTINUE_SCAN
Definition: lwin_wkt_lex.c:185
#define YY_NEW_FILE
Definition: lwin_wkt_lex.c:158
#define YY_DO_BEFORE_ACTION
Definition: lwin_wkt_lex.c:379
static yyconst flex_int16_t yy_def[172]
Definition: lwin_wkt_lex.c:483
#define YY_START
Definition: lwin_wkt_lex.c:151
static yyconst flex_int16_t yy_base[172]
Definition: lwin_wkt_lex.c:460
static char * yy_last_accepting_cpos
Definition: lwin_wkt_lex.c:607
static char yy_hold_char
Definition: lwin_wkt_lex.c:293
#define yytext_ptr
Definition: lwin_wkt_lex.c:369
static int yy_start
Definition: lwin_wkt_lex.c:300
YYSTYPE wkt_yylval
static yyconst flex_int32_t yy_ec[256]
Definition: lwin_wkt_lex.c:418

Here is the call graph for this function:

Here is the caller graph for this function: