diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.xml | 8 | ||||
-rw-r--r-- | src/fortranscanner.l | 24 | ||||
-rw-r--r-- | src/plantuml.cpp | 33 |
3 files changed, 59 insertions, 6 deletions
diff --git a/src/config.xml b/src/config.xml index 670ebaf..fb3b1de 100644 --- a/src/config.xml +++ b/src/config.xml @@ -3314,6 +3314,14 @@ to be found in the default search path. ]]> </docs> </option> + <option type='list' id='PLANTUML_INCLUDE_PATH' format='dir' defval='' depends='HAVE_DOT'> + <docs> +<![CDATA[ + When using plantuml, the specified paths are searched for files specified by the \c !include + statement in a plantuml block. +]]> + </docs> + </option> <option type='int' id='DOT_GRAPH_MAX_NODES' minval='0' maxval='10000' defval='50' depends='HAVE_DOT'> <docs> <![CDATA[ diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 765f887..8ea8aeb 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -258,11 +258,12 @@ CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" -ATTR_SPEC (ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE) +ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE) ACCESS_SPEC (PRIVATE|PUBLIC) LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")" /* Assume that attribute statements are almost the same as attributes. */ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} +EXTERNAL_STMT (EXTERNAL) CONTAINS CONTAINS PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|IMPURE|PURE|ELEMENTAL)? @@ -726,6 +727,18 @@ private { } } */ +{EXTERNAL_STMT}/({BS}"::"|{BS_}{ID}) { + /* external can be a "type" or an attribute */ + if(YY_START == Start) + { + addModule(NULL); + yy_push_state(ModuleBody); //anon program + } + QCString tmp = yytext; + currentModifiers |= tmp.stripWhiteSpace(); + argType = QCString(yytext).simplifyWhiteSpace().lower(); + yy_push_state(AttributeList); + } {ATTR_STMT}/{BS_}{ID} | {ATTR_STMT}/{BS}"::" { /* attribute statement starts */ @@ -744,7 +757,7 @@ private { <AttributeList>{ {COMMA} {} {BS} {} -{ATTR_SPEC}. { /* update current modifierswhen it is an ATTR_SPEC and not a variable name */ +{ATTR_SPEC}. { /* update current modifiers when it is an ATTR_SPEC and not a variable name */ /* bug_625519 */ QChar chr = yytext[(int)yyleng-1]; if (chr.isLetter() || chr.isDigit() || (chr == '_')) @@ -1723,8 +1736,11 @@ static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs) } if (mdfs.external) { - if (!typeName.isEmpty()) typeName += ", "; - typeName += "external"; + if (!typeName.contains("external")) + { + if (!typeName.isEmpty()) typeName += ", "; + typeName += "external"; + } } if (mdfs.intrinsic) { diff --git a/src/plantuml.cpp b/src/plantuml.cpp index 7e2863e..5e5bd98 100644 --- a/src/plantuml.cpp +++ b/src/plantuml.cpp @@ -20,7 +20,7 @@ #include <qdir.h> -//static const int maxCmdLine = 40960; +static const int maxCmdLine = 40960; QCString writePlantUMLSource(const QCString &outDir,const QCString &fileName,const QCString &content) { @@ -56,7 +56,24 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp static QCString plantumlJarPath = Config_getString("PLANTUML_JAR_PATH"); QCString pumlExe = "java"; - QCString pumlArgs = "-Djava.awt.headless=true -jar \""+plantumlJarPath+"plantuml.jar\" "; + QCString pumlArgs = ""; + + QStrList &pumlIncludePathList = Config_getList("PLANTUML_INCLUDE_PATH"); + char *s=pumlIncludePathList.first(); + if (s) + { + pumlArgs += "-Dplantuml.include.path=\""; + pumlArgs += s; + s = pumlIncludePathList.next(); + } + while (s) + { + pumlArgs += portable_pathListSeparator(); + pumlArgs += s; + s = pumlIncludePathList.next(); + } + if (pumlIncludePathList.first()) pumlArgs += "\" "; + pumlArgs += "-Djava.awt.headless=true -jar \""+plantumlJarPath+"plantuml.jar\" "; pumlArgs+="-o \""; pumlArgs+=outDir; pumlArgs+="\" "; @@ -79,6 +96,7 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp pumlArgs+=" \""; pumlArgs+=baseName; pumlArgs+=".pu\" "; + pumlArgs+="-charset " + Config_getString("INPUT_ENCODING") + " "; int exitCode; //printf("*** running: %s %s outDir:%s %s\n",pumlExe.data(),pumlArgs.data(),outDir,outFile); msg("Running PlantUML on generated file %s.pu\n",baseName); @@ -93,5 +111,16 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp QFile(QCString(baseName)+".pu").remove(); } portable_sysTimerStop(); + if ( (format==PUML_EPS) && (Config_getBool("USE_PDFLATEX")) ) + { + QCString epstopdfArgs(maxCmdLine); + epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",baseName,baseName); + portable_sysTimerStart(); + if (exitCode=portable_system("epstopdf",epstopdfArgs)!=0) + { + err("Problems running epstopdf. Check your TeX installation! Exit code: %d\n",exitCode); + } + portable_sysTimerStop(); + } } |