Commit 4ec569e9 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

minor updates to python compiler, adding getConnectivity python api



Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 268ab47d
......@@ -106,8 +106,12 @@ exp
| '(' exp ')'
| unaryop '(' exp ')'
| id '=' exp
| '\'[' ( ','? coupler )* ']\''
;
coupler
: '[' INT ',' INT ']'
;
/* unary operations */
unaryop
: 'sin'
......
#!/ bin / bash
set - o errexit java - jar antlr - 4.7.1 - complete.jar - Dlanguage =
Cpp - listener - o generated / -package pyxacc PyXACCIR.g4
#!/bin/bash
set - o errexit
java -jar antlr-4.7.1-complete.jar -Dlanguage=Cpp -listener -o generated/ -package pyxacc PyXACCIR.g4
......@@ -30,6 +30,10 @@ null
'/'
'^'
'='
'\'['
']\''
'['
']'
'sin'
'cos'
'tan'
......@@ -82,6 +86,10 @@ null
null
null
null
null
null
null
null
COMMENT
ID
REAL
......@@ -104,6 +112,7 @@ uop
gate
explist
exp
coupler
unaryop
id
real
......@@ -111,4 +120,4 @@ string
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 45, 152, 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, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 3, 2, 7, 2, 38, 10, 2, 12, 2, 14, 2, 41, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 47, 10, 3, 3, 3, 7, 3, 50, 10, 3, 12, 3, 14, 3, 53, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 6, 5, 62, 10, 5, 13, 5, 14, 5, 63, 3, 6, 6, 6, 67, 10, 6, 13, 6, 14, 6, 68, 3, 6, 5, 6, 72, 10, 6, 3, 7, 3, 7, 5, 7, 76, 10, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 5, 9, 83, 10, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 7, 13, 97, 10, 13, 12, 13, 14, 13, 100, 11, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 122, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 139, 10, 14, 12, 14, 14, 14, 142, 11, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 2, 3, 26, 19, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 2, 4, 3, 2, 9, 25, 3, 2, 33, 38, 2, 155, 2, 39, 3, 2, 2, 2, 4, 42, 3, 2, 2, 2, 6, 58, 3, 2, 2, 2, 8, 61, 3, 2, 2, 2, 10, 71, 3, 2, 2, 2, 12, 75, 3, 2, 2, 2, 14, 77, 3, 2, 2, 2, 16, 79, 3, 2, 2, 2, 18, 84, 3, 2, 2, 2, 20, 86, 3, 2, 2, 2, 22, 91, 3, 2, 2, 2, 24, 93, 3, 2, 2, 2, 26, 121, 3, 2, 2, 2, 28, 143, 3, 2, 2, 2, 30, 145, 3, 2, 2, 2, 32, 147, 3, 2, 2, 2, 34, 149, 3, 2, 2, 2, 36, 38, 5, 4, 3, 2, 37, 36, 3, 2, 2, 2, 38, 41, 3, 2, 2, 2, 39, 37, 3, 2, 2, 2, 39, 40, 3, 2, 2, 2, 40, 3, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 42, 43, 7, 3, 2, 2, 43, 44, 5, 30, 16, 2, 44, 51, 7, 4, 2, 2, 45, 47, 7, 5, 2, 2, 46, 45, 3, 2, 2, 2, 46, 47, 3, 2, 2, 2, 47, 48, 3, 2, 2, 2, 48, 50, 5, 18, 10, 2, 49, 46, 3, 2, 2, 2, 50, 53, 3, 2, 2, 2, 51, 49, 3, 2, 2, 2, 51, 52, 3, 2, 2, 2, 52, 54, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 54, 55, 7, 6, 2, 2, 55, 56, 7, 7, 2, 2, 56, 57, 5, 6, 4, 2, 57, 5, 3, 2, 2, 2, 58, 59, 5, 8, 5, 2, 59, 7, 3, 2, 2, 2, 60, 62, 5, 10, 6, 2, 61, 60, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 61, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 9, 3, 2, 2, 2, 65, 67, 5, 12, 7, 2, 66, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 72, 3, 2, 2, 2, 70, 72, 5, 14, 8, 2, 71, 66, 3, 2, 2, 2, 71, 70, 3, 2, 2, 2, 72, 11, 3, 2, 2, 2, 73, 76, 5, 20, 11, 2, 74, 76, 7, 8, 2, 2, 75, 73, 3, 2, 2, 2, 75, 74, 3, 2, 2, 2, 76, 13, 3, 2, 2, 2, 77, 78, 7, 39, 2, 2, 78, 15, 3, 2, 2, 2, 79, 82, 5, 18, 10, 2, 80, 81, 7, 5, 2, 2, 81, 83, 5, 16, 9, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 17, 3, 2, 2, 2, 84, 85, 5, 30, 16, 2, 85, 19, 3, 2, 2, 2, 86, 87, 5, 22, 12, 2, 87, 88, 7, 4, 2, 2, 88, 89, 5, 24, 13, 2, 89, 90, 7, 6, 2, 2, 90, 21, 3, 2, 2, 2, 91, 92, 9, 2, 2, 2, 92, 23, 3, 2, 2, 2, 93, 98, 5, 26, 14, 2, 94, 95, 7, 5, 2, 2, 95, 97, 5, 26, 14, 2, 96, 94, 3, 2, 2, 2, 97, 100, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 25, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 101, 102, 8, 14, 1, 2, 102, 122, 5, 32, 17, 2, 103, 122, 7, 42, 2, 2, 104, 122, 7, 26, 2, 2, 105, 122, 5, 30, 16, 2, 106, 107, 7, 28, 2, 2, 107, 122, 5, 26, 14, 7, 108, 109, 7, 4, 2, 2, 109, 110, 5, 26, 14, 2, 110, 111, 7, 6, 2, 2, 111, 122, 3, 2, 2, 2, 112, 113, 5, 28, 15, 2, 113, 114, 7, 4, 2, 2, 114, 115, 5, 26, 14, 2, 115, 116, 7, 6, 2, 2, 116, 122, 3, 2, 2, 2, 117, 118, 5, 30, 16, 2, 118, 119, 7, 32, 2, 2, 119, 120, 5, 26, 14, 3, 120, 122, 3, 2, 2, 2, 121, 101, 3, 2, 2, 2, 121, 103, 3, 2, 2, 2, 121, 104, 3, 2, 2, 2, 121, 105, 3, 2, 2, 2, 121, 106, 3, 2, 2, 2, 121, 108, 3, 2, 2, 2, 121, 112, 3, 2, 2, 2, 121, 117, 3, 2, 2, 2, 122, 140, 3, 2, 2, 2, 123, 124, 12, 11, 2, 2, 124, 125, 7, 27, 2, 2, 125, 139, 5, 26, 14, 12, 126, 127, 12, 10, 2, 2, 127, 128, 7, 28, 2, 2, 128, 139, 5, 26, 14, 11, 129, 130, 12, 9, 2, 2, 130, 131, 7, 29, 2, 2, 131, 139, 5, 26, 14, 10, 132, 133, 12, 8, 2, 2, 133, 134, 7, 30, 2, 2, 134, 139, 5, 26, 14, 9, 135, 136, 12, 6, 2, 2, 136, 137, 7, 31, 2, 2, 137, 139, 5, 26, 14, 7, 138, 123, 3, 2, 2, 2, 138, 126, 3, 2, 2, 2, 138, 129, 3, 2, 2, 2, 138, 132, 3, 2, 2, 2, 138, 135, 3, 2, 2, 2, 139, 142, 3, 2, 2, 2, 140, 138, 3, 2, 2, 2, 140, 141, 3, 2, 2, 2, 141, 27, 3, 2, 2, 2, 142, 140, 3, 2, 2, 2, 143, 144, 9, 3, 2, 2, 144, 29, 3, 2, 2, 2, 145, 146, 7, 40, 2, 2, 146, 31, 3, 2, 2, 2, 147, 148, 7, 41, 2, 2, 148, 33, 3, 2, 2, 2, 149, 150, 7, 43, 2, 2, 150, 35, 3, 2, 2, 2, 14, 39, 46, 51, 63, 68, 71, 75, 82, 98, 121, 138, 140]
\ No newline at end of file
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 49, 171, 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, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 3, 2, 7, 2, 40, 10, 2, 12, 2, 14, 2, 43, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 49, 10, 3, 3, 3, 7, 3, 52, 10, 3, 12, 3, 14, 3, 55, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 6, 5, 64, 10, 5, 13, 5, 14, 5, 65, 3, 6, 6, 6, 69, 10, 6, 13, 6, 14, 6, 70, 3, 6, 5, 6, 74, 10, 6, 3, 7, 3, 7, 5, 7, 78, 10, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 5, 9, 85, 10, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 7, 13, 99, 10, 13, 12, 13, 14, 13, 102, 11, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 126, 10, 14, 3, 14, 7, 14, 129, 10, 14, 12, 14, 14, 14, 132, 11, 14, 3, 14, 5, 14, 135, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 152, 10, 14, 12, 14, 14, 14, 155, 11, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 2, 3, 26, 20, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 2, 4, 3, 2, 9, 25, 3, 2, 37, 42, 2, 176, 2, 41, 3, 2, 2, 2, 4, 44, 3, 2, 2, 2, 6, 60, 3, 2, 2, 2, 8, 63, 3, 2, 2, 2, 10, 73, 3, 2, 2, 2, 12, 77, 3, 2, 2, 2, 14, 79, 3, 2, 2, 2, 16, 81, 3, 2, 2, 2, 18, 86, 3, 2, 2, 2, 20, 88, 3, 2, 2, 2, 22, 93, 3, 2, 2, 2, 24, 95, 3, 2, 2, 2, 26, 134, 3, 2, 2, 2, 28, 156, 3, 2, 2, 2, 30, 162, 3, 2, 2, 2, 32, 164, 3, 2, 2, 2, 34, 166, 3, 2, 2, 2, 36, 168, 3, 2, 2, 2, 38, 40, 5, 4, 3, 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, 3, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 7, 3, 2, 2, 45, 46, 5, 32, 17, 2, 46, 53, 7, 4, 2, 2, 47, 49, 7, 5, 2, 2, 48, 47, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 50, 3, 2, 2, 2, 50, 52, 5, 18, 10, 2, 51, 48, 3, 2, 2, 2, 52, 55, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 56, 3, 2, 2, 2, 55, 53, 3, 2, 2, 2, 56, 57, 7, 6, 2, 2, 57, 58, 7, 7, 2, 2, 58, 59, 5, 6, 4, 2, 59, 5, 3, 2, 2, 2, 60, 61, 5, 8, 5, 2, 61, 7, 3, 2, 2, 2, 62, 64, 5, 10, 6, 2, 63, 62, 3, 2, 2, 2, 64, 65, 3, 2, 2, 2, 65, 63, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 9, 3, 2, 2, 2, 67, 69, 5, 12, 7, 2, 68, 67, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 70, 71, 3, 2, 2, 2, 71, 74, 3, 2, 2, 2, 72, 74, 5, 14, 8, 2, 73, 68, 3, 2, 2, 2, 73, 72, 3, 2, 2, 2, 74, 11, 3, 2, 2, 2, 75, 78, 5, 20, 11, 2, 76, 78, 7, 8, 2, 2, 77, 75, 3, 2, 2, 2, 77, 76, 3, 2, 2, 2, 78, 13, 3, 2, 2, 2, 79, 80, 7, 43, 2, 2, 80, 15, 3, 2, 2, 2, 81, 84, 5, 18, 10, 2, 82, 83, 7, 5, 2, 2, 83, 85, 5, 16, 9, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 17, 3, 2, 2, 2, 86, 87, 5, 32, 17, 2, 87, 19, 3, 2, 2, 2, 88, 89, 5, 22, 12, 2, 89, 90, 7, 4, 2, 2, 90, 91, 5, 24, 13, 2, 91, 92, 7, 6, 2, 2, 92, 21, 3, 2, 2, 2, 93, 94, 9, 2, 2, 2, 94, 23, 3, 2, 2, 2, 95, 100, 5, 26, 14, 2, 96, 97, 7, 5, 2, 2, 97, 99, 5, 26, 14, 2, 98, 96, 3, 2, 2, 2, 99, 102, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 25, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 103, 104, 8, 14, 1, 2, 104, 135, 5, 34, 18, 2, 105, 135, 7, 46, 2, 2, 106, 135, 7, 26, 2, 2, 107, 135, 5, 32, 17, 2, 108, 109, 7, 28, 2, 2, 109, 135, 5, 26, 14, 8, 110, 111, 7, 4, 2, 2, 111, 112, 5, 26, 14, 2, 112, 113, 7, 6, 2, 2, 113, 135, 3, 2, 2, 2, 114, 115, 5, 30, 16, 2, 115, 116, 7, 4, 2, 2, 116, 117, 5, 26, 14, 2, 117, 118, 7, 6, 2, 2, 118, 135, 3, 2, 2, 2, 119, 120, 5, 32, 17, 2, 120, 121, 7, 32, 2, 2, 121, 122, 5, 26, 14, 4, 122, 135, 3, 2, 2, 2, 123, 130, 7, 33, 2, 2, 124, 126, 7, 5, 2, 2, 125, 124, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 129, 5, 28, 15, 2, 128, 125, 3, 2, 2, 2, 129, 132, 3, 2, 2, 2, 130, 128, 3, 2, 2, 2, 130, 131, 3, 2, 2, 2, 131, 133, 3, 2, 2, 2, 132, 130, 3, 2, 2, 2, 133, 135, 7, 34, 2, 2, 134, 103, 3, 2, 2, 2, 134, 105, 3, 2, 2, 2, 134, 106, 3, 2, 2, 2, 134, 107, 3, 2, 2, 2, 134, 108, 3, 2, 2, 2, 134, 110, 3, 2, 2, 2, 134, 114, 3, 2, 2, 2, 134, 119, 3, 2, 2, 2, 134, 123, 3, 2, 2, 2, 135, 153, 3, 2, 2, 2, 136, 137, 12, 12, 2, 2, 137, 138, 7, 27, 2, 2, 138, 152, 5, 26, 14, 13, 139, 140, 12, 11, 2, 2, 140, 141, 7, 28, 2, 2, 141, 152, 5, 26, 14, 12, 142, 143, 12, 10, 2, 2, 143, 144, 7, 29, 2, 2, 144, 152, 5, 26, 14, 11, 145, 146, 12, 9, 2, 2, 146, 147, 7, 30, 2, 2, 147, 152, 5, 26, 14, 10, 148, 149, 12, 7, 2, 2, 149, 150, 7, 31, 2, 2, 150, 152, 5, 26, 14, 8, 151, 136, 3, 2, 2, 2, 151, 139, 3, 2, 2, 2, 151, 142, 3, 2, 2, 2, 151, 145, 3, 2, 2, 2, 151, 148, 3, 2, 2, 2, 152, 155, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 27, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 156, 157, 7, 35, 2, 2, 157, 158, 7, 46, 2, 2, 158, 159, 7, 5, 2, 2, 159, 160, 7, 46, 2, 2, 160, 161, 7, 36, 2, 2, 161, 29, 3, 2, 2, 2, 162, 163, 9, 3, 2, 2, 163, 31, 3, 2, 2, 2, 164, 165, 7, 44, 2, 2, 165, 33, 3, 2, 2, 2, 166, 167, 7, 45, 2, 2, 167, 35, 3, 2, 2, 2, 168, 169, 7, 47, 2, 2, 169, 37, 3, 2, 2, 2, 16, 41, 48, 53, 65, 70, 73, 77, 84, 100, 125, 130, 134, 151, 153]
\ No newline at end of file
......@@ -34,13 +34,17 @@ T__32=33
T__33=34
T__34=35
T__35=36
COMMENT=37
ID=38
REAL=39
INT=40
STRING=41
WS=42
EOL=43
T__36=37
T__37=38
T__38=39
T__39=40
COMMENT=41
ID=42
REAL=43
INT=44
STRING=45
WS=46
EOL=47
'def'=1
'('=2
','=3
......@@ -71,9 +75,13 @@ EOL=43
'/'=28
'^'=29
'='=30
'sin'=31
'cos'=32
'tan'=33
'exp'=34
'ln'=35
'sqrt'=36
'\'['=31
']\''=32
'['=33
']'=34
'sin'=35
'cos'=36
'tan'=37
'exp'=38
'ln'=39
'sqrt'=40
// Generated from PyXACCIR.g4 by ANTLR 4.7.1
#include "PyXACCIRBaseListener.h"
using namespace pyxacc;
......@@ -3,86 +3,81 @@
#pragma once
#include "antlr4-runtime.h"
#include "PyXACCIRListener.h"
namespace pyxacc {
/**
* This class provides an empty implementation of PyXACCIRListener,
* which can be extended to create a listener which only needs to handle a
* subset of the available methods.
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
class PyXACCIRBaseListener : public PyXACCIRListener {
class PyXACCIRBaseListener : public PyXACCIRListener {
public:
virtual void enterXaccsrc(PyXACCIRParser::XaccsrcContext * /*ctx*/) override {
}
virtual void exitXaccsrc(PyXACCIRParser::XaccsrcContext * /*ctx*/) override {}
virtual void
enterXacckernel(PyXACCIRParser::XacckernelContext * /*ctx*/) override {}
virtual void
exitXacckernel(PyXACCIRParser::XacckernelContext * /*ctx*/) override {}
virtual void enterXaccsrc(PyXACCIRParser::XaccsrcContext * /*ctx*/) override { }
virtual void exitXaccsrc(PyXACCIRParser::XaccsrcContext * /*ctx*/) override { }
virtual void enterXacckernel(PyXACCIRParser::XacckernelContext * /*ctx*/) override { }
virtual void exitXacckernel(PyXACCIRParser::XacckernelContext * /*ctx*/) override { }
virtual void enterMainprog(PyXACCIRParser::MainprogContext * /*ctx*/) override { }
virtual void exitMainprog(PyXACCIRParser::MainprogContext * /*ctx*/) override { }
virtual void enterProgram(PyXACCIRParser::ProgramContext * /*ctx*/) override { }
virtual void exitProgram(PyXACCIRParser::ProgramContext * /*ctx*/) override { }
virtual void enterLine(PyXACCIRParser::LineContext * /*ctx*/) override { }
virtual void exitLine(PyXACCIRParser::LineContext * /*ctx*/) override { }
virtual void
enterMainprog(PyXACCIRParser::MainprogContext * /*ctx*/) override {}
virtual void
exitMainprog(PyXACCIRParser::MainprogContext * /*ctx*/) override {}
virtual void enterStatement(PyXACCIRParser::StatementContext * /*ctx*/) override { }
virtual void exitStatement(PyXACCIRParser::StatementContext * /*ctx*/) override { }
virtual void enterProgram(PyXACCIRParser::ProgramContext * /*ctx*/) override {
}
virtual void exitProgram(PyXACCIRParser::ProgramContext * /*ctx*/) override {}
virtual void enterComment(PyXACCIRParser::CommentContext * /*ctx*/) override { }
virtual void exitComment(PyXACCIRParser::CommentContext * /*ctx*/) override { }
virtual void enterLine(PyXACCIRParser::LineContext * /*ctx*/) override {}
virtual void exitLine(PyXACCIRParser::LineContext * /*ctx*/) override {}
virtual void enterParamlist(PyXACCIRParser::ParamlistContext * /*ctx*/) override { }
virtual void exitParamlist(PyXACCIRParser::ParamlistContext * /*ctx*/) override { }
virtual void
enterStatement(PyXACCIRParser::StatementContext * /*ctx*/) override {}
virtual void
exitStatement(PyXACCIRParser::StatementContext * /*ctx*/) override {}
virtual void enterParam(PyXACCIRParser::ParamContext * /*ctx*/) override { }
virtual void exitParam(PyXACCIRParser::ParamContext * /*ctx*/) override { }
virtual void enterComment(PyXACCIRParser::CommentContext * /*ctx*/) override {
}
virtual void exitComment(PyXACCIRParser::CommentContext * /*ctx*/) override {}
virtual void enterUop(PyXACCIRParser::UopContext * /*ctx*/) override { }
virtual void exitUop(PyXACCIRParser::UopContext * /*ctx*/) override { }
virtual void
enterParamlist(PyXACCIRParser::ParamlistContext * /*ctx*/) override {}
virtual void
exitParamlist(PyXACCIRParser::ParamlistContext * /*ctx*/) override {}
virtual void enterGate(PyXACCIRParser::GateContext * /*ctx*/) override { }
virtual void exitGate(PyXACCIRParser::GateContext * /*ctx*/) override { }
virtual void enterParam(PyXACCIRParser::ParamContext * /*ctx*/) override {}
virtual void exitParam(PyXACCIRParser::ParamContext * /*ctx*/) override {}
virtual void enterExplist(PyXACCIRParser::ExplistContext * /*ctx*/) override { }
virtual void exitExplist(PyXACCIRParser::ExplistContext * /*ctx*/) override { }
virtual void enterUop(PyXACCIRParser::UopContext * /*ctx*/) override {}
virtual void exitUop(PyXACCIRParser::UopContext * /*ctx*/) override {}
virtual void enterExp(PyXACCIRParser::ExpContext * /*ctx*/) override { }
virtual void exitExp(PyXACCIRParser::ExpContext * /*ctx*/) override { }
virtual void enterGate(PyXACCIRParser::GateContext * /*ctx*/) override {}
virtual void exitGate(PyXACCIRParser::GateContext * /*ctx*/) override {}
virtual void enterCoupler(PyXACCIRParser::CouplerContext * /*ctx*/) override { }
virtual void exitCoupler(PyXACCIRParser::CouplerContext * /*ctx*/) override { }
virtual void enterExplist(PyXACCIRParser::ExplistContext * /*ctx*/) override {
}
virtual void exitExplist(PyXACCIRParser::ExplistContext * /*ctx*/) override {}
virtual void enterUnaryop(PyXACCIRParser::UnaryopContext * /*ctx*/) override { }
virtual void exitUnaryop(PyXACCIRParser::UnaryopContext * /*ctx*/) override { }
virtual void enterExp(PyXACCIRParser::ExpContext * /*ctx*/) override {}
virtual void exitExp(PyXACCIRParser::ExpContext * /*ctx*/) override {}
virtual void enterId(PyXACCIRParser::IdContext * /*ctx*/) override { }
virtual void exitId(PyXACCIRParser::IdContext * /*ctx*/) override { }
virtual void enterUnaryop(PyXACCIRParser::UnaryopContext * /*ctx*/) override {
}
virtual void exitUnaryop(PyXACCIRParser::UnaryopContext * /*ctx*/) override {}
virtual void enterReal(PyXACCIRParser::RealContext * /*ctx*/) override { }
virtual void exitReal(PyXACCIRParser::RealContext * /*ctx*/) override { }
virtual void enterId(PyXACCIRParser::IdContext * /*ctx*/) override {}
virtual void exitId(PyXACCIRParser::IdContext * /*ctx*/) override {}
virtual void enterString(PyXACCIRParser::StringContext * /*ctx*/) override { }
virtual void exitString(PyXACCIRParser::StringContext * /*ctx*/) override { }
virtual void enterReal(PyXACCIRParser::RealContext * /*ctx*/) override {}
virtual void exitReal(PyXACCIRParser::RealContext * /*ctx*/) override {}
virtual void enterString(PyXACCIRParser::StringContext * /*ctx*/) override {}
virtual void exitString(PyXACCIRParser::StringContext * /*ctx*/) override {}
virtual void enterEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { }
virtual void exitEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { }
virtual void visitTerminal(antlr4::tree::TerminalNode * /*node*/) override { }
virtual void visitErrorNode(antlr4::tree::ErrorNode * /*node*/) override { }
virtual void enterEveryRule(antlr4::ParserRuleContext * /*ctx*/) override {}
virtual void exitEveryRule(antlr4::ParserRuleContext * /*ctx*/) override {}
virtual void visitTerminal(antlr4::tree::TerminalNode * /*node*/) override {}
virtual void visitErrorNode(antlr4::tree::ErrorNode * /*node*/) override {}
};
} // namespace pyxacc
} // namespace pyxacc
This diff is collapsed.
......@@ -3,72 +3,39 @@
#pragma once
#include "antlr4-runtime.h"
namespace pyxacc {
class PyXACCIRLexer : public antlr4::Lexer {
class PyXACCIRLexer : public antlr4::Lexer {
public:
enum {
T__0 = 1,
T__1 = 2,
T__2 = 3,
T__3 = 4,
T__4 = 5,
T__5 = 6,
T__6 = 7,
T__7 = 8,
T__8 = 9,
T__9 = 10,
T__10 = 11,
T__11 = 12,
T__12 = 13,
T__13 = 14,
T__14 = 15,
T__15 = 16,
T__16 = 17,
T__17 = 18,
T__18 = 19,
T__19 = 20,
T__20 = 21,
T__21 = 22,
T__22 = 23,
T__23 = 24,
T__24 = 25,
T__25 = 26,
T__26 = 27,
T__27 = 28,
T__28 = 29,
T__29 = 30,
T__30 = 31,
T__31 = 32,
T__32 = 33,
T__33 = 34,
T__34 = 35,
T__35 = 36,
COMMENT = 37,
ID = 38,
REAL = 39,
INT = 40,
STRING = 41,
WS = 42,
EOL = 43
T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7,
T__7 = 8, T__8 = 9, T__9 = 10, T__10 = 11, T__11 = 12, T__12 = 13, T__13 = 14,
T__14 = 15, T__15 = 16, T__16 = 17, T__17 = 18, T__18 = 19, T__19 = 20,
T__20 = 21, T__21 = 22, T__22 = 23, T__23 = 24, T__24 = 25, T__25 = 26,
T__26 = 27, T__27 = 28, T__28 = 29, T__29 = 30, T__30 = 31, T__31 = 32,
T__32 = 33, T__33 = 34, T__34 = 35, T__35 = 36, T__36 = 37, T__37 = 38,
T__38 = 39, T__39 = 40, COMMENT = 41, ID = 42, REAL = 43, INT = 44,
STRING = 45, WS = 46, EOL = 47
};
PyXACCIRLexer(antlr4::CharStream *input);
~PyXACCIRLexer();
virtual std::string getGrammarFileName() const override;
virtual const std::vector<std::string> &getRuleNames() const override;
virtual const std::vector<std::string>& getRuleNames() const override;
virtual const std::vector<std::string> &getChannelNames() const override;
virtual const std::vector<std::string> &getModeNames() const override;
virtual const std::vector<std::string> &
getTokenNames() const override; // deprecated, use vocabulary instead
virtual antlr4::dfa::Vocabulary &getVocabulary() const override;
virtual const std::vector<std::string>& getChannelNames() const override;
virtual const std::vector<std::string>& getModeNames() const override;
virtual const std::vector<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
virtual antlr4::dfa::Vocabulary& getVocabulary() const override;
virtual const std::vector<uint16_t> getSerializedATN() const override;
virtual const antlr4::atn::ATN &getATN() const override;
virtual const antlr4::atn::ATN& getATN() const override;
private:
static std::vector<antlr4::dfa::DFA> _decisionToDFA;
......@@ -84,6 +51,7 @@ private:
static antlr4::atn::ATN _atn;
static std::vector<uint16_t> _serializedATN;
// Individual action functions triggered by action() above.
// Individual semantic predicate functions triggered by sempred() above.
......@@ -94,4 +62,4 @@ private:
static Initializer _init;
};
} // namespace pyxacc
} // namespace pyxacc
......@@ -30,6 +30,10 @@ null
'/'
'^'
'='
'\'['
']\''
'['
']'
'sin'
'cos'
'tan'
......@@ -82,6 +86,10 @@ null
null
null
null
null
null
null
null
COMMENT
ID
REAL
......@@ -127,6 +135,10 @@ T__32
T__33
T__34
T__35
T__36
T__37
T__38
T__39
COMMENT
ID
REAL
......@@ -143,4 +155,4 @@ mode names:
DEFAULT_MODE
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 45, 265, 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, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 3, 2, 3, 2, 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, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 7, 38, 224, 10, 38, 12, 38, 14, 38, 227, 11, 38, 3, 38, 3, 38, 3, 39, 3, 39, 7, 39, 233, 10, 39, 12, 39, 14, 39, 236, 11, 39, 3, 40, 3, 40, 3, 40, 5, 40, 241, 10, 40, 3, 41, 6, 41, 244, 10, 41, 13, 41, 14, 41, 245, 3, 42, 3, 42, 7, 42, 250, 10, 42, 12, 42, 14, 42, 253, 11, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 5, 44, 262, 10, 44, 3, 44, 3, 44, 2, 2, 45, 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, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 3, 2, 7, 4, 2, 12, 12, 15, 15, 3, 2, 99, 124, 6, 2, 50, 59, 67, 92, 97, 97, 99, 124, 3, 2, 36, 36, 5, 2, 11, 12, 15, 15, 34, 34, 2, 270, 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, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 3, 89, 3, 2, 2, 2, 5, 93, 3, 2, 2, 2, 7, 95, 3, 2, 2, 2, 9, 97, 3, 2, 2, 2, 11, 99, 3, 2, 2, 2, 13, 101, 3, 2, 2, 2, 15, 108, 3, 2, 2, 2, 17, 110, 3, 2, 2, 2, 19, 113, 3, 2, 2, 2, 21, 116, 3, 2, 2, 2, 23, 119, 3, 2, 2, 2, 25, 121, 3, 2, 2, 2, 27, 123, 3, 2, 2, 2, 29, 128, 3, 2, 2, 2, 31, 131, 3, 2, 2, 2, 33, 134, 3, 2, 2, 2, 35, 136, 3, 2, 2, 2, 37, 141, 3, 2, 2, 2, 39, 150, 3, 2, 2, 2, 41, 157, 3, 2, 2, 2, 43, 165, 3, 2, 2, 2, 45, 173, 3, 2, 2, 2, 47, 178, 3, 2, 2, 2, 49, 182, 3, 2, 2, 2, 51, 185, 3, 2, 2, 2, 53, 187, 3, 2, 2, 2, 55, 189, 3, 2, 2, 2, 57, 191, 3, 2, 2, 2, 59, 193, 3, 2, 2, 2, 61, 195, 3, 2, 2, 2, 63, 197, 3, 2, 2, 2, 65, 201, 3, 2, 2, 2, 67, 205, 3, 2, 2, 2, 69, 209, 3, 2, 2, 2, 71, 213, 3, 2, 2, 2, 73, 216, 3, 2, 2, 2, 75, 221, 3, 2, 2, 2, 77, 230, 3, 2, 2, 2, 79, 237, 3, 2, 2, 2, 81, 243, 3, 2, 2, 2, 83, 247, 3, 2, 2, 2, 85, 256, 3, 2, 2, 2, 87, 261, 3, 2, 2, 2, 89, 90, 7, 102, 2, 2, 90, 91, 7, 103, 2, 2, 91, 92, 7, 104, 2, 2, 92, 4, 3, 2, 2, 2, 93, 94, 7, 42, 2, 2, 94, 6, 3, 2, 2, 2, 95, 96, 7, 46, 2, 2, 96, 8, 3, 2, 2, 2, 97, 98, 7, 43, 2, 2, 98, 10, 3, 2, 2, 2, 99, 100, 7, 60, 2, 2, 100, 12, 3, 2, 2, 2, 101, 102, 7, 116, 2, 2, 102, 103, 7, 103, 2, 2, 103, 104, 7, 118, 2, 2, 104, 105, 7, 119, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 112, 2, 2, 107, 14, 3, 2, 2, 2, 108, 109, 7, 90, 2, 2, 109, 16, 3, 2, 2, 2, 110, 111, 7, 84, 2, 2, 111, 112, 7, 122, 2, 2, 112, 18, 3, 2, 2, 2, 113, 114, 7, 84, 2, 2, 114, 115, 7, 124, 2, 2, 115, 20, 3, 2, 2, 2, 116, 117, 7, 84, 2, 2, 117, 118, 7, 123, 2, 2, 118, 22, 3, 2, 2, 2, 119, 120, 7, 91, 2, 2, 120, 24, 3, 2, 2, 2, 121, 122, 7, 92, 2, 2, 122, 26, 3, 2, 2, 2, 123, 124, 7, 69, 2, 2, 124, 125, 7, 80, 2, 2, 125, 126, 7, 81, 2, 2, 126, 127, 7, 86, 2, 2, 127, 28, 3, 2, 2, 2, 128, 129, 7, 69, 2, 2, 129, 130, 7, 92, 2, 2, 130, 30, 3, 2, 2, 2, 131, 132, 7, 69, 2, 2, 132, 133, 7, 90, 2, 2, 133, 32, 3, 2, 2, 2, 134, 135, 7, 74, 2, 2, 135, 34, 3, 2, 2, 2, 136, 137, 7, 85, 2, 2, 137, 138, 7, 121, 2, 2, 138, 139, 7, 99, 2, 2, 139, 140, 7, 114, 2, 2, 140, 36, 3, 2, 2, 2, 141, 142, 7, 75, 2, 2, 142, 143, 7, 102, 2, 2, 143, 144, 7, 103, 2, 2, 144, 145, 7, 112, 2, 2, 145, 146, 7, 118, 2, 2, 146, 147, 7, 107, 2, 2, 147, 148, 7, 118, 2, 2, 148, 149, 7, 123, 2, 2, 149, 38, 3, 2, 2, 2, 150, 151, 7, 69, 2, 2, 151, 152, 7, 82, 2, 2, 152, 153, 7, 106, 2, 2, 153, 154, 7, 99, 2, 2, 154, 155, 7, 117, 2, 2, 155, 156, 7, 103, 2, 2, 156, 40, 3, 2, 2, 2, 157, 158, 7, 79, 2, 2, 158, 159, 7, 103, 2, 2, 159, 160, 7, 99, 2, 2, 160, 161, 7, 117, 2, 2, 161, 162, 7, 119, 2, 2, 162, 163, 7, 116, 2, 2, 163, 164, 7, 103, 2, 2, 164, 42, 3, 2, 2, 2, 165, 166, 7, 79, 2, 2, 166, 167, 7, 71, 2, 2, 167, 168, 7, 67, 2, 2, 168, 169, 7, 85, 2, 2, 169, 170, 7, 87, 2, 2, 170, 171, 7, 84, 2, 2, 171, 172, 7, 71, 2, 2, 172, 44, 3, 2, 2, 2, 173, 174, 7, 122, 2, 2, 174, 175, 7, 99, 2, 2, 175, 176, 7, 101, 2, 2, 176, 177, 7, 101, 2, 2, 177, 46, 3, 2, 2, 2, 178, 179, 7, 115, 2, 2, 179, 180, 7, 111, 2, 2, 180, 181, 7, 107, 2, 2, 181, 48, 3, 2, 2, 2, 182, 183, 7, 114, 2, 2, 183, 184, 7, 107, 2, 2, 184, 50, 3, 2, 2, 2, 185, 186, 7, 45, 2, 2, 186, 52, 3, 2, 2, 2, 187, 188, 7, 47, 2, 2, 188, 54, 3, 2, 2, 2, 189, 190, 7, 44, 2, 2, 190, 56, 3, 2, 2, 2, 191, 192, 7, 49, 2, 2, 192, 58, 3, 2, 2, 2, 193, 194, 7, 96, 2, 2, 194, 60, 3, 2, 2, 2, 195, 196, 7, 63, 2, 2, 196, 62, 3, 2, 2, 2, 197, 198, 7, 117, 2, 2, 198, 199, 7, 107, 2, 2, 199, 200, 7, 112, 2, 2, 200, 64, 3, 2, 2, 2, 201, 202, 7, 101, 2, 2, 202, 203, 7, 113, 2, 2, 203, 204, 7, 117, 2, 2, 204, 66, 3, 2, 2, 2, 205, 206, 7, 118, 2, 2, 206, 207, 7, 99, 2, 2, 207, 208, 7, 112, 2, 2, 208, 68, 3, 2, 2, 2, 209, 210, 7, 103, 2, 2, 210, 211, 7, 122, 2, 2, 211, 212, 7, 114, 2, 2, 212, 70, 3, 2, 2, 2, 213, 214, 7, 110, 2, 2, 214, 215, 7, 112, 2, 2, 215, 72, 3, 2, 2, 2, 216, 217, 7, 117, 2, 2, 217, 218, 7, 115, 2, 2, 218, 219, 7, 116, 2, 2, 219, 220, 7, 118, 2, 2, 220, 74, 3, 2, 2, 2, 221, 225, 7, 37, 2, 2, 222, 224, 10, 2, 2, 2, 223, 222, 3, 2, 2, 2, 224, 227, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 228, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 228, 229, 5, 87, 44, 2, 229, 76, 3, 2, 2, 2, 230, 234, 9, 3, 2, 2, 231, 233, 9, 4, 2, 2, 232, 231, 3, 2, 2, 2, 233, 236, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 78, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 237, 238, 5, 81, 41, 2, 238, 240, 7, 48, 2, 2, 239, 241, 5, 81, 41, 2, 240, 239, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 80, 3, 2, 2, 2, 242, 244, 4, 50, 59, 2, 243, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 82, 3, 2, 2, 2, 247, 251, 7, 36, 2, 2, 248, 250, 10, 5, 2, 2, 249, 248, 3, 2, 2, 2, 250, 253, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 254, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 254, 255, 7, 36, 2, 2, 255, 84, 3, 2, 2, 2, 256, 257, 9, 6, 2, 2, 257, 258, 3, 2, 2, 2, 258, 259, 8, 43, 2, 2, 259, 86, 3, 2, 2, 2, 260, 262, 7, 15, 2, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 12, 2, 2, 264, 88, 3, 2, 2, 2, 9, 2, 225, 234, 240, 245, 251, 261, 3, 8, 2, 2]
\ No newline at end of file
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 49, 283, 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, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 3, 2, 3, 2, 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, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 7, 42, 242, 10, 42, 12, 42, 14, 42, 245, 11, 42, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 251, 10, 43, 12, 43, 14, 43, 254, 11, 43, 3, 44, 3, 44, 3, 44, 5, 44, 259, 10, 44, 3, 45, 6, 45, 262, 10, 45, 13, 45, 14, 45, 263, 3, 46, 3, 46, 7, 46, 268, 10, 46, 12, 46, 14, 46, 271, 11, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 5, 48, 280, 10, 48, 3, 48, 3, 48, 2, 2, 49, 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, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 3, 2, 7, 4, 2, 12, 12, 15, 15, 3, 2, 99, 124, 6, 2, 50, 59, 67, 92, 97, 97, 99, 124, 3, 2, 36, 36, 5, 2, 11, 12, 15, 15, 34, 34, 2, 288, 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, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 3, 97, 3, 2, 2, 2, 5, 101, 3, 2, 2, 2, 7, 103, 3, 2, 2, 2, 9, 105, 3, 2, 2, 2, 11, 107, 3, 2, 2, 2, 13, 109, 3, 2, 2, 2, 15, 116, 3, 2, 2, 2, 17, 118, 3, 2, 2, 2, 19, 121, 3, 2, 2, 2, 21, 124, 3, 2, 2, 2, 23, 127, 3, 2, 2, 2, 25, 129, 3, 2, 2, 2, 27, 131, 3, 2, 2, 2, 29, 136, 3, 2, 2, 2, 31, 139, 3, 2, 2, 2, 33, 142, 3, 2, 2, 2, 35, 144, 3, 2, 2, 2, 37, 149, 3, 2, 2, 2, 39, 158, 3, 2, 2, 2, 41, 165, 3, 2, 2, 2, 43, 173, 3, 2, 2, 2, 45, 181, 3, 2, 2, 2, 47, 186, 3, 2, 2, 2, 49, 190, 3, 2, 2, 2, 51, 193, 3, 2, 2, 2, 53, 195, 3, 2, 2, 2, 55, 197, 3, 2, 2, 2, 57, 199, 3, 2, 2, 2, 59, 201, 3, 2, 2, 2, 61, 203, 3, 2, 2, 2, 63, 205, 3, 2, 2, 2, 65, 208, 3, 2, 2, 2, 67, 211, 3, 2, 2, 2, 69, 213, 3, 2, 2, 2, 71, 215, 3, 2, 2, 2, 73, 219, 3, 2, 2, 2, 75, 223, 3, 2, 2, 2, 77, 227, 3, 2, 2, 2, 79, 231, 3, 2, 2, 2, 81, 234, 3, 2, 2, 2, 83, 239, 3, 2, 2, 2, 85, 248, 3, 2, 2, 2, 87, 255, 3, 2, 2, 2, 89, 261, 3, 2, 2, 2, 91, 265, 3, 2, 2, 2, 93, 274, 3, 2, 2, 2, 95, 279, 3, 2, 2, 2, 97, 98, 7, 102, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 104, 2, 2, 100, 4, 3, 2, 2, 2, 101, 102, 7, 42, 2, 2, 102, 6, 3, 2, 2, 2, 103, 104, 7, 46, 2, 2, 104, 8, 3, 2, 2, 2, 105, 106, 7, 43, 2, 2, 106, 10, 3, 2, 2, 2, 107, 108, 7, 60, 2, 2, 108, 12, 3, 2, 2, 2, 109, 110, 7, 116, 2, 2, 110, 111, 7, 103, 2, 2, 111, 112, 7, 118, 2, 2, 112, 113, 7, 119, 2, 2, 113, 114, 7, 116, 2, 2, 114, 115, 7, 112, 2, 2, 115, 14, 3, 2, 2, 2, 116, 117, 7, 90, 2, 2, 117, 16, 3, 2, 2, 2, 118, 119, 7, 84, 2, 2, 119, 120, 7, 122, 2, 2, 120, 18, 3, 2, 2, 2, 121, 122, 7, 84, 2, 2, 122, 123, 7, 124, 2, 2, 123, 20, 3, 2, 2, 2, 124, 125, 7, 84, 2, 2, 125, 126, 7, 123, 2, 2, 126, 22, 3, 2, 2, 2, 127, 128, 7, 91, 2, 2, 128, 24, 3, 2, 2, 2, 129, 130, 7, 92, 2, 2, 130, 26, 3, 2, 2, 2, 131, 132, 7, 69, 2, 2, 132, 133, 7, 80, 2, 2, 133, 134, 7, 81, 2, 2, 134, 135, 7, 86, 2, 2, 135, 28, 3, 2, 2, 2, 136, 137, 7, 69, 2, 2, 137, 138, 7, 92, 2, 2, 138, 30, 3, 2, 2, 2, 139, 140, 7, 69, 2, 2, 140, 141, 7, 90, 2, 2, 141, 32, 3, 2, 2, 2, 142, 143, 7, 74, 2, 2, 143, 34, 3, 2, 2, 2, 144, 145, 7, 85, 2, 2, 145, 146, 7, 121, 2, 2, 146, 147, 7, 99, 2, 2, 147, 148, 7, 114, 2, 2, 148, 36, 3, 2, 2, 2, 149, 150, 7, 75, 2, 2, 150, 151, 7, 102, 2, 2, 151, 152, 7, 103, 2, 2, 152, 153, 7, 112, 2, 2, 153, 154, 7, 118, 2, 2, 154, 155, 7, 107, 2, 2, 155, 156, 7, 118, 2, 2, 156, 157, 7, 123, 2, 2, 157, 38, 3, 2, 2, 2, 158, 159, 7, 69, 2, 2, 159, 160, 7, 82, 2, 2, 160, 161, 7, 106, 2, 2, 161, 162, 7, 99, 2, 2, 162, 163, 7, 117, 2, 2, 163, 164, 7, 103, 2, 2, 164, 40, 3, 2, 2, 2, 165, 166, 7, 79, 2, 2, 166, 167, 7, 103, 2, 2, 167, 168, 7, 99, 2, 2, 168, 169, 7, 117, 2, 2, 169, 170, 7, 119, 2, 2, 170, 171, 7, 116, 2, 2, 171, 172, 7, 103, 2, 2, 172, 42, 3, 2, 2, 2, 173, 174, 7, 79, 2, 2, 174, 175, 7, 71, 2, 2, 175, 176, 7, 67, 2, 2, 176, 177, 7, 85, 2, 2, 177, 178, 7, 87, 2, 2, 178, 179, 7, 84, 2, 2, 179, 180, 7, 71, 2, 2, 180, 44, 3, 2, 2, 2, 181, 182, 7, 122, 2, 2, 182, 183, 7, 99, 2, 2, 183, 184, 7, 101, 2, 2, 184, 185, 7, 101, 2, 2, 185, 46, 3, 2, 2, 2, 186, 187, 7, 115, 2, 2, 187, 188, 7, 111, 2, 2, 188, 189, 7, 107, 2, 2, 189, 48, 3, 2, 2, 2, 190, 191, 7, 114, 2, 2, 191, 192, 7, 107, 2, 2, 192, 50, 3, 2, 2, 2, 193, 194, 7, 45, 2, 2, 194, 52, 3, 2, 2, 2, 195, 196, 7, 47, 2, 2, 196, 54, 3, 2, 2, 2, 197, 198, 7, 44, 2, 2, 198, 56, 3, 2, 2, 2, 199, 200, 7, 49, 2, 2, 200, 58, 3, 2, 2, 2, 201, 202, 7, 96, 2, 2, 202, 60, 3, 2, 2, 2, 203, 204, 7, 63, 2, 2, 204, 62, 3, 2, 2, 2, 205, 206, 7, 41, 2, 2, 206, 207, 7, 93, 2, 2, 207, 64, 3, 2, 2, 2, 208, 209, 7, 95, 2, 2, 209, 210, 7, 41, 2, 2, 210, 66, 3, 2, 2, 2, 211, 212, 7, 93, 2, 2, 212, 68, 3, 2, 2, 2, 213, 214, 7, 95, 2, 2, 214, 70, 3, 2, 2, 2, 215, 216, 7, 117, 2, 2, 216, 217, 7, 107, 2, 2, 217, 218, 7, 112, 2, 2, 218, 72, 3, 2, 2, 2, 219, 220, 7, 101, 2, 2, 220, 221, 7, 113, 2, 2, 221, 222, 7, 117, 2, 2, 222, 74, 3, 2, 2, 2, 223, 224, 7, 118, 2, 2, 224, 225, 7, 99, 2, 2, 225, 226, 7, 112, 2, 2, 226, 76, 3, 2, 2, 2, 227, 228, 7, 103, 2, 2, 228, 229, 7, 122, 2, 2, 229, 230, 7, 114, 2, 2, 230, 78, 3, 2, 2, 2, 231, 232, 7, 110, 2, 2, 232, 233, 7, 112, 2, 2, 233, 80, 3, 2, 2, 2, 234, 235, 7, 117, 2, 2, 235, 236, 7, 115, 2, 2, 236, 237, 7, 116, 2, 2, 237, 238, 7, 118, 2, 2, 238, 82, 3, 2, 2, 2, 239, 243, 7, 37, 2, 2, 240, 242, 10, 2, 2, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 246, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 247, 5, 95, 48, 2, 247, 84, 3, 2, 2, 2, 248, 252, 9, 3, 2, 2, 249, 251, 9, 4, 2, 2, 250, 249, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 86, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 256, 5, 89, 45, 2, 256, 258, 7, 48, 2, 2, 257, 259, 5, 89, 45, 2, 258, 257, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 88, 3, 2, 2, 2, 260, 262, 4, 50, 59, 2, 261, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 90, 3, 2, 2, 2, 265, 269, 7, 36, 2, 2, 266, 268, 10, 5, 2, 2, 267, 266, 3, 2, 2, 2, 268, 271, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 272, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 272, 273, 7, 36, 2, 2, 273, 92, 3, 2, 2, 2, 274, 275, 9, 6, 2, 2, 275, 276, 3, 2, 2, 2, 276, 277, 8, 47, 2, 2, 277, 94, 3, 2, 2, 2, 278, 280, 7, 15, 2, 2, 279, 278, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 282, 7, 12, 2, 2, 282, 96, 3, 2, 2, 2, 9, 2, 243, 252, 258, 263, 269, 279, 3, 8, 2, 2]
\ No newline at end of file
......@@ -34,13 +34,17 @@ T__32=33
T__33=34
T__34=35
T__35=36
COMMENT=37
ID=38
REAL=39
INT=40
STRING=41
WS=42
EOL=43
T__36=37
T__37=38
T__38=39
T__39=40
COMMENT=41
ID=42
REAL=43
INT=44
STRING=45
WS=46
EOL=47
'def'=1
'('=2
','=3
......@@ -71,9 +75,13 @@ EOL=43
'/'=28
'^'=29
'='=30
'sin'=31
'cos'=32
'tan'=33
'exp'=34
'ln'=35
'sqrt'=36
'\'['=31
']\''=32
'['=33
']'=34
'sin'=35
'cos'=36
'tan'=37
'exp'=38
'ln'=39
'sqrt'=40
// Generated from PyXACCIR.g4 by ANTLR 4.7.1
#include "PyXACCIRListener.h"
using namespace pyxacc;
......@@ -3,17 +3,19 @@
#pragma once
#include "antlr4-runtime.h"
#include "PyXACCIRParser.h"
namespace pyxacc {
/**
* This interface defines an abstract listener for a parse tree produced by
* PyXACCIRParser.
* This interface defines an abstract listener for a parse tree produced by PyXACCIRParser.
*/
class PyXACCIRListener : public antlr4::tree::ParseTreeListener {
class PyXACCIRListener : public antlr4::tree::ParseTreeListener {
public:
virtual void enterXaccsrc(PyXACCIRParser::XaccsrcContext *ctx) = 0;
virtual void exitXaccsrc(PyXACCIRParser::XaccsrcContext *ctx) = 0;
......@@ -53,6 +55,9 @@ public:
virtual void enterExp(PyXACCIRParser::ExpContext *ctx) = 0;
virtual void exitExp(PyXACCIRParser::ExpContext *ctx) = 0;
virtual void enterCoupler(PyXACCIRParser::CouplerContext *ctx) = 0;
virtual void exitCoupler(PyXACCIRParser::CouplerContext *ctx) = 0;
virtual void enterUnaryop(PyXACCIRParser::UnaryopContext *ctx) = 0;
virtual void exitUnaryop(PyXACCIRParser::UnaryopContext *ctx) = 0;
......@@ -64,6 +69,8 @@ public:
virtual void enterString(PyXACCIRParser::StringContext *ctx) = 0;
virtual void exitString(PyXACCIRParser::StringContext *ctx) = 0;
};
} // namespace pyxacc
} // namespace pyxacc
......@@ -3,88 +3,42 @@
#pragma once
#include "antlr4-runtime.h"
namespace pyxacc {
class PyXACCIRParser : public antlr4::Parser {
class PyXACCIRParser : public antlr4::Parser {
public:
enum {
T__0 = 1,
T__1 = 2,
T__2 = 3,
T__3 = 4,
T__4 = 5,
T__5 = 6,
T__6 = 7,
T__7 = 8,
T__8 = 9,
T__9 = 10,
T__10 = 11,
T__11 = 12,
T__12 = 13,
T__13 = 14,
T__14 = 15,
T__15 = 16,
T__16 = 17,
T__17 = 18,
T__18 = 19,
T__19 = 20,
T__20 = 21,
T__21 = 22,
T__22 = 23,
T__23 = 24,
T__24 = 25,
T__25 = 26,
T__26 = 27,
T__27 = 28,
T__28 = 29,
T__29 = 30,
T__30 = 31,
T__31 = 32,
T__32 = 33,
T__33 = 34,
T__34 = 35,
T__35 = 36,
COMMENT = 37,
ID = 38,
REAL = 39,
INT = 40,
STRING = 41,
WS = 42,
EOL = 43
T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7,
T__7 = 8, T__8 = 9, T__9 = 10, T__10 = 11, T__11 = 12, T__12 = 13, T__13 = 14,
T__14 = 15, T__15 = 16, T__16 = 17, T__17 = 18, T__18 = 19, T__19 = 20,
T__20 = 21, T__21 = 22, T__22 = 23, T__23 = 24, T__24 = 25, T__25 = 26,
T__26 = 27, T__27 = 28, T__28 = 29, T__29 = 30, T__30 = 31, T__31 = 32,
T__32 = 33, T__33 = 34, T__34 = 35, T__35 = 36, T__36 = 37, T__37 = 38,
T__38 = 39, T__39 = 40, COMMENT = 41, ID = 42, REAL = 43, INT = 44,
STRING = 45, WS = 46, EOL = 47
};
enum {
RuleXaccsrc = 0,
RuleXacckernel = 1,
RuleMainprog = 2,
RuleProgram = 3,
RuleLine = 4,
RuleStatement = 5,
RuleComment = 6,
RuleParamlist = 7,
RuleParam = 8,
RuleUop = 9,
RuleGate = 10,
RuleExplist = 11,
RuleExp = 12,
RuleUnaryop = 13,
RuleId = 14,
RuleReal = 15,
RuleString = 16
RuleXaccsrc = 0, RuleXacckernel = 1, RuleMainprog = 2, RuleProgram = 3,
RuleLine = 4, RuleStatement = 5, RuleComment = 6, RuleParamlist = 7,
RuleParam = 8, RuleUop = 9, RuleGate = 10, RuleExplist = 11, RuleExp = 12,
RuleCoupler = 13, RuleUnaryop = 14, RuleId = 15, RuleReal = 16, RuleString = 17
};
PyXACCIRParser(antlr4::TokenStream *input);
~PyXACCIRParser();