Unverified Commit de6c5ce7 authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub
Browse files

Merge pull request #205 from danclaudino/scientific_notation

Fix for observables to work with coefficients in scientific notation
parents 88c2e3c9 9f216f61
Pipeline #107425 passed with stage
in 67 minutes and 58 seconds
...@@ -12,11 +12,11 @@ op : INT carat?; ...@@ -12,11 +12,11 @@ op : INT carat?;
carat : '^'; carat : '^';
coeff : complex | real; coeff : complex | real ;
complex : '('(real | INT)','(real | INT)')'; complex : '('(real | INT | scientific)','(real | INT | scientific)')';
real : REAL; real : REAL | scientific;
comment : COMMENT; comment : COMMENT;
...@@ -25,6 +25,9 @@ COMMENT : '#' ~[\r\n] * EOL; ...@@ -25,6 +25,9 @@ COMMENT : '#' ~[\r\n] * EOL;
/* Real number */ /* Real number */
REAL : ('-') ? INT ? '.' INT; REAL : ('-') ? INT ? '.' INT;
/* scientific notation */
scientific : REAL ? ('e'|'E') ? INT;
/* Non-negative integer */ /* Non-negative integer */
INT : ('-') ? ('0'..'9') + ; INT : ('-') ? ('0'..'9') + ;
......
#!/bin/bash #!/bin/bash
set - o errexit set - o errexit
java -jar antlr-4.7.2-complete.jar -Dlanguage=Cpp -listener -o generated/ -package fermion FermionOperator.g4 java -jar antlr-4.8-complete.jar -Dlanguage=Cpp -listener -o generated/ -package fermion FermionOperator.g4
...@@ -6,6 +6,8 @@ null ...@@ -6,6 +6,8 @@ null
'(' '('
',' ','
')' ')'
'e'
'E'
null null
null null
null null
...@@ -20,6 +22,8 @@ null ...@@ -20,6 +22,8 @@ null
null null
null null
null null
null
null
COMMENT COMMENT
REAL REAL
INT INT
...@@ -37,7 +41,8 @@ coeff ...@@ -37,7 +41,8 @@ coeff
complex complex
real real
comment comment
scientific
atn: atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 13, 71, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9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 5, 10, 6, 2, 43, 9, 3, 2, 2, 2, 44, 46, 7, 11, 2, 2, 45, 47, 5, 12, 7, 2, 46, 45, 3, 2, 2, 2, 46, 47, 3, 2, 2, 2, 47, 11, 3, 2, 2, 2, 48, 49, 7, 5, 2, 2, 49, 13, 3, 2, 2, 2, 50, 53, 5, 16, 9, 2, 51, 53, 5, 18, 10, 2, 52, 50, 3, 2, 2, 2, 52, 51, 3, 2, 2, 2, 53, 15, 3, 2, 2, 2, 54, 57, 7, 6, 2, 2, 55, 58, 5, 18, 10, 2, 56, 58, 7, 11, 2, 2, 57, 55, 3, 2, 2, 2, 57, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 62, 7, 7, 2, 2, 60, 63, 5, 18, 10, 2, 61, 63, 7, 11, 2, 2, 62, 60, 3, 2, 2, 2, 62, 61, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 65, 7, 8, 2, 2, 65, 17, 3, 2, 2, 2, 66, 67, 7, 10, 2, 2, 67, 19, 3, 2, 2, 2, 68, 69, 7, 9, 2, 2, 69, 21, 3, 2, 2, 2, 9, 28, 34, 39, 46, 52, 57, 62] [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 15, 85, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 29, 10, 2, 12, 2, 14, 2, 32, 11, 2, 3, 3, 3, 3, 3, 4, 5, 4, 37, 10, 4, 3, 4, 7, 4, 40, 10, 4, 12, 4, 14, 4, 43, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 5, 6, 49, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 5, 8, 55, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 61, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 67, 10, 9, 3, 9, 3, 9, 3, 10, 3, 10, 5, 10, 73, 10, 10, 3, 11, 3, 11, 3, 12, 5, 12, 78, 10, 12, 3, 12, 5, 12, 81, 10, 12, 3, 12, 3, 12, 3, 12, 2, 2, 13, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 2, 4, 3, 2, 3, 4, 3, 2, 9, 10, 2, 85, 2, 24, 3, 2, 2, 2, 4, 33, 3, 2, 2, 2, 6, 36, 3, 2, 2, 2, 8, 44, 3, 2, 2, 2, 10, 46, 3, 2, 2, 2, 12, 50, 3, 2, 2, 2, 14, 54, 3, 2, 2, 2, 16, 56, 3, 2, 2, 2, 18, 72, 3, 2, 2, 2, 20, 74, 3, 2, 2, 2, 22, 77, 3, 2, 2, 2, 24, 30, 5, 6, 4, 2, 25, 26, 5, 4, 3, 2, 26, 27, 5, 6, 4, 2, 27, 29, 3, 2, 2, 2, 28, 25, 3, 2, 2, 2, 29, 32, 3, 2, 2, 2, 30, 28, 3, 2, 2, 2, 30, 31, 3, 2, 2, 2, 31, 3, 3, 2, 2, 2, 32, 30, 3, 2, 2, 2, 33, 34, 9, 2, 2, 2, 34, 5, 3, 2, 2, 2, 35, 37, 5, 14, 8, 2, 36, 35, 3, 2, 2, 2, 36, 37, 3, 2, 2, 2, 37, 41, 3, 2, 2, 2, 38, 40, 5, 8, 5, 2, 39, 38, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 7, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 5, 10, 6, 2, 45, 9, 3, 2, 2, 2, 46, 48, 7, 13, 2, 2, 47, 49, 5, 12, 7, 2, 48, 47, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 11, 3, 2, 2, 2, 50, 51, 7, 5, 2, 2, 51, 13, 3, 2, 2, 2, 52, 55, 5, 16, 9, 2, 53, 55, 5, 18, 10, 2, 54, 52, 3, 2, 2, 2, 54, 53, 3, 2, 2, 2, 55, 15, 3, 2, 2, 2, 56, 60, 7, 6, 2, 2, 57, 61, 5, 18, 10, 2, 58, 61, 7, 13, 2, 2, 59, 61, 5, 22, 12, 2, 60, 57, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 60, 59, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 66, 7, 7, 2, 2, 63, 67, 5, 18, 10, 2, 64, 67, 7, 13, 2, 2, 65, 67, 5, 22, 12, 2, 66, 63, 3, 2, 2, 2, 66, 64, 3, 2, 2, 2, 66, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 69, 7, 8, 2, 2, 69, 17, 3, 2, 2, 2, 70, 73, 7, 12, 2, 2, 71, 73, 5, 22, 12, 2, 72, 70, 3, 2, 2, 2, 72, 71, 3, 2, 2, 2, 73, 19, 3, 2, 2, 2, 74, 75, 7, 11, 2, 2, 75, 21, 3, 2, 2, 2, 76, 78, 7, 12, 2, 2, 77, 76, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 80, 3, 2, 2, 2, 79, 81, 9, 3, 2, 2, 80, 79, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 83, 7, 13, 2, 2, 83, 23, 3, 2, 2, 2, 12, 30, 36, 41, 48, 54, 60, 66, 72, 77, 80]
\ No newline at end of file \ No newline at end of file
...@@ -4,14 +4,18 @@ T__2=3 ...@@ -4,14 +4,18 @@ T__2=3
T__3=4 T__3=4
T__4=5 T__4=5
T__5=6 T__5=6
COMMENT=7 T__6=7
REAL=8 T__7=8
INT=9 COMMENT=9
WS=10 REAL=10
EOL=11 INT=11
WS=12
EOL=13
'+'=1 '+'=1
'-'=2 '-'=2
'^'=3 '^'=3
'('=4 '('=4
','=5 ','=5
')'=6 ')'=6
'e'=7
'E'=8
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#include "FermionOperatorBaseListener.h" #include "FermionOperatorBaseListener.h"
......
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#pragma once #pragma once
...@@ -48,6 +48,9 @@ public: ...@@ -48,6 +48,9 @@ public:
virtual void enterComment(FermionOperatorParser::CommentContext * /*ctx*/) override { } virtual void enterComment(FermionOperatorParser::CommentContext * /*ctx*/) override { }
virtual void exitComment(FermionOperatorParser::CommentContext * /*ctx*/) override { } virtual void exitComment(FermionOperatorParser::CommentContext * /*ctx*/) override { }
virtual void enterScientific(FermionOperatorParser::ScientificContext * /*ctx*/) override { }
virtual void exitScientific(FermionOperatorParser::ScientificContext * /*ctx*/) override { }
virtual void enterEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { } virtual void enterEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { }
virtual void exitEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { } virtual void exitEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { }
......
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#include "FermionOperatorLexer.h" #include "FermionOperatorLexer.h"
...@@ -61,8 +61,8 @@ atn::ATN FermionOperatorLexer::_atn; ...@@ -61,8 +61,8 @@ atn::ATN FermionOperatorLexer::_atn;
std::vector<uint16_t> FermionOperatorLexer::_serializedATN; std::vector<uint16_t> FermionOperatorLexer::_serializedATN;
std::vector<std::string> FermionOperatorLexer::_ruleNames = { std::vector<std::string> FermionOperatorLexer::_ruleNames = {
u8"T__0", u8"T__1", u8"T__2", u8"T__3", u8"T__4", u8"T__5", u8"COMMENT", u8"T__0", u8"T__1", u8"T__2", u8"T__3", u8"T__4", u8"T__5", u8"T__6",
u8"REAL", u8"INT", u8"WS", u8"EOL" u8"T__7", u8"COMMENT", u8"REAL", u8"INT", u8"WS", u8"EOL"
}; };
std::vector<std::string> FermionOperatorLexer::_channelNames = { std::vector<std::string> FermionOperatorLexer::_channelNames = {
...@@ -74,11 +74,12 @@ std::vector<std::string> FermionOperatorLexer::_modeNames = { ...@@ -74,11 +74,12 @@ std::vector<std::string> FermionOperatorLexer::_modeNames = {
}; };
std::vector<std::string> FermionOperatorLexer::_literalNames = { std::vector<std::string> FermionOperatorLexer::_literalNames = {
"", u8"'+'", u8"'-'", u8"'^'", u8"'('", u8"','", u8"')'" "", u8"'+'", u8"'-'", u8"'^'", u8"'('", u8"','", u8"')'", u8"'e'", u8"'E'"
}; };
std::vector<std::string> FermionOperatorLexer::_symbolicNames = { std::vector<std::string> FermionOperatorLexer::_symbolicNames = {
"", "", "", "", "", "", "", u8"COMMENT", u8"REAL", u8"INT", u8"WS", u8"EOL" "", "", "", "", "", "", "", "", "", u8"COMMENT", u8"REAL", u8"INT", u8"WS",
u8"EOL"
}; };
dfa::Vocabulary FermionOperatorLexer::_vocabulary(_literalNames, _symbolicNames); dfa::Vocabulary FermionOperatorLexer::_vocabulary(_literalNames, _symbolicNames);
...@@ -102,55 +103,61 @@ FermionOperatorLexer::Initializer::Initializer() { ...@@ -102,55 +103,61 @@ FermionOperatorLexer::Initializer::Initializer() {
_serializedATN = { _serializedATN = {
0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, 0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964,
0x2, 0xd, 0x48, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x2, 0xf, 0x50, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4,
0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9,
0x7, 0x4, 0x8, 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xc, 0x2, 0x2, 0x47, 0x18, 0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x45, 0x43, 0x3, 0x2, 0x2, 0x2, 0x45, 0x46, 0x3, 0x2,
0x2, 0x9, 0x2, 0x29, 0x2f, 0x32, 0x38, 0x3d, 0x44, 0x3, 0x8, 0x2, 0x2, 0x2, 0x2, 0x46, 0x18, 0x3, 0x2, 0x2, 0x2, 0x47, 0x48, 0x9, 0x3, 0x2,
0x2, 0x48, 0x49, 0x3, 0x2, 0x2, 0x2, 0x49, 0x4a, 0x8, 0xd, 0x2, 0x2,
0x4a, 0x1a, 0x3, 0x2, 0x2, 0x2, 0x4b, 0x4d, 0x7, 0xf, 0x2, 0x2, 0x4c,
0x4b, 0x3, 0x2, 0x2, 0x2, 0x4c, 0x4d, 0x3, 0x2, 0x2, 0x2, 0x4d, 0x4e,
0x3, 0x2, 0x2, 0x2, 0x4e, 0x4f, 0x7, 0xc, 0x2, 0x2, 0x4f, 0x1c, 0x3,
0x2, 0x2, 0x2, 0x9, 0x2, 0x31, 0x37, 0x3a, 0x40, 0x45, 0x4c, 0x3, 0x8,
0x2, 0x2,
}; };
atn::ATNDeserializer deserializer; atn::ATNDeserializer deserializer;
......
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#pragma once #pragma once
...@@ -13,8 +13,8 @@ namespace fermion { ...@@ -13,8 +13,8 @@ namespace fermion {
class FermionOperatorLexer : public antlr4::Lexer { class FermionOperatorLexer : public antlr4::Lexer {
public: public:
enum { enum {
T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, COMMENT = 7, T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7,
REAL = 8, INT = 9, WS = 10, EOL = 11 T__7 = 8, COMMENT = 9, REAL = 10, INT = 11, WS = 12, EOL = 13
}; };
FermionOperatorLexer(antlr4::CharStream *input); FermionOperatorLexer(antlr4::CharStream *input);
......
...@@ -6,6 +6,8 @@ null ...@@ -6,6 +6,8 @@ null
'(' '('
',' ','
')' ')'
'e'
'E'
null null
null null
null null
...@@ -20,6 +22,8 @@ null ...@@ -20,6 +22,8 @@ null
null null
null null
null null
null
null
COMMENT COMMENT
REAL REAL
INT INT
...@@ -33,6 +37,8 @@ T__2 ...@@ -33,6 +37,8 @@ T__2
T__3 T__3
T__4 T__4
T__5 T__5
T__6
T__7
COMMENT COMMENT
REAL REAL
INT INT
...@@ -47,4 +53,4 @@ mode names: ...@@ -47,4 +53,4 @@ mode names:
DEFAULT_MODE DEFAULT_MODE
atn: atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 13, 72, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 7, 8, 40, 10, 8, 12, 8, 14, 8, 43, 11, 8, 3, 8, 3, 8, 3, 9, 5, 9, 48, 10, 9, 3, 9, 5, 9, 51, 10, 9, 3, 9, 3, 9, 3, 9, 3, 10, 5, 10, 57, 10, 10, 3, 10, 6, 10, 60, 10, 10, 13, 10, 14, 10, 61, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 5, 12, 69, 10, 12, 3, 12, 3, 12, 2, 2, 13, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 3, 2, 4, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 15, 15, 34, 34, 2, 77, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 3, 25, 3, 2, 2, 2, 5, 27, 3, 2, 2, 2, 7, 29, 3, 2, 2, 2, 9, 31, 3, 2, 2, 2, 11, 33, 3, 2, 2, 2, 13, 35, 3, 2, 2, 2, 15, 37, 3, 2, 2, 2, 17, 47, 3, 2, 2, 2, 19, 56, 3, 2, 2, 2, 21, 63, 3, 2, 2, 2, 23, 68, 3, 2, 2, 2, 25, 26, 7, 45, 2, 2, 26, 4, 3, 2, 2, 2, 27, 28, 7, 47, 2, 2, 28, 6, 3, 2, 2, 2, 29, 30, 7, 96, 2, 2, 30, 8, 3, 2, 2, 2, 31, 32, 7, 42, 2, 2, 32, 10, 3, 2, 2, 2, 33, 34, 7, 46, 2, 2, 34, 12, 3, 2, 2, 2, 35, 36, 7, 43, 2, 2, 36, 14, 3, 2, 2, 2, 37, 41, 7, 37, 2, 2, 38, 40, 10, 2, 2, 2, 39, 38, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 44, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 5, 23, 12, 2, 45, 16, 3, 2, 2, 2, 46, 48, 7, 47, 2, 2, 47, 46, 3, 2, 2, 2, 47, 48, 3, 2, 2, 2, 48, 50, 3, 2, 2, 2, 49, 51, 5, 19, 10, 2, 50, 49, 3, 2, 2, 2, 50, 51, 3, 2, 2, 2, 51, 52, 3, 2, 2, 2, 52, 53, 7, 48, 2, 2, 53, 54, 5, 19, 10, 2, 54, 18, 3, 2, 2, 2, 55, 57, 7, 47, 2, 2, 56, 55, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 59, 3, 2, 2, 2, 58, 60, 4, 50, 59, 2, 59, 58, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 59, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 20, 3, 2, 2, 2, 63, 64, 9, 3, 2, 2, 64, 65, 3, 2, 2, 2, 65, 66, 8, 11, 2, 2, 66, 22, 3, 2, 2, 2, 67, 69, 7, 15, 2, 2, 68, 67, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 71, 7, 12, 2, 2, 71, 24, 3, 2, 2, 2, 9, 2, 41, 47, 50, 56, 61, 68, 3, 8, 2, 2] [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 15, 80, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 7, 10, 48, 10, 10, 12, 10, 14, 10, 51, 11, 10, 3, 10, 3, 10, 3, 11, 5, 11, 56, 10, 11, 3, 11, 5, 11, 59, 10, 11, 3, 11, 3, 11, 3, 11, 3, 12, 5, 12, 65, 10, 12, 3, 12, 6, 12, 68, 10, 12, 13, 12, 14, 12, 69, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 5, 14, 77, 10, 14, 3, 14, 3, 14, 2, 2, 15, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 3, 2, 4, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 15, 15, 34, 34, 2, 85, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 3, 29, 3, 2, 2, 2, 5, 31, 3, 2, 2, 2, 7, 33, 3, 2, 2, 2, 9, 35, 3, 2, 2, 2, 11, 37, 3, 2, 2, 2, 13, 39, 3, 2, 2, 2, 15, 41, 3, 2, 2, 2, 17, 43, 3, 2, 2, 2, 19, 45, 3, 2, 2, 2, 21, 55, 3, 2, 2, 2, 23, 64, 3, 2, 2, 2, 25, 71, 3, 2, 2, 2, 27, 76, 3, 2, 2, 2, 29, 30, 7, 45, 2, 2, 30, 4, 3, 2, 2, 2, 31, 32, 7, 47, 2, 2, 32, 6, 3, 2, 2, 2, 33, 34, 7, 96, 2, 2, 34, 8, 3, 2, 2, 2, 35, 36, 7, 42, 2, 2, 36, 10, 3, 2, 2, 2, 37, 38, 7, 46, 2, 2, 38, 12, 3, 2, 2, 2, 39, 40, 7, 43, 2, 2, 40, 14, 3, 2, 2, 2, 41, 42, 7, 103, 2, 2, 42, 16, 3, 2, 2, 2, 43, 44, 7, 71, 2, 2, 44, 18, 3, 2, 2, 2, 45, 49, 7, 37, 2, 2, 46, 48, 10, 2, 2, 2, 47, 46, 3, 2, 2, 2, 48, 51, 3, 2, 2, 2, 49, 47, 3, 2, 2, 2, 49, 50, 3, 2, 2, 2, 50, 52, 3, 2, 2, 2, 51, 49, 3, 2, 2, 2, 52, 53, 5, 27, 14, 2, 53, 20, 3, 2, 2, 2, 54, 56, 7, 47, 2, 2, 55, 54, 3, 2, 2, 2, 55, 56, 3, 2, 2, 2, 56, 58, 3, 2, 2, 2, 57, 59, 5, 23, 12, 2, 58, 57, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 61, 7, 48, 2, 2, 61, 62, 5, 23, 12, 2, 62, 22, 3, 2, 2, 2, 63, 65, 7, 47, 2, 2, 64, 63, 3, 2, 2, 2, 64, 65, 3, 2, 2, 2, 65, 67, 3, 2, 2, 2, 66, 68, 4, 50, 59, 2, 67, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 24, 3, 2, 2, 2, 71, 72, 9, 3, 2, 2, 72, 73, 3, 2, 2, 2, 73, 74, 8, 13, 2, 2, 74, 26, 3, 2, 2, 2, 75, 77, 7, 15, 2, 2, 76, 75, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 79, 7, 12, 2, 2, 79, 28, 3, 2, 2, 2, 9, 2, 49, 55, 58, 64, 69, 76, 3, 8, 2, 2]
\ No newline at end of file \ No newline at end of file
...@@ -4,14 +4,18 @@ T__2=3 ...@@ -4,14 +4,18 @@ T__2=3
T__3=4 T__3=4
T__4=5 T__4=5
T__5=6 T__5=6
COMMENT=7 T__6=7
REAL=8 T__7=8
INT=9 COMMENT=9
WS=10 REAL=10
EOL=11 INT=11
WS=12
EOL=13
'+'=1 '+'=1
'-'=2 '-'=2
'^'=3 '^'=3
'('=4 '('=4
','=5 ','=5
')'=6 ')'=6
'e'=7
'E'=8
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#include "FermionOperatorListener.h" #include "FermionOperatorListener.h"
......
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#pragma once #pragma once
...@@ -46,6 +46,9 @@ public: ...@@ -46,6 +46,9 @@ public:
virtual void enterComment(FermionOperatorParser::CommentContext *ctx) = 0; virtual void enterComment(FermionOperatorParser::CommentContext *ctx) = 0;
virtual void exitComment(FermionOperatorParser::CommentContext *ctx) = 0; virtual void exitComment(FermionOperatorParser::CommentContext *ctx) = 0;
virtual void enterScientific(FermionOperatorParser::ScientificContext *ctx) = 0;
virtual void exitScientific(FermionOperatorParser::ScientificContext *ctx) = 0;
}; };
......
// Generated from FermionOperator.g4 by ANTLR 4.7.2 // Generated from FermionOperator.g4 by ANTLR 4.8
#include "FermionOperatorListener.h" #include "FermionOperatorListener.h"
...@@ -81,19 +81,19 @@ FermionOperatorParser::FermionSrcContext* FermionOperatorParser::fermionSrc() { ...@@ -81,19 +81,19 @@ FermionOperatorParser::FermionSrcContext* FermionOperatorParser::fermionSrc() {
}); });
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
setState(20); setState(22);
term(); term();
setState(26); setState(28);
_errHandler->sync(this); _errHandler->sync(this);
_la = _input->LA(1); _la = _input->LA(1);
while (_la == FermionOperatorParser::T__0 while (_la == FermionOperatorParser::T__0
|| _la == FermionOperatorParser::T__1) { || _la == FermionOperatorParser::T__1) {
setState(21); setState(23);
plusorminus(); plusorminus();
setState(22); setState(24);
term(); term();
setState(28); setState(30);
_errHandler->sync(this); _errHandler->sync(this);
_la = _input->LA(1); _la = _input->LA(1);
} }
...@@ -141,7 +141,7 @@ FermionOperatorParser::PlusorminusContext* FermionOperatorParser::plusorminus() ...@@ -141,7 +141,7 @@ FermionOperatorParser::PlusorminusContext* FermionOperatorParser::plusorminus()
}); });
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
setState(29); setState(31);
_la = _input->LA(1); _la = _input->LA(1);
if (!(_la == FermionOperatorParser::T__0 if (!(_la == FermionOperatorParser::T__0
...@@ -208,23 +208,24 @@ FermionOperatorParser::TermContext* FermionOperatorParser::term() { ...@@ -208,23 +208,24 @@ FermionOperatorParser::TermContext* FermionOperatorParser::term() {
}); });
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
setState(32); setState(34);
_errHandler->sync(this); _errHandler->sync(this);
_la = _input->LA(1); switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 1, _ctx)) {
if (_la == FermionOperatorParser::T__3 case 1: {
setState(33);
|| _la == FermionOperatorParser::REAL) {
setState(31);
coeff(); coeff();
break;
}
} }
setState(37); setState(39);
_errHandler->sync(this); _errHandler->sync(this);
_la = _input->LA(1); _la = _input->LA(1);
while (_la == FermionOperatorParser::INT) { while (_la == FermionOperatorParser::INT) {
setState(34); setState(36);
fermion(); fermion();
setState(39); setState(41);
_errHandler->sync(this); _errHandler->sync(this);
_la = _input->LA(1); _la = _input->LA(1);
} }
...@@ -275,7 +276,7 @@ FermionOperatorParser::FermionContext* FermionOperatorParser::fermion() { ...@@ -275,7 +276,7 @@ FermionOperatorParser::FermionContext* FermionOperatorParser::fermion() {
}); });
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
setState(40); setState(42);
op(); op();