Skip to content
Snippets Groups Projects
Commit 502b59eb authored by Patrick Dular's avatar Patrick Dular
Browse files

Added: string functions LowerCase and LowerCaseIn

parent 19368030
No related branches found
No related tags found
No related merge requests found
...@@ -287,6 +287,8 @@ TotalMemory return tTotalMemory; ...@@ -287,6 +287,8 @@ TotalMemory return tTotalMemory;
UndefineConstant return tUndefineConstant; UndefineConstant return tUndefineConstant;
UpperCase return tUpperCase; UpperCase return tUpperCase;
LowerCase return tLowerCase;
LowerCaseIn return tLowerCaseIn;
Using return tUsing; Using return tUsing;
Volume return tVolume; Volume return tVolume;
......
This diff is collapsed.
/* A Bison parser, made by GNU Bison 3.0.4. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison interface for Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -15,7 +16,9 @@ ...@@ -15,7 +16,9 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -30,210 +33,385 @@ ...@@ -30,210 +33,385 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_GMSH_YY_GMSH_TAB_HPP_INCLUDED /* Tokens. */
# define YY_GMSH_YY_GMSH_TAB_HPP_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int gmsh_yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
enum yytokentype /* Put the tokens into the symbol table, so that GDB and other debuggers
{ know about them. */
tDOUBLE = 258, enum yytokentype {
tSTRING = 259, tDOUBLE = 258,
tBIGSTR = 260, tSTRING = 259,
tEND = 261, tBIGSTR = 260,
tAFFECT = 262, tEND = 261,
tDOTS = 263, tAFFECT = 262,
tPi = 264, tDOTS = 263,
tMPI_Rank = 265, tPi = 264,
tMPI_Size = 266, tMPI_Rank = 265,
tEuclidian = 267, tMPI_Size = 266,
tCoordinates = 268, tEuclidian = 267,
tExp = 269, tCoordinates = 268,
tLog = 270, tExp = 269,
tLog10 = 271, tLog = 270,
tSqrt = 272, tLog10 = 271,
tSin = 273, tSqrt = 272,
tAsin = 274, tSin = 273,
tCos = 275, tAsin = 274,
tAcos = 276, tCos = 275,
tTan = 277, tAcos = 276,
tRand = 278, tTan = 277,
tAtan = 279, tRand = 278,
tAtan2 = 280, tAtan = 279,
tSinh = 281, tAtan2 = 280,
tCosh = 282, tSinh = 281,
tTanh = 283, tCosh = 282,
tFabs = 284, tTanh = 283,
tFloor = 285, tFabs = 284,
tCeil = 286, tFloor = 285,
tRound = 287, tCeil = 286,
tFmod = 288, tRound = 287,
tModulo = 289, tFmod = 288,
tHypot = 290, tModulo = 289,
tList = 291, tHypot = 290,
tPrintf = 292, tList = 291,
tError = 293, tPrintf = 292,
tStr = 294, tError = 293,
tSprintf = 295, tStr = 294,
tStrCat = 296, tSprintf = 295,
tStrPrefix = 297, tStrCat = 296,
tStrRelative = 298, tStrPrefix = 297,
tStrReplace = 299, tStrRelative = 298,
tFind = 300, tStrReplace = 299,
tStrFind = 301, tFind = 300,
tStrCmp = 302, tStrFind = 301,
tStrChoice = 303, tStrCmp = 302,
tUpperCase = 304, tStrChoice = 303,
tTextAttributes = 305, tUpperCase = 304,
tBoundingBox = 306, tLowerCase = 305,
tDraw = 307, tLowerCaseIn = 306,
tSetChanged = 308, tTextAttributes = 307,
tToday = 309, tBoundingBox = 308,
tFixRelativePath = 310, tDraw = 309,
tCurrentDirectory = 311, tSetChanged = 310,
tSyncModel = 312, tToday = 311,
tNewModel = 313, tFixRelativePath = 312,
tOnelabAction = 314, tCurrentDirectory = 313,
tOnelabRun = 315, tSyncModel = 314,
tCpu = 316, tNewModel = 315,
tMemory = 317, tOnelabAction = 316,
tTotalMemory = 318, tOnelabRun = 317,
tCreateTopology = 319, tCpu = 318,
tCreateTopologyNoHoles = 320, tMemory = 319,
tDistanceFunction = 321, tTotalMemory = 320,
tDefineConstant = 322, tCreateTopology = 321,
tUndefineConstant = 323, tCreateTopologyNoHoles = 322,
tDefineNumber = 324, tDistanceFunction = 323,
tDefineString = 325, tDefineConstant = 324,
tSetNumber = 326, tUndefineConstant = 325,
tSetString = 327, tDefineNumber = 326,
tPoint = 328, tDefineString = 327,
tCircle = 329, tSetNumber = 328,
tEllipse = 330, tSetString = 329,
tLine = 331, tPoint = 330,
tSphere = 332, tCircle = 331,
tPolarSphere = 333, tEllipse = 332,
tSurface = 334, tLine = 333,
tSpline = 335, tSphere = 334,
tVolume = 336, tPolarSphere = 335,
tCharacteristic = 337, tSurface = 336,
tLength = 338, tSpline = 337,
tParametric = 339, tVolume = 338,
tElliptic = 340, tCharacteristic = 339,
tRefineMesh = 341, tLength = 340,
tAdaptMesh = 342, tParametric = 341,
tRelocateMesh = 343, tElliptic = 342,
tPlane = 344, tRefineMesh = 343,
tRuled = 345, tAdaptMesh = 344,
tTransfinite = 346, tRelocateMesh = 345,
tComplex = 347, tPlane = 346,
tPhysical = 348, tRuled = 347,
tCompound = 349, tTransfinite = 348,
tPeriodic = 350, tComplex = 349,
tUsing = 351, tPhysical = 350,
tPlugin = 352, tCompound = 351,
tDegenerated = 353, tPeriodic = 352,
tRecursive = 354, tUsing = 353,
tRotate = 355, tPlugin = 354,
tTranslate = 356, tDegenerated = 355,
tSymmetry = 357, tRecursive = 356,
tDilate = 358, tRotate = 357,
tExtrude = 359, tTranslate = 358,
tLevelset = 360, tSymmetry = 359,
tAffine = 361, tDilate = 360,
tRecombine = 362, tExtrude = 361,
tSmoother = 363, tLevelset = 362,
tSplit = 364, tAffine = 363,
tDelete = 365, tRecombine = 364,
tCoherence = 366, tSmoother = 365,
tIntersect = 367, tSplit = 366,
tMeshAlgorithm = 368, tDelete = 367,
tReverse = 369, tCoherence = 368,
tLayers = 370, tIntersect = 369,
tScaleLast = 371, tMeshAlgorithm = 370,
tHole = 372, tReverse = 371,
tAlias = 373, tLayers = 372,
tAliasWithOptions = 374, tScaleLast = 373,
tCopyOptions = 375, tHole = 374,
tQuadTriAddVerts = 376, tAlias = 375,
tQuadTriNoNewVerts = 377, tAliasWithOptions = 376,
tQuadTriSngl = 378, tCopyOptions = 377,
tQuadTriDbl = 379, tQuadTriAddVerts = 378,
tRecombLaterals = 380, tQuadTriNoNewVerts = 379,
tTransfQuadTri = 381, tQuadTriSngl = 380,
tText2D = 382, tQuadTriDbl = 381,
tText3D = 383, tRecombLaterals = 382,
tInterpolationScheme = 384, tTransfQuadTri = 383,
tTime = 385, tText2D = 384,
tCombine = 386, tText3D = 385,
tBSpline = 387, tInterpolationScheme = 386,
tBezier = 388, tTime = 387,
tNurbs = 389, tCombine = 388,
tNurbsOrder = 390, tBSpline = 389,
tNurbsKnots = 391, tBezier = 390,
tColor = 392, tNurbs = 391,
tColorTable = 393, tNurbsOrder = 392,
tFor = 394, tNurbsKnots = 393,
tIn = 395, tColor = 394,
tEndFor = 396, tColorTable = 395,
tIf = 397, tFor = 396,
tEndIf = 398, tIn = 397,
tExit = 399, tEndFor = 398,
tAbort = 400, tIf = 399,
tField = 401, tEndIf = 400,
tReturn = 402, tExit = 401,
tCall = 403, tAbort = 402,
tMacro = 404, tField = 403,
tShow = 405, tReturn = 404,
tHide = 406, tCall = 405,
tGetValue = 407, tMacro = 406,
tGetEnv = 408, tShow = 407,
tGetString = 409, tHide = 408,
tGetNumber = 410, tGetValue = 409,
tHomology = 411, tGetEnv = 410,
tCohomology = 412, tGetString = 411,
tBetti = 413, tGetNumber = 412,
tSetOrder = 414, tHomology = 413,
tExists = 415, tCohomology = 414,
tFileExists = 416, tBetti = 415,
tGMSH_MAJOR_VERSION = 417, tSetOrder = 416,
tGMSH_MINOR_VERSION = 418, tExists = 417,
tGMSH_PATCH_VERSION = 419, tFileExists = 418,
tGmshExecutableName = 420, tGMSH_MAJOR_VERSION = 419,
tSetPartition = 421, tGMSH_MINOR_VERSION = 420,
tNameFromString = 422, tGMSH_PATCH_VERSION = 421,
tStringFromName = 423, tGmshExecutableName = 422,
tAFFECTPLUS = 424, tSetPartition = 423,
tAFFECTMINUS = 425, tNameFromString = 424,
tAFFECTTIMES = 426, tStringFromName = 425,
tAFFECTDIVIDE = 427, tAFFECTDIVIDE = 426,
tOR = 428, tAFFECTTIMES = 427,
tAND = 429, tAFFECTMINUS = 428,
tEQUAL = 430, tAFFECTPLUS = 429,
tNOTEQUAL = 431, tOR = 430,
tLESSOREQUAL = 432, tAND = 431,
tGREATEROREQUAL = 433, tNOTEQUAL = 432,
tPLUSPLUS = 434, tEQUAL = 433,
tMINUSMINUS = 435, tGREATEROREQUAL = 434,
UNARYPREC = 436 tLESSOREQUAL = 435,
}; UNARYPREC = 436,
tMINUSMINUS = 437,
tPLUSPLUS = 438
};
#endif #endif
/* Tokens. */
#define tDOUBLE 258
#define tSTRING 259
#define tBIGSTR 260
#define tEND 261
#define tAFFECT 262
#define tDOTS 263
#define tPi 264
#define tMPI_Rank 265
#define tMPI_Size 266
#define tEuclidian 267
#define tCoordinates 268
#define tExp 269
#define tLog 270
#define tLog10 271
#define tSqrt 272
#define tSin 273
#define tAsin 274
#define tCos 275
#define tAcos 276
#define tTan 277
#define tRand 278
#define tAtan 279
#define tAtan2 280
#define tSinh 281
#define tCosh 282
#define tTanh 283
#define tFabs 284
#define tFloor 285
#define tCeil 286
#define tRound 287
#define tFmod 288
#define tModulo 289
#define tHypot 290
#define tList 291
#define tPrintf 292
#define tError 293
#define tStr 294
#define tSprintf 295
#define tStrCat 296
#define tStrPrefix 297
#define tStrRelative 298
#define tStrReplace 299
#define tFind 300
#define tStrFind 301
#define tStrCmp 302
#define tStrChoice 303
#define tUpperCase 304
#define tLowerCase 305
#define tLowerCaseIn 306
#define tTextAttributes 307
#define tBoundingBox 308
#define tDraw 309
#define tSetChanged 310
#define tToday 311
#define tFixRelativePath 312
#define tCurrentDirectory 313
#define tSyncModel 314
#define tNewModel 315
#define tOnelabAction 316
#define tOnelabRun 317
#define tCpu 318
#define tMemory 319
#define tTotalMemory 320
#define tCreateTopology 321
#define tCreateTopologyNoHoles 322
#define tDistanceFunction 323
#define tDefineConstant 324
#define tUndefineConstant 325
#define tDefineNumber 326
#define tDefineString 327
#define tSetNumber 328
#define tSetString 329
#define tPoint 330
#define tCircle 331
#define tEllipse 332
#define tLine 333
#define tSphere 334
#define tPolarSphere 335
#define tSurface 336
#define tSpline 337
#define tVolume 338
#define tCharacteristic 339
#define tLength 340
#define tParametric 341
#define tElliptic 342
#define tRefineMesh 343
#define tAdaptMesh 344
#define tRelocateMesh 345
#define tPlane 346
#define tRuled 347
#define tTransfinite 348
#define tComplex 349
#define tPhysical 350
#define tCompound 351
#define tPeriodic 352
#define tUsing 353
#define tPlugin 354
#define tDegenerated 355
#define tRecursive 356
#define tRotate 357
#define tTranslate 358
#define tSymmetry 359
#define tDilate 360
#define tExtrude 361
#define tLevelset 362
#define tAffine 363
#define tRecombine 364
#define tSmoother 365
#define tSplit 366
#define tDelete 367
#define tCoherence 368
#define tIntersect 369
#define tMeshAlgorithm 370
#define tReverse 371
#define tLayers 372
#define tScaleLast 373
#define tHole 374
#define tAlias 375
#define tAliasWithOptions 376
#define tCopyOptions 377
#define tQuadTriAddVerts 378
#define tQuadTriNoNewVerts 379
#define tQuadTriSngl 380
#define tQuadTriDbl 381
#define tRecombLaterals 382
#define tTransfQuadTri 383
#define tText2D 384
#define tText3D 385
#define tInterpolationScheme 386
#define tTime 387
#define tCombine 388
#define tBSpline 389
#define tBezier 390
#define tNurbs 391
#define tNurbsOrder 392
#define tNurbsKnots 393
#define tColor 394
#define tColorTable 395
#define tFor 396
#define tIn 397
#define tEndFor 398
#define tIf 399
#define tEndIf 400
#define tExit 401
#define tAbort 402
#define tField 403
#define tReturn 404
#define tCall 405
#define tMacro 406
#define tShow 407
#define tHide 408
#define tGetValue 409
#define tGetEnv 410
#define tGetString 411
#define tGetNumber 412
#define tHomology 413
#define tCohomology 414
#define tBetti 415
#define tSetOrder 416
#define tExists 417
#define tFileExists 418
#define tGMSH_MAJOR_VERSION 419
#define tGMSH_MINOR_VERSION 420
#define tGMSH_PATCH_VERSION 421
#define tGmshExecutableName 422
#define tSetPartition 423
#define tNameFromString 424
#define tStringFromName 425
#define tAFFECTDIVIDE 426
#define tAFFECTTIMES 427
#define tAFFECTMINUS 428
#define tAFFECTPLUS 429
#define tOR 430
#define tAND 431
#define tNOTEQUAL 432
#define tEQUAL 433
#define tGREATEROREQUAL 434
#define tLESSOREQUAL 435
#define UNARYPREC 436
#define tMINUSMINUS 437
#define tPLUSPLUS 438
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 105 "Gmsh.y" /* yacc.c:1909 */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 105 "Gmsh.y"
{
char *c; char *c;
int i; int i;
unsigned int u; unsigned int u;
...@@ -241,18 +419,14 @@ union YYSTYPE ...@@ -241,18 +419,14 @@ union YYSTYPE
double v[5]; double v[5];
Shape s; Shape s;
List_T *l; List_T *l;
}
#line 246 "Gmsh.tab.hpp" /* yacc.c:1909 */ /* Line 1529 of yacc.c. */
}; #line 425 "Gmsh.tab.hpp"
YYSTYPE;
typedef union YYSTYPE YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE gmsh_yylval; extern YYSTYPE gmsh_yylval;
int gmsh_yyparse (void);
#endif /* !YY_GMSH_YY_GMSH_TAB_HPP_INCLUDED */
...@@ -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 tUpperCase %token tFind tStrFind tStrCmp tStrChoice tUpperCase tLowerCase tLowerCaseIn
%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,7 +5686,7 @@ StringExpr : ...@@ -5686,7 +5686,7 @@ StringExpr :
} }
List_Delete($3); List_Delete($3);
} }
| tUpperCase LP StringExpr RP | tUpperCase LP StringExprVar RP
{ {
int i = 0; int i = 0;
while ($3[i]) { while ($3[i]) {
...@@ -5695,6 +5695,25 @@ StringExpr : ...@@ -5695,6 +5695,25 @@ StringExpr :
} }
$$ = $3; $$ = $3;
} }
| tLowerCase LP StringExprVar RP
{
int i = 0;
while ($3[i]) {
$3[i] = tolower($3[i]);
i++;
}
$$ = $3;
}
| tLowerCaseIn LP StringExprVar RP
{
int i = 0;
while ($3[i]) {
if (i > 0 && $3[i-1] != '_')
$3[i] = tolower($3[i]);
i++;
}
$$ = $3;
}
| tStrChoice LP FExpr ',' StringExpr ',' StringExpr RP | tStrChoice LP FExpr ',' StringExpr ',' StringExpr RP
{ {
if($3){ if($3){
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment