#include <stdio.h>
#include <vector>
#include <string>
#include "nel/misc/debug.h"
#include "nel/misc/file.h"
#include "cf_gramatical.h"
Go to the source code of this file.
Data Structures | |
| struct | cf_value |
| struct | yy_buffer_state |
Defines | |
| #define | BEGIN yy_start = 1 + 2 * |
| #define | DEBUG_PRINTF |
| #define | ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
| #define | EOB_ACT_CONTINUE_SCAN 0 |
| #define | EOB_ACT_END_OF_FILE 1 |
| #define | EOB_ACT_LAST_MATCH 2 |
| #define | FLEX_SCANNER |
| #define | INITIAL 0 |
| #define | REJECT reject_used_but_not_detected |
| #define | unput(c) yyunput( c, yytext_ptr ) |
| #define | YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
| #define | YY_BREAK break; |
| #define | YY_BUF_SIZE 16384 |
| #define | YY_BUFFER_EOF_PENDING 2 |
| #define | YY_BUFFER_NEW 0 |
| #define | YY_BUFFER_NORMAL 1 |
| #define | yy_create_buffer cf_create_buffer |
| #define | YY_CURRENT_BUFFER yy_current_buffer |
| #define | YY_DECL int yylex YY_PROTO(( void )) |
| #define | yy_delete_buffer cf_delete_buffer |
| #define | YY_DO_BEFORE_ACTION |
| #define | YY_END_OF_BUFFER 24 |
| #define | YY_END_OF_BUFFER_CHAR 0 |
| #define | YY_EXIT_FAILURE 2 |
| #define | YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
| #define | yy_flex_debug cf_flex_debug |
| #define | YY_FLEX_MAJOR_VERSION 2 |
| #define | YY_FLEX_MINOR_VERSION 5 |
| #define | YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
| #define | yy_flush_buffer cf_flush_buffer |
| #define | yy_init_buffer cf_init_buffer |
| #define | YY_INPUT(buf, result, max_size) |
| #define | yy_load_buffer_state cf_load_buffer_state |
| #define | YY_MORE_ADJ 0 |
| #define | YY_NEVER_INTERACTIVE 1 |
| #define | yy_new_buffer yy_create_buffer |
| #define | YY_NEW_FILE yyrestart( yyin ) |
| #define | YY_NO_POP_STATE 1 |
| #define | YY_NO_PUSH_STATE 1 |
| #define | YY_NO_TOP_STATE 1 |
| #define | YY_NO_UNPUT 1 |
| #define | YY_NULL 0 |
| #define | YY_NUM_RULES 23 |
| #define | YY_PROTO(proto) () |
| #define | YY_READ_BUF_SIZE 8192 |
| #define | YY_RESTORE_YY_MORE_OFFSET |
| #define | YY_RULE_SETUP YY_USER_ACTION |
| #define | YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
| #define | yy_scan_buffer cf_scan_buffer |
| #define | yy_scan_bytes cf_scan_bytes |
| #define | yy_scan_string cf_scan_string |
| #define | yy_set_bol(at_bol) |
| #define | yy_set_interactive(is_interactive) |
| #define | YY_START ((yy_start - 1) / 2) |
| #define | YY_START_STACK_INCR 25 |
| #define | YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
| #define | yy_switch_to_buffer cf_switch_to_buffer |
| #define | yyconst |
| #define | yyin cfin |
| #define | yyleng cfleng |
| #define | yyless(n) |
| #define | yyless(n) |
| #define | yylex cflex |
| #define | yymore() yymore_used_but_not_detected |
| #define | yyout cfout |
| #define | yyrestart cfrestart |
| #define | YYSTATE YY_START |
| #define | yyterminate() return YY_NULL |
| #define | yytext cftext |
| #define | yytext_ptr yytext |
| #define | yywrap cfwrap |
Typedefs | |
| typedef yy_buffer_state * | YY_BUFFER_STATE |
| typedef unsigned char | YY_CHAR |
| typedef unsigned int | yy_size_t |
| typedef int | yy_state_type |
Enumerations | |
| enum | cf_type { T_UNKNOWN, T_INT, T_STRING, T_REAL } |
Functions | |
| YY_BUFFER_STATE | cf_create_buffer () |
| void | cf_delete_buffer () |
| void | cf_flush_buffer () |
| void | cf_init_buffer () |
| void | cf_load_buffer_state () |
| YY_BUFFER_STATE | cf_scan_buffer () |
| YY_BUFFER_STATE | cf_scan_bytes () |
| YY_BUFFER_STATE | cf_scan_string () |
| void | cf_switch_to_buffer () |
| int | cflex () |
| void | cfrestart () |
| int | cfwrap () |
| void | comment () |
| int | input () |
| void | yy_fatal_error () |
| void * | yy_flex_alloc () |
| void | yy_flex_free () |
| void * | yy_flex_realloc () |
| int | yy_get_next_buffer () |
| yy_state_type | yy_get_previous_state () |
| yy_state_type | yy_try_NUL_trans (yy_current_state) yy_state_type yy_current_state |
| yy_state_type | yy_try_NUL_trans () |
Variables | |
| int | cf_CurrentLine |
| CIFile | cf_ifile |
| bool | cf_Ignore |
| FILE * | cfin = (FILE *) 0 * cfout = (FILE *) 0 |
| int | cfleng |
| FILE * | cfout |
| char * | cftext |
| FILE * | file |
| int | len |
| int | size |
| short int | yy_accept [41] |
| char * | yy_c_buf_p = (char *) 0 |
| YY_BUFFER_STATE | yy_current_buffer = 0 |
| int | yy_did_buffer_switch_on_eof |
| char | yy_hold_char |
| int | yy_init = 1 |
| char * | yy_last_accepting_cpos |
| yy_state_type | yy_last_accepting_state |
| int | yy_n_chars |
| yy_state_type | yy_NUL_trans [41] |
| short | yy_nxt [][256] |
| int | yy_start = 0 |
|
|
Definition at line 103 of file cf_lexical.cpp. |
|
|
Definition at line 1660 of file cf_lexical.cpp. |
|
|
Definition at line 1792 of file cf_lexical.cpp. |
|
|
Definition at line 128 of file cf_lexical.cpp. |
|
|
Definition at line 129 of file cf_lexical.cpp. |
|
|
Definition at line 130 of file cf_lexical.cpp. |
|
|
Definition at line 26 of file cf_lexical.cpp. |
|
|
Definition at line 1638 of file cf_lexical.cpp. |
|
|
Definition at line 1632 of file cf_lexical.cpp. |
|
|
Definition at line 159 of file cf_lexical.cpp. |
|
|
Definition at line 286 of file cf_lexical.cpp. |
|
|
Definition at line 1838 of file cf_lexical.cpp. |
|
|
Definition at line 121 of file cf_lexical.cpp. |
|
|
Definition at line 222 of file cf_lexical.cpp. |
|
|
Definition at line 210 of file cf_lexical.cpp. |
|
|
Definition at line 211 of file cf_lexical.cpp. |
|
|
Definition at line 1 of file cf_lexical.cpp. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 231 of file cf_lexical.cpp. |
|
|
Definition at line 1826 of file cf_lexical.cpp. |
|
|
Definition at line 2 of file cf_lexical.cpp. |
|
|
Value: yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; Definition at line 1601 of file cf_lexical.cpp. |
|
|
Definition at line 1609 of file cf_lexical.cpp. |
|
|
Definition at line 118 of file cf_lexical.cpp. |
|
|
|
|
|
Definition at line 1819 of file cf_lexical.cpp. |
|
|
Definition at line 6 of file cf_lexical.cpp. |
|
|
Definition at line 27 of file cf_lexical.cpp. |
|
|
Definition at line 28 of file cf_lexical.cpp. |
|
|
Definition at line 260 of file cf_lexical.cpp. |
|
|
Definition at line 8 of file cf_lexical.cpp. |
|
|
Definition at line 7 of file cf_lexical.cpp. |
|
|
Value: { \
if (cf_ifile.eof()) \
{ \
DEBUG_PRINTF("YY_INPUT: eof");\
result = YY_NULL; \
} else { \
uint32 nbc = std::min((uint32)max_size, (uint32)cf_ifile.getFileSize() - cf_ifile.getPos()); \
DEBUG_PRINTF("YY_INPUT: wanted %d bytes, will read %d\n", max_size, nbc);\
cf_ifile.serialBuffer ((uint8 *)buf, nbc); \
result = nbc; \
} \
}
Definition at line 1684 of file cf_lexical.cpp. |
|
|
Definition at line 9 of file cf_lexical.cpp. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 1634 of file cf_lexical.cpp. |
|
|
Definition at line 1663 of file cf_lexical.cpp. |
|
|
Definition at line 270 of file cf_lexical.cpp. |
|
|
Definition at line 116 of file cf_lexical.cpp. |
|
|
Definition at line 1762 of file cf_lexical.cpp. |
|
|
Definition at line 1761 of file cf_lexical.cpp. |
|
|
Definition at line 1763 of file cf_lexical.cpp. |
|
|
Definition at line 1711 of file cf_lexical.cpp. |
|
|
Definition at line 90 of file cf_lexical.cpp. |
|
|
Definition at line 1608 of file cf_lexical.cpp. |
|
|
Definition at line 86 of file cf_lexical.cpp. |
|
|
Definition at line 1783 of file cf_lexical.cpp. |
|
|
Definition at line 1635 of file cf_lexical.cpp. Referenced by cflex(). |
|
|
Definition at line 1841 of file cf_lexical.cpp. |
|
|
Definition at line 97 of file cf_lexical.cpp. |
|
|
Definition at line 3 of file cf_lexical.cpp. |
|
|
Definition at line 5 of file cf_lexical.cpp. |
|
|
Definition at line 4 of file cf_lexical.cpp. |
|
|
Value: { \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
Definition at line 279 of file cf_lexical.cpp. |
|
|
Value: { \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}
Definition at line 272 of file cf_lexical.cpp. |
|
|
Definition at line 109 of file cf_lexical.cpp. |
|
|
Definition at line 1814 of file cf_lexical.cpp. |
|
|
Definition at line 113 of file cf_lexical.cpp. |
|
|
Definition at line 10 of file cf_lexical.cpp. |
|
|
Definition at line 79 of file cf_lexical.cpp. |
|
|
Definition at line 11 of file cf_lexical.cpp. Referenced by cflex(), NLAISCRIPT::yyFlexLexer::LexerInput(), yy_get_next_buffer(), NLAISCRIPT::yyFlexLexer::yylex(), and NLAISCRIPT::CCompilateur::yywrap(). |
|
|
Definition at line 12 of file cf_lexical.cpp. |
|
|
Value: do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) Definition at line 148 of file cf_lexical.cpp. |
|
|
Value: do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) Definition at line 148 of file cf_lexical.cpp. |
|
|
Definition at line 13 of file cf_lexical.cpp. |
|
|
Definition at line 1633 of file cf_lexical.cpp. |
|
|
Definition at line 14 of file cf_lexical.cpp. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 15 of file cf_lexical.cpp. Referenced by yy_get_next_buffer(). |
|
|
Definition at line 110 of file cf_lexical.cpp. |
|
|
Definition at line 1809 of file cf_lexical.cpp. |
|
|
Definition at line 16 of file cf_lexical.cpp. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 292 of file cf_lexical.cpp. |
|
|
Definition at line 17 of file cf_lexical.cpp. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 123 of file cf_lexical.cpp. |
|
|
Definition at line 288 of file cf_lexical.cpp. |
|
|
Definition at line 165 of file cf_lexical.cpp. |
|
|
Definition at line 290 of file cf_lexical.cpp. Referenced by cflex(), NLAISCRIPT::yyFlexLexer::yy_get_previous_state(), yy_get_previous_state(), NLAISCRIPT::yyFlexLexer::yy_try_NUL_trans(), NLAISCRIPT::yyFlexLexer::yyFlexLexer(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 1671 of file cf_lexical.cpp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 1844 of file cf_lexical.cpp. References ADD_ASSIGN, ASSIGN, cf_CurrentLine, cf_Ignore, cflval, COMMA, comment(), DEBUG_PRINTF, DIVIDE, ECHO, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, INITIAL, INT, cf_value::Int, LBRACE, LPAREN, MINUS, MULT, PLUS, RBRACE, REAL, cf_value::Real, RPAREN, SEMICOLON, STRING, cf_value::String, cf_value::Type, YYSTYPE::Val, VARIABLE, yy_accept, YY_BREAK, YY_BUF_SIZE, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yy_buffer_state::yy_buffer_status, yy_c_buf_p, yy_buffer_state::yy_ch_buf, yy_create_buffer, yy_current_buffer, YY_DECL, 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_init, yy_buffer_state::yy_input_file, yy_last_accepting_cpos, yy_last_accepting_state, yy_load_buffer_state, YY_MORE_ADJ, yy_buffer_state::yy_n_chars, YY_NEW_FILE, yy_nxt, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, yy_start, YY_STATE_EOF, yy_state_type, yy_try_NUL_trans(), yyin, yyout, yyterminate, yytext, yytext_ptr, and yywrap.
01845 {
01846 register yy_state_type yy_current_state;
01847 register char *yy_cp, *yy_bp;
01848 register int yy_act;
01849
01850 #line 89 "cf_lexical.lxx"
01851
01852
01853 #line 1854 "cf_lexical.cpp"
01854
01855 if ( yy_init )
01856 {
01857 yy_init = 0;
01858
01859 #ifdef YY_USER_INIT
01860 YY_USER_INIT;
01861 #endif
01862
01863 if ( ! yy_start )
01864 yy_start = 1; /* first start state */
01865
01866 if ( ! yyin )
01867 yyin = stdin;
01868
01869 if ( ! yyout )
01870 yyout = stdout;
01871
01872 if ( ! yy_current_buffer )
01873 yy_current_buffer =
01874 yy_create_buffer( yyin, YY_BUF_SIZE );
01875
01876 yy_load_buffer_state();
01877 }
01878
01879 while ( 1 ) /* loops until end-of-file is reached */
01880 {
01881 yy_cp = yy_c_buf_p;
01882
01883 /* Support of yytext. */
01884 *yy_cp = yy_hold_char;
01885
01886 /* yy_bp points to the position in yy_ch_buf of the start of
01887 * the current run.
01888 */
01889 yy_bp = yy_cp;
01890
01891 yy_current_state = yy_start;
01892 yy_match:
01893 while ( (yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]) > 0 )
01894 {
01895 if ( yy_accept[yy_current_state] )
01896 {
01897 yy_last_accepting_state = yy_current_state;
01898 yy_last_accepting_cpos = yy_cp;
01899 }
01900
01901 ++yy_cp;
01902 }
01903
01904 yy_current_state = -yy_current_state;
01905
01906 yy_find_action:
01907 yy_act = yy_accept[yy_current_state];
01908
01909 YY_DO_BEFORE_ACTION;
01910
01911
01912 do_action: /* This label is used only to access EOF actions. */
01913
01914
01915 switch ( yy_act )
01916 { /* beginning of action switch */
01917 case 0: /* must back up */
01918 /* undo the effects of YY_DO_BEFORE_ACTION */
01919 *yy_cp = yy_hold_char;
01920 yy_cp = yy_last_accepting_cpos + 1;
01921 yy_current_state = yy_last_accepting_state;
01922 goto yy_find_action;
01923
01924 case 1:
01925 YY_RULE_SETUP
01926 #line 91 "cf_lexical.lxx"
01927 { if (!cf_Ignore) return PLUS; }
01928 YY_BREAK
01929 case 2:
01930 YY_RULE_SETUP
01931 #line 92 "cf_lexical.lxx"
01932 { if (!cf_Ignore) return MINUS; }
01933 YY_BREAK
01934 case 3:
01935 YY_RULE_SETUP
01936 #line 93 "cf_lexical.lxx"
01937 { if (!cf_Ignore) return MULT; }
01938 YY_BREAK
01939 case 4:
01940 YY_RULE_SETUP
01941 #line 94 "cf_lexical.lxx"
01942 { if (!cf_Ignore) return DIVIDE; }
01943 YY_BREAK
01944 case 5:
01945 YY_RULE_SETUP
01946 #line 95 "cf_lexical.lxx"
01947 { if (!cf_Ignore) return RPAREN; }
01948 YY_BREAK
01949 case 6:
01950 YY_RULE_SETUP
01951 #line 96 "cf_lexical.lxx"
01952 { if (!cf_Ignore) return LPAREN; }
01953 YY_BREAK
01954 case 7:
01955 YY_RULE_SETUP
01956 #line 97 "cf_lexical.lxx"
01957 { if (!cf_Ignore) return ASSIGN; }
01958 YY_BREAK
01959 case 8:
01960 YY_RULE_SETUP
01961 #line 98 "cf_lexical.lxx"
01962 { if (!cf_Ignore) return ADD_ASSIGN; }
01963 YY_BREAK
01964 case 9:
01965 YY_RULE_SETUP
01966 #line 99 "cf_lexical.lxx"
01967 { if (!cf_Ignore) return SEMICOLON; }
01968 YY_BREAK
01969 case 10:
01970 YY_RULE_SETUP
01971 #line 100 "cf_lexical.lxx"
01972 { if (!cf_Ignore) return RBRACE; }
01973 YY_BREAK
01974 case 11:
01975 YY_RULE_SETUP
01976 #line 101 "cf_lexical.lxx"
01977 { if (!cf_Ignore) return LBRACE; }
01978 YY_BREAK
01979 case 12:
01980 YY_RULE_SETUP
01981 #line 102 "cf_lexical.lxx"
01982 { if (!cf_Ignore) return COMMA; }
01983 YY_BREAK
01984 case 13:
01985 YY_RULE_SETUP
01986 #line 104 "cf_lexical.lxx"
01987 { /* ignore tabulation and spaces */; }
01988 YY_BREAK
01989 case 14:
01990 YY_RULE_SETUP
01991 #line 106 "cf_lexical.lxx"
01992 {
01993 /* ignore new line but count them */
01994 cf_CurrentLine++;
01995 DEBUG_PRINTF("*****line++ %d\n", cf_CurrentLine);
01996 }
01997 YY_BREAK
01998 case 15:
01999 YY_RULE_SETUP
02000 #line 112 "cf_lexical.lxx"
02001 { comment(); }
02002 YY_BREAK
02003 case 16:
02004 YY_RULE_SETUP
02005 #line 114 "cf_lexical.lxx"
02006 { /* Start of a comment */ cf_Ignore = true; }
02007 YY_BREAK
02008 case 17:
02009 YY_RULE_SETUP
02010 #line 116 "cf_lexical.lxx"
02011 { /* End of a comment */ cf_Ignore = false; }
02012 YY_BREAK
02013 case 18:
02014 YY_RULE_SETUP
02015 #line 118 "cf_lexical.lxx"
02016 { /* A string */
02017 if (!cf_Ignore)
02018 {
02019 cflval.Val.Type = T_STRING;
02020 strcpy (cflval.Val.String, yytext+1);
02021 cflval.Val.String[strlen(cflval.Val.String)-1] = '\0';
02022 DEBUG_PRINTF("lex: string '%s' '%s'\n", yytext, cflval.Val.String);
02023 return STRING;
02024 }
02025 }
02026 YY_BREAK
02027 case 19:
02028 YY_RULE_SETUP
02029 #line 129 "cf_lexical.lxx"
02030 { /* A variable */
02031 if (!cf_Ignore)
02032 {
02033 cflval.Val.Type = T_STRING;
02034 strcpy (cflval.Val.String, yytext);
02035 DEBUG_PRINTF("lex: variable '%s' '%s'\n", yytext, cflval.Val.String);
02036 return VARIABLE;
02037 }
02038 }
02039 YY_BREAK
02040 case 20:
02041 YY_RULE_SETUP
02042 #line 139 "cf_lexical.lxx"
02043 { /* A real */
02044 if (!cf_Ignore)
02045 {
02046 cflval.Val.Type = T_REAL;
02047 cflval.Val.Real = atof (yytext);
02048 DEBUG_PRINTF("lex: real '%s' '%f\n", yytext, cflval.Val.Real);
02049 return REAL;
02050 }
02051 }
02052 YY_BREAK
02053 case 21:
02054 YY_RULE_SETUP
02055 #line 149 "cf_lexical.lxx"
02056 { /* An int */
02057 if (!cf_Ignore)
02058 {
02059 cflval.Val.Type = T_INT;
02060 cflval.Val.Int = atoi (yytext);
02061 DEBUG_PRINTF("lex: int '%s' '%d'\n", yytext, cflval.Val.Int);
02062 return INT;
02063 }
02064 }
02065 YY_BREAK
02066 case 22:
02067 YY_RULE_SETUP
02068 #line 159 "cf_lexical.lxx"
02069 { /* An hex int */
02070 if (!cf_Ignore)
02071 {
02072 cflval.Val.Type = T_INT;
02073 sscanf (yytext, "%x", &(cflval.Val.Int));
02074 DEBUG_PRINTF("lex: hexa '%s' '0x%x' '%d'\n", yytext, cflval.Val.Int, cflval.Val.Int);
02075 return INT;
02076 }
02077 }
02078 YY_BREAK
02079 case 23:
02080 YY_RULE_SETUP
02081 #line 169 "cf_lexical.lxx"
02082 ECHO;
02083 YY_BREAK
02084 #line 2085 "cf_lexical.cpp"
02085 case YY_STATE_EOF(INITIAL):
02086 yyterminate();
02087
02088 case YY_END_OF_BUFFER:
02089 {
02090 /* Amount of text matched not including the EOB char. */
02091 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
02092
02093 /* Undo the effects of YY_DO_BEFORE_ACTION. */
02094 *yy_cp = yy_hold_char;
02095 YY_RESTORE_YY_MORE_OFFSET
02096
02097 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
02098 {
02099 /* We're scanning a new file or input source. It's
02100 * possible that this happened because the user
02101 * just pointed yyin at a new source and called
02102 * yylex(). If so, then we have to assure
02103 * consistency between yy_current_buffer and our
02104 * globals. Here is the right place to do so, because
02105 * this is the first action (other than possibly a
02106 * back-up) that will match for the new input source.
02107 */
02108 yy_n_chars = yy_current_buffer->yy_n_chars;
02109 yy_current_buffer->yy_input_file = yyin;
02110 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
02111 }
02112
02113 /* Note that here we test for yy_c_buf_p "<=" to the position
02114 * of the first EOB in the buffer, since yy_c_buf_p will
02115 * already have been incremented past the NUL character
02116 * (since all states make transitions on EOB to the
02117 * end-of-buffer state). Contrast this with the test
02118 * in input().
02119 */
02120 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
02121 { /* This was really a NUL. */
02122 yy_state_type yy_next_state;
02123
02124 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
02125
02126 yy_current_state = yy_get_previous_state();
02127
02128 /* Okay, we're now positioned to make the NUL
02129 * transition. We couldn't have
02130 * yy_get_previous_state() go ahead and do it
02131 * for us because it doesn't know how to deal
02132 * with the possibility of jamming (and we don't
02133 * want to build jamming into it because then it
02134 * will run more slowly).
02135 */
02136
02137 yy_next_state = yy_try_NUL_trans( yy_current_state );
02138
02139 yy_bp = yytext_ptr + YY_MORE_ADJ;
02140
02141 if ( yy_next_state )
02142 {
02143 /* Consume the NUL. */
02144 yy_cp = ++yy_c_buf_p;
02145 yy_current_state = yy_next_state;
02146 goto yy_match;
02147 }
02148
02149 else
02150 {
02151 yy_cp = yy_c_buf_p;
02152 goto yy_find_action;
02153 }
02154 }
02155
02156 else switch ( yy_get_next_buffer() )
02157 {
02158 case EOB_ACT_END_OF_FILE:
02159 {
02160 yy_did_buffer_switch_on_eof = 0;
02161
02162 if ( yywrap() )
02163 {
02164 /* Note: because we've taken care in
02165 * yy_get_next_buffer() to have set up
02166 * yytext, we can now set up
02167 * yy_c_buf_p so that if some total
02168 * hoser (like flex itself) wants to
02169 * call the scanner after we return the
02170 * YY_NULL, it'll still work - another
02171 * YY_NULL will get returned.
02172 */
02173 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
02174
02175 yy_act = YY_STATE_EOF(YY_START);
02176 goto do_action;
02177 }
02178
02179 else
02180 {
02181 if ( ! yy_did_buffer_switch_on_eof )
02182 YY_NEW_FILE;
02183 }
02184 break;
02185 }
02186
02187 case EOB_ACT_CONTINUE_SCAN:
02188 yy_c_buf_p =
02189 yytext_ptr + yy_amount_of_matched_text;
02190
02191 yy_current_state = yy_get_previous_state();
02192
02193 yy_cp = yy_c_buf_p;
02194 yy_bp = yytext_ptr + YY_MORE_ADJ;
02195 goto yy_match;
02196
02197 case EOB_ACT_LAST_MATCH:
02198 yy_c_buf_p =
02199 &yy_current_buffer->yy_ch_buf[yy_n_chars];
02200
02201 yy_current_state = yy_get_previous_state();
02202
02203 yy_cp = yy_c_buf_p;
02204 yy_bp = yytext_ptr + YY_MORE_ADJ;
02205 goto yy_find_action;
02206 }
02207 break;
02208 }
02209
02210 default:
02211 YY_FATAL_ERROR(
02212 "fatal flex scanner internal error--no action found" );
02213 } /* end of action switch */
02214 } /* end of scanning one token */
02215 } /* end of yylex */
|
|
|
Referenced by NLMISC::CConfigFile::reparse(). |
|
|
|
|
|
|
Referenced by NLAISCRIPT::yyFlexLexer::yyinput(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 2226 of file cf_lexical.cpp. References EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yy_buffer_state::yy_buf_size, YY_BUFFER_EOF_PENDING, YY_BUFFER_STATE, yy_buffer_state::yy_buffer_status, yy_c_buf_p, yy_buffer_state::yy_ch_buf, yy_current_buffer, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_flex_realloc(), YY_INPUT, yy_buffer_state::yy_is_our_buffer, YY_MORE_ADJ, yy_buffer_state::yy_n_chars, YY_READ_BUF_SIZE, yyin, yyrestart, and yytext_ptr. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex().
02227 {
02228 register char *dest = yy_current_buffer->yy_ch_buf;
02229 register char *source = yytext_ptr;
02230 register int number_to_move, i;
02231 int ret_val;
02232
02233 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
02234 YY_FATAL_ERROR(
02235 "fatal flex scanner internal error--end of buffer missed" );
02236
02237 if ( yy_current_buffer->yy_fill_buffer == 0 )
02238 { /* Don't try to fill the buffer, so this is an EOF. */
02239 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
02240 {
02241 /* We matched a single character, the EOB, so
02242 * treat this as a final EOF.
02243 */
02244 return EOB_ACT_END_OF_FILE;
02245 }
02246
02247 else
02248 {
02249 /* We matched some text prior to the EOB, first
02250 * process it.
02251 */
02252 return EOB_ACT_LAST_MATCH;
02253 }
02254 }
02255
02256 /* Try to read more data. */
02257
02258 /* First move last chars to start of buffer. */
02259 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
02260
02261 for ( i = 0; i < number_to_move; ++i )
02262 *(dest++) = *(source++);
02263
02264 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
02265 /* don't do the read, it's not guaranteed to return an EOF,
02266 * just force an EOF
02267 */
02268 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
02269
02270 else
02271 {
02272 int num_to_read =
02273 yy_current_buffer->yy_buf_size - number_to_move - 1;
02274
02275 while ( num_to_read <= 0 )
02276 { /* Not enough room in the buffer - grow it. */
02277 #ifdef YY_USES_REJECT
02278 YY_FATAL_ERROR(
02279 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
02280 #else
02281
02282 /* just a shorter name for the current buffer */
02283 YY_BUFFER_STATE b = yy_current_buffer;
02284
02285 int yy_c_buf_p_offset =
02286 (int) (yy_c_buf_p - b->yy_ch_buf);
02287
02288 if ( b->yy_is_our_buffer )
02289 {
02290 int new_size = b->yy_buf_size * 2;
02291
02292 if ( new_size <= 0 )
02293 b->yy_buf_size += b->yy_buf_size / 8;
02294 else
02295 b->yy_buf_size *= 2;
02296
02297 b->yy_ch_buf = (char *)
02298 /* Include room in for 2 EOB chars. */
02299 yy_flex_realloc( (void *) b->yy_ch_buf,
02300 b->yy_buf_size + 2 );
02301 }
02302 else
02303 /* Can't grow it, we don't own it. */
02304 b->yy_ch_buf = 0;
02305
02306 if ( ! b->yy_ch_buf )
02307 YY_FATAL_ERROR(
02308 "fatal error - scanner input buffer overflow" );
02309
02310 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
02311
02312 num_to_read = yy_current_buffer->yy_buf_size -
02313 number_to_move - 1;
02314 #endif
02315 }
02316
02317 if ( num_to_read > YY_READ_BUF_SIZE )
02318 num_to_read = YY_READ_BUF_SIZE;
02319
02320 /* Read in more data. */
02321 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
02322 yy_n_chars, num_to_read );
02323
02324 yy_current_buffer->yy_n_chars = yy_n_chars;
02325 }
02326
02327 if ( yy_n_chars == 0 )
02328 {
02329 if ( number_to_move == YY_MORE_ADJ )
02330 {
02331 ret_val = EOB_ACT_END_OF_FILE;
02332 yyrestart( yyin );
02333 }
02334
02335 else
02336 {
02337 ret_val = EOB_ACT_LAST_MATCH;
02338 yy_current_buffer->yy_buffer_status =
02339 YY_BUFFER_EOF_PENDING;
02340 }
02341 }
02342
02343 else
02344 ret_val = EOB_ACT_CONTINUE_SCAN;
02345
02346 yy_n_chars += number_to_move;
02347 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
02348 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
02349
02350 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
02351
02352 return ret_val;
02353 }
|
|
|
Definition at line 2358 of file cf_lexical.cpp. References yy_accept, yy_c_buf_p, yy_last_accepting_cpos, yy_last_accepting_state, YY_MORE_ADJ, yy_NUL_trans, yy_nxt, YY_SC_TO_UI, yy_start, yy_state_type, and yytext_ptr. Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex().
02359 {
02360 register yy_state_type yy_current_state;
02361 register char *yy_cp;
02362
02363 yy_current_state = yy_start;
02364
02365 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
02366 {
02367 if ( *yy_cp )
02368 {
02369 yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)];
02370 }
02371 else
02372 yy_current_state = yy_NUL_trans[yy_current_state];
02373 if ( yy_accept[yy_current_state] )
02374 {
02375 yy_last_accepting_state = yy_current_state;
02376 yy_last_accepting_cpos = yy_cp;
02377 }
02378 }
02379
02380 return yy_current_state;
02381 }
|
|
|
|
|
|
Referenced by cflex(), and NLAISCRIPT::yyFlexLexer::yylex(). |
|
|
Definition at line 1703 of file cf_lexical.cpp. |
|
|
Definition at line 1682 of file cf_lexical.cpp. Referenced by NLMISC::CConfigFile::reparse(). |
|
|
Definition at line 1707 of file cf_lexical.cpp. Referenced by cflex(). |
|
|
Definition at line 289 of file cf_lexical.cpp. |
|
|
Definition at line 240 of file cf_lexical.cpp. |
|
|
Definition at line 126 of file cf_lexical.cpp. |
|
|
Definition at line 1636 of file cf_lexical.cpp. |
|
|
|
Definition at line 2767 of file cf_lexical.cpp. |
|
|
|
Initial value:
{ 0,
0, 0, 24, 23, 13, 14, 23, 6, 5, 3,
1, 12, 2, 23, 4, 21, 21, 9, 7, 19,
11, 10, 0, 18, 17, 8, 20, 16, 15, 20,
21, 0, 19, 0, 0, 22, 0, 20, 0, 20
}
Definition at line 1610 of file cf_lexical.cpp. Referenced by cflex(), and yy_get_previous_state(). |
|
|
Definition at line 243 of file cf_lexical.cpp. Referenced by cflex(), yy_get_next_buffer(), and yy_get_previous_state(). |
|
|
Definition at line 225 of file cf_lexical.cpp. Referenced by cflex(), and yy_get_next_buffer(). |
|
|
Definition at line 250 of file cf_lexical.cpp. Referenced by cflex(). |
|
|
Definition at line 235 of file cf_lexical.cpp. Referenced by cflex(). |
|
|
Definition at line 244 of file cf_lexical.cpp. Referenced by cflex(). |
|
|
Definition at line 1619 of file cf_lexical.cpp. Referenced by cflex(), and yy_get_previous_state(). |
|
|
Definition at line 1618 of file cf_lexical.cpp. Referenced by cflex(), and yy_get_previous_state(). |
|
|
Definition at line 237 of file cf_lexical.cpp. |
|
|
Initial value:
{ 0,
4, 4, 0, 0, 0, 0, 23, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 23, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
Definition at line 1621 of file cf_lexical.cpp. Referenced by yy_get_previous_state(). |
|
|
Definition at line 293 of file cf_lexical.cpp. Referenced by cflex(), and yy_get_previous_state(). |
|
|
Definition at line 245 of file cf_lexical.cpp. Referenced by cflex(), and yy_get_previous_state(). |
1.3.6