Commit Graph

1683 Commits

Author SHA1 Message Date
Nathan Burles 198da78c98 Compare contents in SemanticContext::*::operator== 2016-08-01 16:32:51 +01:00
Nathan Burles 739bf3a756 Compare contents in LexerATNConfig::operator== 2016-08-01 16:31:48 +01:00
Nathan Burles 903fa473c5 Compare contents in ATNConfigSet::operator== 2016-08-01 16:26:37 +01:00
Nathan Burles a025c9eefc Compare contents in ATNConfig::operator== 2016-08-01 16:25:37 +01:00
Mike Lischke 282e193e6a Corrected an include. 2016-07-31 16:10:39 +02:00
Mike Lischke eee86d8292 Small updates for VS 2013/2015.
Updated the demo project to also use static/dynamic libs like the runtime and fixed a few warnings in the Any class.
2016-07-31 13:28:01 +02:00
Mike Lischke 8a5f6815fe Rework of the visitor implementation
The translation from Java generics to templates in C++ lead to the need of virtual template functions, which is not supported by C++. Instead we use now the Any class for results of visits and no longer need templates for that part.
2016-07-30 20:03:27 +02:00
Tim O'Callaghan 7724dd2cd5 external project cmake example, needed set C++ 11 2016-07-24 22:13:17 +02:00
Tim O'Callaghan d6d50457ff Updated CMake for demo to:
- Only require JRE
- Support out of tree build from antlr repostitory
- Support Superproject build with ExternalAntlr4Cpp cmake module

