aboutsummaryrefslogtreecommitdiff
path: root/Source/Parser/wp_parser.l
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli.88@gmail.com> 2019-07-24 22:26:23 +0200
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-07-24 13:26:23 -0700
commit69ad179b500cb22d358c6841fce3954e7465bce7 (patch)
tree57a0244081cb8b705916a3c7b023e713f197c3ca /Source/Parser/wp_parser.l
parenta994e6e7c4419bdf5bee8d55889f1c25eaea5f1e (diff)
downloadWarpX-69ad179b500cb22d358c6841fce3954e7465bce7.tar.gz
WarpX-69ad179b500cb22d358c6841fce3954e7465bce7.tar.zst
WarpX-69ad179b500cb22d358c6841fce3954e7465bce7.zip
Parser now understands >= , <=, ==, !=, and, or (#230)
* Now parser understands <= and >= * Now parser understands <= and >= * Bugfixing * Updated example * Fixed bug * Fixed precedence and added ==, !=, and, or
Diffstat (limited to 'Source/Parser/wp_parser.l')
-rw-r--r--Source/Parser/wp_parser.l10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Parser/wp_parser.l b/Source/Parser/wp_parser.l
index 9c54ab06c..8e70203cb 100644
--- a/Source/Parser/wp_parser.l
+++ b/Source/Parser/wp_parser.l
@@ -44,6 +44,12 @@ EXP ([Ee][-+]?[0-9]+)
"fabs" { yylval.f1 = WP_ABS; return F1; }
"**" { yylval.f2 = WP_POW; return POW;}
"^" { yylval.f2 = WP_POW; return POW;}
+">=" { yylval.f2 = WP_GEQ; return GEQ;}
+"<=" { yylval.f2 = WP_LEQ; return LEQ;}
+"==" { yylval.f2 = WP_EQ; return EQ;}
+"!=" { yylval.f2 = WP_NEQ; return NEQ;}
+"and" { yylval.f2 = WP_AND; return AND;}
+"or" { yylval.f2 = WP_OR; return OR;}
"pow" { yylval.f2 = WP_POW; return F2; }
"heaviside" { yylval.f2 = WP_HEAVISIDE; return F2; }
"min" { yylval.f2 = WP_MIN; return F2; }
@@ -57,8 +63,8 @@ EXP ([Ee][-+]?[0-9]+)
"."?[0-9]+{EXP}? { yylval.d = atof(yytext); return NUMBER; }
/* Special characters */
-"//".*
-[ \t] /* ignore white space */
+"//".*
+[ \t] /* ignore white space */
\\\n /* ignore line continuation */
"\n" { return EOL; }