Commit Graph

6481 Commits

Author SHA1 Message Date
Erik A. Brandstadmoen 85154d06ee Changed incorrect .js file endings to .cs in doc/charp-target.md 2017-06-11 23:43:39 +02:00
Terence Parr e9155ef9cb Merge pull request #1908 from mike-lischke/master-build-fix
[C++] Build fix/correction for UTF32 conversion.
2017-06-11 08:54:46 -07:00
Terence Parr 35cf1ba4ff Merge pull request #1907 from mike-lischke/optimizations
[C++] Small optimizations
2017-06-11 08:54:21 -07:00
Terence Parr ddfdcb5e77 Merge pull request #1897 from hanjoes/travis-linux
Swift Target Linux Support
2017-06-11 08:53:07 -07:00
Mike Lischke ef49f61819 Formatting 2017-06-11 13:31:33 +02:00
Mike Lischke bcb0a8f150 Revert "Simplify output path generation"
This reverts commit 47e43cc8d6.
2017-06-11 13:01:04 +02:00
Mike Lischke aad5faf819 Revert "Extended tokenVocab search to the grammar subfolder."
This reverts commit defad74649.
2017-06-11 12:57:49 +02:00
Jan Martin Mikkelsen 70402f8eff ATN: Remove race condition in addState(ATNState*)
This is a proposed fix to bug #1826 which removes a race condition where
multiple threads could update ATNState::nextTokenWithinRule, leading to
corrupted std::vector instances in an InstanceSet.
2017-06-11 11:23:33 +10:00
Jan Martin Mikkelsen 4a359c1831 ATN: Handle empty, read-only, nextTokenWithinRule
ATN::nextTokens(ATNState* s) updates s->nextTokenWithinRule if the
IntervalSet is empty, and then sets it to be read only. However, if the
updated IntervalSet value was also empty, it becomes a read-only empty
set, causing an exception on a second call on the same state.

This was exposed a change I made to make IntervalSet::operator=()
respect the _readonly flag. (Which in turn was found by compiling with a
high warningly level.)

The approach in this update is to perform the update if the updated
value is not empty or if the current value is not read only. This
preserves the previous behaviour of creating a read-only empty set and
working on subsequent calls. It will throw on an attempt to update a
read-only value, where previously the read-only value would be silently
discarded and set to updatable.
2017-06-11 09:53:47 +10:00
Jan Martin Mikkelsen eb02a05efb Possible fix for max_align_t breakage in Travis CI
The Travis CI build is failing after an include of <cstddef> -- This is
an attempt to work around that by including <stddef.h> instead. Problem
not apparent in my FreeBSD environment.
2017-06-10 19:56:31 +10:00
Jan Martin Mikkelsen 2d011c8e3a Remove C++14 auto return type on utf8_to_utf32
- Also remove static instance of std::wstring_convert. Access to
  std::wstring_convert<>::{from,to}_bytes() is not guaranteed to be thread
  safe.
2017-06-10 18:46:46 +10:00
Jan Martin Mikkelsen e0301636f0 Add myself to contributors.txt. 2017-06-10 18:01:23 +10:00
Jan Martin Mikkelsen 092afb283e C++ runtime changes for high warning levels
These changes are for compiling with high warning levels and -Werror.
There are no functional changes in this commit. Compiled with gcc 5.4
and clang 3.8.

Summary:

- Put virtual destructors into the appropriate .cpp file instead
  of the inline version in the header to avoid many vtables.
- Change C-style casts to modern C++ casts.
- Add explicit casts in some signed to/from unsigned conversions.
- Remove unreached code in BufferedTokenStream.cpp and
  LexerATNSimulator.cpp.
- Remove shadowed variables by qualifying constructor arguments with
  the name name as a member variable.
- Add explicitly defined copy constructors and assignment operators
  where required by gcc's -Weff-c++.
- Use std::numeric_limits<size_t>::max() instead of assigning a negative
  number.
- Remove semi-colons after function definitions.
- Remove unneccessary casts.
- In preprocessor statements "#if label > value" change to
  "#if defined(label) && label > value" to avoid warnings about the
  undefined symbol being seen as zero.
- Remove ANTLR4CPP_PUBLIC from "enum class" definitions.
- Change the FinalAction move constructor to move instead of copy the
  _cleanUp std::function object. (A side-effect of explicitly
  initialising member variables as required by gcc's -Weff-c++. I turned
  this one off because most constructors needed to be touched,
  especially the classes implemented with InitializeInstanceFields()).
