summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-02-12 17:02:11 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-02-12 17:02:11 (GMT)
commit77c63397e832a7ad5c618b1aed7fc5de25ff6e89 (patch)
treee885da91ffeb6ab98455c4fd31598f5fd467d047 /src/util.cpp
parent4d8e0f3abdf682e323db79aec176854f2a8aa699 (diff)
downloadDoxygen-77c63397e832a7ad5c618b1aed7fc5de25ff6e89.zip
Doxygen-77c63397e832a7ad5c618b1aed7fc5de25ff6e89.tar.gz
Doxygen-77c63397e832a7ad5c618b1aed7fc5de25ff6e89.tar.bz2
Adding support for lex files
Adding support for lex. The lex files consist of a mixture of lex specific structures, that are handled in the the lexcode.l and lexscanner.l, abd C code that is handled by the C parsers (hence the rules used are partly copied from scanner.l). Special attention has been paid to memberdef.cpp as the initial values should not be handled by the lex parsers but by the C parsers.
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 3bf349a..ad6b208 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -325,6 +325,7 @@ int guessSection(const char *name)
n.right(4)==".i++" ||
n.right(4)==".inl" ||
n.right(4)==".xml" ||
+ n.right(4)==".lex" ||
n.right(4)==".sql"
) return Entry::SOURCE_SEC;
if (n.right(2)==".h" || // header
@@ -5483,6 +5484,7 @@ g_lang2extMap[] =
{ "xml", "xml", SrcLangExt_XML },
{ "sql", "sql", SrcLangExt_SQL },
{ "md", "md", SrcLangExt_Markdown },
+ { "lex", "lex", SrcLangExt_Lex },
{ 0, 0, (SrcLangExt)0 }
};
@@ -5580,6 +5582,9 @@ void initDefaultExtensionMapping()
updateLanguageMapping(".md", "md");
updateLanguageMapping(".markdown", "md");
updateLanguageMapping(".ice", "slice");
+ updateLanguageMapping(".l", "lex");
+ updateLanguageMapping(".doxygen_lex_c", "c"); // this is a placeholder so we can map initializations
+ // in the lex scanning to cpp
}
void addCodeOnlyMappings()
@@ -6592,6 +6597,7 @@ QCString langToString(SrcLangExt lang)
case SrcLangExt_SQL: return "SQL";
case SrcLangExt_Markdown: return "Markdown";
case SrcLangExt_Slice: return "Slice";
+ case SrcLangExt_Lex: return "Lex";
}
return "Unknown";
}