Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update antlr4-python3-runtime to 4.9.2 #51

Merged
merged 4 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

<h3>New features since last release</h3>

* Rebuilds the grammar using ANTLR `v4.9.2`
[(#51)](https://github.com/XanaduAI/blackbird/pull/51)

<h3>Improvements</h3>

<h3>Breaking changes</h3>
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build:
image: latest

python:
version: 3.6
version: 3.8

# Don't build any extra formats
formats:
- none
- none
67 changes: 60 additions & 7 deletions blackbird_cpp/blackbird.interp

Large diffs are not rendered by default.

151 changes: 95 additions & 56 deletions blackbird_cpp/blackbird.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,104 @@ TIMES=3
DIVIDE=4
PWR=5
ASSIGN=6
INT=7
FLOAT=8
COMPLEX=9
STR=10
BOOL=11
SEQUENCE=12
PI=13
NEWLINE=14
TAB=15
SPACE=16
WITH=17
SQRT=18
SIN=19
COS=20
EXP=21
PERIOD=22
COMMA=23
COLON=24
QUOTE=25
LBRAC=26
RBRAC=27
LSQBRAC=28
RSQBRAC=29
APPLY=30
TYPE_ARRAY=31
TYPE_FLOAT=32
TYPE_COMPLEX=33
TYPE_INT=34
TYPE_STR=35
TYPE_BOOL=36
MEASURE=37
NAME=38
DEVICE=39
COMMENT=40
ANY=41
FOR=7
IN=8
INT=9
FLOAT=10
COMPLEX=11
STR=12
BOOL=13
SEQUENCE=14
PI=15
NEWLINE=16
TAB=17
SPACE=18
PROGNAME=19
VERSION=20
TARGET=21
PROGTYPE=22
INCLUDE=23
SQRT=24
SIN=25
COS=26
TAN=27
ARCSIN=28
ARCCOS=29
ARCTAN=30
SINH=31
COSH=32
TANH=33
ARCSINH=34
ARCCOSH=35
ARCTANH=36
EXP=37
LOG=38
PERIOD=39
COMMA=40
COLON=41
QUOTE=42
LBRAC=43
RBRAC=44
LSQBRAC=45
RSQBRAC=46
LBRACE=47
RBRACE=48
APPLY=49
TYPE_ARRAY=50
TYPE_FLOAT=51
TYPE_COMPLEX=52
TYPE_INT=53
TYPE_STR=54
TYPE_BOOL=55
REGREF=56
MEASURE=57
NAME=58
DEVICE=59
COMMENT=60
ANY=61
'+'=1
'-'=2
'*'=3
'/'=4
'**'=5
'='=6
'pi'=13
'with'=17
'sqrt'=18
'sin'=19
'cos'=20
'exp'=21
'.'=22
','=23
':'=24
'"'=25
'('=26
')'=27
'['=28
']'=29
'|'=30
'array'=31
'float'=32
'complex'=33
'int'=34
'str'=35
'bool'=36
'for'=7
'in'=8
'pi'=15
'name'=19
'version'=20
'target'=21
'type'=22
'include'=23
'sqrt'=24
'sin'=25
'cos'=26
'tan'=27
'arcsin'=28
'arccos'=29
'arctan'=30
'sinh'=31
'cosh'=32
'tanh'=33
'arcsinh'=34
'arccosh'=35
'arctanh'=36
'exp'=37
'log'=38
'.'=39
','=40
':'=41
'"'=42
'('=43
')'=44
'['=45
']'=46
'{'=47
'}'=48
'|'=49
'array'=50
'float'=51
'complex'=52
'int'=53
'str'=54
'bool'=55
2 changes: 1 addition & 1 deletion blackbird_cpp/blackbirdBaseVisitor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from blackbird.g4 by ANTLR 4.7.1
// Generated from blackbird.g4 by ANTLR 4.9.2


#include "blackbirdBaseVisitor.h"
Expand Down
80 changes: 70 additions & 10 deletions blackbird_cpp/blackbirdBaseVisitor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from blackbird.g4 by ANTLR 4.7.1
// Generated from blackbird.g4 by ANTLR 4.9.2

#pragma once

Expand All @@ -19,7 +19,47 @@ class blackbirdBaseVisitor : public blackbirdVisitor {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitVarblock(blackbirdParser::VarblockContext *ctx) override {
virtual antlrcpp::Any visitMetadatablock(blackbirdParser::MetadatablockContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitDeclarename(blackbirdParser::DeclarenameContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitProgramname(blackbirdParser::ProgramnameContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitVersion(blackbirdParser::VersionContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitVersionnumber(blackbirdParser::VersionnumberContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitTarget(blackbirdParser::TargetContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitDevice(blackbirdParser::DeviceContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitDeclaretype(blackbirdParser::DeclaretypeContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitProgramtype(blackbirdParser::ProgramtypeContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitInclude(blackbirdParser::IncludeContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitProgram(blackbirdParser::ProgramContext *ctx) override {
return visitChildren(ctx);
}

Expand All @@ -35,31 +75,31 @@ class blackbirdBaseVisitor : public blackbirdVisitor {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitVartype(blackbirdParser::VartypeContext *ctx) override {
virtual antlrcpp::Any visitInvalid(blackbirdParser::InvalidContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitNonnumeric(blackbirdParser::NonnumericContext *ctx) override {
virtual antlrcpp::Any visitReserved(blackbirdParser::ReservedContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitShape(blackbirdParser::ShapeContext *ctx) override {
virtual antlrcpp::Any visitVartype(blackbirdParser::VartypeContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitArrayval(blackbirdParser::ArrayvalContext *ctx) override {
virtual antlrcpp::Any visitNonnumeric(blackbirdParser::NonnumericContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitArrayrow(blackbirdParser::ArrayrowContext *ctx) override {
virtual antlrcpp::Any visitShape(blackbirdParser::ShapeContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitProgram(blackbirdParser::ProgramContext *ctx) override {
virtual antlrcpp::Any visitArrayval(blackbirdParser::ArrayvalContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitDevice(blackbirdParser::DeviceContext *ctx) override {
virtual antlrcpp::Any visitArrayrow(blackbirdParser::ArrayrowContext *ctx) override {
return visitChildren(ctx);
}

Expand All @@ -75,6 +115,10 @@ class blackbirdBaseVisitor : public blackbirdVisitor {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitForloop(blackbirdParser::ForloopContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitArguments(blackbirdParser::ArgumentsContext *ctx) override {
return visitChildren(ctx);
}
Expand All @@ -87,7 +131,15 @@ class blackbirdBaseVisitor : public blackbirdVisitor {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitModes(blackbirdParser::ModesContext *ctx) override {
virtual antlrcpp::Any visitVallist(blackbirdParser::VallistContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitRangeval(blackbirdParser::RangevalContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitParameterLabel(blackbirdParser::ParameterLabelContext *ctx) override {
return visitChildren(ctx);
}

Expand All @@ -111,6 +163,10 @@ class blackbirdBaseVisitor : public blackbirdVisitor {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitArrayIdxLabel(blackbirdParser::ArrayIdxLabelContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitMulLabel(blackbirdParser::MulLabelContext *ctx) override {
return visitChildren(ctx);
}
Expand All @@ -123,6 +179,10 @@ class blackbirdBaseVisitor : public blackbirdVisitor {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitParameter(blackbirdParser::ParameterContext *ctx) override {
return visitChildren(ctx);
}

virtual antlrcpp::Any visitNumber(blackbirdParser::NumberContext *ctx) override {
return visitChildren(ctx);
}
Expand Down
Loading