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

added StringFromName and NameFromString

parent 43345a85
Branches
Tags
No related merge requests found
...@@ -210,6 +210,7 @@ MPI_Rank return tMPI_Rank; ...@@ -210,6 +210,7 @@ MPI_Rank return tMPI_Rank;
MPI_Size return tMPI_Size; MPI_Size return tMPI_Size;
Memory return tMemory; Memory return tMemory;
NameFromString return tNameFromString;
NewModel return tNewModel; NewModel return tNewModel;
Nurbs return tNurbs; Nurbs return tNurbs;
...@@ -259,6 +260,7 @@ Spline return tSpline; ...@@ -259,6 +260,7 @@ Spline return tSpline;
Split return tSplit; Split return tSplit;
Surface return tSurface; Surface return tSurface;
Str return tStr; Str return tStr;
StringFromName return tStringFromName;
Sprintf return tSprintf; Sprintf return tSprintf;
StrCat return tStrCat; StrCat return tStrCat;
StrReplace return tStrReplace; StrReplace return tStrReplace;
... ...
......
This diff is collapsed.
...@@ -208,19 +208,21 @@ extern int gmsh_yydebug; ...@@ -208,19 +208,21 @@ extern int gmsh_yydebug;
tGMSH_PATCH_VERSION = 418, tGMSH_PATCH_VERSION = 418,
tGmshExecutableName = 419, tGmshExecutableName = 419,
tSetPartition = 420, tSetPartition = 420,
tAFFECTPLUS = 421, tNameFromString = 421,
tAFFECTMINUS = 422, tStringFromName = 422,
tAFFECTTIMES = 423, tAFFECTPLUS = 423,
tAFFECTDIVIDE = 424, tAFFECTMINUS = 424,
tOR = 425, tAFFECTTIMES = 425,
tAND = 426, tAFFECTDIVIDE = 426,
tEQUAL = 427, tOR = 427,
tNOTEQUAL = 428, tAND = 428,
tLESSOREQUAL = 429, tEQUAL = 429,
tGREATEROREQUAL = 430, tNOTEQUAL = 430,
tPLUSPLUS = 431, tLESSOREQUAL = 431,
tMINUSMINUS = 432, tGREATEROREQUAL = 432,
UNARYPREC = 433 tPLUSPLUS = 433,
tMINUSMINUS = 434,
UNARYPREC = 435
}; };
#endif #endif
...@@ -239,7 +241,7 @@ union YYSTYPE ...@@ -239,7 +241,7 @@ union YYSTYPE
Shape s; Shape s;
List_T *l; List_T *l;
#line 243 "Gmsh.tab.hpp" /* yacc.c:1909 */ #line 245 "Gmsh.tab.hpp" /* yacc.c:1909 */
}; };
typedef union YYSTYPE YYSTYPE; typedef union YYSTYPE YYSTYPE;
... ...
......
...@@ -147,6 +147,7 @@ struct doubleXstring{ ...@@ -147,6 +147,7 @@ struct doubleXstring{
%token tHomology tCohomology tBetti tSetOrder tExists tFileExists %token tHomology tCohomology tBetti tSetOrder tExists tFileExists
%token tGMSH_MAJOR_VERSION tGMSH_MINOR_VERSION tGMSH_PATCH_VERSION %token tGMSH_MAJOR_VERSION tGMSH_MINOR_VERSION tGMSH_PATCH_VERSION
%token tGmshExecutableName tSetPartition %token tGmshExecutableName tSetPartition
%token tNameFromString tStringFromName
%type <d> FExpr FExpr_Single %type <d> FExpr FExpr_Single
%type <v> VExpr VExpr_Single CircleOptions TransfiniteType %type <v> VExpr VExpr_Single CircleOptions TransfiniteType
...@@ -3213,7 +3214,7 @@ Loop : ...@@ -3213,7 +3214,7 @@ Loop :
(&gmsh_yyin, gmsh_yyname, gmsh_yylineno)) (&gmsh_yyin, gmsh_yyname, gmsh_yylineno))
yymsg(0, "Error while exiting function"); yymsg(0, "Error while exiting function");
} }
| tCall tSTRING tEND | tCall String__Index tEND
{ {
if(!FunctionManager::Instance()->enterFunction if(!FunctionManager::Instance()->enterFunction
(std::string($2), &gmsh_yyin, gmsh_yyname, gmsh_yylineno)) (std::string($2), &gmsh_yyin, gmsh_yyname, gmsh_yylineno))
...@@ -5567,6 +5568,10 @@ StringExpr : ...@@ -5567,6 +5568,10 @@ StringExpr :
{ {
$$ = $1; $$ = $1;
} }
| tStringFromName '[' String__Index ']'
{
$$ = $3;
}
| tToday | tToday
{ {
$$ = (char *)Malloc(32 * sizeof(char)); $$ = (char *)Malloc(32 * sizeof(char));
...@@ -5780,6 +5785,9 @@ String__Index : ...@@ -5780,6 +5785,9 @@ String__Index :
| StringIndex | StringIndex
{ $$ = $1; } { $$ = $1; }
// Name from any string
| tNameFromString '[' StringExprVar ']'
{ $$ = $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