Skip to content

Commit

Permalink
Upgrade Antlr4 version to work around uuid problem
Browse files Browse the repository at this point in the history
  • Loading branch information
skef committed Nov 5, 2024
1 parent 720764d commit 84efa60
Show file tree
Hide file tree
Showing 13 changed files with 1,906 additions and 3,208 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# CIBW_BEFORE_ALL_LINUX: "yum install -y libuuid-devel && yum install -y libxml2-devel"
# CIBW_ENVIRONMENT_LINUX: "CFLAGS='-I/usr/include/libxml2'"
# CIBW_BEFORE_ALL_LINUX: "yum install -y libuuid-devel"
CIBW_BEFORE_ALL_LINUX: "dnf -y install uuid-devel"
# CIBW_BEFORE_ALL_LINUX: "dnf -y install uuid-devel"
CIBW_ENVIRONMENT_MACOS: "CFLAGS='-I/usr/include/libxml2'"
CIBW_ENVIRONMENT_LINUX: "FORCE_BUILD_LIBXML2=ON"
CIBW_ENVIRONMENT_WINDOWS: "FORCE_BUILD_LIBXML2=ON"
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif()
message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# scikit-build
if(SKBUILD)
Expand All @@ -39,7 +39,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
add_definitions(-DANTLR4CPP_STATIC)
set(ANTLR4_WITH_STATIC_CRT OFF)
# 4.9.3 is the latest ANTLR4 version
set(ANTLR4_TAG tags/4.9.3)
set(ANTLR4_TAG tags/4.13.2)
include(ExternalAntlr4Cpp)


Expand Down
2 changes: 1 addition & 1 deletion c/makeotf/lib/hotconv/BuildGrammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

antlr_program = "antlr4"
antlr_version = "4.9.3"
antlr_version = "4.13.2"

antlr_args = ['-no-listener', '-Dlanguage=Cpp']

Expand Down
2,179 changes: 791 additions & 1,388 deletions c/makeotf/lib/hotconv/FeatLexer.cpp

Large diffs are not rendered by default.

50 changes: 22 additions & 28 deletions c/makeotf/lib/hotconv/FeatLexer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from FeatLexer.g4 by ANTLR 4.9.3
// Generated from FeatLexer.g4 by ANTLR 4.13.2

#pragma once

Expand Down Expand Up @@ -50,7 +50,8 @@ class FeatLexer : public antlr4::Lexer {
};

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

~FeatLexer() override;


std::string anon_tag;
Expand All @@ -74,44 +75,37 @@ class FeatLexer : public antlr4::Lexer {
return true;
}

virtual std::string getGrammarFileName() 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;
std::string getGrammarFileName() const override;

virtual const std::vector<uint16_t> getSerializedATN() const override;
virtual const antlr4::atn::ATN& getATN() const override;
const std::vector<std::string>& getRuleNames() const override;

virtual void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override;
virtual bool sempred(antlr4::RuleContext *_localctx, size_t ruleIndex, size_t predicateIndex) override;
const std::vector<std::string>& getChannelNames() 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>& getModeNames() const override;

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

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

const antlr4::atn::ATN& getATN() 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;
void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override;

bool sempred(antlr4::RuleContext *_localctx, size_t ruleIndex, size_t predicateIndex) 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.
void A_LABELAction(antlr4::RuleContext *context, size_t actionIndex);

// Individual semantic predicate functions triggered by sempred() above.
bool A_CLOSESempred(antlr4::RuleContext *_localctx, size_t predicateIndex);

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

2 changes: 1 addition & 1 deletion c/makeotf/lib/hotconv/FeatLexer.interp

Large diffs are not rendered by default.

2,157 changes: 731 additions & 1,426 deletions c/makeotf/lib/hotconv/FeatParser.cpp

Large diffs are not rendered by default.

Loading

0 comments on commit 84efa60

Please sign in to comment.