Initial commit from sysy-main
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
//
|
||||
// main.cpp
|
||||
// antlr4-cpp-demo
|
||||
//
|
||||
// Created by Mike Lischke on 13.03.16.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
#include "TLexer.h"
|
||||
#include "TParser.h"
|
||||
|
||||
using namespace antlrcpptest;
|
||||
using namespace antlr4;
|
||||
|
||||
int main(int , const char **) {
|
||||
ANTLRInputStream input(u8"🍴 = 🍐 + \"😎\";(((x * π))) * µ + ∰; a + (x * (y ? 0 : 1) + z);");
|
||||
TLexer lexer(&input);
|
||||
CommonTokenStream tokens(&lexer);
|
||||
|
||||
tokens.fill();
|
||||
for (auto token : tokens.getTokens()) {
|
||||
std::cout << token->toString() << std::endl;
|
||||
}
|
||||
|
||||
TParser parser(&tokens);
|
||||
tree::ParseTree *tree = parser.main();
|
||||
|
||||
std::cout << tree->toStringTree(&parser) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* [The "BSD license"]
|
||||
* Copyright (c) 2016 Mike Lischke
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#include "ANTLRInputStream.h"
|
||||
#include "Exceptions.h"
|
||||
#include "Interval.h"
|
||||
#include "UnbufferedTokenStream.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
using namespace antlrcpp;
|
||||
using namespace antlr4;
|
||||
using namespace antlr4::misc;
|
||||
|
||||
@interface InputHandlingTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation InputHandlingTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testANTLRInputStreamCreation {
|
||||
ANTLRInputStream stream1;
|
||||
XCTAssert(stream1.toString().empty());
|
||||
XCTAssertEqual(stream1.index(), 0U);
|
||||
|
||||
ANTLRInputStream stream2("To be or not to be");
|
||||
XCTAssert(stream2.toString() == "To be or not to be");
|
||||
XCTAssertEqual(stream2.index(), 0U);
|
||||
XCTAssertEqual(stream2.size(), 18U);
|
||||
|
||||
char data[] = "Lorem ipsum dolor sit amet";
|
||||
ANTLRInputStream stream3(data, sizeof(data) / sizeof(data[0]));
|
||||
XCTAssert(stream3.toString() == std::string("Lorem ipsum dolor sit amet\0", 27));
|
||||
XCTAssertEqual(stream3.index(), 0U);
|
||||
XCTAssertEqual(stream3.size(), 27U);
|
||||
|
||||
std::stringstream input("Lorem ipsum dolor sit amet");
|
||||
ANTLRInputStream stream4(input);
|
||||
std::string content = stream4.toString();
|
||||
XCTAssertEqual(content, "Lorem ipsum dolor sit amet"); // Now as utf-8 string.
|
||||
XCTAssertEqual(stream4.index(), 0U);
|
||||
XCTAssertEqual(stream4.size(), 26U);
|
||||
|
||||
std::string longString(33333, 'a');
|
||||
input.str(longString);
|
||||
stream4.load(input);
|
||||
XCTAssertEqual(stream4.index(), 0U);
|
||||
XCTAssertEqual(stream4.size(), 33333U);
|
||||
|
||||
input.clear();
|
||||
stream4.load(input);
|
||||
XCTAssertEqual(stream4.size(), 0U);
|
||||
}
|
||||
|
||||
- (void)testANTLRInputStreamUse {
|
||||
std::string text(u8"🚧Lorem ipsum dolor sit amet🕶");
|
||||
std::u32string wtext = utf8_to_utf32(text.c_str(), text.c_str() + text.size()); // Convert to UTF-32.
|
||||
ANTLRInputStream stream(text);
|
||||
XCTAssertEqual(stream.index(), 0U);
|
||||
XCTAssertEqual(stream.size(), wtext.size());
|
||||
|
||||
for (size_t i = 0; i < stream.size(); ++i) {
|
||||
stream.consume();
|
||||
XCTAssertEqual(stream.index(), i + 1);
|
||||
}
|
||||
|
||||
try {
|
||||
stream.consume();
|
||||
XCTFail();
|
||||
} catch (IllegalStateException &e) {
|
||||
// Expected.
|
||||
std::string message = e.what();
|
||||
XCTAssertEqual(message, "cannot consume EOF");
|
||||
}
|
||||
|
||||
XCTAssertEqual(stream.index(), wtext.size());
|
||||
stream.reset();
|
||||
XCTAssertEqual(stream.index(), 0U);
|
||||
|
||||
XCTAssertEqual(stream.LA(0), 0ULL);
|
||||
for (size_t i = 1; i < wtext.size(); ++i) {
|
||||
XCTAssertEqual(stream.LA(static_cast<ssize_t>(i)), wtext[i - 1]); // LA(1) means: current char.
|
||||
XCTAssertEqual(stream.LT(static_cast<ssize_t>(i)), wtext[i - 1]); // LT is mapped to LA.
|
||||
XCTAssertEqual(stream.index(), 0U); // No consumption when looking ahead.
|
||||
}
|
||||
|
||||
stream.seek(wtext.size() - 1);
|
||||
XCTAssertEqual(stream.index(), wtext.size() - 1);
|
||||
|
||||
stream.seek(wtext.size() / 2);
|
||||
XCTAssertEqual(stream.index(), wtext.size() / 2);
|
||||
|
||||
stream.seek(wtext.size() - 1);
|
||||
for (ssize_t i = 1; i < static_cast<ssize_t>(wtext.size()) - 1; ++i) {
|
||||
XCTAssertEqual(stream.LA(-i), wtext[wtext.size() - i - 1]); // LA(-1) means: previous char.
|
||||
XCTAssertEqual(stream.LT(-i), wtext[wtext.size() - i - 1]); // LT is mapped to LA.
|
||||
XCTAssertEqual(stream.index(), wtext.size() - 1); // No consumption when looking ahead.
|
||||
}
|
||||
|
||||
XCTAssertEqual(stream.LA(-10000), IntStream::EOF);
|
||||
|
||||
// Mark and release do nothing.
|
||||
stream.reset();
|
||||
XCTAssertEqual(stream.index(), 0U);
|
||||
ssize_t marker = stream.mark();
|
||||
XCTAssertEqual(marker, -1);
|
||||
stream.seek(10);
|
||||
XCTAssertEqual(stream.index(), 10U);
|
||||
XCTAssertEqual(stream.mark(), -1);
|
||||
|
||||
stream.release(marker);
|
||||
XCTAssertEqual(stream.index(), 10U);
|
||||
|
||||
misc::Interval interval1(2, 10UL); // From - to, inclusive.
|
||||
std::string output = stream.getText(interval1);
|
||||
std::string sub = utf32_to_utf8(wtext.substr(2, 9));
|
||||
XCTAssertEqual(output, sub);
|
||||
|
||||
misc::Interval interval2(200, 10UL); // Start beyond bounds.
|
||||
output = stream.getText(interval2);
|
||||
XCTAssert(output.empty());
|
||||
|
||||
misc::Interval interval3(0, 200UL); // End beyond bounds.
|
||||
output = stream.getText(interval3);
|
||||
XCTAssertEqual(output, text);
|
||||
|
||||
stream.name = "unit tests"; // Quite useless test, as "name" is a public field.
|
||||
XCTAssertEqual(stream.getSourceName(), "unit tests");
|
||||
}
|
||||
|
||||
- (void)testUnbufferedTokenSteam {
|
||||
//UnbufferedTokenStream stream;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,388 @@
|
||||
/*
|
||||
* [The "BSD license"]
|
||||
* Copyright (c) 2016 Mike Lischke
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlr4::misc;
|
||||
using namespace antlrcpp;
|
||||
|
||||
@interface MiscClassTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation MiscClassTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testCPPUtils {
|
||||
|
||||
class A { public: virtual ~A() {}; };
|
||||
class B : public A { public: virtual ~B() {}; };
|
||||
class C : public A { public: virtual ~C() {}; };
|
||||
class D : public C { public: virtual ~D() {}; };
|
||||
|
||||
{
|
||||
A *a = new A(); B *b = new B(); C *c = new C(); D *d = new D();
|
||||
XCTAssert(is<A*>(b));
|
||||
XCTAssertFalse(is<B*>(a));
|
||||
XCTAssert(is<A*>(c));
|
||||
XCTAssertFalse(is<B*>(c));
|
||||
XCTAssert(is<A*>(d));
|
||||
XCTAssert(is<C*>(d));
|
||||
XCTAssertFalse(is<B*>(d));
|
||||
delete a; delete b; delete c; delete d;
|
||||
}
|
||||
{
|
||||
Ref<A> a(new A());
|
||||
Ref<B> b(new B());
|
||||
Ref<C> c(new C());
|
||||
Ref<D> d(new D());
|
||||
XCTAssert(is<A>(b));
|
||||
XCTAssertFalse(is<B>(a));
|
||||
XCTAssert(is<A>(c));
|
||||
XCTAssertFalse(is<B>(c));
|
||||
XCTAssert(is<A>(d));
|
||||
XCTAssert(is<C>(d));
|
||||
XCTAssertFalse(is<B>(d));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testMurmurHash {
|
||||
XCTAssertEqual(MurmurHash::initialize(), 0U);
|
||||
XCTAssertEqual(MurmurHash::initialize(31), 31U);
|
||||
|
||||
// In absence of real test vectors (64bit) for murmurhash I instead check if I can find duplicate hash values
|
||||
// in a deterministic and a random sequence of 100K values each.
|
||||
std::set<size_t> hashs;
|
||||
for (size_t i = 0; i < 100000; ++i) {
|
||||
std::vector<size_t> data = { i, static_cast<size_t>(i * M_PI), arc4random() };
|
||||
size_t hash = 0;
|
||||
for (auto value : data)
|
||||
hash = MurmurHash::update(hash, value);
|
||||
hash = MurmurHash::finish(hash, data.size());
|
||||
hashs.insert(hash);
|
||||
}
|
||||
XCTAssertEqual(hashs.size(), 100000U, @"At least one duplicate hash found.");
|
||||
|
||||
hashs.clear();
|
||||
for (size_t i = 0; i < 100000; ++i) {
|
||||
std::vector<size_t> data = { i, static_cast<size_t>(i * M_PI) };
|
||||
size_t hash = 0;
|
||||
for (auto value : data)
|
||||
hash = MurmurHash::update(hash, value);
|
||||
hash = MurmurHash::finish(hash, data.size());
|
||||
hashs.insert(hash);
|
||||
}
|
||||
XCTAssertEqual(hashs.size(), 100000U, @"At least one duplicate hash found.");
|
||||
|
||||
// Another test with fixed input but varying seeds.
|
||||
// Note: the higher the seed the less LSDs are in the result (for small input data).
|
||||
hashs.clear();
|
||||
std::vector<size_t> data = { L'µ', 'a', '@', '1' };
|
||||
for (size_t i = 0; i < 100000; ++i) {
|
||||
size_t hash = i;
|
||||
for (auto value : data)
|
||||
hash = MurmurHash::update(hash, value);
|
||||
hash = MurmurHash::finish(hash, data.size());
|
||||
hashs.insert(hash);
|
||||
}
|
||||
XCTAssertEqual(hashs.size(), 100000U, @"At least one duplicate hash found.");
|
||||
}
|
||||
|
||||
- (void)testInterval {
|
||||
// The Interval class contains no error handling (checks for invalid intervals), hence some of the results
|
||||
// look strange as we test of course such intervals as well.
|
||||
XCTAssertEqual(Interval().length(), 0UL);
|
||||
XCTAssertEqual(Interval(0, 0UL).length(), 1UL); // Remember: it's an inclusive interval.
|
||||
XCTAssertEqual(Interval(100, 100UL).length(), 1UL);
|
||||
XCTAssertEqual(Interval(-1L, -1).length(), 1UL); // Unwanted behavior: negative ranges.
|
||||
XCTAssertEqual(Interval(-1L, -2).length(), 0UL);
|
||||
XCTAssertEqual(Interval(100, 50UL).length(), 0UL);
|
||||
|
||||
XCTAssert(Interval() == Interval(-1L, -2));
|
||||
XCTAssert(Interval(0, 0UL) == Interval(0, 0UL));
|
||||
XCTAssertFalse(Interval(0, 1UL) == Interval(1, 2UL));
|
||||
|
||||
XCTAssertEqual(Interval().hashCode(), 22070U);
|
||||
XCTAssertEqual(Interval(0, 0UL).hashCode(), 22103U);
|
||||
XCTAssertEqual(Interval(10, 2000UL).hashCode(), 24413U);
|
||||
|
||||
// Results for the interval test functions in this order:
|
||||
// startsBeforeDisjoint
|
||||
// startsBeforeNonDisjoint
|
||||
// startsAfter
|
||||
// startsAfterDisjoint
|
||||
// startsAfterNonDisjoint
|
||||
// disjoint
|
||||
// adjacent
|
||||
// properlyContains
|
||||
|
||||
typedef std::vector<bool> TestResults;
|
||||
struct TestEntry { size_t runningNumber; Interval interval1, interval2; TestResults results; };
|
||||
std::vector<TestEntry> testData = {
|
||||
// Extreme cases + invalid intervals.
|
||||
{ 0, Interval(), Interval(10, 20UL), { true, false, false, false, false, true, false, false } },
|
||||
{ 1, Interval(1, 1UL), Interval(1, 1UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 2, Interval(10000, 10000UL), Interval(10000, 10000UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 3, Interval(100, 10UL), Interval(100, 10UL), { false, false, false, true, false, true, false, true } },
|
||||
{ 4, Interval(100, 10UL), Interval(10, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 5, Interval(10, 100UL), Interval(100, 10UL), { false, true, false, false, false, false, false, true } },
|
||||
|
||||
// First starts before second. End varies.
|
||||
{ 20, Interval(10, 12UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 21, Interval(10, 12UL), Interval(13, 100UL), { true, false, false, false, false, true, true, false } },
|
||||
{ 22, Interval(10, 12UL), Interval(14, 100UL), { true, false, false, false, false, true, false, false } },
|
||||
{ 23, Interval(10, 13UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 24, Interval(10, 14UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 25, Interval(10, 99UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 26, Interval(10, 100UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 27, Interval(10, 101UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 28, Interval(10, 1000UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
|
||||
// First and second start equal. End varies.
|
||||
{ 30, Interval(12, 12UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 31, Interval(12, 12UL), Interval(13, 100UL), { true, false, false, false, false, true, true, false } },
|
||||
{ 32, Interval(12, 12UL), Interval(14, 100UL), { true, false, false, false, false, true, false, false } },
|
||||
{ 33, Interval(12, 13UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 34, Interval(12, 14UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 35, Interval(12, 99UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 36, Interval(12, 100UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 37, Interval(12, 101UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 38, Interval(12, 1000UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
|
||||
// First starts after second. End varies.
|
||||
{ 40, Interval(15, 12UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 41, Interval(15, 12UL), Interval(13, 100UL), { false, false, true, false, true, false, true, false } },
|
||||
{ 42, Interval(15, 12UL), Interval(14, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 43, Interval(15, 13UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 44, Interval(15, 14UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 45, Interval(15, 99UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 46, Interval(15, 100UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 47, Interval(15, 101UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 48, Interval(15, 1000UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
|
||||
// First ends before second. Start varies.
|
||||
{ 50, Interval(10, 90UL), Interval(20, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 51, Interval(19, 90UL), Interval(20, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 52, Interval(20, 90UL), Interval(20, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 53, Interval(21, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 54, Interval(98, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 55, Interval(99, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 56, Interval(100, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 57, Interval(101, 90UL), Interval(20, 100UL), { false, false, true, true, false, true, true, false } },
|
||||
{ 58, Interval(1000, 90UL), Interval(20, 100UL), { false, false, true, true, false, true, false, false } },
|
||||
|
||||
// First and second end equal. Start varies.
|
||||
{ 60, Interval(10, 100UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 61, Interval(19, 100UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 62, Interval(20, 100UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 63, Interval(21, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 64, Interval(98, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 65, Interval(99, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 66, Interval(100, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 67, Interval(101, 100UL), Interval(20, 100UL), { false, false, true, true, false, true, true, false } },
|
||||
{ 68, Interval(1000, 100UL), Interval(20, 100UL), { false, false, true, true, false, true, false, false } },
|
||||
|
||||
// First ends after second. Start varies.
|
||||
{ 70, Interval(10, 1000UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 71, Interval(19, 1000UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 72, Interval(20, 1000UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 73, Interval(21, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 74, Interval(98, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 75, Interval(99, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 76, Interval(100, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 77, Interval(101, 1000UL), Interval(20, 100UL), { false, false, true, true, false, true, true, false } },
|
||||
{ 78, Interval(1000, 1000UL), Interval(20, 100UL), { false, false, true, true, false, true, false, false } },
|
||||
|
||||
// It's possible to add more tests with borders that touch each other (e.g. first starts before/on/after second
|
||||
// and first ends directly before/after second. However, such cases are not handled differently in the Interval
|
||||
// class
|
||||
// (only adjacent intervals, where first ends directly before second starts and vice versa. So I ommitted them here.
|
||||
};
|
||||
|
||||
for (auto &entry : testData) {
|
||||
XCTAssert(entry.interval1.startsBeforeDisjoint(entry.interval2) == entry.results[0], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsBeforeNonDisjoint(entry.interval2) == entry.results[1], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsAfter(entry.interval2) == entry.results[2], @"entry: %zu", entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsAfterDisjoint(entry.interval2) == entry.results[3], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsAfterNonDisjoint(entry.interval2) == entry.results[4], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.disjoint(entry.interval2) == entry.results[5], @"entry: %zu", entry.runningNumber);
|
||||
XCTAssert(entry.interval1.adjacent(entry.interval2) == entry.results[6], @"entry: %zu", entry.runningNumber);
|
||||
XCTAssert(entry.interval1.properlyContains(entry.interval2) == entry.results[7], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
}
|
||||
|
||||
XCTAssert(Interval().Union(Interval(10, 100UL)) == Interval(-1L, 100));
|
||||
XCTAssert(Interval(10, 10UL).Union(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(10, 11UL).Union(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(10, 1000UL).Union(Interval(10, 100UL)) == Interval(10, 1000UL));
|
||||
XCTAssert(Interval(1000, 30UL).Union(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(1000, 2000UL).Union(Interval(10, 100UL)) == Interval(10, 2000UL));
|
||||
XCTAssert(Interval(500, 2000UL).Union(Interval(10, 1000UL)) == Interval(10, 2000UL));
|
||||
|
||||
XCTAssert(Interval().intersection(Interval(10, 100UL)) == Interval(10, -2L));
|
||||
XCTAssert(Interval(10, 10UL).intersection(Interval(10, 100UL)) == Interval(10, 10UL));
|
||||
XCTAssert(Interval(10, 11UL).intersection(Interval(10, 100UL)) == Interval(10, 11UL));
|
||||
XCTAssert(Interval(10, 1000UL).intersection(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(1000, 30UL).intersection(Interval(10, 100UL)) == Interval(1000, 30UL));
|
||||
XCTAssert(Interval(1000, 2000UL).intersection(Interval(10, 100UL)) == Interval(1000, 100UL));
|
||||
XCTAssert(Interval(500, 2000UL).intersection(Interval(10, 1000UL)) == Interval(500, 1000UL));
|
||||
|
||||
XCTAssert(Interval().toString() == "-1..-2");
|
||||
XCTAssert(Interval(10, 10UL).toString() == "10..10");
|
||||
XCTAssert(Interval(1000, 2000UL).toString() == "1000..2000");
|
||||
XCTAssert(Interval(500UL, INT_MAX).toString() == "500.." + std::to_string(INT_MAX));
|
||||
}
|
||||
|
||||
- (void)testIntervalSet {
|
||||
XCTAssertFalse(IntervalSet().isReadOnly());
|
||||
XCTAssert(IntervalSet().isEmpty());
|
||||
|
||||
IntervalSet set1;
|
||||
set1.setReadOnly(true);
|
||||
XCTAssert(set1.isReadOnly());
|
||||
|
||||
XCTAssert(IntervalSet() == IntervalSet::EMPTY_SET);
|
||||
|
||||
std::vector<Interval> intervals = { Interval(), Interval(10, 20UL), Interval(20, 100UL), Interval(1000, 2000UL) };
|
||||
IntervalSet set2(intervals);
|
||||
XCTAssertFalse(set2.isEmpty());
|
||||
XCTAssertFalse(set2.contains(9UL));
|
||||
XCTAssert(set2.contains(10UL));
|
||||
XCTAssert(set2.contains(20UL));
|
||||
XCTAssertTrue(set2.contains(22UL));
|
||||
XCTAssert(set2.contains(1111UL));
|
||||
XCTAssertFalse(set2.contains(10000UL));
|
||||
XCTAssertEqual(set2.getSingleElement(), Token::INVALID_TYPE);
|
||||
XCTAssertEqual(set2.getMinElement(), -1);
|
||||
XCTAssertEqual(set2.getMaxElement(), 2000);
|
||||
|
||||
IntervalSet set3(set2);
|
||||
XCTAssertFalse(set3.isEmpty());
|
||||
XCTAssertFalse(set3.contains(9UL));
|
||||
XCTAssert(set3.contains(10UL));
|
||||
XCTAssert(set3.contains(20UL));
|
||||
XCTAssertTrue(set3.contains(22UL));
|
||||
XCTAssert(set3.contains(1111UL));
|
||||
XCTAssertFalse(set3.contains(10000UL));
|
||||
XCTAssertEqual(set3.getSingleElement(), Token::INVALID_TYPE);
|
||||
XCTAssertEqual(set3.getMinElement(), 10);
|
||||
XCTAssertEqual(set3.getMaxElement(), 2000);
|
||||
|
||||
set3.add(Interval(100, 1000UL));
|
||||
XCTAssertEqual(set3.getMinElement(), 10);
|
||||
set3.add(Interval(9, 1000UL));
|
||||
XCTAssertEqual(set3.getMinElement(), 9);
|
||||
set3.add(Interval(1, 1UL));
|
||||
XCTAssertEqual(set3.getMinElement(), 1);
|
||||
|
||||
IntervalSet set4;
|
||||
set4.add(10);
|
||||
XCTAssertEqual(set4.getSingleElement(), 10);
|
||||
XCTAssertEqual(set4.getMinElement(), 10);
|
||||
XCTAssertEqual(set4.getMaxElement(), 10);
|
||||
|
||||
set4.clear();
|
||||
XCTAssert(set4.isEmpty());
|
||||
set4.add(Interval(10, 10UL));
|
||||
XCTAssertEqual(set4.getSingleElement(), 10);
|
||||
XCTAssertEqual(set4.getMinElement(), 10);
|
||||
XCTAssertEqual(set4.getMaxElement(), 10);
|
||||
set4.setReadOnly(true);
|
||||
try {
|
||||
set4.clear();
|
||||
XCTFail(@"Expected exception");
|
||||
} catch (IllegalStateException &e) {
|
||||
}
|
||||
|
||||
try {
|
||||
set4.setReadOnly(false);
|
||||
XCTFail(@"Expected exception");
|
||||
} catch (IllegalStateException &e) {
|
||||
}
|
||||
|
||||
try {
|
||||
set4 = IntervalSet::of(12345);
|
||||
XCTFail(@"Expected exception");
|
||||
} catch (IllegalStateException &e) {
|
||||
}
|
||||
|
||||
IntervalSet set5 = IntervalSet::of(12345);
|
||||
XCTAssertEqual(set5.getSingleElement(), 12345);
|
||||
XCTAssertEqual(set5.getMinElement(), 12345);
|
||||
XCTAssertEqual(set5.getMaxElement(), 12345);
|
||||
|
||||
IntervalSet set6(10, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50);
|
||||
XCTAssertEqual(set6.getMinElement(), 5);
|
||||
XCTAssertEqual(set6.getMaxElement(), 50);
|
||||
XCTAssertEqual(set6.size(), 10U);
|
||||
set6.add(12, 18);
|
||||
XCTAssertEqual(set6.size(), 16U); // (15, 15) replaced by (12, 18)
|
||||
set6.add(9, 33);
|
||||
XCTAssertEqual(set6.size(), 30U); // (10, 10), (12, 18), (20, 20), (25, 25) and (30, 30) replaced by (9, 33)
|
||||
|
||||
XCTAssert(IntervalSet(3, 1, 2, 10).Or(IntervalSet(3, 1, 2, 5)) == IntervalSet(4, 1, 2, 5, 10));
|
||||
XCTAssert(IntervalSet({ Interval(2, 10UL) }).Or(IntervalSet({ Interval(5, 8UL) })) == IntervalSet({ Interval(2, 10UL) }));
|
||||
|
||||
XCTAssert(IntervalSet::of(1, 10).complement(IntervalSet::of(7, 55)) == IntervalSet::of(11, 55));
|
||||
XCTAssert(IntervalSet::of(1, 10).complement(IntervalSet::of(20, 55)) == IntervalSet::of(20, 55));
|
||||
XCTAssert(IntervalSet::of(1, 10).complement(IntervalSet::of(5, 6)) == IntervalSet::EMPTY_SET);
|
||||
XCTAssert(IntervalSet::of(15, 20).complement(IntervalSet::of(7, 55)) ==
|
||||
IntervalSet({ Interval(7, 14UL), Interval(21, 55UL) }));
|
||||
XCTAssert(IntervalSet({ Interval(1, 10UL), Interval(30, 35UL) }).complement(IntervalSet::of(7, 55)) ==
|
||||
IntervalSet({ Interval(11, 29UL), Interval(36, 55UL) }));
|
||||
|
||||
XCTAssert(IntervalSet::of(1, 10).And(IntervalSet::of(7, 55)) == IntervalSet::of(7, 10));
|
||||
XCTAssert(IntervalSet::of(1, 10).And(IntervalSet::of(20, 55)) == IntervalSet::EMPTY_SET);
|
||||
XCTAssert(IntervalSet::of(1, 10).And(IntervalSet::of(5, 6)) == IntervalSet::of(5, 6));
|
||||
XCTAssert(IntervalSet::of(15, 20).And(IntervalSet::of(7, 55)) == IntervalSet::of(15, 20));
|
||||
|
||||
XCTAssert(IntervalSet::of(1, 10).subtract(IntervalSet::of(7, 55)) == IntervalSet::of(1, 6));
|
||||
XCTAssert(IntervalSet::of(1, 10).subtract(IntervalSet::of(20, 55)) == IntervalSet::of(1, 10));
|
||||
XCTAssert(IntervalSet::of(1, 10).subtract(IntervalSet::of(5, 6)) ==
|
||||
IntervalSet({ Interval(1, 4UL), Interval(7, 10UL) }));
|
||||
XCTAssert(IntervalSet::of(15, 20).subtract(IntervalSet::of(7, 55)) == IntervalSet::EMPTY_SET);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* [The "BSD license"]
|
||||
* Copyright (c) 2015 Dan McLaughlin
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#include "ParserATNSimulator.h"
|
||||
#include "DFA.h"
|
||||
#include "ATN.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
@interface antlrcpp_Tests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation antlrcpp_Tests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,585 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2707D9C22764C11300D99A45 /* libantlr4-runtime.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */; };
|
||||
270925B11CDB455B00522D32 /* TLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */; };
|
||||
2747A7131CA6C46C0030247B /* InputHandlingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2747A7121CA6C46C0030247B /* InputHandlingTests.mm */; };
|
||||
274FC6D91CA96B6C008D4374 /* MiscClassTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */; };
|
||||
27C66A6A1C9591280021E494 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C66A691C9591280021E494 /* main.cpp */; };
|
||||
27C6E1801C972FFC0079AF06 /* TParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E1741C972FFC0079AF06 /* TParser.cpp */; };
|
||||
27C6E1811C972FFC0079AF06 /* TParserBaseListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E1771C972FFC0079AF06 /* TParserBaseListener.cpp */; };
|
||||
27C6E1821C972FFC0079AF06 /* TParserBaseVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E1791C972FFC0079AF06 /* TParserBaseVisitor.cpp */; };
|
||||
27C6E1831C972FFC0079AF06 /* TParserListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E17B1C972FFC0079AF06 /* TParserListener.cpp */; };
|
||||
27C6E1841C972FFC0079AF06 /* TParserVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E17D1C972FFC0079AF06 /* TParserVisitor.cpp */; };
|
||||
37F1356D1B4AC02800E0CACF /* antlrcpp_Tests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37F1356C1B4AC02800E0CACF /* antlrcpp_Tests.mm */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
2707D9BB2764C04C00D99A45 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 37D727AA1867AF1E007B6D10;
|
||||
remoteInfo = antlr4;
|
||||
};
|
||||
2707D9BD2764C04C00D99A45 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 37C147171B4D5A04008EDDDB;
|
||||
remoteInfo = antlr4_static;
|
||||
};
|
||||
2707D9BF2764C04C00D99A45 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 270C67F01CDB4F1E00116E17;
|
||||
remoteInfo = antlr4_ios;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
27C66A651C9591280021E494 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = antlrcpp.xcodeproj; path = ../../runtime/antlrcpp.xcodeproj; sourceTree = "<group>"; };
|
||||
2747A7121CA6C46C0030247B /* InputHandlingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InputHandlingTests.mm; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MiscClassTests.mm; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||
27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TLexer.cpp; path = ../generated/TLexer.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27A23EA21CC2A8D60036D8A3 /* TLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TLexer.h; path = ../generated/TLexer.h; sourceTree = "<group>"; };
|
||||
27C66A671C9591280021E494 /* antlr4-cpp-demo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "antlr4-cpp-demo"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
27C66A691C9591280021E494 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C66A731C9592400021E494 /* TLexer.g4 */ = {isa = PBXFileReference; lastKnownFileType = text; name = TLexer.g4; path = ../../TLexer.g4; sourceTree = "<group>"; };
|
||||
27C66A741C9592400021E494 /* TParser.g4 */ = {isa = PBXFileReference; lastKnownFileType = text; name = TParser.g4; path = ../../TParser.g4; sourceTree = "<group>"; };
|
||||
27C6E1741C972FFC0079AF06 /* TParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParser.cpp; path = ../generated/TParser.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C6E1751C972FFC0079AF06 /* TParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParser.h; path = ../generated/TParser.h; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C6E1771C972FFC0079AF06 /* TParserBaseListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserBaseListener.cpp; path = ../generated/TParserBaseListener.cpp; sourceTree = "<group>"; };
|
||||
27C6E1781C972FFC0079AF06 /* TParserBaseListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserBaseListener.h; path = ../generated/TParserBaseListener.h; sourceTree = "<group>"; };
|
||||
27C6E1791C972FFC0079AF06 /* TParserBaseVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserBaseVisitor.cpp; path = ../generated/TParserBaseVisitor.cpp; sourceTree = "<group>"; };
|
||||
27C6E17B1C972FFC0079AF06 /* TParserListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserListener.cpp; path = ../generated/TParserListener.cpp; sourceTree = "<group>"; };
|
||||
27C6E17C1C972FFC0079AF06 /* TParserListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserListener.h; path = ../generated/TParserListener.h; sourceTree = "<group>"; };
|
||||
27C6E17D1C972FFC0079AF06 /* TParserVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserVisitor.cpp; path = ../generated/TParserVisitor.cpp; sourceTree = "<group>"; };
|
||||
27C6E1851C97322F0079AF06 /* TParserBaseVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserBaseVisitor.h; path = ../generated/TParserBaseVisitor.h; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C6E1861C97322F0079AF06 /* TParserVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserVisitor.h; path = ../generated/TParserVisitor.h; sourceTree = "<group>"; };
|
||||
37F135681B4AC02800E0CACF /* antlrcpp Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "antlrcpp Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
37F1356B1B4AC02800E0CACF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
37F1356C1B4AC02800E0CACF /* antlrcpp_Tests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = antlrcpp_Tests.mm; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
27C66A641C9591280021E494 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2707D9C22764C11300D99A45 /* libantlr4-runtime.dylib in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37F135651B4AC02800E0CACF /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2707D9B62764C04C00D99A45 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */,
|
||||
2707D9BE2764C04C00D99A45 /* libantlr4-runtime.a */,
|
||||
2707D9C02764C04C00D99A45 /* antlr4_ios.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2707D9C12764C11300D99A45 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
27874F221CCBB34200AF1C53 /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
27C66A5C1C958EB50021E494 /* generated */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */,
|
||||
27A23EA21CC2A8D60036D8A3 /* TLexer.h */,
|
||||
27C6E1741C972FFC0079AF06 /* TParser.cpp */,
|
||||
27C6E1751C972FFC0079AF06 /* TParser.h */,
|
||||
27C6E1771C972FFC0079AF06 /* TParserBaseListener.cpp */,
|
||||
27C6E1781C972FFC0079AF06 /* TParserBaseListener.h */,
|
||||
27C6E1791C972FFC0079AF06 /* TParserBaseVisitor.cpp */,
|
||||
27C6E1851C97322F0079AF06 /* TParserBaseVisitor.h */,
|
||||
27C6E17B1C972FFC0079AF06 /* TParserListener.cpp */,
|
||||
27C6E17C1C972FFC0079AF06 /* TParserListener.h */,
|
||||
27C6E17D1C972FFC0079AF06 /* TParserVisitor.cpp */,
|
||||
27C6E1861C97322F0079AF06 /* TParserVisitor.h */,
|
||||
);
|
||||
name = generated;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
27C66A681C9591280021E494 /* antlr4-cpp-demo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
27C66A691C9591280021E494 /* main.cpp */,
|
||||
27C66A731C9592400021E494 /* TLexer.g4 */,
|
||||
27C66A741C9592400021E494 /* TParser.g4 */,
|
||||
);
|
||||
path = "antlr4-cpp-demo";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37D727A11867AF1E007B6D10 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */,
|
||||
27C66A681C9591280021E494 /* antlr4-cpp-demo */,
|
||||
37F135691B4AC02800E0CACF /* antlrcpp Tests */,
|
||||
27C66A5C1C958EB50021E494 /* generated */,
|
||||
27874F221CCBB34200AF1C53 /* Linked Frameworks */,
|
||||
37D727AB1867AF1E007B6D10 /* Products */,
|
||||
2707D9C12764C11300D99A45 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37D727AB1867AF1E007B6D10 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
37F135681B4AC02800E0CACF /* antlrcpp Tests.xctest */,
|
||||
27C66A671C9591280021E494 /* antlr4-cpp-demo */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37F135691B4AC02800E0CACF /* antlrcpp Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
37F1356A1B4AC02800E0CACF /* Supporting Files */,
|
||||
37F1356C1B4AC02800E0CACF /* antlrcpp_Tests.mm */,
|
||||
2747A7121CA6C46C0030247B /* InputHandlingTests.mm */,
|
||||
274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */,
|
||||
);
|
||||
path = "antlrcpp Tests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37F1356A1B4AC02800E0CACF /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
37F1356B1B4AC02800E0CACF /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
27C66A661C9591280021E494 /* antlr4-cpp-demo */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 27C66A6B1C9591280021E494 /* Build configuration list for PBXNativeTarget "antlr4-cpp-demo" */;
|
||||
buildPhases = (
|
||||
27C66A721C9591EF0021E494 /* Generate Parser */,
|
||||
27C66A631C9591280021E494 /* Sources */,
|
||||
27C66A641C9591280021E494 /* Frameworks */,
|
||||
27C66A651C9591280021E494 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "antlr4-cpp-demo";
|
||||
productName = "antlr4-cpp-demo";
|
||||
productReference = 27C66A671C9591280021E494 /* antlr4-cpp-demo */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
37F135671B4AC02800E0CACF /* antlrcpp Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 37F135731B4AC02800E0CACF /* Build configuration list for PBXNativeTarget "antlrcpp Tests" */;
|
||||
buildPhases = (
|
||||
37F135641B4AC02800E0CACF /* Sources */,
|
||||
37F135651B4AC02800E0CACF /* Frameworks */,
|
||||
37F135661B4AC02800E0CACF /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "antlrcpp Tests";
|
||||
productName = "antlrcpp Tests";
|
||||
productReference = 37F135681B4AC02800E0CACF /* antlrcpp Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
37D727A21867AF1E007B6D10 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = "ANTLR4 Project";
|
||||
TargetAttributes = {
|
||||
27C66A661C9591280021E494 = {
|
||||
CreatedOnToolsVersion = 7.2.1;
|
||||
};
|
||||
37F135671B4AC02800E0CACF = {
|
||||
CreatedOnToolsVersion = 6.3.2;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 37D727A51867AF1E007B6D10 /* Build configuration list for PBXProject "antlrcpp-demo" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 37D727A11867AF1E007B6D10;
|
||||
productRefGroup = 37D727AB1867AF1E007B6D10 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 2707D9B62764C04C00D99A45 /* Products */;
|
||||
ProjectRef = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
37F135671B4AC02800E0CACF /* antlrcpp Tests */,
|
||||
27C66A661C9591280021E494 /* antlr4-cpp-demo */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = "compiled.mach-o.dylib";
|
||||
path = "libantlr4-runtime.dylib";
|
||||
remoteRef = 2707D9BB2764C04C00D99A45 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2707D9BE2764C04C00D99A45 /* libantlr4-runtime.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libantlr4-runtime.a";
|
||||
remoteRef = 2707D9BD2764C04C00D99A45 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2707D9C02764C04C00D99A45 /* antlr4_ios.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = antlr4_ios.framework;
|
||||
remoteRef = 2707D9BF2764C04C00D99A45 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
37F135661B4AC02800E0CACF /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
27C66A721C9591EF0021E494 /* Generate Parser */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Generate Parser";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "pushd ..\nif [ TParser.g4 -nt generated/TParser.cpp -o TLexer.g4 -nt generated/TLexer.cpp ]; then\n./generate.sh;\nfi\npopd\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
27C66A631C9591280021E494 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
27C66A6A1C9591280021E494 /* main.cpp in Sources */,
|
||||
27C6E1821C972FFC0079AF06 /* TParserBaseVisitor.cpp in Sources */,
|
||||
270925B11CDB455B00522D32 /* TLexer.cpp in Sources */,
|
||||
27C6E1831C972FFC0079AF06 /* TParserListener.cpp in Sources */,
|
||||
27C6E1811C972FFC0079AF06 /* TParserBaseListener.cpp in Sources */,
|
||||
27C6E1841C972FFC0079AF06 /* TParserVisitor.cpp in Sources */,
|
||||
27C6E1801C972FFC0079AF06 /* TParser.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37F135641B4AC02800E0CACF /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37F1356D1B4AC02800E0CACF /* antlrcpp_Tests.mm in Sources */,
|
||||
2747A7131CA6C46C0030247B /* InputHandlingTests.mm in Sources */,
|
||||
274FC6D91CA96B6C008D4374 /* MiscClassTests.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
27C66A6C1C9591280021E494 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
27C66A6D1C9591280021E494 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
37D727B51867AF1E007B6D10 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../runtime/src/tree/pattern,
|
||||
../../runtime/src/tree,
|
||||
../../runtime/src/support,
|
||||
../../runtime/src/misc,
|
||||
../../runtime/src/dfa,
|
||||
../../runtime/src/atn,
|
||||
../../runtime/src,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.1;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
37D727B61867AF1E007B6D10 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../runtime/src/tree/pattern,
|
||||
../../runtime/src/tree,
|
||||
../../runtime/src/support,
|
||||
../../runtime/src/misc,
|
||||
../../runtime/src/dfa,
|
||||
../../runtime/src/atn,
|
||||
../../runtime/src,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.1;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
37F135711B4AC02800E0CACF /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "antlrcpp Tests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.antlr.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
37F135721B4AC02800E0CACF /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "antlrcpp Tests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.antlr.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
27C66A6B1C9591280021E494 /* Build configuration list for PBXNativeTarget "antlr4-cpp-demo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
27C66A6C1C9591280021E494 /* Debug */,
|
||||
27C66A6D1C9591280021E494 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
37D727A51867AF1E007B6D10 /* Build configuration list for PBXProject "antlrcpp-demo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
37D727B51867AF1E007B6D10 /* Debug */,
|
||||
37D727B61867AF1E007B6D10 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
37F135731B4AC02800E0CACF /* Build configuration list for PBXNativeTarget "antlrcpp Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
37F135711B4AC02800E0CACF /* Debug */,
|
||||
37F135721B4AC02800E0CACF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 37D727A21867AF1E007B6D10 /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37F135671B4AC02800E0CACF"
|
||||
BuildableName = "antlrcpp Tests.xctest"
|
||||
BlueprintName = "antlrcpp Tests"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37F135671B4AC02800E0CACF"
|
||||
BuildableName = "antlrcpp Tests.xctest"
|
||||
BlueprintName = "antlrcpp Tests"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
43
antlr/antlr4-runtime-4.12.0/demo/Mac/build.sh
Executable file
43
antlr/antlr4-runtime-4.12.0/demo/Mac/build.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# [The "BSD license"]
|
||||
# Copyright (c) 2013 Terence Parr
|
||||
# Copyright (c) 2013 Dan McLaughlin
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
ANTLRCPP_XCODEPROJ="${CURRENT_DIR}/antlrcpp.xcodeproj"
|
||||
|
||||
# OS X
|
||||
xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp -configuration Release $@
|
||||
xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp -configuration Debug $@
|
||||
|
||||
# iOS
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone -configuration Release -sdk iphoneos $@
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone -configuration Debug -sdk iphoneos $@
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone_sim -configuration Release -sdk iphonesimulator $@
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone_sim -configuration Debug -sdk iphonesimulator $@
|
||||
|
||||
Reference in New Issue
Block a user