ExternalAntlr4Cpp module has quickstart documentation for people to be
able to start working quicly with antlr4cpp from the base demo sources
see source file for example.
2016-07-24 21:58:45 +02:00
Mike Lischke 365e0f2df0 Fixed a few warnings. 2016-07-22 16:33:43 +02:00
Mike Lischke d46ef90aa0 Fixed some cmake issues. Closes issue #13 and issue #8.
Additionally a warning was fixed (std::move prevents copy elision)
2016-07-20 16:24:12 +02:00
Mike Lischke 196e8ab53d Actually use a channel in the demo grammar. 2016-07-20 15:22:09 +02:00
Mike Lischke 5e313471df Merge pull request #19 from nburles/fix-utf8-bom
Added code to detect and handle the UTF-8 BOM if present
2016-07-20 15:20:31 +02:00
Mike Lischke be2c98f64f Merge pull request #18 from nburles/fix-intervalset-iterator
vector::erase invalidates any iterators at/after the erase position
2016-07-20 15:16:26 +02:00
Mike Lischke 91a7657d73 A few small corrections after the previous merge. 2016-07-20 12:32:02 +02:00
Nathan Burles 78de172790 Fix warnings with int to char cast 2016-07-19 11:46:24 +01:00
Nathan Burles d3027f18fb Added code to detect and handle the UTF-8 BOM if present, otherwise the utfConverter leaves it in the stream 2016-07-19 11:31:03 +01:00
Nathan Burles ba5cf0060c vector::erase invalidates any iterators at/after the erase position 2016-07-18 13:52:45 +01:00
Nic30 22794aa2d8 fix liblib in library names 2016-07-07 12:48:33 +02:00
Nic30 1ceb6a45dd indent fix 2016-07-07 12:43:03 +02:00
Nic30 027dde5e3e LexerAction instances shared_ptr fix 2016-07-07 12:33:59 +02:00
Chris Heller c4785ab8be Document cmake minimum version.
Document the minimum cmake version needed to build C++ target (if compiling with cmake).  Also, fix a missing space in cmake command between directory path and defining where the ANTLR .jar is located.
2016-06-26 15:28:26 -07:00
Mike Lischke 8046c28a5e A few more text escape calls in DefaultErrorStrategy.
And some cleanup.
2016-06-26 11:35:38 +02:00
Mike Lischke c462e03126 Merge branch 'master_upstream' 2016-06-26 11:12:23 +02:00
Mike Lischke 2352ff03e1 getSerializedATN() wasn't properly overwritten. 2016-06-26 11:10:31 +02:00
nuuman a2d6b62a1a Update DefaultErrorStrategy.cpp
Property escape vocabulary reporting
2016-06-25 21:06:53 +02:00
Eric Vergnaud 26c409103d Fix #1217
The root cause was that ATNConfigSet was not using he required custom hashing strategy for ParserATNSimulator.
The commit includes a number of additional fixes, related to code that was never executed before due to the root cause.
A similar issue is also likely to exist in the JavaScript runtime, I'll fix it later.
2016-06-23 15:51:39 +02:00
Eric Vergnaud c260ce75d1 make it possible to add breakpoint 2016-06-23 15:06:14 +02:00
Mike Lischke c8f80b167d Small naming fix. 2016-06-22 11:24:26 +02:00
Mike Lischke a127f34a74 Changed Win deployment script to produce 2 smaller zips instead of a big one. 2016-06-22 10:56:38 +02:00
Mike Lischke 1da7e8eea0 Fixed #include. 2016-06-21 16:28:44 +02:00
Mike Lischke a2f5cf12fd Fixed + simplified loading text to parse from a file.
- The previous approach to load and convert UTF-8 data via a stream didn't work well, so I replaced that with a simple load-to-buffer + convert buffer from UTF-8 to UTF-32.
- Removed deleted Token.cpp file from XCode project.
2016-06-21 16:23:28 +02:00
Mike Lischke 8c62740f16 Missed to commit an XCode project change. 2016-06-21 10:53:36 +02:00
Mike Lischke d718fa9f44 Windows runtime deployment.
- Created deployment script for Windows + updated doc/releasing-antlr.md.
- Created projects for both VS2013 and VS2015 to be used by the deployment script.
- Fixed trouble with a bug in VS2015 where std::codecvt_utf8<char32_t> is not properly supported.
- Fixed a few #include paths + a number of warnings.
2016-06-21 10:51:31 +02:00
Mike Lischke 89442c6cb8 Changes for deployment.
- Settled on a final library name scheme: base part is "libantlr4-runtime" on MacOS + Linux. The extension determines the type (.a static lib, .dylib dynamic lib in MacOS, .so dynamic lib in Linux). No more mention of target language (cpp) or type (static) in the lib name. On Windows we omit the lib prefix, so the name becomes: antlr4-runtime.dll + antlr4-runtime.lib. We may later want to add version information there, but doing that automatically is difficult.
- Updated XCode project and CMakeLists.txt file for the new naming scheme.
- Added deployment scripts for source code (for Linux + iOS) and MacOS.
- Added C++ section in docs/releasing-antlr.md.
2016-06-19 15:31:09 +02:00
Mike Lischke 19dbd8e746 A fix for the Linux demo project. 2016-06-17 15:54:21 +02:00
Mike Lischke 3b5b400d03 A few fixes for the previous listener change.
Also fixed runtime tests again.
2016-06-17 11:27:52 +02:00
Mike Lischke 4a7ec859aa Simplified parse tree listener handling.
No need to use shared_ptr for management. Listeners are, like the other main classes (parser, lexer, input stream etc.) provided by the application and hence managed there.
2016-06-17 10:22:19 +02:00
Mike Lischke dd48c0fbd5 A few final touches to make runtime tests passing. 2016-06-16 11:20:42 +02:00
Mike Lischke e68cdc3c0e A few of the previously reverted changes are still good. 2016-06-15 13:46:27 +02:00
Mike Lischke 4a8010b4eb Revert "A few more places that no longer pass a shared_ptr around."
This reverts commit 728af59528.
2016-06-15 13:30:37 +02:00
Mike Lischke 728af59528 A few more places that no longer pass a shared_ptr around. 2016-06-14 15:17:23 +02:00
Mike Lischke dcb0d4aa62 Some cleanup. 2016-06-14 14:05:18 +02:00
Mike Lischke 7ac5252fe9 Explicitly delete copy c-tor + copy operator to for Visual Studio.
VS requires to have copy operations disabled on classes which hold vectors of unique pointers (clang is a bit more relaxed about this).
2016-06-13 17:38:57 +02:00
Mike Lischke 7488621983 Visual Studio build fix. 2016-06-13 16:47:32 +02:00
Mike Lischke b9c28d8c9c Signficantly simplified Token handling.
In order to lower the overhead when passing around Token instances via smart pointers and because the ownership is clear (token streams own them), these instances can be passed as raw pointers.
2016-06-13 13:12:02 +02:00
Mike Lischke 23eeae4b44 Simplification of the ATN config lookup handling.
No need for the ConfigLookup(Impl) class as we only need a way to determine if a config has been added to a set or not. This can be done much simpler by using individual hash codes produced by either ATNConfigSet or OrderedATNConfigSet (idea taken from C# runtime).
2016-06-12 16:08:16 +02:00
Mike Lischke c920d57331 DFA states member is now a set (instead of a map). 2016-06-11 12:57:29 +02:00
Mike Lischke e9d2a04be1 Removed shared_ptr instances for ATNConfigSet.
ATNConfigSet instance follow a clear ownership (all owned by DFAState instances, which stay alive all time). Hence we can use a unique_ptr for memory management instead and pass raw pointers around where needed.
2016-06-10 16:13:15 +02:00
Mike Lischke fec23ce989 Simplified equality check in ATNConfigSet. 2016-06-10 14:58:22 +02:00