Browse Source

Initial commit

master
Pearl 1 year ago
commit
7046c35bf8
2 changed files with 195 additions and 0 deletions
  1. + 11
    - 0
      meson.build
  2. + 184
    - 0
      runtime/meson.build

+ 11
- 0
meson.build

@ -0,0 +1,11 @@
project('antlr4-runtime',
'cpp',
version : '4.7.2',
license : 'BSD',
default_options : ['c_std=c11', 'cpp_std=c++11']
)
uuid_dep = dependency('uuid', required : false) # Linux only
apple_dep = dependency('appleframeworks', modules : 'foundation', required : false) # macOS only
subdir('runtime')

+ 184
- 0
runtime/meson.build

@ -0,0 +1,184 @@
include_src = include_directories('src')
antlr4_src = [
'src/ANTLRErrorListener.cpp',
'src/ANTLRErrorStrategy.cpp',
'src/ANTLRFileStream.cpp',
'src/ANTLRInputStream.cpp',
'src/atn/AbstractPredicateTransition.cpp',
'src/atn/ActionTransition.cpp',
'src/atn/AmbiguityInfo.cpp',
'src/atn/ArrayPredictionContext.cpp',
'src/atn/ATN.cpp',
'src/atn/ATNConfig.cpp',
'src/atn/ATNConfigSet.cpp',
'src/atn/ATNDeserializationOptions.cpp',
'src/atn/ATNDeserializer.cpp',
'src/atn/ATNSerializer.cpp',
'src/atn/ATNSimulator.cpp',
'src/atn/ATNState.cpp',
'src/atn/AtomTransition.cpp',
'src/atn/BasicBlockStartState.cpp',
'src/atn/BasicState.cpp',
'src/atn/BlockEndState.cpp',
'src/atn/BlockStartState.cpp',
'src/atn/ContextSensitivityInfo.cpp',
'src/atn/DecisionEventInfo.cpp',
'src/atn/DecisionInfo.cpp',
'src/atn/DecisionState.cpp',
'src/atn/EmptyPredictionContext.cpp',
'src/atn/EpsilonTransition.cpp',
'src/atn/ErrorInfo.cpp',
'src/atn/LexerAction.cpp',
'src/atn/LexerActionExecutor.cpp',
'src/atn/LexerATNConfig.cpp',
'src/atn/LexerATNSimulator.cpp',
'src/atn/LexerChannelAction.cpp',
'src/atn/LexerCustomAction.cpp',
'src/atn/LexerIndexedCustomAction.cpp',
'src/atn/LexerModeAction.cpp',
'src/atn/LexerMoreAction.cpp',
'src/atn/LexerPopModeAction.cpp',
'src/atn/LexerPushModeAction.cpp',
'src/atn/LexerSkipAction.cpp',
'src/atn/LexerTypeAction.cpp',
'src/atn/LL1Analyzer.cpp',
'src/atn/LookaheadEventInfo.cpp',
'src/atn/LoopEndState.cpp',
'src/atn/NotSetTransition.cpp',
'src/atn/OrderedATNConfigSet.cpp',
'src/atn/ParseInfo.cpp',
'src/atn/ParserATNSimulator.cpp',
'src/atn/PlusBlockStartState.cpp',
'src/atn/PlusLoopbackState.cpp',
'src/atn/PrecedencePredicateTransition.cpp',
'src/atn/PredicateEvalInfo.cpp',
'src/atn/PredicateTransition.cpp',
'src/atn/PredictionContext.cpp',
'src/atn/PredictionMode.cpp',
'src/atn/ProfilingATNSimulator.cpp',
'src/atn/RangeTransition.cpp',
'src/atn/RuleStartState.cpp',
'src/atn/RuleStopState.cpp',
'src/atn/RuleTransition.cpp',
'src/atn/SemanticContext.cpp',
'src/atn/SetTransition.cpp',
'src/atn/SingletonPredictionContext.cpp',
'src/atn/StarBlockStartState.cpp',
'src/atn/StarLoopbackState.cpp',
'src/atn/StarLoopEntryState.cpp',
'src/atn/TokensStartState.cpp',
'src/atn/Transition.cpp',
'src/atn/WildcardTransition.cpp',
'src/BailErrorStrategy.cpp',
'src/BaseErrorListener.cpp',
'src/BufferedTokenStream.cpp',
'src/CharStream.cpp',
'src/CommonToken.cpp',
'src/CommonTokenFactory.cpp',
'src/CommonTokenStream.cpp',
'src/ConsoleErrorListener.cpp',
'src/DefaultErrorStrategy.cpp',
'src/dfa/DFA.cpp',
'src/dfa/DFASerializer.cpp',
'src/dfa/DFAState.cpp',
'src/dfa/LexerDFASerializer.cpp',
'src/DiagnosticErrorListener.cpp',
'src/Exceptions.cpp',
'src/FailedPredicateException.cpp',
'src/InputMismatchException.cpp',
'src/InterpreterRuleContext.cpp',
'src/IntStream.cpp',
'src/Lexer.cpp',
'src/LexerInterpreter.cpp',
'src/LexerNoViableAltException.cpp',
'src/ListTokenSource.cpp',
'src/misc/Interval.cpp',
'src/misc/IntervalSet.cpp',
'src/misc/MurmurHash.cpp',
'src/misc/Predicate.cpp',
'src/NoViableAltException.cpp',
'src/Parser.cpp',
'src/ParserInterpreter.cpp',
'src/ParserRuleContext.cpp',
'src/ProxyErrorListener.cpp',
'src/RecognitionException.cpp',
'src/Recognizer.cpp',
'src/RuleContext.cpp',
'src/RuleContextWithAltNum.cpp',
'src/RuntimeMetaData.cpp',
'src/support/Any.cpp',
'src/support/Arrays.cpp',
'src/support/CPPUtils.cpp',
'src/support/guid.cpp',
'src/support/StringUtils.cpp',
'src/Token.cpp',
'src/TokenSource.cpp',
'src/TokenStream.cpp',
'src/TokenStreamRewriter.cpp',
'src/tree/ErrorNode.cpp',
'src/tree/ErrorNodeImpl.cpp',
'src/tree/IterativeParseTreeWalker.cpp',
'src/tree/ParseTree.cpp',
'src/tree/ParseTreeListener.cpp',
'src/tree/ParseTreeVisitor.cpp',
'src/tree/ParseTreeWalker.cpp',
'src/tree/pattern/Chunk.cpp',
'src/tree/pattern/ParseTreeMatch.cpp',
'src/tree/pattern/ParseTreePattern.cpp',
'src/tree/pattern/ParseTreePatternMatcher.cpp',
'src/tree/pattern/RuleTagToken.cpp',
'src/tree/pattern/TagChunk.cpp',
'src/tree/pattern/TextChunk.cpp',
'src/tree/pattern/TokenTagToken.cpp',
'src/tree/TerminalNode.cpp',
'src/tree/TerminalNodeImpl.cpp',
'src/tree/Trees.cpp',
'src/tree/xpath/XPath.cpp',
'src/tree/xpath/XPathElement.cpp',
'src/tree/xpath/XPathLexer.cpp',
'src/tree/xpath/XPathLexerErrorListener.cpp',
'src/tree/xpath/XPathRuleAnywhereElement.cpp',
'src/tree/xpath/XPathRuleElement.cpp',
'src/tree/xpath/XPathTokenAnywhereElement.cpp',
'src/tree/xpath/XPathTokenElement.cpp',
'src/tree/xpath/XPathWildcardAnywhereElement.cpp',
'src/tree/xpath/XPathWildcardElement.cpp',
'src/UnbufferedCharStream.cpp',
'src/UnbufferedTokenStream.cpp',
'src/Vocabulary.cpp',
'src/WritableToken.cpp',
]
extra_shared_compile_flags = []
extra_static_compile_flags = []
if host_machine.system() == 'windows'
extra_shared_compile_flags += '-DANTLR4CPP_EXPORTS'
extra_static_compile_flags += '-DANTLR4CPP_STATIC'
endif
antlr4_shared = shared_library(
'antlr4-runtime',
antlr4_src,
include_directories : [include_src],
dependencies : [uuid_dep, apple_dep],
cpp_args : [
'-std=c++11',
extra_shared_compile_flags
]
)
compiler = meson.get_compiler('cpp')
static_name = 'antlr4-runtime'
if compiler.get_argument_syntax() == 'msvc'
static_name = 'antlr4-runtime-static'
endif
antlr4_static = static_library(
static_name,
antlr4_src,
include_directories : [include_src],
dependencies : [uuid_dep, apple_dep],
cpp_args : [
'-std=c++11',
extra_static_compile_flags
]
)

Loading…
Cancel
Save