30
30
#include "xtag.h"
31
31
#include "promise.h"
32
32
33
+ #include "dependency.h"
34
+ #include "cxx/cxx_tag.h"
35
+
33
36
/*
34
37
* On-line "Oracle Database PL/SQL Language Reference":
35
38
* http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/toc.htm
@@ -505,6 +508,8 @@ static struct SqlReservedWord SqlReservedWord [SQLKEYWORD_COUNT] = {
505
508
[KEYWORD_without ] = {0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 },
506
509
};
507
510
511
+ static langType Lang_c ;
512
+
508
513
/*
509
514
* FUNCTION DECLARATIONS
510
515
*/
@@ -2207,6 +2212,16 @@ static void parseBlock (tokenInfo *const token, const bool local)
2207
2212
parseBlockFull (token , local , LANG_IGNORE );
2208
2213
}
2209
2214
2215
+ static void makeSqlTagForInternalFunction (tokenInfo * const token )
2216
+ {
2217
+ tagEntryInfo foreignEntry ;
2218
+ initForeignRefTagEntry (
2219
+ & foreignEntry , vStringValue (token -> string ), Lang_c ,
2220
+ CXXTagKindFUNCTION , CXXTagFUNCTIONRoleFOREIGNCALL );
2221
+ updateTagLine (& foreignEntry , token -> lineNumber , token -> filePosition );
2222
+ makeTagEntry (& foreignEntry );
2223
+ }
2224
+
2210
2225
static void parseBlockFull (tokenInfo * const token , const bool local , langType lang )
2211
2226
{
2212
2227
int promise = -1 ;
@@ -2226,6 +2241,9 @@ static void parseBlockFull (tokenInfo *const token, const bool local, langType l
2226
2241
promise = token -> promise ;
2227
2242
token -> promise = -1 ;
2228
2243
2244
+ tokenInfo * const body = newToken ();
2245
+ copyToken (body , token );
2246
+
2229
2247
readToken (token );
2230
2248
while (! isCmdTerm (token )
2231
2249
&& !isType (token , TOKEN_EOF ))
@@ -2237,10 +2255,16 @@ static void parseBlockFull (tokenInfo *const token, const bool local, langType l
2237
2255
lang = getNamedLanguageFromToken (token );
2238
2256
if (lang != LANG_IGNORE )
2239
2257
readToken (token );
2258
+ else if (vStringEqC (token -> string , "internal" ))
2259
+ {
2260
+ makeSqlTagForInternalFunction (body );
2261
+ readToken (token );
2262
+ }
2240
2263
}
2241
2264
else
2242
2265
readToken (token );
2243
2266
}
2267
+ deleteToken (body );
2244
2268
2245
2269
if (promise != -1 && lang != LANG_IGNORE )
2246
2270
promiseUpdateLanguage (promise , lang );
@@ -3388,6 +3412,10 @@ extern parserDefinition* SqlParser (void)
3388
3412
static const char * const extensions [] = { "sql" , NULL };
3389
3413
static const char * const aliases [] = {"pgsql" , NULL };
3390
3414
parserDefinition * def = parserNew ("SQL" );
3415
+ static parserDependency dependencies [] = {
3416
+ [0 ] = { DEPTYPE_FOREIGNER , "C" , & Lang_c },
3417
+ };
3418
+
3391
3419
def -> kindTable = SqlKinds ;
3392
3420
def -> kindCount = ARRAY_SIZE (SqlKinds );
3393
3421
def -> extensions = extensions ;
@@ -3397,5 +3425,7 @@ extern parserDefinition* SqlParser (void)
3397
3425
def -> keywordTable = SqlKeywordTable ;
3398
3426
def -> keywordCount = ARRAY_SIZE (SqlKeywordTable );
3399
3427
def -> useCork = CORK_QUEUE | CORK_SYMTAB ;
3428
+ def -> dependencies = dependencies ;
3429
+ def -> dependencyCount = ARRAY_SIZE (dependencies );
3400
3430
return def ;
3401
3431
}
0 commit comments