/[ff3d]/ff3d/language/parse.ff.yy
ViewVC logotype

Diff of /ff3d/language/parse.ff.yy

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by delpinux, Sun Sep 21 14:31:37 2003 UTC revision 1.8 by delpinux, Tue Sep 30 19:41:55 2003 UTC
# Line 204  Line 204 
204  %token <realVariable> VARREALID "real_t variable"  %token <realVariable> VARREALID "real_t variable"
205  %token <vector3Variable> VARVECTID "vector variable"  %token <vector3Variable> VARVECTID "vector variable"
206  %token <functionVariable> VARFNCTID "function variable"  %token <functionVariable> VARFNCTID "function variable"
207  %token <meshVariable> MESHID STRUCT3DMESHID SURFMESHID TETRAHEDRAMESHID  %token <meshVariable> MESHID
208    
209  %token <sceneVariable> VARSCENEID "scene variable"  %token <sceneVariable> VARSCENEID "scene variable"
210  %token <domainVariable> VARDOMAINID "domain variable"  %token <domainVariable> VARDOMAINID "domain variable"
# Line 223  Line 223 
223  %type <multilinearformsum> multiLinearSumExp  %type <multilinearformsum> multiLinearSumExp
224  %type <variationalFormula> variationalFormula  %type <variationalFormula> variationalFormula
225    
 %type <meshVariable> meshid "mesh variable"  
226  %type <expression> exp "expression"  %type <expression> exp "expression"
227  %type <realExp> realexp  "double"  %type <realExp> realexp  "double"
228  %type <vector3> vector3exp "vector"  %type <vector3> vector3exp "vector"
# Line 339  Line 338 
338  %token ZMIN "zmin"  %token ZMIN "zmin"
339  %token ZMAX "zmax"  %token ZMAX "zmax"
340    
341  %token DNU CONVECT DERIVE  %token DNU CONVECT
342    
343  %token INCR DECR  %token INCR DECR
344    
# Line 371  Line 370 
370  %token TESTS  %token TESTS
371  %token IN ON BY INSIDE OUTSIDE POV SYSTEM  %token IN ON BY INSIDE OUTSIDE POV SYSTEM
372  %token COUT CERR  %token COUT CERR
373  %token ABS SIN COS TAN ASIN ACOS ATAN SQRT EXP  %token ABS SIN COS TAN ASIN ACOS ATAN SQRT EXP LOG
374    
375  /* Variable, Function and User Function */  /* Variable, Function and User Function */
376  %token <aString> NAME  %token <aString> NAME
# Line 581  affectation: Line 580  affectation:
580  {  {
581    $$ = new InstructionAffectation<FunctionExpression, FunctionVariable>($1,$3);    $$ = new InstructionAffectation<FunctionExpression, FunctionVariable>($1,$3);
582  }  }
583  | meshid '=' meshexp  | MESHID '=' meshexp
584  {  {
585    $$ = new InstructionAffectation<MeshExpression, MeshVariable>($1,$3);    $$ = new InstructionAffectation<MeshExpression, MeshVariable>($1,$3);
586  }  }
# Line 721  meshexp: Line 720  meshexp:
720  {  {
721    $$ = $1;    $$ = $1;
722  }  }
723  | meshid  | MESHID
724  {  {
725    $$ = new MeshExpressionVariable($1);    $$ = new MeshExpressionVariable($1);
726  }  }
# Line 762  surfacemeshexp: Line 761  surfacemeshexp:
761  }  }
762  ;  ;
763    
 meshid:  
   MESHID  
 {  
   $$ = $1;  
 }  
 |  STRUCT3DMESHID  
 {  
   $$ = $1;  
 }  
 | SURFMESHID  
 {  
   $$ = $1;  
 }  
 | TETRAHEDRAMESHID  
 {  
   $$ = $1;  
 }  
 ;  
   
764  sceneexp:  sceneexp:
765    POV '(' stringexp ')'    POV '(' stringexp ')'
766  {  {
# Line 1459  boundaryexp: Line 1439  boundaryexp:
1439  {  {
1440    $$ = new BoundaryExpressionPOVRay($1);    $$ = new BoundaryExpressionPOVRay($1);
1441  }  }
1442  | STRUCT3DMESHID  | MESHID
 {  
   $$ = new BoundaryExpressionStructured3DMesh();  
 }  
 | SURFMESHID  
1443  {  {
1444    ReferenceCounting<MeshExpression> m    switch ((*$1->expression()).meshType()) {
1445      = new MeshExpressionVariable($1);    case MeshExpression::structured: {
1446    $$ = new BoundaryExpressionSurfaceMesh(m);      $$ = new BoundaryExpressionStructured3DMesh();
1447        break;
1448      }
1449      case MeshExpression::surface: {
1450        ReferenceCounting<MeshExpression> m
1451          = new MeshExpressionVariable($1);
1452        $$ = new BoundaryExpressionSurfaceMesh(m);
1453        break;
1454      }
1455      default: {
1456        yyerror("Cannot use this kind of mesh as boundary condition");
1457      }
1458      }
1459  }  }
1460  | STRUCT3DMESHID face  | MESHID face
1461  {  {
1462    $$ = new BoundaryExpressionStructured3DMesh($2);    $$ = new BoundaryExpressionStructured3DMesh($2);
1463  }  }
# Line 1707  functionexp: Line 1695  functionexp:
1695    $$ = new FunctionExpressionUnaryOperator<ExpressionStdFunction<FunctionExpression,    $$ = new FunctionExpressionUnaryOperator<ExpressionStdFunction<FunctionExpression,
1696      std::exp> >($3);      std::exp> >($3);
1697  }  }
1698    | LOG '(' functionexp ')'
1699    {
1700      $$ = new FunctionExpressionUnaryOperator<ExpressionStdFunction<FunctionExpression,
1701        std::log> >($3);
1702    }
1703  | SIN '(' functionexp ')'  | SIN '(' functionexp ')'
1704  {  {
1705    $$ = new FunctionExpressionUnaryOperator<ExpressionStdFunction<FunctionExpression,    $$ = new FunctionExpressionUnaryOperator<ExpressionStdFunction<FunctionExpression,
# Line 1907  realexp: Line 1900  realexp:
1900  {  {
1901    $$ = new RealExpressionUnaryOperator<std::exp>($3);    $$ = new RealExpressionUnaryOperator<std::exp>($3);
1902  }  }
1903    | LOG  '(' realexp ')'
1904    {
1905      $$ = new RealExpressionUnaryOperator<std::log>($3);
1906    }
1907  | SIN  '(' realexp ')'  | SIN  '(' realexp ')'
1908  {  {
1909    $$ = new RealExpressionUnaryOperator<std::sin>($3);    $$ = new RealExpressionUnaryOperator<std::sin>($3);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26