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

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

887  {
888  yy_cp = (yy_c_buf_p);
889 
890  /* Support of wkt_yytext. */
891  *yy_cp = (yy_hold_char);
892 
893  /* yy_bp points to the position in yy_ch_buf of the start of
894  * the current run.
895  */
896  yy_bp = yy_cp;
897 
898  yy_current_state = (yy_start);
899 yy_match:
900  do
901  {
902  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
903  if ( yy_accept[yy_current_state] )
904  {
905  (yy_last_accepting_state) = yy_current_state;
907  }
908  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
909  {
910  yy_current_state = (int) yy_def[yy_current_state];
911  if ( yy_current_state >= 172 )
912  yy_c = yy_meta[(unsigned int) yy_c];
913  }
914  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
915  ++yy_cp;
916  }
917  while ( yy_current_state != 171 );
919  yy_current_state = (yy_last_accepting_state);
920 
921 yy_find_action:
922  yy_act = yy_accept[yy_current_state];
923 
925 
926 do_action: /* This label is used only to access EOF actions. */
927 
928  switch ( yy_act )
929  { /* beginning of action switch */
930  case 0: /* must back up */
931  /* undo the effects of YY_DO_BEFORE_ACTION */
932  *yy_cp = (yy_hold_char);
934  yy_current_state = (yy_last_accepting_state);
935  goto yy_find_action;
936 
937 case 1:
939 #line 66 "lwin_wkt_lex.l"
940 {
941  LWDEBUG(5,"DOUBLE");
943  return DOUBLE_TOK;
944  }
945  YY_BREAK
946 case 2:
948 #line 72 "lwin_wkt_lex.l"
949 {
950  LWDEBUG(5,"SRID");
952  return SRID_TOK;
953  }
954  YY_BREAK
955 case 3:
957 #line 78 "lwin_wkt_lex.l"
958 { return COLLECTION_TOK; }
959  YY_BREAK
960 case 4:
962 #line 79 "lwin_wkt_lex.l"
963 { return MSURFACE_TOK; }
964  YY_BREAK
965 case 5:
967 #line 80 "lwin_wkt_lex.l"
968 { return MPOLYGON_TOK; }
969  YY_BREAK
970 case 6:
972 #line 81 "lwin_wkt_lex.l"
973 { return MCURVE_TOK; }
974  YY_BREAK
975 case 7:
977 #line 82 "lwin_wkt_lex.l"
978 { return MLINESTRING_TOK; }
979  YY_BREAK
980 case 8:
982 #line 83 "lwin_wkt_lex.l"
983 { return MPOINT_TOK; }
984  YY_BREAK
985 case 9:
987 #line 84 "lwin_wkt_lex.l"
988 { return CURVEPOLYGON_TOK; }
989  YY_BREAK
990 case 10:
992 #line 85 "lwin_wkt_lex.l"
993 { return POLYGON_TOK; }
994  YY_BREAK
995 case 11:
997 #line 86 "lwin_wkt_lex.l"
998 { return COMPOUNDCURVE_TOK; }
999  YY_BREAK
1000 case 12:
1002 #line 87 "lwin_wkt_lex.l"
1003 { return CIRCULARSTRING_TOK; }
1004  YY_BREAK
1005 case 13:
1007 #line 88 "lwin_wkt_lex.l"
1008 { return LINESTRING_TOK; }
1009  YY_BREAK
1010 case 14:
1012 #line 89 "lwin_wkt_lex.l"
1013 { return POLYHEDRALSURFACE_TOK; }
1014  YY_BREAK
1015 case 15:
1017 #line 90 "lwin_wkt_lex.l"
1018 { return TRIANGLE_TOK; }
1019  YY_BREAK
1020 case 16:
1022 #line 91 "lwin_wkt_lex.l"
1023 { return TIN_TOK; }
1024  YY_BREAK
1025 case 17:
1027 #line 92 "lwin_wkt_lex.l"
1028 { return POINT_TOK; }
1029  YY_BREAK
1030 case 18:
1032 #line 93 "lwin_wkt_lex.l"
1033 { return EMPTY_TOK; }
1034  YY_BREAK
1035 case 19:
1037 #line 95 "lwin_wkt_lex.l"
1038 {
1039  LWDEBUG(5,"DIMENSIONALITY");
1041  return DIMENSIONALITY_TOK;
1042  }
1043  YY_BREAK
1044 case 20:
1046 #line 101 "lwin_wkt_lex.l"
1047 { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; }
1048  YY_BREAK
1049 case 21:
1051 #line 102 "lwin_wkt_lex.l"
1052 { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; }
1053  YY_BREAK
1054 case 22:
1056 #line 103 "lwin_wkt_lex.l"
1057 { LWDEBUG(5,"COMMA"); return COMMA_TOK; }
1058  YY_BREAK
1059 case 23:
1061 #line 104 "lwin_wkt_lex.l"
1062 { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; }
1063  YY_BREAK
1064 case 24:
1065 /* rule 24 can match eol */
1067 #line 106 "lwin_wkt_lex.l"
1068 { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); }
1069  YY_BREAK
1070 case 25:
1072 #line 108 "lwin_wkt_lex.l"
1073 { /* Error out and stop parsing on unknown/unexpected characters */
1074  LWDEBUG(5,"UNKNOWN");
1076  yyterminate();
1077  }
1078  YY_BREAK
1079 case 26:
1081 #line 114 "lwin_wkt_lex.l"
1082 ECHO;
1083  YY_BREAK
1084 #line 1085 "lwin_wkt_lex.c"
1085 case YY_STATE_EOF(INITIAL):
1086  yyterminate();
1087 
1088  case YY_END_OF_BUFFER:
1089  {
1090  /* Amount of text matched not including the EOB char. */
1091  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1092 
1093  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1094  *yy_cp = (yy_hold_char);
1096 
1097  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1098  {
1099  /* We're scanning a new file or input source. It's
1100  * possible that this happened because the user
1101  * just pointed wkt_yyin at a new source and called
1102  * wkt_yylex(). If so, then we have to assure
1103  * consistency between YY_CURRENT_BUFFER and our
1104  * globals. Here is the right place to do so, because
1105  * this is the first action (other than possibly a
1106  * back-up) that will match for the new input source.
1107  */
1108  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1109  YY_CURRENT_BUFFER_LVALUE->yy_input_file = wkt_yyin;
1110  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1111  }
1112 
1113  /* Note that here we test for yy_c_buf_p "<=" to the position
1114  * of the first EOB in the buffer, since yy_c_buf_p will
1115  * already have been incremented past the NUL character
1116  * (since all states make transitions on EOB to the
1117  * end-of-buffer state). Contrast this with the test
1118  * in input().
1119  */
1120  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1121  { /* This was really a NUL. */
1122  yy_state_type yy_next_state;
1123 
1124  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1125 
1126  yy_current_state = yy_get_previous_state( );
1127 
1128  /* Okay, we're now positioned to make the NUL
1129  * transition. We couldn't have
1130  * yy_get_previous_state() go ahead and do it
1131  * for us because it doesn't know how to deal
1132  * with the possibility of jamming (and we don't
1133  * want to build jamming into it because then it
1134  * will run more slowly).
1135  */
1136 
1137  yy_next_state = yy_try_NUL_trans( yy_current_state );
1138 
1140 
1141  if ( yy_next_state )
1142  {
1143  /* Consume the NUL. */
1144  yy_cp = ++(yy_c_buf_p);
1145  yy_current_state = yy_next_state;
1146  goto yy_match;
1147  }
1148 
1149  else
1150  {
1152  yy_current_state = (yy_last_accepting_state);
1153  goto yy_find_action;
1154  }
1155  }
1156 
1157  else switch ( yy_get_next_buffer( ) )
1158  {
1159  case EOB_ACT_END_OF_FILE:
1160  {
1162 
1163  if ( wkt_yywrap( ) )
1164  {
1165  /* Note: because we've taken care in
1166  * yy_get_next_buffer() to have set up
1167  * wkt_yytext, we can now set up
1168  * yy_c_buf_p so that if some total
1169  * hoser (like flex itself) wants to
1170  * call the scanner after we return the
1171  * YY_NULL, it'll still work - another
1172  * YY_NULL will get returned.
1173  */
1175 
1177  goto do_action;
1178  }
1179 
1180  else
1181  {
1182  if ( ! (yy_did_buffer_switch_on_eof) )
1183  YY_NEW_FILE;
1184  }
1185  break;
1186  }
1187 
1188  case EOB_ACT_CONTINUE_SCAN:
1189  (yy_c_buf_p) =
1190  (yytext_ptr) + yy_amount_of_matched_text;
1191 
1192  yy_current_state = yy_get_previous_state( );
1193 
1194  yy_cp = (yy_c_buf_p);
1196  goto yy_match;
1197 
1198  case EOB_ACT_LAST_MATCH:
1199  (yy_c_buf_p) =
1200  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1201 
1202  yy_current_state = yy_get_previous_state( );
1203 
1204  yy_cp = (yy_c_buf_p);
1206  goto yy_find_action;
1207  }
1208  break;
1209  }
1210 
1211  default:
1213  "fatal flex scanner internal error--no action found" );
1214  } /* end of action switch */
1215  } /* end of scanning one token */
#define LBRACKET_TOK
static yy_state_type yy_get_previous_state(void)
#define LINESTRING_TOK
static int yy_did_buffer_switch_on_eof
Definition: lwin_wkt_lex.c:304
#define COMPOUNDCURVE_TOK
#define CURVEPOLYGON_TOK
#define EOB_ACT_LAST_MATCH
Definition: lwin_wkt_lex.c:186
static yyconst flex_int16_t yy_nxt[419]
Definition: lwin_wkt_lex.c:505
#define MLINESTRING_TOK
#define DOUBLE_TOK
#define MPOINT_TOK
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:449
#define YY_STATE_EOF(state)
Definition: lwin_wkt_lex.c:154
#define POLYGON_TOK
#define YY_BUFFER_NORMAL
Definition: lwin_wkt_lex.c:255
static int yy_get_next_buffer(void)
FILE * wkt_yyin
Definition: lwin_wkt_lex.c:359
#define YY_RULE_SETUP
Definition: lwin_wkt_lex.c:844
#define POINT_TOK
register char * yy_cp
Definition: lwin_wkt_lex.c:852
#define wkt_yywrap(n)
Definition: lwin_wkt_lex.c:354
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
#define MPOLYGON_TOK
register char * yy_bp
Definition: lwin_wkt_lex.c:852
static yyconst flex_int16_t yy_chk[419]
Definition: lwin_wkt_lex.c:555
#define YY_BREAK
Definition: lwin_wkt_lex.c:841
#define DIMENSIONALITY_TOK
#define yyterminate()
Definition: lwin_wkt_lex.c:806
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define YY_SC_TO_UI(c)
Definition: lwin_wkt_lex.c:138
static yyconst flex_int16_t yy_accept[172]
Definition: lwin_wkt_lex.c:394
#define EOB_ACT_END_OF_FILE
Definition: lwin_wkt_lex.c:185
#define COMMA_TOK
#define YY_END_OF_BUFFER
Definition: lwin_wkt_lex.c:386
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:254
char * wkt_yytext
Definition: lwin_wkt_lex.c:618
static yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:293
unsigned char YY_CHAR
Definition: lwin_wkt_lex.c:357
#define INITIAL
Definition: lwin_wkt_lex.c:677
#define ECHO
Definition: lwin_wkt_lex.c:762
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:816
#define YY_CURRENT_BUFFER_LVALUE
Definition: lwin_wkt_lex.c:289
register int yy_act
Definition: lwin_wkt_lex.c:853
#define MSURFACE_TOK
static void wkt_lexer_unknown()
Definition: lwin_wkt_lex.c:652
#define EMPTY_TOK
#define RBRACKET_TOK
int integervalue
double doublevalue
#define TRIANGLE_TOK
#define YY_MORE_ADJ
Definition: lwin_wkt_lex.c:616
#define SRID_TOK
#define SEMICOLON_TOK
static char * yy_c_buf_p
Definition: lwin_wkt_lex.c:297
int yy_state_type
Definition: lwin_wkt_lex.c:361
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lwin_wkt_lex.c:617
static yy_state_type yy_last_accepting_state
Definition: lwin_wkt_lex.c:605
#define TIN_TOK
#define EOB_ACT_CONTINUE_SCAN
Definition: lwin_wkt_lex.c:184
#define YY_NEW_FILE
Definition: lwin_wkt_lex.c:157
#define YY_DO_BEFORE_ACTION
Definition: lwin_wkt_lex.c:378
static yyconst flex_int16_t yy_def[172]
Definition: lwin_wkt_lex.c:482
#define YY_START
Definition: lwin_wkt_lex.c:150
static yyconst flex_int16_t yy_base[172]
Definition: lwin_wkt_lex.c:459
static char * yy_last_accepting_cpos
Definition: lwin_wkt_lex.c:606
#define POLYHEDRALSURFACE_TOK
#define CIRCULARSTRING_TOK
static char yy_hold_char
Definition: lwin_wkt_lex.c:292
#define yytext_ptr
Definition: lwin_wkt_lex.c:368
#define COLLECTION_TOK
static int yy_start
Definition: lwin_wkt_lex.c:299
YYSTYPE wkt_yylval
#define MCURVE_TOK
static yyconst flex_int32_t yy_ec[256]
Definition: lwin_wkt_lex.c:417

Here is the call graph for this function:

Here is the caller graph for this function: