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
*/
@@ -2203,6 +2208,16 @@ static void parseBlock (tokenInfo *const token, const bool local)
2203
2208
parseBlockFull (token , local , LANG_IGNORE );
2204
2209
}
2205
2210
2211
+ static void makeSqlTagForInternalFunction (tokenInfo * const token )
2212
+ {
2213
+ tagEntryInfo foreignEntry ;
2214
+ initForeignRefTagEntry (
2215
+ & foreignEntry , vStringValue (token -> string ), Lang_c ,
2216
+ CXXTagKindFUNCTION , CXXTagFUNCTIONRoleFOREIGNCALL );
2217
+ updateTagLine (& foreignEntry , token -> lineNumber , token -> filePosition );
2218
+ makeTagEntry (& foreignEntry );
2219
+ }
2220
+
2206
2221
static void parseBlockFull (tokenInfo * const token , const bool local , langType lang )
2207
2222
{
2208
2223
int promise = -1 ;
@@ -2222,6 +2237,9 @@ static void parseBlockFull (tokenInfo *const token, const bool local, langType l
2222
2237
promise = token -> promise ;
2223
2238
token -> promise = -1 ;
2224
2239
2240
+ tokenInfo * const body = newToken ();
2241
+ copyToken (body , token );
2242
+
2225
2243
readToken (token );
2226
2244
while (! isCmdTerm (token )
2227
2245
&& !isType (token , TOKEN_EOF ))
@@ -2233,10 +2251,16 @@ static void parseBlockFull (tokenInfo *const token, const bool local, langType l
2233
2251
lang = getNamedLanguageFromToken (token );
2234
2252
if (lang != LANG_IGNORE )
2235
2253
readToken (token );
2254
+ else if (vStringEqC (token -> string , "internal" ))
2255
+ {
2256
+ makeSqlTagForInternalFunction (body );
2257
+ readToken (token );
2258
+ }
2236
2259
}
2237
2260
else
2238
2261
readToken (token );
2239
2262
}
2263
+ deleteToken (body );
2240
2264
2241
2265
if (promise != -1 && lang != LANG_IGNORE )
2242
2266
promiseUpdateLanguage (promise , lang );
@@ -3384,6 +3408,10 @@ extern parserDefinition* SqlParser (void)
3384
3408
static const char * const extensions [] = { "sql" , NULL };
3385
3409
static const char * const aliases [] = {"pgsql" , NULL };
3386
3410
parserDefinition * def = parserNew ("SQL" );
3411
+ static parserDependency dependencies [] = {
3412
+ [0 ] = { DEPTYPE_FOREIGNER , "C" , & Lang_c },
3413
+ };
3414
+
3387
3415
def -> kindTable = SqlKinds ;
3388
3416
def -> kindCount = ARRAY_SIZE (SqlKinds );
3389
3417
def -> extensions = extensions ;
@@ -3393,5 +3421,7 @@ extern parserDefinition* SqlParser (void)
3393
3421
def -> keywordTable = SqlKeywordTable ;
3394
3422
def -> keywordCount = ARRAY_SIZE (SqlKeywordTable );
3395
3423
def -> useCork = CORK_QUEUE | CORK_SYMTAB ;
3424
+ def -> dependencies = dependencies ;
3425
+ def -> dependencyCount = ARRAY_SIZE (dependencies );
3396
3426
return def ;
3397
3427
}
0 commit comments