Extend mathematic operations support in the kmath-ast parser #120

Merged
CommanderTvis merged 10 commits from extended-grammar into dev 2020-07-27 19:37:09 +03:00
CommanderTvis commented 2020-07-20 23:44:01 +03:00 (Migrated from github.com)
  • Add reference ANTLR grammar.
  • Add symbols support in ASM MST matcher.
  • Extend parser to support singular values (like i in ComplexField) as well as unary and binary functions.

closes #117

- Add reference ANTLR grammar. - Add symbols support in ASM MST matcher. - Extend parser to support singular values (like i in ComplexField) as well as unary and binary functions. closes #117
CommanderTvis commented 2020-07-27 10:36:20 +03:00 (Migrated from github.com)

Converting it to draft because of better-parse bug. h0tk3y/better-parse#28

Converting it to draft because of better-parse bug. h0tk3y/better-parse#28
Shimuuar (Migrated from github.com) reviewed 2020-07-27 11:09:53 +03:00
Shimuuar (Migrated from github.com) commented 2020-07-27 11:02:43 +03:00

1.23e+3 generally + in exponent is generally allowed

`1.23e+3` generally + in exponent is generally allowed
@ -0,0 +1,59 @@
grammar ArithmeticsEvaluator;
fragment DIGIT: '0'..'9';
fragment LETTER: 'a'..'z';
Shimuuar (Migrated from github.com) commented 2020-07-27 11:02:15 +03:00

What about uppercase letters?

What about uppercase letters?
@ -0,0 +50,4 @@
: powChain ((DIV | MUL) powChain)*
;
subSumChain
Shimuuar (Migrated from github.com) commented 2020-07-27 11:08:02 +03:00

Is operator precedence right? Looks suspicious. It would be nice to add test for it

Is operator precedence right? Looks suspicious. It would be nice to add test for it
CommanderTvis (Migrated from github.com) reviewed 2020-07-27 16:51:20 +03:00
@ -0,0 +50,4 @@
: powChain ((DIV | MUL) powChain)*
;
subSumChain
CommanderTvis (Migrated from github.com) commented 2020-07-27 16:51:20 +03:00

Tests were added

Tests were added
CommanderTvis (Migrated from github.com) reviewed 2020-07-27 16:51:45 +03:00
CommanderTvis (Migrated from github.com) commented 2020-07-27 16:51:45 +03:00

Fixed

Fixed
CommanderTvis (Migrated from github.com) reviewed 2020-07-27 16:51:54 +03:00
@ -0,0 +1,59 @@
grammar ArithmeticsEvaluator;
fragment DIGIT: '0'..'9';
fragment LETTER: 'a'..'z';
CommanderTvis (Migrated from github.com) commented 2020-07-27 16:51:53 +03:00

Added.

Added.
altavir (Migrated from github.com) approved these changes 2020-07-27 19:36:49 +03:00
Sign in to join this conversation.
No description provided.