Commit Graph

6460 Commits

Author SHA1 Message Date
Jan Martin Mikkelsen 0c4473ea1a Merge https://github.com/antlr/antlr4 2017-06-26 17:22:44 +10:00
Terence Parr ff13553a2b Merge pull request #1921 from alimg/py-input-mismatch-error
Fix input mismatch errors not reported the same way as Java in Python
2017-06-25 09:05:41 -07:00
alimg 4b21583e2b signing in contributors.txt 2017-06-25 19:04:03 +03:00
alimg 60cce436c2 Merge branch 'master' of https://github.com/antlr/antlr4 into py-input-mismatch-error 2017-06-25 19:02:26 +03:00
Terence Parr 77f3c767b7 Merge pull request #1912 from danielkatz/patch-1
Update the example in JavaScript readme doc to 4.7
2017-06-25 08:39:20 -07:00
Terence Parr 645855a65a Merge pull request #1926 from ericvergnaud/fix-unicode-lexer
Fix #1925
2017-06-25 08:38:10 -07:00
Terence Parr e6a77c86da Merge pull request #1915 from danielkatz/patch-2
Update .Net NuGet package name to 4.7 with .NET Core target
2017-06-25 08:36:54 -07:00
Terence Parr 3a7c6a662a Merge pull request #1910 from mike-lischke/optimizations
Reverted removal of namespace.
2017-06-25 08:36:02 -07:00
Eric Vergnaud c3b742e090 also fix in go 2017-06-25 14:49:21 +08:00
Eric Vergnaud dbff375c54 fix failing test 2017-06-25 14:13:18 +08:00
Eric Vergnaud 2e56ccfe19 simplify test 2017-06-25 14:13:01 +08:00
Eric Vergnaud 0166ba95ac fix JavaScript too 2017-06-25 13:44:24 +08:00
Eric Vergnaud ff4ffa613b Fix ATN deserialisation for unicode chars FFFE and FFFF 2017-06-25 12:05:57 +08:00
Eric Vergnaud 94ca69b727 add test for #1925 2017-06-25 10:13:58 +08:00
alimg 405dc20488 add parser error test case to replicate the Python formatting issue 2017-06-20 16:48:08 +03:00
alimg f0d1a093ed Python: fix reported input alternatives are not in par with Java version 2017-06-19 18:55:48 +03:00
Daniel Katz 952b971728 Update .Net NuGet package name to 4.7 with .NET Core target 2017-06-14 11:22:47 +03:00
Daniel Katz 30836a47c5 CharStreams is deprecated in 4.7 2017-06-13 21:29:44 +03:00
Jan Martin Mikkelsen cdfe310c5d Merge branch 'optimizations' of https://github.com/mike-lischke/antlr4 2017-06-13 10:04:51 +10:00
Jan Martin Mikkelsen fdcfefa0a9 Convention: Change virtual dtor to empty bodies 2017-06-12 20:26:17 +10:00
Jan Martin Mikkelsen fad048897e SemanticContext::Operator: explicit virtual dtor 2017-06-12 19:44:34 +10:00
Jan Martin Mikkelsen 63fc7cb7a7 LexerActionType.h: Use antlr4-common.h for size_t 2017-06-12 19:42:04 +10:00
Mike Lischke 2b3dd222bd Reverted removal of namespace. 2017-06-12 09:26:11 +02:00
Jan Martin Mikkelsen aab2c043f0 Fix missed curly brace convention fix. 2017-06-12 11:26:06 +10:00
Jan Martin Mikkelsen 8c45d71673 Undo remove cast to same type in generated code 2017-06-12 11:13:42 +10:00
Jan Martin Mikkelsen 577b1d61bb Comply with curly brace conventions. 2017-06-12 11:10:32 +10:00
Jan Martin Mikkelsen 8fd4bcfa33 Add defined() before #if SYM > val evaluations
- Change "#if SYM > x" to "#if defined(SYM) && SYM > x" as a pattern. In
  StringUtils.h this follows the pattern used earlier in the file.
2017-06-12 10:46:29 +10:00
Jan Martin Mikkelsen 274e3c2d3b Change Lexer::{MORE,SKIP} def back to negative
- Explicitly cast negative values to size_t instead of using an offset
  from std::numeric_limts<size_t>::max().
2017-06-12 10:44:30 +10:00
Jan Martin Mikkelsen 6e46b168f5 Naming convention fix for qualifing shadowed args
- Change qualifying suffix from "_in" to "_" to confirm with
  conventions.
2017-06-12 10:23:47 +10:00
Jan Martin Mikkelsen dde893d365 Merge https://github.com/antlr/antlr4 2017-06-12 10:07:55 +10: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