Created
December 13, 2010 07:31
-
-
Save yoppi/738759 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern int main(int __unused__ argc, char **argv) { | |
cookedArgs *args; | |
[...] | |
args = cArgNewFromArgv (argv); | |
[...] | |
makeTags (args); | |
/* Clean up. | |
*/ | |
[...] | |
exit(0); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void makeTags (cookedArgs *args) | |
{ | |
[...] | |
if (Options.fileList != NULL) { | |
verbose ("Reading list file\n"); | |
resize = (boolean) (createTagsFromListFile (Option.fileList) || resize); | |
} | |
[...] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boolean createTagsFromListFile(const char *const fileName) | |
{ | |
boolean resize; | |
[...] | |
FILE *fp = fopen (fileName, "r"); | |
resize = createTagsFromFileInput (fp, FALSE); | |
fclose(fp); | |
return resize; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boolean createTagsFromFileInput(FILE *fp, const boolean filter) | |
{ | |
boolean resize = FALSE; | |
if (fp != NULL) { | |
cookedArgs *args = cArgNewFromLineFile (fp); | |
while (! cArgOff (args)) { | |
resize |= createTagsForEntry (cArgItem (args)); | |
[...] | |
} | |
} | |
return resize; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boolean createTagsForEntry (const char *const entryName) | |
{ | |
boolean resize = FALSE; | |
[...] | |
resize = parseFile (entryName); | |
return resize; | |
} | |
extern boolean parseFile (const char *const fileName) | |
{ | |
boolean tagFileResized = FALSE; | |
langType language = Option.language; | |
if (Option.language == LANG_AUTO) | |
language = getFileLanguage (fileName); | |
[...] | |
tagFileResized = createTagsWithFallback (fileName, language); | |
[...] | |
return tagFileResized; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boolean createTagsWithFallback ( | |
const char *const fileName, const langType language) | |
{ | |
while (createTagsForFile (fileName, language, ++passCount)) | |
{ | |
[...] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boolean createTagsForFile(const char *const fileName, const langType language, const unsigned int passCount) { | |
boolean retried = FALSE; | |
Assert (0 <= language && language < (int) LanguageCount) | |
[...] | |
const parserDefinition *const lang = LanguageTable [language]; | |
if (lang != NULL) | |
{ | |
lang->parser(); | |
} | |
[...] | |
return retried; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern parserDefinition* RubyParser (void) | |
{ | |
static const char *const extentions [] = { "rb", "ruby", NULL }; | |
parserDefinition *def = parserNew("Ruby"); | |
def->kinds = RubyKinds; | |
def->kindCount = KIND_COUNT (RubyKinds); | |
def->extentions = extentions; | |
def->parser = findRubyTags; | |
return def; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment