Appendix B
Grammar
B.1 The bison grammar
start: input ENDOFFILE;
input: instructions ;
instructions: instruction
| instructions instruction ;
list_of_id_args:
| id
| id '=' no_comma_expr
| FESPACE id
| type_of_dcl id
| type_of_dcl '&' id
| '[' list_of_id_args ']'
| list_of_id_args ',' id
| list_of_id_args ',' '[' list_of_id_args ']'
| list_of_id_args ',' id '=' no_comma_expr
| list_of_id_args ',' FESPACE id
| list_of_id_args ',' type_of_dcl id
| list_of_id_args ',' type_of_dcl '&' id ;
list_of_id1: id
| list_of_id1 ',' id ;
id: ID | FESPACE ;
list_of_dcls: ID
| ID '=' no_comma_expr
| ID '(' parameters_list ')'
| list_of_dcls ',' list_of_dcls ;
parameters_list:
no_set_expr
| FESPACE ID
| ID '=' no_set_expr
| parameters_list ',' no_set_expr
| parameters_list ',' id '=' no_set_expr ;
type_of_dcl: TYPE
| TYPE '[' TYPE ']' ;
ID_space:
ID
| ID '[' no_set_expr ']'
| ID '=' no_set_expr
| '[' list_of_id1 ']'
| '[' list_of_id1 ']' '[' no_set_expr ']'
| '[' list_of_id1 ']' '=' no_set_expr ;
ID_array_space:
ID '(' no_set_expr ')'
| '[' list_of_id1 ']' '(' no_set_expr ')' ;
fespace: FESPACE ;
spaceIDa : ID_array_space
| spaceIDa ',' ID_array_space ;
spaceIDb : ID_space
| spaceIDb ',' ID_space ;
spaceIDs : fespace spaceIDb
| fespace '[' TYPE ']' spaceIDa ;
fespace_def: ID '(' parameters_list ')' ;
fespace_def_list: fespace_def
| fespace_def_list ',' fespace_def ;
declaration: type_of_dcl list_of_dcls ';'
| 'fespace' fespace_def_list ';'
| spaceIDs ';'
| FUNCTION ID '=' Expr ';'
| FUNCTION type_of_dcl ID '(' list_of_id_args ')' '{' instructions'}'
| FUNCTION ID '(' list_of_id_args ')' '=' no_comma_expr ';' ;
begin: '{' ;
end: '}' ;
for_loop: 'for' ;
while_loop: 'while' ;
instruction: ';'
| 'include' STRING
| 'load' STRING
| Expr ';'
| declaration
| for_loop '(' Expr ';' Expr ';' Expr ')' instruction
| while_loop '(' Expr ')' instruction
| 'if' '(' Expr ')' instruction
| 'if' '(' Expr ')' instruction ELSE instruction
| begin instructions end
| 'border' ID border_expr
| 'border' ID '[' array ']' ';'
| 'break' ';'
| 'continue' ';'
| 'return' Expr ';' ;
bornes: '(' ID '=' Expr ',' Expr ')' ;
border_expr: bornes instruction ;
Expr: no_comma_expr
| Expr ',' Expr ;
unop: '-'
| '+'
| '!'
| '++'
| '--' ;
no_comma_expr:
no_set_expr
| no_set_expr '=' no_comma_expr
| no_set_expr '+=' no_comma_expr
| no_set_expr '-=' no_comma_expr
| no_set_expr '⋆=' no_comma_expr
| no_set_expr '/=' no_comma_expr ;
no_set_expr:
no_ternary_expr
| no_ternary_expr '?' no_set_expr ':' no_set_expr ;
no_ternary_expr:
unary_expr
| no_ternary_expr '⋆' no_ternary_expr
| no_ternary_expr '.⋆' no_ternary_expr
| no_ternary_expr './' no_ternary_expr
| no_ternary_expr '/' no_ternary_expr
| no_ternary_expr '%' no_ternary_expr
| no_ternary_expr '+' no_ternary_expr
| no_ternary_expr '-' no_ternary_expr
| no_ternary_expr '<<' no_ternary_expr
| no_ternary_expr '>>' no_ternary_expr
| no_ternary_expr '&' no_ternary_expr
| no_ternary_expr '&&' no_ternary_expr
| no_ternary_expr '|' no_ternary_expr
| no_ternary_expr '||' no_ternary_expr
| no_ternary_expr '<' no_ternary_expr
| no_ternary_expr '<=' no_ternary_expr
| no_ternary_expr '>' no_ternary_expr
| no_ternary_expr '>=' no_ternary_expr
| no_ternary_expr '==' no_ternary_expr
| no_ternary_expr '!=' no_ternary_expr ;
sub_script_expr:
no_set_expr
| ':'
| no_set_expr ':' no_set_expr
| no_set_expr ':' no_set_expr ':' no_set_expr ;
parameters:
| no_set_expr
| FESPACE
| id '=' no_set_expr
| sub_script_expr
| parameters ',' FESPACE
| parameters ',' no_set_expr
| parameters ',' id '=' no_set_expr ;
array: no_comma_expr
| array ',' no_comma_expr ;
unary_expr:
pow_expr
| unop pow_expr %prec UNARY ;
pow_expr: primary
| primary '^' unary_expr
| primary '_' unary_expr
| primary '
; // transpose
primary:
ID
| LNUM
| DNUM
| CNUM
| STRING
| primary '(' parameters ')'
| primary '[' Expr ']'
| primary '[' ']'
| primary '.' ID
| primary '++'
| primary '--'
| TYPE '(' Expr ')' ;
| '(' Expr ')'
| '[' array ']' ;
B.2 The Types of the languages, and cast
B.3 All the operators
- CG, type :<TypeSolveMat>
- Cholesky, type :<TypeSolveMat>
- Crout, type :<TypeSolveMat>
- GMRES, type :<TypeSolveMat>
- LU, type :<TypeSolveMat>
- LinearCG, type :<Polymorphic> operator() :
( <long> : <Polymorphic>, <KN<double> ⋆>, <KN<double> ⋆> )
- N, type :<Fem2D::R3>
- NoUseOfWait, type :<bool ⋆>
- P, type :<Fem2D::R3>
- P0, type :<Fem2D::TypeOfFE>
- P1, type :<Fem2D::TypeOfFE>
- P1nc, type :<Fem2D::TypeOfFE>
- P2, type :<Fem2D::TypeOfFE>
- RT0, type :<Fem2D::TypeOfFE>
- RTmodif, type :<Fem2D::TypeOfFE>
- abs, type :<Polymorphic> operator() :
( <double> : <double> )
- acos, type :<Polymorphic> operator() :
( <double> : <double> )
- acosh, type :<Polymorphic> operator() :
( <double> : <double> )
- adaptmesh, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <Fem2D::Mesh>... )
- append, type :<std::ios_base::openmode>
- asin, type :<Polymorphic> operator() :
( <double> : <double> )
- asinh, type :<Polymorphic> operator() :
( <double> : <double> )
- atan, type :<Polymorphic> operator() :
( <double> : <double> )
( <double> : <double>, <double> )
- atan2, type :<Polymorphic> operator() :
( <double> : <double>, <double> )
- atanh, type :<Polymorphic> operator() :
( <double> : <double> )
- buildmesh, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <E_BorderN> )
- buildmeshborder, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <E_BorderN> )
- cin, type :<istream>
- clock, type :<Polymorphic>
( <double> : )
- conj, type :<Polymorphic> operator() :
( <complex> : <complex> )
- convect, type :<Polymorphic> operator() :
( <double> : <E_Array>, <double>, <double> )
- cos, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- cosh, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- cout, type :<ostream>
- dumptable, type :<Polymorphic> operator() :
( <ostream> : <ostream> )
- dx, type :<Polymorphic> operator() :
( <LinearComb<MDroit, C_F0>> : <LinearComb<MDroit, C_F0>> )
( <double> : <std::pair<FEbase<double> ⋆, int>> )
( <LinearComb<MGauche, C_F0>> : <LinearComb<MGauche, C_F0>> )
- dy, type :<Polymorphic> operator() :
( <LinearComb<MDroit, C_F0>> : <LinearComb<MDroit, C_F0>> )
( <double> : <std::pair<FEbase<double> ⋆, int>> )
( <LinearComb<MGauche, C_F0>> : <LinearComb<MGauche, C_F0>> )
- endl, type :<char>
- exec, type :<Polymorphic> operator() :
( <long> : <string> )
- exit, type :<Polymorphic> operator() :
( <long> : <long> )
- exp, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- false, type :<bool>
- imag, type :<Polymorphic> operator() :
( <double> : <complex> )
- int1d, type :<Polymorphic> operator() :
( <CDomainOfIntegration> : <Fem2D::Mesh>... )
- int2d, type :<Polymorphic> operator() :
( <CDomainOfIntegration> : <Fem2D::Mesh>... )
- intalledges, type :<Polymorphic>
operator( :
( <CDomainOfIntegration> : <Fem2D::Mesh>... )
- jump, type :<Polymorphic>
operator( :
( <LinearComb<MDroit, C_F0>> : <LinearComb<MDroit, C_F0>> )
( <double> : <double> )
( <complex > : <complex > )
( <LinearComb<MGauche, C_F0>> : <LinearComb<MGauche, C_F0>> )
- label, type :<long ⋆>
- log, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- log10, type :<Polymorphic> operator() :
( <double> : <double> )
- max, type :<Polymorphic> operator() :
( <double> : <double>, <double> )
( <long> : <long>, <long> )
- mean, type :<Polymorphic>
operator( :
( <double> : <double> )
( <complex> : <complex> )
- min, type :<Polymorphic> operator() :
( <double> : <double>, <double> )
( <long> : <long>, <long> )
- movemesh, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <Fem2D::Mesh>, <E_Array>... )
- norm, type :<Polymorphic>
operator( :
( <double> : <std::complex<double>> )
- nuTriangle, type :<long>
- nuEdge, type :<long>
- on, type :<Polymorphic> operator() :
( <BC_set<double>> : <long>... )
- otherside, type :<Polymorphic>
operator( :
( <LinearComb<MDroit, C_F0>> : <LinearComb<MDroit, C_F0>> )
( <LinearComb<MGauche, C_F0>> : <LinearComb<MGauche, C_F0>> )
- pi, type :<double>
- plot, type :<Polymorphic> operator() :
( <long> : ... )
- pow, type :<Polymorphic> operator() :
( <double> : <double>, <double> )
( <complex> : <complex>, <complex> )
- qf1pE, type :<Fem2D::QuadratureFormular1d>
- qf1pT, type :<Fem2D::QuadratureFormular>
- qf1pTlump, type :<Fem2D::QuadratureFormular>
- qf2pE, type :<Fem2D::QuadratureFormular1d>
- qf2pT, type :<Fem2D::QuadratureFormular>
- qf2pT4P1, type :<Fem2D::QuadratureFormular>
- qf3pE, type :<Fem2D::QuadratureFormular1d>
- qf5pT, type :<Fem2D::QuadratureFormular>
- readmesh, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <string> )
- real, type :<Polymorphic> operator() :
( <double> : <complex> )
- region, type :<long ⋆>
- savemesh, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <Fem2D::Mesh>, <string>... )
- sin, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- sinh, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- sqrt, type :<Polymorphic> operator() :
( <double> : <double> )
( <complex> : <complex> )
- square, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <long>, <long> )
( <Fem2D::Mesh> : <long>, <long>, <E_Array> )
- tan, type :<Polymorphic> operator() :
( <double> : <double> )
- true, type :<bool>
- trunc, type :<Polymorphic> operator() :
( <Fem2D::Mesh> : <Fem2D::Mesh>, <bool> )
- verbosity, type :<long ⋆>
- wait, type :<bool ⋆>
- x, type :<double ⋆>
- y, type :<double ⋆>
- z, type :<double ⋆>