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

add special token "Today" to return the current date
parent da857b19
Branches
Tags
No related merge requests found
%{
// $Id: Gmsh.l,v 1.63 2005-01-01 19:35:32 geuzaine Exp $
// $Id: Gmsh.l,v 1.64 2005-01-02 17:46:07 geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -217,6 +217,7 @@ Translate return tTranslate;
Tanh return tTanh;
Tan return tTan;
Trimmed return tTrimmed;
Today return tToday;
Using return tUsing;
......
This diff is collapsed.
......@@ -43,158 +43,159 @@ typedef union {
#define tStrPrefix 290
#define tBoundingBox 291
#define tDraw 292
#define tPoint 293
#define tCircle 294
#define tEllipse 295
#define tLine 296
#define tSurface 297
#define tSpline 298
#define tVolume 299
#define tCharacteristic 300
#define tLength 301
#define tParametric 302
#define tElliptic 303
#define tPlane 304
#define tRuled 305
#define tTriangulation 306
#define tTransfinite 307
#define tComplex 308
#define tPhysical 309
#define tUsing 310
#define tBump 311
#define tProgression 312
#define tPlugin 313
#define tRotate 314
#define tTranslate 315
#define tSymmetry 316
#define tDilate 317
#define tExtrude 318
#define tDuplicata 319
#define tLoop 320
#define tRecombine 321
#define tDelete 322
#define tCoherence 323
#define tIntersect 324
#define tAttractor 325
#define tLayers 326
#define tScalarPoint 327
#define tVectorPoint 328
#define tTensorPoint 329
#define tScalarLine 330
#define tVectorLine 331
#define tTensorLine 332
#define tScalarTriangle 333
#define tVectorTriangle 334
#define tTensorTriangle 335
#define tScalarQuadrangle 336
#define tVectorQuadrangle 337
#define tTensorQuadrangle 338
#define tScalarTetrahedron 339
#define tVectorTetrahedron 340
#define tTensorTetrahedron 341
#define tScalarHexahedron 342
#define tVectorHexahedron 343
#define tTensorHexahedron 344
#define tScalarPrism 345
#define tVectorPrism 346
#define tTensorPrism 347
#define tScalarPyramid 348
#define tVectorPyramid 349
#define tTensorPyramid 350
#define tText2D 351
#define tText3D 352
#define tInterpolationScheme 353
#define tTime 354
#define tCombine 355
#define tBSpline 356
#define tBezier 357
#define tNurbs 358
#define tOrder 359
#define tWith 360
#define tBounds 361
#define tKnots 362
#define tColor 363
#define tColorTable 364
#define tFor 365
#define tIn 366
#define tEndFor 367
#define tIf 368
#define tEndIf 369
#define tExit 370
#define tReturn 371
#define tCall 372
#define tFunction 373
#define tTrimmed 374
#define tShow 375
#define tHide 376
#define tGetValue 377
#define tB_SPLINE_SURFACE_WITH_KNOTS 378
#define tB_SPLINE_CURVE_WITH_KNOTS 379
#define tCARTESIAN_POINT 380
#define tTRUE 381
#define tFALSE 382
#define tUNSPECIFIED 383
#define tU 384
#define tV 385
#define tEDGE_CURVE 386
#define tVERTEX_POINT 387
#define tORIENTED_EDGE 388
#define tPLANE 389
#define tFACE_OUTER_BOUND 390
#define tEDGE_LOOP 391
#define tADVANCED_FACE 392
#define tVECTOR 393
#define tDIRECTION 394
#define tAXIS2_PLACEMENT_3D 395
#define tISO 396
#define tENDISO 397
#define tENDSEC 398
#define tDATA 399
#define tHEADER 400
#define tFILE_DESCRIPTION 401
#define tFILE_SCHEMA 402
#define tFILE_NAME 403
#define tMANIFOLD_SOLID_BREP 404
#define tCLOSED_SHELL 405
#define tADVANCED_BREP_SHAPE_REPRESENTATION 406
#define tFACE_BOUND 407
#define tCYLINDRICAL_SURFACE 408
#define tCONICAL_SURFACE 409
#define tCIRCLE 410
#define tTRIMMED_CURVE 411
#define tGEOMETRIC_SET 412
#define tCOMPOSITE_CURVE_SEGMENT 413
#define tCONTINUOUS 414
#define tCOMPOSITE_CURVE 415
#define tTOROIDAL_SURFACE 416
#define tPRODUCT_DEFINITION 417
#define tPRODUCT_DEFINITION_SHAPE 418
#define tSHAPE_DEFINITION_REPRESENTATION 419
#define tELLIPSE 420
#define tSolid 421
#define tEndSolid 422
#define tVertex 423
#define tFacet 424
#define tNormal 425
#define tOuter 426
#define tLoopSTL 427
#define tEndLoop 428
#define tEndFacet 429
#define tAFFECTPLUS 430
#define tAFFECTMINUS 431
#define tAFFECTTIMES 432
#define tAFFECTDIVIDE 433
#define tOR 434
#define tAND 435
#define tEQUAL 436
#define tNOTEQUAL 437
#define tAPPROXEQUAL 438
#define tLESSOREQUAL 439
#define tGREATEROREQUAL 440
#define tCROSSPRODUCT 441
#define tPLUSPLUS 442
#define tMINUSMINUS 443
#define UNARYPREC 444
#define tToday 293
#define tPoint 294
#define tCircle 295
#define tEllipse 296
#define tLine 297
#define tSurface 298
#define tSpline 299
#define tVolume 300
#define tCharacteristic 301
#define tLength 302
#define tParametric 303
#define tElliptic 304
#define tPlane 305
#define tRuled 306
#define tTriangulation 307
#define tTransfinite 308
#define tComplex 309
#define tPhysical 310
#define tUsing 311
#define tBump 312
#define tProgression 313
#define tPlugin 314
#define tRotate 315
#define tTranslate 316
#define tSymmetry 317
#define tDilate 318
#define tExtrude 319
#define tDuplicata 320
#define tLoop 321
#define tRecombine 322
#define tDelete 323
#define tCoherence 324
#define tIntersect 325
#define tAttractor 326
#define tLayers 327
#define tScalarPoint 328
#define tVectorPoint 329
#define tTensorPoint 330
#define tScalarLine 331
#define tVectorLine 332
#define tTensorLine 333
#define tScalarTriangle 334
#define tVectorTriangle 335
#define tTensorTriangle 336
#define tScalarQuadrangle 337
#define tVectorQuadrangle 338
#define tTensorQuadrangle 339
#define tScalarTetrahedron 340
#define tVectorTetrahedron 341
#define tTensorTetrahedron 342
#define tScalarHexahedron 343
#define tVectorHexahedron 344
#define tTensorHexahedron 345
#define tScalarPrism 346
#define tVectorPrism 347
#define tTensorPrism 348
#define tScalarPyramid 349
#define tVectorPyramid 350
#define tTensorPyramid 351
#define tText2D 352
#define tText3D 353
#define tInterpolationScheme 354
#define tTime 355
#define tCombine 356
#define tBSpline 357
#define tBezier 358
#define tNurbs 359
#define tOrder 360
#define tWith 361
#define tBounds 362
#define tKnots 363
#define tColor 364
#define tColorTable 365
#define tFor 366
#define tIn 367
#define tEndFor 368
#define tIf 369
#define tEndIf 370
#define tExit 371
#define tReturn 372
#define tCall 373
#define tFunction 374
#define tTrimmed 375
#define tShow 376
#define tHide 377
#define tGetValue 378
#define tB_SPLINE_SURFACE_WITH_KNOTS 379
#define tB_SPLINE_CURVE_WITH_KNOTS 380
#define tCARTESIAN_POINT 381
#define tTRUE 382
#define tFALSE 383
#define tUNSPECIFIED 384
#define tU 385
#define tV 386
#define tEDGE_CURVE 387
#define tVERTEX_POINT 388
#define tORIENTED_EDGE 389
#define tPLANE 390
#define tFACE_OUTER_BOUND 391
#define tEDGE_LOOP 392
#define tADVANCED_FACE 393
#define tVECTOR 394
#define tDIRECTION 395
#define tAXIS2_PLACEMENT_3D 396
#define tISO 397
#define tENDISO 398
#define tENDSEC 399
#define tDATA 400
#define tHEADER 401
#define tFILE_DESCRIPTION 402
#define tFILE_SCHEMA 403
#define tFILE_NAME 404
#define tMANIFOLD_SOLID_BREP 405
#define tCLOSED_SHELL 406
#define tADVANCED_BREP_SHAPE_REPRESENTATION 407
#define tFACE_BOUND 408
#define tCYLINDRICAL_SURFACE 409
#define tCONICAL_SURFACE 410
#define tCIRCLE 411
#define tTRIMMED_CURVE 412
#define tGEOMETRIC_SET 413
#define tCOMPOSITE_CURVE_SEGMENT 414
#define tCONTINUOUS 415
#define tCOMPOSITE_CURVE 416
#define tTOROIDAL_SURFACE 417
#define tPRODUCT_DEFINITION 418
#define tPRODUCT_DEFINITION_SHAPE 419
#define tSHAPE_DEFINITION_REPRESENTATION 420
#define tELLIPSE 421
#define tSolid 422
#define tEndSolid 423
#define tVertex 424
#define tFacet 425
#define tNormal 426
#define tOuter 427
#define tLoopSTL 428
#define tEndLoop 429
#define tEndFacet 430
#define tAFFECTPLUS 431
#define tAFFECTMINUS 432
#define tAFFECTTIMES 433
#define tAFFECTDIVIDE 434
#define tOR 435
#define tAND 436
#define tEQUAL 437
#define tNOTEQUAL 438
#define tAPPROXEQUAL 439
#define tLESSOREQUAL 440
#define tGREATEROREQUAL 441
#define tCROSSPRODUCT 442
#define tPLUSPLUS 443
#define tMINUSMINUS 444
#define UNARYPREC 445
extern YYSTYPE yylval;
%{
// $Id: Gmsh.y,v 1.195 2005-01-01 19:35:36 geuzaine Exp $
// $Id: Gmsh.y,v 1.196 2005-01-02 17:46:09 geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -21,6 +21,7 @@
// Please report all bugs and problems to <gmsh@geuz.org>.
#include <stdarg.h>
#include <time.h>
#include "PluginManager.h"
#include "ParUtil.h"
#include "Gmsh.h"
......@@ -89,7 +90,7 @@ int CheckViewErrorFlags(Post_View *v);
%token tExp tLog tLog10 tSqrt tSin tAsin tCos tAcos tTan tRand
%token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil
%token tFmod tModulo tHypot tPrintf tSprintf tStrCat tStrPrefix
%token tBoundingBox tDraw
%token tBoundingBox tDraw tToday
%token tPoint tCircle tEllipse tLine tSurface tSpline tVolume
%token tCharacteristic tLength tParametric tElliptic
%token tPlane tRuled tTriangulation tTransfinite tComplex tPhysical
......@@ -4062,6 +4063,14 @@ StringExpr :
{
$$ = $1;
}
| tToday
{
$$ = (char *)Malloc(32*sizeof(char));
time_t now;
time(&now);
strcpy($$, ctime(&now));
$$[strlen($$) - 1] = '\0';
}
| tStrCat '(' StringExpr ',' StringExpr ')'
{
$$ = (char *)Malloc((strlen($3)+strlen($5)+1)*sizeof(char));
......
This diff is collapsed.
\input texinfo.tex @c -*-texinfo-*-
@c $Id: gmsh.texi,v 1.161 2005-01-02 17:38:26 geuzaine Exp $
@c $Id: gmsh.texi,v 1.162 2005-01-02 17:46:09 geuzaine Exp $
@c
@c Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
@c
......@@ -763,6 +763,7 @@ Character expressions are defined as:
@example
@var{char-expression}:
"@var{string}" |
Today |
StrPrefix ( @var{char-expression} ) |
StrCat ( @var{char-expression} , @var{char-expression} ) |
Sprintf ( @var{char-expression} , @var{expression-list} ) |
......@@ -770,9 +771,9 @@ Character expressions are defined as:
Sprintf ( @var{char-option} )
@end example
@noindent The second case in this definition permits to take the
@noindent The third case in this definition permits to take the
prefix of a string (e.g., for removing the extension from a file name). The
third case permits to concatenate two character expressions, and the fourth
fourth case permits to concatenate two character expressions, and the fifth
is an equivalent of the @code{sprintf} C function (where
@var{char-expression} is a format string that can contain floating point
formatting characters: @code{%e}, @code{%g}, etc.). The last case permits to
......
......@@ -100,7 +100,7 @@ Plane Surface(24) = {23,21};
View "comments" {
// 10 pixels from the left and 15 pixels from the top of the graphic
// window:
T2(10,15,0){"File created on Fri Oct 18 23:50:20 2002"};
T2(10,15,0){StrCat("File created on ", Today)};
// 10 pixels from the left and 10 pixels from the bottom of the
// graphic window:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment