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;
UndefineConstant return tUndefineConstant;
UpperCase return tUpperCase;
LowerCase return tLowerCase;
LowerCaseIn return tLowerCaseIn;
Using return tUsing;
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
......@@ -15,7 +16,9 @@
GNU General Public License for more details.
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
part or all of the Bison parser skeleton and distribute that work
......@@ -30,21 +33,12 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_GMSH_YY_GMSH_TAB_HPP_INCLUDED
# 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. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
tDOUBLE = 258,
tSTRING = 259,
tBIGSTR = 260,
......@@ -92,148 +86,332 @@ extern int gmsh_yydebug;
tStrCmp = 302,
tStrChoice = 303,
tUpperCase = 304,
tTextAttributes = 305,
tBoundingBox = 306,
tDraw = 307,
tSetChanged = 308,
tToday = 309,
tFixRelativePath = 310,
tCurrentDirectory = 311,
tSyncModel = 312,
tNewModel = 313,
tOnelabAction = 314,
tOnelabRun = 315,
tCpu = 316,
tMemory = 317,
tTotalMemory = 318,
tCreateTopology = 319,
tCreateTopologyNoHoles = 320,
tDistanceFunction = 321,
tDefineConstant = 322,
tUndefineConstant = 323,
tDefineNumber = 324,
tDefineString = 325,
tSetNumber = 326,
tSetString = 327,
tPoint = 328,
tCircle = 329,
tEllipse = 330,
tLine = 331,
tSphere = 332,
tPolarSphere = 333,
tSurface = 334,
tSpline = 335,
tVolume = 336,
tCharacteristic = 337,
tLength = 338,
tParametric = 339,
tElliptic = 340,
tRefineMesh = 341,
tAdaptMesh = 342,
tRelocateMesh = 343,
tPlane = 344,
tRuled = 345,
tTransfinite = 346,
tComplex = 347,
tPhysical = 348,
tCompound = 349,
tPeriodic = 350,
tUsing = 351,
tPlugin = 352,
tDegenerated = 353,
tRecursive = 354,
tRotate = 355,
tTranslate = 356,
tSymmetry = 357,
tDilate = 358,
tExtrude = 359,
tLevelset = 360,
tAffine = 361,
tRecombine = 362,
tSmoother = 363,
tSplit = 364,
tDelete = 365,
tCoherence = 366,
tIntersect = 367,
tMeshAlgorithm = 368,
tReverse = 369,
tLayers = 370,
tScaleLast = 371,
tHole = 372,
tAlias = 373,
tAliasWithOptions = 374,
tCopyOptions = 375,
tQuadTriAddVerts = 376,
tQuadTriNoNewVerts = 377,
tQuadTriSngl = 378,
tQuadTriDbl = 379,
tRecombLaterals = 380,
tTransfQuadTri = 381,
tText2D = 382,
tText3D = 383,
tInterpolationScheme = 384,
tTime = 385,
tCombine = 386,
tBSpline = 387,
tBezier = 388,
tNurbs = 389,
tNurbsOrder = 390,
tNurbsKnots = 391,
tColor = 392,
tColorTable = 393,
tFor = 394,
tIn = 395,
tEndFor = 396,
tIf = 397,
tEndIf = 398,
tExit = 399,
tAbort = 400,
tField = 401,
tReturn = 402,
tCall = 403,
tMacro = 404,
tShow = 405,
tHide = 406,
tGetValue = 407,
tGetEnv = 408,
tGetString = 409,
tGetNumber = 410,
tHomology = 411,
tCohomology = 412,
tBetti = 413,
tSetOrder = 414,
tExists = 415,
tFileExists = 416,
tGMSH_MAJOR_VERSION = 417,
tGMSH_MINOR_VERSION = 418,
tGMSH_PATCH_VERSION = 419,
tGmshExecutableName = 420,
tSetPartition = 421,
tNameFromString = 422,
tStringFromName = 423,
tAFFECTPLUS = 424,
tAFFECTMINUS = 425,
tAFFECTTIMES = 426,
tAFFECTDIVIDE = 427,
tOR = 428,
tAND = 429,
tEQUAL = 430,
tNOTEQUAL = 431,
tLESSOREQUAL = 432,
tGREATEROREQUAL = 433,
tPLUSPLUS = 434,
tMINUSMINUS = 435,
UNARYPREC = 436
tLowerCase = 305,
tLowerCaseIn = 306,
tTextAttributes = 307,
tBoundingBox = 308,
tDraw = 309,
tSetChanged = 310,
tToday = 311,
tFixRelativePath = 312,
tCurrentDirectory = 313,
tSyncModel = 314,
tNewModel = 315,
tOnelabAction = 316,
tOnelabRun = 317,
tCpu = 318,
tMemory = 319,
tTotalMemory = 320,
tCreateTopology = 321,
tCreateTopologyNoHoles = 322,
tDistanceFunction = 323,
tDefineConstant = 324,
tUndefineConstant = 325,
tDefineNumber = 326,
tDefineString = 327,
tSetNumber = 328,
tSetString = 329,
tPoint = 330,
tCircle = 331,
tEllipse = 332,
tLine = 333,
tSphere = 334,
tPolarSphere = 335,
tSurface = 336,
tSpline = 337,
tVolume = 338,
tCharacteristic = 339,
tLength = 340,
tParametric = 341,
tElliptic = 342,
tRefineMesh = 343,
tAdaptMesh = 344,
tRelocateMesh = 345,
tPlane = 346,
tRuled = 347,
tTransfinite = 348,
tComplex = 349,
tPhysical = 350,
tCompound = 351,
tPeriodic = 352,
tUsing = 353,
tPlugin = 354,
tDegenerated = 355,
tRecursive = 356,
tRotate = 357,
tTranslate = 358,
tSymmetry = 359,
tDilate = 360,
tExtrude = 361,
tLevelset = 362,
tAffine = 363,
tRecombine = 364,
tSmoother = 365,
tSplit = 366,
tDelete = 367,
tCoherence = 368,
tIntersect = 369,
tMeshAlgorithm = 370,
tReverse = 371,
tLayers = 372,
tScaleLast = 373,
tHole = 374,
tAlias = 375,
tAliasWithOptions = 376,
tCopyOptions = 377,
tQuadTriAddVerts = 378,
tQuadTriNoNewVerts = 379,
tQuadTriSngl = 380,
tQuadTriDbl = 381,
tRecombLaterals = 382,
tTransfQuadTri = 383,
tText2D = 384,
tText3D = 385,
tInterpolationScheme = 386,
tTime = 387,
tCombine = 388,
tBSpline = 389,
tBezier = 390,
tNurbs = 391,
tNurbsOrder = 392,
tNurbsKnots = 393,
tColor = 394,
tColorTable = 395,
tFor = 396,
tIn = 397,
tEndFor = 398,
tIf = 399,
tEndIf = 400,
tExit = 401,
tAbort = 402,
tField = 403,
tReturn = 404,
tCall = 405,
tMacro = 406,
tShow = 407,
tHide = 408,
tGetValue = 409,
tGetEnv = 410,
tGetString = 411,
tGetNumber = 412,
tHomology = 413,
tCohomology = 414,
tBetti = 415,
tSetOrder = 416,
tExists = 417,
tFileExists = 418,
tGMSH_MAJOR_VERSION = 419,
tGMSH_MINOR_VERSION = 420,
tGMSH_PATCH_VERSION = 421,
tGmshExecutableName = 422,
tSetPartition = 423,
tNameFromString = 424,
tStringFromName = 425,
tAFFECTDIVIDE = 426,
tAFFECTTIMES = 427,
tAFFECTMINUS = 428,
tAFFECTPLUS = 429,
tOR = 430,
tAND = 431,
tNOTEQUAL = 432,
tEQUAL = 433,
tGREATEROREQUAL = 434,
tLESSOREQUAL = 435,
UNARYPREC = 436,
tMINUSMINUS = 437,
tPLUSPLUS = 438
};
#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;
int i;
unsigned int u;
......@@ -241,18 +419,14 @@ union YYSTYPE
double v[5];
Shape s;
List_T *l;
#line 246 "Gmsh.tab.hpp" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
}
/* Line 1529 of yacc.c. */
#line 425 "Gmsh.tab.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE gmsh_yylval;
int gmsh_yyparse (void);
#endif /* !YY_GMSH_YY_GMSH_TAB_HPP_INCLUDED */
......@@ -120,7 +120,7 @@ struct doubleXstring{
%token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil tRound
%token tFmod tModulo tHypot tList
%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 tBoundingBox tDraw tSetChanged tToday tFixRelativePath tCurrentDirectory
%token tSyncModel tNewModel
......@@ -5686,7 +5686,7 @@ StringExpr :
}
List_Delete($3);
}
| tUpperCase LP StringExpr RP
| tUpperCase LP StringExprVar RP
{
int i = 0;
while ($3[i]) {
......@@ -5695,6 +5695,25 @@ StringExpr :
}
$$ = $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
{
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