Skip to content
Snippets Groups Projects
Commit 143cba3d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

UpperCase

parent 6c18bd25
No related branches found
No related tags found
No related merge requests found
...@@ -286,6 +286,7 @@ Today return tToday; ...@@ -286,6 +286,7 @@ Today return tToday;
TotalMemory return tTotalMemory; TotalMemory return tTotalMemory;
UndefineConstant return tUndefineConstant; UndefineConstant return tUndefineConstant;
UpperCase return tUpperCase;
Using return tUsing; Using return tUsing;
Volume return tVolume; Volume return tVolume;
......
This diff is collapsed.
...@@ -91,138 +91,139 @@ extern int gmsh_yydebug; ...@@ -91,138 +91,139 @@ extern int gmsh_yydebug;
tStrFind = 301, tStrFind = 301,
tStrCmp = 302, tStrCmp = 302,
tStrChoice = 303, tStrChoice = 303,
tTextAttributes = 304, tUpperCase = 304,
tBoundingBox = 305, tTextAttributes = 305,
tDraw = 306, tBoundingBox = 306,
tSetChanged = 307, tDraw = 307,
tToday = 308, tSetChanged = 308,
tFixRelativePath = 309, tToday = 309,
tCurrentDirectory = 310, tFixRelativePath = 310,
tSyncModel = 311, tCurrentDirectory = 311,
tNewModel = 312, tSyncModel = 312,
tOnelabAction = 313, tNewModel = 313,
tOnelabRun = 314, tOnelabAction = 314,
tCpu = 315, tOnelabRun = 315,
tMemory = 316, tCpu = 316,
tTotalMemory = 317, tMemory = 317,
tCreateTopology = 318, tTotalMemory = 318,
tCreateTopologyNoHoles = 319, tCreateTopology = 319,
tDistanceFunction = 320, tCreateTopologyNoHoles = 320,
tDefineConstant = 321, tDistanceFunction = 321,
tUndefineConstant = 322, tDefineConstant = 322,
tDefineNumber = 323, tUndefineConstant = 323,
tDefineString = 324, tDefineNumber = 324,
tSetNumber = 325, tDefineString = 325,
tSetString = 326, tSetNumber = 326,
tPoint = 327, tSetString = 327,
tCircle = 328, tPoint = 328,
tEllipse = 329, tCircle = 329,
tLine = 330, tEllipse = 330,
tSphere = 331, tLine = 331,
tPolarSphere = 332, tSphere = 332,
tSurface = 333, tPolarSphere = 333,
tSpline = 334, tSurface = 334,
tVolume = 335, tSpline = 335,
tCharacteristic = 336, tVolume = 336,
tLength = 337, tCharacteristic = 337,
tParametric = 338, tLength = 338,
tElliptic = 339, tParametric = 339,
tRefineMesh = 340, tElliptic = 340,
tAdaptMesh = 341, tRefineMesh = 341,
tRelocateMesh = 342, tAdaptMesh = 342,
tPlane = 343, tRelocateMesh = 343,
tRuled = 344, tPlane = 344,
tTransfinite = 345, tRuled = 345,
tComplex = 346, tTransfinite = 346,
tPhysical = 347, tComplex = 347,
tCompound = 348, tPhysical = 348,
tPeriodic = 349, tCompound = 349,
tUsing = 350, tPeriodic = 350,
tPlugin = 351, tUsing = 351,
tDegenerated = 352, tPlugin = 352,
tRecursive = 353, tDegenerated = 353,
tRotate = 354, tRecursive = 354,
tTranslate = 355, tRotate = 355,
tSymmetry = 356, tTranslate = 356,
tDilate = 357, tSymmetry = 357,
tExtrude = 358, tDilate = 358,
tLevelset = 359, tExtrude = 359,
tAffine = 360, tLevelset = 360,
tRecombine = 361, tAffine = 361,
tSmoother = 362, tRecombine = 362,
tSplit = 363, tSmoother = 363,
tDelete = 364, tSplit = 364,
tCoherence = 365, tDelete = 365,
tIntersect = 366, tCoherence = 366,
tMeshAlgorithm = 367, tIntersect = 367,
tReverse = 368, tMeshAlgorithm = 368,
tLayers = 369, tReverse = 369,
tScaleLast = 370, tLayers = 370,
tHole = 371, tScaleLast = 371,
tAlias = 372, tHole = 372,
tAliasWithOptions = 373, tAlias = 373,
tCopyOptions = 374, tAliasWithOptions = 374,
tQuadTriAddVerts = 375, tCopyOptions = 375,
tQuadTriNoNewVerts = 376, tQuadTriAddVerts = 376,
tQuadTriSngl = 377, tQuadTriNoNewVerts = 377,
tQuadTriDbl = 378, tQuadTriSngl = 378,
tRecombLaterals = 379, tQuadTriDbl = 379,
tTransfQuadTri = 380, tRecombLaterals = 380,
tText2D = 381, tTransfQuadTri = 381,
tText3D = 382, tText2D = 382,
tInterpolationScheme = 383, tText3D = 383,
tTime = 384, tInterpolationScheme = 384,
tCombine = 385, tTime = 385,
tBSpline = 386, tCombine = 386,
tBezier = 387, tBSpline = 387,
tNurbs = 388, tBezier = 388,
tNurbsOrder = 389, tNurbs = 389,
tNurbsKnots = 390, tNurbsOrder = 390,
tColor = 391, tNurbsKnots = 391,
tColorTable = 392, tColor = 392,
tFor = 393, tColorTable = 393,
tIn = 394, tFor = 394,
tEndFor = 395, tIn = 395,
tIf = 396, tEndFor = 396,
tEndIf = 397, tIf = 397,
tExit = 398, tEndIf = 398,
tAbort = 399, tExit = 399,
tField = 400, tAbort = 400,
tReturn = 401, tField = 401,
tCall = 402, tReturn = 402,
tMacro = 403, tCall = 403,
tShow = 404, tMacro = 404,
tHide = 405, tShow = 405,
tGetValue = 406, tHide = 406,
tGetEnv = 407, tGetValue = 407,
tGetString = 408, tGetEnv = 408,
tGetNumber = 409, tGetString = 409,
tHomology = 410, tGetNumber = 410,
tCohomology = 411, tHomology = 411,
tBetti = 412, tCohomology = 412,
tSetOrder = 413, tBetti = 413,
tExists = 414, tSetOrder = 414,
tFileExists = 415, tExists = 415,
tGMSH_MAJOR_VERSION = 416, tFileExists = 416,
tGMSH_MINOR_VERSION = 417, tGMSH_MAJOR_VERSION = 417,
tGMSH_PATCH_VERSION = 418, tGMSH_MINOR_VERSION = 418,
tGmshExecutableName = 419, tGMSH_PATCH_VERSION = 419,
tSetPartition = 420, tGmshExecutableName = 420,
tNameFromString = 421, tSetPartition = 421,
tStringFromName = 422, tNameFromString = 422,
tAFFECTPLUS = 423, tStringFromName = 423,
tAFFECTMINUS = 424, tAFFECTPLUS = 424,
tAFFECTTIMES = 425, tAFFECTMINUS = 425,
tAFFECTDIVIDE = 426, tAFFECTTIMES = 426,
tOR = 427, tAFFECTDIVIDE = 427,
tAND = 428, tOR = 428,
tEQUAL = 429, tAND = 429,
tNOTEQUAL = 430, tEQUAL = 430,
tLESSOREQUAL = 431, tNOTEQUAL = 431,
tGREATEROREQUAL = 432, tLESSOREQUAL = 432,
tPLUSPLUS = 433, tGREATEROREQUAL = 433,
tMINUSMINUS = 434, tPLUSPLUS = 434,
UNARYPREC = 435 tMINUSMINUS = 435,
UNARYPREC = 436
}; };
#endif #endif
...@@ -241,7 +242,7 @@ union YYSTYPE ...@@ -241,7 +242,7 @@ union YYSTYPE
Shape s; Shape s;
List_T *l; List_T *l;
#line 245 "Gmsh.tab.hpp" /* yacc.c:1909 */ #line 246 "Gmsh.tab.hpp" /* yacc.c:1909 */
}; };
typedef union YYSTYPE YYSTYPE; typedef union YYSTYPE YYSTYPE;
......
...@@ -120,7 +120,7 @@ struct doubleXstring{ ...@@ -120,7 +120,7 @@ struct doubleXstring{
%token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil tRound %token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil tRound
%token tFmod tModulo tHypot tList %token tFmod tModulo tHypot tList
%token tPrintf tError tStr tSprintf tStrCat tStrPrefix tStrRelative tStrReplace %token tPrintf tError tStr tSprintf tStrCat tStrPrefix tStrRelative tStrReplace
%token tFind tStrFind tStrCmp tStrChoice %token tFind tStrFind tStrCmp tStrChoice tUpperCase
%token tTextAttributes %token tTextAttributes
%token tBoundingBox tDraw tSetChanged tToday tFixRelativePath tCurrentDirectory %token tBoundingBox tDraw tSetChanged tToday tFixRelativePath tCurrentDirectory
%token tSyncModel tNewModel %token tSyncModel tNewModel
...@@ -5686,6 +5686,15 @@ StringExpr : ...@@ -5686,6 +5686,15 @@ StringExpr :
} }
List_Delete($3); List_Delete($3);
} }
| tUpperCase LP StringExpr RP
{
int i = 0;
while ($3[i]) {
$3[i] = toupper($3[i]);
i++;
}
$$ = $3;
}
| tStrChoice LP FExpr ',' StringExpr ',' StringExpr RP | tStrChoice LP FExpr ',' StringExpr ',' StringExpr RP
{ {
if($3){ if($3){
......
This diff is collapsed.
...@@ -1140,6 +1140,7 @@ Character expressions are defined as: ...@@ -1140,6 +1140,7 @@ Character expressions are defined as:
StrCat ( @var{char-expression} <,@dots{}> ) | StrCat ( @var{char-expression} <,@dots{}> ) |
Str ( @var{char-expression} <,@dots{}> ) | Str ( @var{char-expression} <,@dots{}> ) |
StrChoice ( @var{expression}, @var{char-expression}, @var{char-expression}) | StrChoice ( @var{expression}, @var{char-expression}, @var{char-expression}) |
UpperCase ( @var{char-expression} ) |
Sprintf ( @var{char-expression} , @var{expression-list} ) | Sprintf ( @var{char-expression} , @var{expression-list} ) |
Sprintf ( @var{char-expression} ) | Sprintf ( @var{char-expression} ) |
Sprintf ( @var{char-option} ) | Sprintf ( @var{char-option} ) |
...@@ -1158,18 +1159,21 @@ the directory of the @code{.geo} file. @code{StrPrefix} and ...@@ -1158,18 +1159,21 @@ the directory of the @code{.geo} file. @code{StrPrefix} and
@code{StrRelative} permit to take the prefix (e.g. to remove the @code{StrRelative} permit to take the prefix (e.g. to remove the
extension) or the relative path of a file name. @code{StrCat} and extension) or the relative path of a file name. @code{StrCat} and
@code{Str} permit to concatenate character expressions (@code{Str} adds @code{Str} permit to concatenate character expressions (@code{Str} adds
a newline character after each string except the last). @code{Sprintf} a newline character after each string except the last).
is equivalent to the @code{sprintf} C function (where @code{StrChoice} returns the first or second @var{char-expression}
@var{char-expression} is a format string that can contain floating point depending on the value of @var{expression}. @code{UpperCase} converts
formatting characters: @code{%e}, @code{%g}, etc.) The various the @var{char-expression} to upper case. @code{Sprintf} is equivalent to
@w{@var{char-option}s} are listed in @ref{Options}. @code{GetEnvThe} the @code{sprintf} C function (where @var{char-expression} is a format
gets the value of an environment variable from the operating string that can contain floating point formatting characters: @code{%e},
system. @code{GetString} allows to get a ONELAB string value (with one @code{%g}, etc.) The various @w{@var{char-option}s} are listed in
argument, the name of the ONELAB variable), or ask the user for a value @ref{Options}. @code{GetEnvThe} gets the value of an environment
interactively (with two arguments). @code{StrReplace}'s arguments are: variable from the operating system. @code{GetString} allows to get a
input string, old substring, new substring.@footnote{For compatibility ONELAB string value (with one argument, the name of the ONELAB
with GetDP (@uref{http://geuz.org/getdp/}), parentheses can be replaced variable), or ask the user for a value interactively (with two
by brackets @code{[]} in @code{Str} and @code{Sprintf}.} arguments). @code{StrReplace}'s arguments are: input string, old
substring, new substring.@footnote{For compatibility with GetDP
(@uref{http://geuz.org/getdp/}), parentheses can be replaced by brackets
@code{[]} in @code{Str} and @code{Sprintf}.}
@code{DefineString} allows to define a ONELAB variable in-line. The @code{DefineString} allows to define a ONELAB variable in-line. The
@var{char-expression} given as the first argument is the default value; this @var{char-expression} given as the first argument is the default value; this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment