Skip to content

Commit

Permalink
Upgrade ANTLR4 runtime
Browse files Browse the repository at this point in the history
Ref #2039. This fixes the warnings when we compile the runtime.
  • Loading branch information
Riolku committed Sep 15, 2023
1 parent 49850c8 commit d8a5ca4
Show file tree
Hide file tree
Showing 335 changed files with 17,083 additions and 19,670 deletions.
2 changes: 1 addition & 1 deletion scripts/antlr4/generate_grammar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" >/dev/null 2>&1 && pwd
if [ ! -e antlr4.jar ]
then
echo "Downloading antlr4.jar"
curl --url 'https://www.antlr.org/download/antlr-4.9-complete.jar'\
curl --url 'https://www.antlr.org/download/antlr-4.13.1-complete.jar'\
--output './antlr4.jar'
fi

Expand Down
2,065 changes: 745 additions & 1,320 deletions third_party/antlr4_cypher/cypher_lexer.cpp

Large diffs are not rendered by default.

2,761 changes: 967 additions & 1,794 deletions third_party/antlr4_cypher/cypher_parser.cpp

Large diffs are not rendered by default.

45 changes: 19 additions & 26 deletions third_party/antlr4_cypher/include/cypher_lexer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from Cypher.g4 by ANTLR 4.9
// Generated from Cypher.g4 by ANTLR 4.13.1

#pragma once

Expand Down Expand Up @@ -41,41 +41,34 @@ class CypherLexer : public antlr4::Lexer {
};

explicit CypherLexer(antlr4::CharStream *input);
~CypherLexer();

virtual std::string getGrammarFileName() const override;
virtual const std::vector<std::string>& getRuleNames() const override;
~CypherLexer() 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;
std::string getGrammarFileName() const override;

private:
static std::vector<antlr4::dfa::DFA> _decisionToDFA;
static antlr4::atn::PredictionContextCache _sharedContextCache;
static std::vector<std::string> _ruleNames;
static std::vector<std::string> _tokenNames;
static std::vector<std::string> _channelNames;
static std::vector<std::string> _modeNames;
const std::vector<std::string>& getRuleNames() const override;

const std::vector<std::string>& getChannelNames() const override;

const std::vector<std::string>& getModeNames() const override;

const antlr4::dfa::Vocabulary& getVocabulary() const override;

static std::vector<std::string> _literalNames;
static std::vector<std::string> _symbolicNames;
static antlr4::dfa::Vocabulary _vocabulary;
static antlr4::atn::ATN _atn;
static std::vector<uint16_t> _serializedATN;
antlr4::atn::SerializedATNView getSerializedATN() const override;

const antlr4::atn::ATN& getATN() const override;

// By default the static state used to implement the lexer is lazily initialized during the first
// call to the constructor. You can call this function if you wish to initialize the static state
// ahead of time.
static void initialize();

private:

// Individual action functions triggered by action() above.

// Individual semantic predicate functions triggered by sempred() above.

struct Initializer {
Initializer();
};
static Initializer _init;
};

42 changes: 19 additions & 23 deletions third_party/antlr4_cypher/include/cypher_parser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from Cypher.g4 by ANTLR 4.9
// Generated from Cypher.g4 by ANTLR 4.13.1

#pragma once

Expand Down Expand Up @@ -90,13 +90,20 @@ class CypherParser : public antlr4::Parser {
};

explicit CypherParser(antlr4::TokenStream *input);
~CypherParser();

virtual std::string getGrammarFileName() const override;
virtual const antlr4::atn::ATN& getATN() const override { return _atn; };
virtual const std::vector<std::string>& getTokenNames() const override { return _tokenNames; }; // deprecated: use vocabulary instead.
virtual const std::vector<std::string>& getRuleNames() const override;
virtual antlr4::dfa::Vocabulary& getVocabulary() const override;
CypherParser(antlr4::TokenStream *input, const antlr4::atn::ParserATNSimulatorOptions &options);

~CypherParser() override;

std::string getGrammarFileName() const override;

const antlr4::atn::ATN& getATN() const override;

const std::vector<std::string>& getRuleNames() const override;

const antlr4::dfa::Vocabulary& getVocabulary() const override;

antlr4::atn::SerializedATNView getSerializedATN() const override;


class OC_CypherContext;
Expand Down Expand Up @@ -2143,18 +2150,12 @@ class CypherParser : public antlr4::Parser {
OC_DashContext* oC_Dash();


private:
static std::vector<antlr4::dfa::DFA> _decisionToDFA;
static antlr4::atn::PredictionContextCache _sharedContextCache;
static std::vector<std::string> _ruleNames;
static std::vector<std::string> _tokenNames;

static std::vector<std::string> _literalNames;
static std::vector<std::string> _symbolicNames;
static antlr4::dfa::Vocabulary _vocabulary;
static antlr4::atn::ATN _atn;
static std::vector<uint16_t> _serializedATN;
// By default the static state used to implement the parser is lazily initialized during the first
// call to the constructor. You can call this function if you wish to initialize the static state
// ahead of time.
static void initialize();

private:

virtual void notifyQueryNotConcludeWithReturn(antlr4::Token* startToken) {};
virtual void notifyNodePatternWithoutParentheses(std::string nodeName, antlr4::Token* startToken) {};
Expand All @@ -2163,10 +2164,5 @@ class CypherParser : public antlr4::Parser {
virtual void notifyReturnNotAtEnd(antlr4::Token* startToken) {};
virtual void notifyNonBinaryComparison(antlr4::Token* startToken) {};


struct Initializer {
Initializer();
};
static Initializer _init;
};

Loading

0 comments on commit d8a5ca4

Please sign in to comment.