- Mark hex digit conversion functions as file static in guid.cpp.
2017-06-10 17:29:25 +10:00
Jan Martin Mikkelsen 9845382e86 Implement IntervalSet::operator=() using the same semantics as the copy
constructor, put the destructor into the .cpp file so the vtable doesn't
get generated everywhere.
2017-06-10 16:47:01 +10:00
Mike Lischke cec714f745 Corrections for VS 2015. 2017-06-04 14:26:55 +02:00
Mike Lischke 19f584da05 Fixed build after UTF32 string convesion patch.
Also made converter local vars in conversion routines, instead of static global vars.
2017-06-04 12:24:06 +02:00
Mike Lischke 4fdcff6f05 Merge branch 'master-upstream' 2017-06-04 12:13:56 +02:00
Hanzhou Shi 4c0bbfd768 Marking Mutex.synchronized with rethrow. 2017-06-03 22:57:22 -07:00
Hanzhou Shi 53b83d7184 Refactored synchronization by using mutex. 2017-06-03 22:57:22 -07:00
Hanzhou Shi f15d9a31a3 revert one trivial change in go test. 2017-06-03 22:57:22 -07:00
Hanzhou Shi 13769268c9 fixing string issue. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 77eddc8e76 fix linker issue on travis ubuntu 2017-06-03 22:57:21 -07:00
Hanzhou Shi e8962dad7e reads SWIFT_HOME from environment variables. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 10a3ee3f49 adding travis configuration for swift under linux 2017-06-03 22:57:21 -07:00
Hanzhou Shi a64ec12e73 fixing tests, and some cleanups. 2017-06-03 22:57:21 -07:00
Hanzhou Shi a879297bb5 swift build & swift test support Linux platform 2017-06-03 22:57:21 -07:00
Hanzhou Shi 3095de982e All tests passing. But slow. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 8cbd7c0693 Get parser tests working. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 6acec92866 Refactoring swift test framework. 2017-06-03 22:57:21 -07:00
Hanzhou Shi d66f89db52 Removed xcworkspace. 2017-06-03 22:57:20 -07:00
Hanzhou Shi 67f683d0ac Adding generation of dyanmically linked lib. 2017-06-03 22:57:20 -07:00
Terence Parr 8cc91c3d4f Merge pull request #1894 from lys0716/patch-1
Typo in the comments of IntStream.java
2017-06-02 13:18:42 -07:00
Terence Parr fd1930e82b Merge pull request #1895 from kosak/doc2
Fix listener example in C++ documentation.
2017-06-02 13:18:06 -07:00
Corey Kosak 1bb3eb1ebf Fix listener example in C++ documentation.
The listener example still refers to Ref<> and shared pointers, but in
reality the generated method does not pass a shared pointer. The actual
signature looks more like this:

  virtual void enterKey(ParserRuleContext * /*ctx*/) override { }

This change updates the example to match that signature, and removes a line
discussing Ref<>. It also adds the "override" keyword in order to make the
user's code a little more robust against typos/changes in the grammar.
2017-06-01 11:15:48 -04:00
Mike Lischke 47d639e7b7 Merge branch 'master-upstream' 2017-06-01 09:04:43 +02:00
lys0716 22034daf25 Typo in the comments of IntStream.java
An extra word is in the comments.

Signed-off-by: Yishuang Lu luyscmu@gmail.com
2017-05-31 21:17:29 -07:00
Terence Parr fd5efc250d Merge pull request #1891 from kosak/master
Make ParseTreeWalker::DEFAULT provide an IterativeParseTreeWalker
2017-05-31 10:22:19 -07:00
Terence Parr 053c594fec Merge pull request #1886 from ericvergnaud/nuget-version
Set version to 4.7.1 because 4.7.0 already exists on Nuget
2017-05-31 10:21:49 -07:00
Terence Parr 7ce775dcaa Merge pull request #1862 from hanjoes/swift-py-script
Supporting Script for Swift Runtime
2017-05-31 10:19:19 -07:00
Terence Parr c97abe5bc2 Merge pull request #1831 from mike-lischke/issue1824
Update C++ target doc for latest API changes - fixes #1824.
2017-05-31 10:16:36 -07:00
Terence Parr 745c88a7c9 Merge pull request #1830 from mike-lischke/issue1827
Channel parameter in c-tor is now a size_t - fixes #1827.
2017-05-31 10:16:10 -07:00
Terence Parr 2c4a55c10a Merge pull request #1849 from shravanrn/master
Fix the utf8 convertor for VS2017
2017-05-31 08:01:31 -07:00
Corey Kosak 381fddebd5 Make ParseTreeWalker::DEFAULT provide an IterativeParseTreeWalker
as intended.

The existing code intended for ParseTreeWalker::DEFAULT to provide a
IterativeParseTreeWalker. However, the implementation initialized
ParseTreeWalker::DEFAULT by doing a (value) copy of an
IterativeParseTreeWalker, which sliced the object and therefore,
unfortunately, transformed it back into a regular ParseTreeWalker.

This change implements the desired behavior. Furthermore by making DEFAULT
a reference, we are able to preserve the interface to existing code.
2017-05-29 22:21:01 -04:00
Eric Vergnaud 44ab88c6f9 Set version to 4.7.1 because 4.7.0 already exists on Nuget 2017-05-28 20:47:58 +08:00
Terence Parr d0eaf29e51 Merge pull request #1884 from waf/dotnetcore-nuget-packaging
[dotnet] NuGet packaging for .NET Core
2017-05-27 07:46:36 -07:00
Will Fuqua efa8a1a9f8 sign the contributors.txt 2017-05-27 00:02:58 +07:00
Will Fuqua e39543a257 add build script and update docs 2017-05-27 00:02:54 +07:00
Will Fuqua e88eba13fb add dotnetcore dll to nuspec
as part of this, add OutputPath to the csproj so it matches the mono csproj OutputPath
2017-05-26 23:12:47 +07:00
Shravan Narayan 9220df2e37 Merge branch 'master' into master 2017-05-15 16:58:55 -07:00
shravanrn@gmail.com de6f04be0b Fix the utf8 convertor in VS2017 2017-05-15 16:53:05 -07:00