MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / get_token

Function get_token

src/gpre/gpre.cpp:1914–2264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1912//
1913
1914static tok* get_token()
1915{
1916 // Save the information from the previous token
1917
1918 gpreGlob.prior_token = gpreGlob.token_global;
1919 gpreGlob.prior_token.tok_position = last_position;
1920
1921 last_position = gpreGlob.token_global.tok_position + gpreGlob.token_global.tok_length +
1922 gpreGlob.token_global.tok_white_space - 1;
1923#if defined (GPRE_COBOL) || defined(GPRE_FORTRAN)
1924 int start_line = line_global;
1925#endif
1926#ifdef GPRE_FORTRAN
1927 const SLONG start_position = position;
1928#endif
1929 gpreGlob.token_global.tok_charset = NULL;
1930
1931 SSHORT c = skip_white();
1932
1933#ifdef GPRE_COBOL
1934 // Skip over cobol line continuation characters
1935 if (gpreGlob.sw_language == lang_cobol && !isAnsiCobol(gpreGlob.sw_cob_dialect))
1936 while (line_position == 1)
1937 {
1938 c = skip_white();
1939 start_line = line_global;
1940 }
1941#endif
1942
1943 // Skip fortran line continuation characters
1944
1945#ifdef GPRE_FORTRAN
1946 if (gpreGlob.sw_language == lang_fortran)
1947 {
1948 while (line_position == 6)
1949 {
1950 c = skip_white();
1951 start_line = line_global;
1952 }
1953 if (gpreGlob.sw_sql && line_global != start_line)
1954 {
1955 return_char(c);
1956 gpreGlob.token_global.tok_string[0] = ';';
1957 gpreGlob.token_global.tok_string[1] = 0;
1958 gpreGlob.token_global.tok_type = tok_punct;
1959 gpreGlob.token_global.tok_length = 0;
1960 gpreGlob.token_global.tok_white_space = 0;
1961 gpreGlob.token_global.tok_position = start_position + 1;
1962 gpreGlob.token_global.tok_symbol = HSH_lookup(gpreGlob.token_global.tok_string);
1963 gpreGlob.token_global.tok_keyword = (kwwords_t) gpreGlob.token_global.tok_symbol->sym_keyword;
1964 return &gpreGlob.token_global;
1965 }
1966 }
1967#endif
1968 // Get token rolling
1969
1970 TEXT* p = gpreGlob.token_global.tok_string;
1971 const TEXT* const end = p + sizeof(gpreGlob.token_global.tok_string);

Callers 1

CPR_tokenFunction · 0.85

Calls 13

skip_whiteFunction · 0.85
isAnsiCobolFunction · 0.85
return_charFunction · 0.85
HSH_lookupFunction · 0.85
get_classesFunction · 0.85
nextcharFunction · 0.85
remember_labelFunction · 0.85
CPR_errorFunction · 0.85
isLangCppFunction · 0.85
isQuotedFunction · 0.85
strip_quotesFunction · 0.85
HSH_lookup2Function · 0.85

Tested by

no test coverage detected