| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#include "general.h" |
| 11 |
|
| 12 |
#include "cxx_debug.h" |
| 13 |
#include "cxx_keyword.h" |
| 14 |
#include "cxx_token.h" |
| 15 |
#include "cxx_token_chain.h" |
| 16 |
#include "cxx_parser.h" |
| 17 |
#include "cxx_scope.h" |
| 18 |
#include "cxx_tag.h" |
| 19 |
|
| 20 |
#include "dependency.h" |
| 21 |
#include "selectors.h" |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
parserDefinition * CParser (void) |
| 76 |
{ |
| 77 |
static const char * const extensions [] = |
| 78 |
{ |
| 79 |
"c", |
| 80 |
NULL |
| 81 |
}; |
| 82 |
|
| 83 |
static selectLanguage selectors[] = { selectByObjectiveCKeywords, NULL }; |
| 84 |
|
| 85 |
parserDefinition* def = parserNew("C"); |
| 86 |
|
| 87 |
def->kindTable = cxxTagGetCKindDefinitions(); |
| 88 |
def->kindCount = cxxTagGetCKindDefinitionCount(); |
| 89 |
def->fieldTable = cxxTagGetCFieldDefinitionifiers(); |
| 90 |
def->fieldCount = cxxTagGetCFieldDefinitionifierCount(); |
| 91 |
def->extensions = extensions; |
| 92 |
def->parser2 = cxxCParserMain; |
| 93 |
def->initialize = cxxCParserInitialize; |
| 94 |
def->finalize = cxxParserCleanup; |
| 95 |
def->selectLanguage = selectors; |
| 96 |
def->useCork = CORK_QUEUE|CORK_SYMTAB; |
| 97 |
|
| 98 |
return def; |
| 99 |
} |
| 100 |
|
| 101 |
parserDefinition * CppParser (void) |
| 102 |
{ |
| 103 |
static const char * const extensions [] = |
| 104 |
{ |
| 105 |
"c++", "cc", "cp", "cpp", "cxx", |
| 106 |
"h", "h++", "hh", "hp", "hpp", "hxx", "inl", |
| 107 |
#ifndef CASE_INSENSITIVE_FILENAMES |
| 108 |
"C", "H", "CPP", "CXX", |
| 109 |
#endif |
| 110 |
NULL |
| 111 |
}; |
| 112 |
static parserDependency dependencies [] = { |
| 113 |
{ DEPTYPE_KIND_OWNER, "C" }, |
| 114 |
}; |
| 115 |
|
| 116 |
static selectLanguage selectors[] = { selectByObjectiveCKeywords, NULL }; |
| 117 |
|
| 118 |
parserDefinition* def = parserNew("C++"); |
| 119 |
|
| 120 |
def->dependencies = dependencies; |
| 121 |
def->dependencyCount = ARRAY_SIZE (dependencies); |
| 122 |
def->kindTable = cxxTagGetCPPKindDefinitions(); |
| 123 |
def->kindCount = cxxTagGetCPPKindDefinitionCount(); |
| 124 |
def->fieldTable = cxxTagGetCPPFieldDefinitionifiers(); |
| 125 |
def->fieldCount = cxxTagGetCPPFieldDefinitionifierCount(); |
| 126 |
def->extensions = extensions; |
| 127 |
def->parser2 = cxxCppParserMain; |
| 128 |
def->initialize = cxxCppParserInitialize; |
| 129 |
def->finalize = cxxParserCleanup; |
| 130 |
def->selectLanguage = selectors; |
| 131 |
def->useCork = CORK_QUEUE|CORK_SYMTAB; |
| 132 |
|
| 133 |
return def; |
| 134 |
} |
| 135 |
|
| 136 |
parserDefinition * CUDAParser (void) |
| 137 |
{ |
| 138 |
static const char * const extensions [] = |
| 139 |
{ |
| 140 |
"cu", "cuh", |
| 141 |
NULL |
| 142 |
}; |
| 143 |
static parserDependency dependencies [] = { |
| 144 |
{ DEPTYPE_KIND_OWNER, "C" }, |
| 145 |
}; |
| 146 |
|
| 147 |
parserDefinition* def = parserNew("CUDA"); |
| 148 |
|
| 149 |
def->dependencies = dependencies; |
| 150 |
def->dependencyCount = ARRAY_SIZE (dependencies); |
| 151 |
def->kindTable = cxxTagGetCUDAKindDefinitions(); |
| 152 |
def->kindCount = cxxTagGetCUDAKindDefinitionCount(); |
| 153 |
def->fieldTable = cxxTagGetCUDAFieldDefinitionifiers(); |
| 154 |
def->fieldCount = cxxTagGetCUDAFieldDefinitionifierCount(); |
| 155 |
def->extensions = extensions; |
| 156 |
def->parser2 = cxxCUDAParserMain; |
| 157 |
def->initialize = cxxCUDAParserInitialize; |
| 158 |
def->finalize = cxxParserCleanup; |
| 159 |
def->selectLanguage = NULL; |
| 160 |
def->useCork = CORK_QUEUE|CORK_SYMTAB; |
| 161 |
|
| 162 |
return def; |
| 163 |
} |