Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cpp #1346

Merged
merged 312 commits into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
312 commits
Select commit Hold shift + click to select a range
89093f7
Some finetuning in template files for C++.
mike-lischke May 1, 2016
7b030d6
A C++ runtime fix that caused test parsing to fail with syntax error.
mike-lischke May 1, 2016
185e956
VS solution update + compile fixes after latest changes.
mike-lischke May 2, 2016
c9c294a
2 smaller changes
mike-lischke May 2, 2016
6d9d52b
Solving a tricky issue with prematurely released prediction contexts.
mike-lischke May 3, 2016
d98f3f7
Fixed a number of subtle bugs that broke parsing.
mike-lischke May 3, 2016
aa88e7b
A bit more complex expression in demo parser.
mike-lischke May 3, 2016
5489ad2
A few changes in test files after running the test generator (mostly …
mike-lischke May 4, 2016
8ff8526
Updated Windows project to be compilable as both static and dynamic lib.
mike-lischke May 4, 2016
0fada33
Fix for a weird lambda execution problem in Windows.
mike-lischke May 5, 2016
dd43278
Linux + Mac build fixes.
mike-lischke May 5, 2016
6939b7f
Split XCode demo + libraries into individual projects.
mike-lischke May 5, 2016
9ca136a
Ignore jar files in the repo.
mike-lischke May 5, 2016
bfe3a7c
Renamed XCode demo project and set install name for dylib.
mike-lischke May 5, 2016
a83849a
Missing parts from the previous commit.
mike-lischke May 5, 2016
5780755
Reorganized runtime folder structure + created ios target in XCode.
mike-lischke May 5, 2016
a44741a
No need for public headers in an OSX dylib.
mike-lischke May 5, 2016
6ac56de
Updated OSX demo project after structure changes.
mike-lischke May 5, 2016
f30aa12
Updated VS solution after project restructuring.
mike-lischke May 5, 2016
04577d1
Merge branch 'master' of https://github.com/davesisson/antlr4
davesisson May 5, 2016
6433481
Added minimum set of files.
davesisson May 6, 2016
f018236
Added minimum set of files.
davesisson May 6, 2016
6c08a6e
update docs
davesisson May 6, 2016
b69076a
update docs
davesisson May 6, 2016
43dc1df
More needed files.
davesisson May 6, 2016
e4fd106
update packages
davesisson May 6, 2016
00083a7
Adding missing file.
davesisson May 6, 2016
297f003
Added more supported grammar sections (named actions).
mike-lischke May 6, 2016
6c21223
Added cmake target (Linux + OSX) + fixed a number of warnings.
mike-lischke May 6, 2016
ce1e72b
Merge branch 'feature/templates-org'
mike-lischke May 6, 2016
303684d
Removed jar that should not have been in the repository.
mike-lischke May 6, 2016
358bde8
Updated runtime tests with updated generation templates.
davesisson May 7, 2016
b976a49
fix which tests to run for cpp
davesisson May 7, 2016
eddf2a1
updating BaseCppTest.java
davesisson May 7, 2016
cbe9c2f
Returned other tests to active duty.
davesisson May 7, 2016
a212755
Cleaned up the test runner.
davesisson May 9, 2016
337f046
Added yet another possible code section + EOF rework.
mike-lischke May 9, 2016
faddb83
Enabled unused-parameter warning in XCode and fixed all occurences.
mike-lischke May 9, 2016
13b135f
VS warns about /* */ comments if the are directly after a *.
mike-lischke May 9, 2016
0835c52
Moved Marcin to Other Contributors list.
mike-lischke May 9, 2016
5653be3
Runtime Cpp: disable warnings and remove unnecessary files
May 9, 2016
db6f3c9
Added the start of linker support.
davesisson May 10, 2016
9920efd
More updates to the C++ test runner.
davesisson May 10, 2016
fda0210
Some updates to demo grammar, Cpp.stg and XCode projects.
mike-lischke May 10, 2016
d8442c0
Update VS solution (removed deleted file references).
mike-lischke May 10, 2016
23873b4
Fixed one more warning in VS.
mike-lischke May 10, 2016
33ba47b
Merge commit '303684dd34095f2f569b6b635ddb3f6f43d116e8' into feature/…
davesisson May 10, 2016
eb5760b
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4 into…
davesisson May 11, 2016
313c971
Bug fixes + update C++ template.
mike-lischke May 12, 2016
1cf3faf
Merge branch 'master' into feature/addtests
mike-lischke May 12, 2016
75bb338
Added 2 newer support classes to the runtime.
mike-lischke May 12, 2016
0eebbdd
Updated VS solution with newly added files.
mike-lischke May 12, 2016
66a9ee5
The generation + runtime now uses std::string instead of std::wstring…
mike-lischke May 13, 2016
2cbed81
Further work to have full Unicode support.
mike-lischke May 14, 2016
d95a0b6
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4
davesisson May 14, 2016
03024cb
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4 into…
davesisson May 14, 2016
33e3825
Merge branch 'feature/addtests' of https://github.com/DanMcLaughlin/a…
davesisson May 14, 2016
0617dff
Rework of the include structure.
mike-lischke May 15, 2016
cc50675
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4
davesisson May 17, 2016
1d6c66e
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4 into…
davesisson May 17, 2016
e2d545f
Changed exception object back in error reporting + removed precompile…
mike-lischke May 18, 2016
e572d17
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4 into…
davesisson May 19, 2016
e6ebc5c
Fixed demo compilation for Visual Studio 2013.
mike-lischke May 19, 2016
b0d5fed
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4 into…
davesisson May 21, 2016
6aa03ed
attempts compilation
davesisson May 21, 2016
ae4dcba
properly escape templates
davesisson May 21, 2016
aafc76a
Fixed big memory consumption problem.
mike-lischke May 21, 2016
c8e60b7
Down to one issue -- tree::ParseTree and tree:RuleNode aren't related…
davesisson May 21, 2016
be65ccd
Moved the library build instructions to the library readme.
mike-lischke May 22, 2016
3da5b86
Merge branch 'master' into feature/addtests
mike-lischke May 22, 2016
7d69f24
Small corrections to make the test module compile.
mike-lischke May 22, 2016
9e30f3f
A few minor changes related to building via cmake.
mike-lischke May 23, 2016
b3a17b0
Set up so we compile link all of the files in the test directory. Do…
davesisson May 24, 2016
e969299
remove accidentally checked-in library file
davesisson May 24, 2016
a3e89e5
Merge branch 'master' of https://github.com/DanMcLaughlin/antlr4 into…
davesisson May 24, 2016
b920bb7
Added run support to the test runner.
davesisson May 24, 2016
3e21e0b
Regenerate all of the tests with the latest test generation template.
davesisson May 24, 2016
f103e05
Some additions for better operation.
mike-lischke May 24, 2016
89c01af
Merge branch 'master' into feature/addtests
mike-lischke May 24, 2016
bebb63a
Updated generation a bit.
davesisson May 24, 2016
bdc4f6a
Merge branch 'feature/addtests' of https://github.com/DanMcLaughlin/a…
davesisson May 24, 2016
b1b8de7
Fixed a number of issues in the generated tests. Many more to go.
davesisson May 25, 2016
657be5f
Fixed generation code for lexer tests.
mike-lischke May 25, 2016
27b76b5
Fixed token toString() so it produces the output expected by the tests.
mike-lischke May 26, 2016
95b7f48
Merge branch 'master' into feature/addtests
mike-lischke May 26, 2016
a066567
Lots of fine tuning to get more tests passing.
mike-lischke May 27, 2016
815bb95
TestLeftRecursion passes, but with some disabled tests.
mike-lischke May 29, 2016
08f844a
Fixed 2 problems found by runtime tests.
mike-lischke May 29, 2016
814a182
TestParserErrors passes now.
mike-lischke May 30, 2016
86014ac
TestParserExec tests pass now.
mike-lischke Jun 1, 2016
6bf1193
All tests of TestLeftRecursion.java now pass.
mike-lischke Jun 1, 2016
28ccc49
TestParseTrees passes now.
mike-lischke Jun 1, 2016
be2e711
TestListeners C++ tests pass now.
mike-lischke Jun 2, 2016
b7ade0a
TestParseTrees + TestSemPredEvalLexer C++ test groups pass now.
mike-lischke Jun 2, 2016
ac664a9
A few more fixes.
mike-lischke Jun 2, 2016
4a6b68c
All C++ runtime tests pass now.
mike-lischke Jun 4, 2016
b8867c7
Fixed warning in C++ code generation and remove obsolete file.
mike-lischke Jun 4, 2016
80ced92
Added informations about C++ target specific stuff to the docs.
mike-lischke Jun 4, 2016
d6339f5
Added some notes about Unicode to the C++ target doc.
mike-lischke Jun 4, 2016
73248ac
Some changes in the C++ target doc + a some template fixes.
mike-lischke Jun 5, 2016
a4bc611
Changed namespaces + fixed runtime tests.
mike-lischke Jun 6, 2016
ff129be
Some smaller fixes for Windows.
mike-lischke Jun 6, 2016
b90398f
A few fixes for Visual Studio after added the xpath stuff.
mike-lischke Jun 6, 2016
963f4fc
... and for Linux the same.
mike-lischke Jun 6, 2016
3a95a36
12% speed improvement for C++ runtime.
mike-lischke Jun 7, 2016
d18109e
Merge branch 'feature/addtests'
mike-lischke Jun 7, 2016
1cbbc1b
Merge branch 'antlr-upstream'
mike-lischke Jun 7, 2016
b8fcb5f
More performance increase for C++ target (25% now).
mike-lischke Jun 9, 2016
fec23ce
Simplified equality check in ATNConfigSet.
mike-lischke Jun 10, 2016
e9d2a04
Removed shared_ptr instances for ATNConfigSet.
mike-lischke Jun 10, 2016
c920d57
DFA states member is now a set (instead of a map).
mike-lischke Jun 11, 2016
23eeae4
Simplification of the ATN config lookup handling.
mike-lischke Jun 12, 2016
b9c28d8
Signficantly simplified Token handling.
mike-lischke Jun 13, 2016
7488621
Visual Studio build fix.
mike-lischke Jun 13, 2016
7ac5252
Explicitly delete copy c-tor + copy operator to for Visual Studio.
mike-lischke Jun 13, 2016
0814d49
Small alt check fix in LexerATNSimulator.
mike-lischke Jun 14, 2016
dcb0d4a
Some cleanup.
mike-lischke Jun 14, 2016
728af59
A few more places that no longer pass a shared_ptr around.
mike-lischke Jun 14, 2016
4a8010b
Revert "A few more places that no longer pass a shared_ptr around."
mike-lischke Jun 15, 2016
e68cdc3
A few of the previously reverted changes are still good.
mike-lischke Jun 15, 2016
dd48c0f
A few final touches to make runtime tests passing.
mike-lischke Jun 16, 2016
4a7ec85
Simplified parse tree listener handling.
mike-lischke Jun 17, 2016
3b5b400
A few fixes for the previous listener change.
mike-lischke Jun 17, 2016
19dbd8e
A fix for the Linux demo project.
mike-lischke Jun 17, 2016
89442c6
Changes for deployment.
mike-lischke Jun 19, 2016
d718fa9
Windows runtime deployment.
mike-lischke Jun 21, 2016
8c62740
Missed to commit an XCode project change.
mike-lischke Jun 21, 2016
a2f5cf1
Fixed + simplified loading text to parse from a file.
mike-lischke Jun 21, 2016
1da7e8e
Fixed #include.
mike-lischke Jun 21, 2016
f6515e5
A few adjustments in doc + runtime tests for the changed library name…
mike-lischke Jun 21, 2016
01638eb
Updated README.md.
mike-lischke Jun 21, 2016
a127f34
Changed Win deployment script to produce 2 smaller zips instead of a …
mike-lischke Jun 22, 2016
c8f80b1
Small naming fix.
mike-lischke Jun 22, 2016
a2d6b62
Update DefaultErrorStrategy.cpp
Jun 25, 2016
a6699ea
Merge pull request #9 from nuuman/patch-1
mike-lischke Jun 26, 2016
2352ff0
getSerializedATN() wasn't properly overwritten.
mike-lischke Jun 26, 2016
c462e03
Merge branch 'master_upstream'
mike-lischke Jun 26, 2016
8046c28
A few more text escape calls in DefaultErrorStrategy.
mike-lischke Jun 26, 2016
c4785ab
Document cmake minimum version.
chrisheller Jun 26, 2016
6de938d
Merge pull request #11 from chrisheller/chrisheller-patch-1
mike-lischke Jun 27, 2016
027dde5
LexerAction instances shared_ptr fix
Nic30 Jul 7, 2016
1ceb6a4
indent fix
Nic30 Jul 7, 2016
22794aa
fix liblib in library names
Nic30 Jul 7, 2016
9fa56a4
Added lexer channels enum to match Java target
Jul 7, 2016
ba5cf00
vector::erase invalidates any iterators at/after the erase position
Jul 18, 2016
d3027f1
Added code to detect and handle the UTF-8 BOM if present, otherwise t…
Jul 19, 2016
78de172
Fix warnings with int to char cast
Jul 19, 2016
568c844
Updated .gitignore for .vscode.
mike-lischke Jul 20, 2016
ef247f1
Merge pull request #16 from Nic30/master
mike-lischke Jul 20, 2016
91a7657
A few small corrections after the previous merge.
mike-lischke Jul 20, 2016
fb9d067
Merge pull request #17 from nburles/add-lexer-channels
mike-lischke Jul 20, 2016
be2c98f
Merge pull request #18 from nburles/fix-intervalset-iterator
mike-lischke Jul 20, 2016
5e31347
Merge pull request #19 from nburles/fix-utf8-bom
mike-lischke Jul 20, 2016
196e8ab
Actually use a channel in the demo grammar.
mike-lischke Jul 20, 2016
d46ef90
Fixed some cmake issues. Closes issue #13 and issue #8.
mike-lischke Jul 20, 2016
ffd65e3
Added to contributors.txt
Jul 20, 2016
56b32a7
Merge pull request #20 from nburles/master
mike-lischke Jul 20, 2016
3a1c803
Add Chris Heller to contributors.txt
chrisheller Jul 21, 2016
e876695
Added kosl90 to contributors list.
mike-lischke Jul 21, 2016
365e0f2
Fixed a few warnings.
mike-lischke Jul 22, 2016
bba0338
Bring chrisheller-patch-1 branch up to date
chrisheller Jul 23, 2016
ef077b0
Merge pull request #21 from chrisheller/chrisheller-patch-1
mike-lischke Jul 23, 2016
d6d5045
Updated CMake for demo to:
timoc Jul 24, 2016
7724dd2
external project cmake example, needed set C++ 11
timoc Jul 24, 2016
6d33a6f
updated contributors list with my details
timoc Jul 27, 2016
51b91f4
Merge pull request #24 from timoc/master
mike-lischke Jul 27, 2016
8a5f681
Rework of the visitor implementation
mike-lischke Jul 30, 2016
eee86d8
Small updates for VS 2013/2015.
mike-lischke Jul 31, 2016
282e193
Corrected an include.
mike-lischke Jul 31, 2016
d089c8d
Manually merged pull request #26.
mike-lischke Aug 1, 2016
3535830
Fixes ATN serialization
Aug 1, 2016
3ee53a7
Fixes comparisons of IntervalSets
Aug 1, 2016
c60f1bb
Fixed a bug + raised warning level in Visual Studio
mike-lischke Aug 1, 2016
a025c9e
Compare contents in ATNConfig::operator==
Aug 1, 2016
903fa47
Compare contents in ATNConfigSet::operator==
Aug 1, 2016
739bf3a
Compare contents in LexerATNConfig::operator==
Aug 1, 2016
198da78
Compare contents in SemanticContext::*::operator==
Aug 1, 2016
3705e1b
Consistent formatting in Any.h + converted CPPUtils.cpp to utf-8.
mike-lischke Aug 1, 2016
64f1a65
There is no need to call ->hashCode() explicitly
Aug 1, 2016
f3110fd
Merge pull request #27 from nburles/fix-ATN-serialization
mike-lischke Aug 1, 2016
8bbdbe0
Merge pull request #28 from nburles/fix-intervalset-comparisons
mike-lischke Aug 1, 2016
63b5e61
Merge pull request #31 from nburles/simpler-hash-calls
mike-lischke Aug 1, 2016
183b7ce
Merge pull request #30 from nburles/compare-contents-not-just-addresses
mike-lischke Aug 1, 2016
a1d6154
Remove the std::operator== override in CPPUtils.h
Aug 2, 2016
db8339b
Leave spaces alone unless escaped spaces requested
Aug 2, 2016
50d1f2c
Merge pull request #32 from nburles/fix-whitespace-escape
mike-lischke Aug 2, 2016
8335d32
Various smaller changes to fix compilation and other problems.
mike-lischke Aug 4, 2016
b05c828
Corrected a warning suppression check.
mike-lischke Aug 4, 2016
fa0816d
Without these tests, the demo crashes at PredictionContext.h:247 : k-…
Aug 4, 2016
dc35da2
Only compare the addresses, as in Java
Aug 4, 2016
a41774e
Merge pull request #33 from nburles/remove-equality-override
mike-lischke Aug 4, 2016
07ceea1
Some additional changes for removal of the == operator override.
mike-lischke Aug 4, 2016
78a1216
Merge pull request #35 from nburles/fix-prediction-context
mike-lischke Aug 4, 2016
ccc1fc4
Fix for merge problems in PredictionContext.
mike-lischke Aug 4, 2016
7abfbc6
Change deployment scripts location and updated doc.
mike-lischke Aug 4, 2016
b566551
Levelize credits
DanMcLaughlin Aug 5, 2016
6230fbe
Add myself to contributor list
DanMcLaughlin Aug 5, 2016
1869d9d
Reverting revision [a2d6b62]
mike-lischke Aug 7, 2016
ee2510e
Output formatting in DefaultErrorStrategy and init of generated membe…
mike-lischke Aug 10, 2016
6f62821
More optimizations of the runtime.
mike-lischke Aug 22, 2016
6638883
Second parameter is end pointer, not size
Sep 2, 2016
6f31e94
Merge pull request #39 from nburles/fix-utf8-bom
mike-lischke Sep 2, 2016
b0fc8ea
Added semicolon generation after some of the header decls.
mike-lischke Sep 6, 2016
5afa240
Add Travis settings necessary for C++11 compilation.
mike-lischke Sep 7, 2016
82a22b5
Trying to counter weird Travis error.
mike-lischke Sep 7, 2016
1df9d54
Reverted all Travis changes. Didn't do what I expected.
mike-lischke Sep 7, 2016
1934591
Bug fixes + XCode 8 updates
mike-lischke Sep 24, 2016
ee3e918
Exclude also vscode project data when generating the source zip.
mike-lischke Sep 25, 2016
3b98c11
Merge branch 'master_upstream'
mike-lischke Sep 25, 2016
28eb19f
Explicitly delete copy c-tor and operator for DefaultErrorStrategy.
mike-lischke Sep 25, 2016
f983fac
Added support for hidden symbols on Linux and OSX.
mike-lischke Sep 29, 2016
4394cd2
Merge branch 'master_upstream'
mike-lischke Sep 29, 2016
5c63bc9
Some clean up and xcode unit test fixes.
mike-lischke Sep 30, 2016
de4df87
Updates to get all tests green again.
mike-lischke Oct 1, 2016
8280beb
Refactoring of further int values, mostly converting them to size_t.
mike-lischke Oct 2, 2016
70fd952
C++11 for Travis CI.
mike-lischke Oct 2, 2016
a7b9499
Code generation + Travis CI fixes.
mike-lischke Oct 3, 2016
0e0ecfa
Fixed a number of warnings for VS.
mike-lischke Oct 3, 2016
c968b52
alts outer-context flag/counter in ATNConfig is now unsiged.
mike-lischke Oct 3, 2016
bb5d7ef
Set minimum cmake version to 3.1 for C++ target.
mike-lischke Oct 4, 2016
fc5c1a2
Next attempt to get the C++ runtime compiled in Travis CI.
mike-lischke Oct 4, 2016
e8f00f8
Another attempt for Travis CI.
mike-lischke Oct 4, 2016
6c22533
Trying a different compiler in Travis CI.
mike-lischke Oct 4, 2016
2e92b38
Updated unit tests after last refactoring.
mike-lischke Oct 6, 2016
4897bd8
Simplified memory management for volatile parsing part.
mike-lischke Oct 11, 2016
a4e3438
Some small optimizations.
mike-lischke Oct 12, 2016
014070d
Converted smart pointer for the rule context in RecognitionException
mike-lischke Oct 14, 2016
aabf4ba
Added default c-tor to ParseTree + improved createInstance.
mike-lischke Oct 14, 2016
9e77edc
ATNState::transactions improvements
mike-lischke Oct 14, 2016
951d0f0
cpp runtime: updated the vs2013 project reflecting the last changes
FloorGoddijn Oct 21, 2016
c9f85f1
Merge pull request #41 from FloorGoddijn/master
mike-lischke Oct 22, 2016
f794820
Reworked mutex handling + updated C++ template for a var init
mike-lischke Oct 29, 2016
1feef18
ParserRuleContext init members
RYDB3RG Nov 1, 2016
f3c55be
fix RulePropertyRef_stopHeaderHeader typo
RYDB3RG Nov 1, 2016
af624e1
contributors.txt update
RYDB3RG Nov 1, 2016
b9f81ab
Merge pull request #45 from RYDB3RG/master
mike-lischke Nov 1, 2016
e71e950
Merge branch 'master_upstream'
mike-lischke Nov 5, 2016
5e9211b
Re-enabled all tests again.
mike-lischke Nov 5, 2016
cd5744b
Fixed runtime tests after latest changes.
mike-lischke Nov 6, 2016
3b3fe3d
Merge branch 'master_upstream'
mike-lischke Nov 7, 2016
92b0328
Merge branch 'master_upstream'
mike-lischke Nov 7, 2016
1c3a587
Set required runtime version to 4.6.
mike-lischke Nov 7, 2016
51d3811
trying a refactoring to test if i can push back
parrt Nov 7, 2016
3d06785
reuse code to builld named actions. all file model objects have it now.
parrt Nov 7, 2016
f8bec27
bring Go target templates up to same args as others.
parrt Nov 7, 2016
3ee3093
fix some issues with tests after merge
parrt Nov 7, 2016
b366a84
fix some issues with tests after merge
parrt Nov 7, 2016
01e3ffa
optimize imports.
parrt Nov 7, 2016
5fc57fb
Go needs to mimic other tests; regenerated.
parrt Nov 7, 2016
061177f
tweak doc
parrt Nov 7, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ bilder.pyc
bild.log

bild_output.txt
runtime/Cpp/demo/generated
xcuserdata
*.jar
.vscode

# VSCode Java plugin temporary files
javac-services.0.log
Expand Down
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ sudo: true
language: java
script:
- mvn install

jdk:
- openjdk6
- oraclejdk7
- oraclejdk8

before_install:
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
- sudo add-apt-repository ppa:fkrull/deadsnakes -y
Expand All @@ -19,3 +21,17 @@ before_install:
- go version ; go env
- python --version
- python3 --version

env:
- CXX=g++-5

compiler:
- clang

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- uuid-dev
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ANTLR project lead and supreme dictator for life
* [Sam Harwell](http://tunnelvisionlabs.com/) (Tool co-author, Java and C# target)
* Eric Vergnaud (Javascript, Python2, Python3 targets and significant work on C# target)
* [Peter Boyer](https://github.com/pboyer) (Go target)
* [Mike Lischke](http://www.soft-gems.net/) (C++ completed target)
* Dan McLaughlin (C++ initial target)
* David Sisson (C++ initial target and test)

## Useful information

Expand All @@ -20,7 +23,7 @@ ANTLR project lead and supreme dictator for life
* [Official site](http://www.antlr.org/)
* [Documentation](https://github.com/antlr/antlr4/blob/master/doc/index.md)
* [FAQ](https://github.com/antlr/antlr4/blob/master/doc/faq/index.md)
* [ANTLR code generation targets](https://github.com/antlr/antlr4/blob/master/doc/targets.md) (Currently: Java, C#, Python2|3, JavaScript, Go)
* [ANTLR code generation targets](https://github.com/antlr/antlr4/blob/master/doc/targets.md)<br>(Currently: Java, C#, Python2|3, JavaScript, Go, C++)
* [Java API](http://www.antlr.org/api/Java/index.html)
* [ANTLR v3](http://www.antlr3.org/)
* [v3 to v4 Migration, differences](https://github.com/antlr/antlr4/blob/master/doc/faq/general.md)
Expand Down
11 changes: 10 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ANTLR Project Contributors Certification of Origin and Rights
ANTLR Project Contributors Certification of Origin and Rights

All contributors to ANTLR v4 must formally agree to abide by this
certificate of origin by signing on the bottom with their github
Expand Down Expand Up @@ -58,6 +58,7 @@ YYYY/MM/DD, github id, Full name, email
2014/03/18, aphyr, Kyle Kingsbury, aphyr@aphyr.com
2014/06/07, ericvergnaud, Eric Vergnaud, eric.vergnaud@wanadoo.fr
2014/07/04, jimidle, Jim Idle, jimi@Idle.ws
2014/01/01, danmclaughlin, Dan McLaughlin, dan.mclaughlin@gmail.com
2014/09/04. jeduden, Jan-Eric Duden, jeduden@gmail.com
2014/09/27, petrbel, Petr Bělohlávek, antlr@petrbel.cz
2014/10/18, sergiusignacius, Sérgio Silva, serge.a.silva@gmail.com
Expand Down Expand Up @@ -89,13 +90,21 @@ YYYY/MM/DD, github id, Full name, email
2015/12/23, pboyer, Peter Boyer, peter.b.boyer@gmail.com
2015/12/24, dtymon, David Tymon, david.tymon@gmail.com
2016/02/18, reitzig, Raphael Reitzig, reitzig[at]cs.uni-kl.de
2016/03/10, mike-lischke, Mike Lischke, mike@lischke-online.de
2016/03/27, beardlybread, Bradley Steinbacher, bradley.j.steinbacher@gmail.com
2016/03/29, msteiger, Martin Steiger, antlr@martin-steiger.de
2016/03/28, gagern, Martin von Gagern, gagern@ma.tum.de
2016/07/20, chrisheller, Chris Heller, chris.heller.greyheller@gmail.com
2016/07/20, nburles, Nathan Burles, nburles@gmail.com
2016/07/20, kosl90, Li Liqiang, kos1990l@gmail.com
2016/07/27, timoc, Tim O'Callaghan, timo@linux.com
2016/07/26, nic30, Michal Orsák, michal.o.socials@gmail.com
2016/07/18, willfaught, Will Faught, will.faught@gmail.com
2016/08/08, wjkohnen, Wolfgang Johannes Kohnen, wjkohnen-go-antlr@ko-sys.com
2016/08/11, BurtHarris, Ralph "Burt" Harris, Burt_Harris_antlr4@azxs.33mail.com
2016/08/19, andjo403, Andreas Jonson, andjo403@hotmail.com
2016/10/13, cgudrian, Christian Gudrian, christian.gudrian@gmx.de
2016/10/13, nielsbasjes, Niels Basjes, niels@basjes.nl
2016/10/21, FloorGoddijn, Floor Goddijn, floor.goddijn[at]aimms.com
2016/11/01, RYDB3RG, Kai Stammerjohann, RYDB3RG@users.noreply.github.com
2016/11/05, runner-mei, meifakun, runner.mei@gmail.com
5 changes: 3 additions & 2 deletions doc/building-antlr.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ antlr4-tool-testsuite/4.5.2-SNAPSHOT/antlr4-tool-testsuite-4.5.2-SNAPSHOT.jar

Note that ANTLR is written in itself, which is why maven downloads antlr4-4.5.jar for boostrapping 4.5.2-SNAPSHOT purposes.

To build without running the tests (saves about 8 minutes), do this:
## Building without testing
To build without running the tests (saves a lot of time), do this:

```bash
mvn -DskipTests install
Expand All @@ -122,4 +123,4 @@ mvn -DskipTests install

After download ANTLR source, just "import project from existing sources" and click on the "Maven Projects" tab in right gutter of IDE. It should build stuff in the background automatically and look like:

<img src=images/intellij-maven.png width=200>
<img src=images/intellij-maven.png width=200>
137 changes: 137 additions & 0 deletions doc/cpp-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# C++

The C++ target supports all platforms that can either run MS Visual Studio 2013 (or newer), XCode 7 (or newer) or CMake (C++11 required). All build tools can either create static or dynamic libraries, both as 64bit or 32bit arch. Additionally, XCode can create an iOS library.

## How to create a C++ lexer or parser?
This is pretty much the same as creating a Java lexer or parser, except you need to specify the language target, for example:

```
$ antlr4 -Dlanguage=Cpp MyGrammar.g4
```

You will see that there are a whole bunch of files generated by this call. If visitor or listener are not suppressed (which is the default) you'll get:

* MyGrammarLexer.h + MyGrammarLexer.cpp
* MyGrammarParser.h + MyGrammarParser.cpp
* MyGrammarVisitor.h + MyGrammarVisitor.cpp
* MyGrammarBaseVisitor.h + MyGrammarBaseVisitor.cpp
* MyGrammarListener.h + MyGrammarListener.cpp
* MyGrammarBaseListener.h + MyGrammarBaseListener.cpp

## Where can I get the runtime?

Once you've generated the lexer and/or parser code, you need to download or build the runtime. Prebuilt C++ runtime binaries for Windows (VS 2013 runtime), OSX and iOS are available on the ANTLR web site:

* http://www.antlr.org

Use CMake to build a Linux library (works also on OSX, however not for the iOS library). Building your own library on OSX or Windows is trivial, however. Just open the VS or XCode project, select target + arch and build it. Should work out of the box without any additional dependency.


## How do I run the generated lexer and/or parser?

Putting it all together to get a working parser is really easy. Look in the [runtime/Cpp/demo](../runtime/Cpp/demo) folder for a simple example. The [README](../runtime/Cpp/demo/README.md) there describes shortly how to build and run the demo on OSX, Windows or Linux.

## How do I create and run a custom listener?

The generation step above created a listener and base listener class for you. The listener class is an abstract interface, which declares enter and exit methods for each of your parser rules. The base listener implements all those abstract methods with an empty body, so you don't have to do it yourself if you just want to implement a single function. Hence use this base listener as the base class for your custom listener:

```c++
#include <iostream>

#include "antlr4-runtime.h"
#include "MyGrammarLexer.h"
#include "MyGrammarParser.h"
#include "MyGrammarBaseListener.h"

using namespace org::antlr::v4::runtime;

class TreeShapeListener : public MyGrammarBaseListener {
public:
void enterKey(Ref<ParserRuleContext> ctx) {
// Do something when entering the key rule.
}
};


int main(int argc, const char* argv[]) {
std::ifstream stream;
stream.open(argv[1]);
ANTLRInputStream input(stream);
MyGrammarLexer lexer(&input);
CommonTokenStream tokens(&lexer);
MyGrammarParser parser(&tokens);

Ref<tree::ParseTree> tree = parser.key();
Ref<TreeShapeListener> listener(new TreeShapeListener());
tree::ParseTreeWalker::DEFAULT->walk(listener, tree);

return 0;
}

```

This example assumes your grammar contains a parser rule named `key` for which the enterKey function was generated. The `Ref<>` template is an alias for `std::shared_ptr<>` to simplify the runtime source code which often makes use of smart pointers.

## Specialities of this ANTLR target

There are a couple of things that only the C++ ANTLR target has to deal with. They are described here.

### Memory Management
Since C++ has no built-in memory management we need to take extra care. For that we rely mostly on smart pointers, which however might cause time penalties or memory side effects (like cyclic references) if not used with care. Currently however the memory household looks very stable. Generally, when you see a raw pointer in code consider this as being managed elsewehere. You should never try to manage such a pointer (delete, assign to smart pointer etc.).

### Unicode Support
Encoding is mostly an input issue, i.e. when the lexer converts text input into lexer tokens. The parser is completely encoding unaware. However, lexer input in the grammar is defined by character ranges with either a single member (e.g. 'a' or [a] or [abc]), an explicit range (e.g. 'a'..'z' or [a-z]), the full Unicode range (for a wildcard) and the full Unicode range minus a sub range (for negated ranges, e.g. ~[a]). The explicit ranges (including single member ranges) are encoded in the serialized ATN by 16bit numbers, hence cannot reach beyond 0xFFFF (the Unicode BMP), while the implicit ranges can include any value (and hence support the full Unicode set, up to 0x10FFFF).

> An interesting side note here is that the Java target fully supports Unicode as well, despite the inherent limitations from the serialized ATN. That's possible because the Java String class represents characters beyond the BMP as surrogate pairs (two 16bit values) and even reads them as 2 separate input characters. To make this work a character range for an identifier in a grammar must include the surrogate pairs area (for a Java parser).

The C++ target however always expects UTF-8 input (either in a string or via a wide stream) which is then converted to UTF-32 (a char32_t array) and fed to the lexer. ANTLR, when parsing your grammar, limits character ranges explicitly to the BMP currently. So, in order to allow specifying the full Unicode set the C++ target uses a little trick: whenever an explicit character range includes the (unused) codepoint 0xFFFF in a grammar it is silently extended to the full Unicode range. It's clear that this is an all-or-nothing solution. You cannot define a subset of Unicode codepoints > 0xFFFF that way. This can only be solved if ANTLR supports larger character intervals.

The differences in handling characters beyond the BMP leads to a difference between Java and C++ lexers: the character offsets may not concur. This is because Java reads two 16bit values per Unicode char (if that falls into the surrogate area) while a C++ parser only reads one 32bit value. That usually doesn't have practical consequences, but might confuse people when comparing token positions.

### Named Actions
In order to help customizing the generated files there are a number of additional socalled **named actions**. These actions are tight to specific areas in the generated code and allow to add custom (target specific) code. All targets support these actions

* @parser::header
* @parser::members
* @lexer::header
* @lexer::members

(and their scopeless alternatives `@header` and `@members`) where header doesn't mean a C/C++ header file, but the top of a code file. The content of the header action appears in all generated files at the first line. So it's good for things like license/copyright information.

The content of a *members* action is placed in the public section of lexer or parser class declarations. Hence it can be used for public variables or predicate functions used in a grammar predicate. Since all targets support *header* + *members* they are the best place for stuff that should be available also in generated files for other languages.

In addition to that the C++ target supports many more such named actions. Unfortunately, it's not possible to define new scopes (e.g. *listener* in addition to *parser*) so they had to be defined as part of the existing scopes (*lexer* or *parser*). The grammar in the demo application contains all of the named actions as well for reference. Here's the list:

* **@lexer::preinclude** - Placed right before the first #include (e.g. good for headers that must appear first, for system headers etc.). Appears in both lexer h and cpp file.
* **@lexer::postinclude** - Placed right after the last #include, but before any class code (e.g. for additional namespaces). Appears in both lexer h and cpp file.
* **@lexer::context** - Placed right before the lexer class declaration. Use for e.g. additional types, aliases, forward declarations and the like. Appears in the lexer h file.
* **@lexer::declarations** - Placed in the private section of the lexer declaration (generated sections in all classes strictly follow the pattern: public, protected, privat, from top to bottom). Use this for private vars etc.
* **@lexer::definitions** - Placed before other implementations in the cpp file (but after *@postinclude*). Use this to implement e.g. private types.

For the parser there are the same actions as shown above for the lexer. In addition to that there are even more actions for visitor and listener classes:

* **@parser::listenerpreinclude**
* **@parser::listenerpostinclude**
* **@parser::listenerdeclarations**
* **@parser::listenermembers**
* **@parser::listenerdefinitions**
*
* **@parser::baselistenerpreinclude**
* **@parser::baselistenerpostinclude**
* **@parser::baselistenerdeclarations**
* **@parser::baselistenermembers**
* **@parser::baselistenerdefinitions**
*
* **@parser::visitorpreinclude**
* **@parser::visitorpostinclude**
* **@parser::visitordeclarations**
* **@parser::visitormembers**
* **@parser::visitordefinitions**
*
* **@parser::basevisitorpreinclude**
* **@parser::basevisitorpostinclude**
* **@parser::basevisitordeclarations**
* **@parser::basevisitormembers**
* **@parser::basevisitordefinitions**

and should be self explanatory now. Note: there is no *context* action for listeners or visitors, simply because they would be even less used than the other actions and there are so many already.
2 changes: 1 addition & 1 deletion doc/creating-a-language-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Creating a new target involves the following key elements:
```bash
$ mvn compile
```
That should proceed with success. See [Building ANTLR](building-antlr.md) for more details. (That link does not currently work as I have that documentation in a branch. see https://github.com/parrt/antlr4/blob/move-doc-to-repo/doc/building-antlr.md for now.)
That should proceed with success. See [Building ANTLR](building-antlr.md) for more details.
51 changes: 50 additions & 1 deletion doc/releasing-antlr.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ Edit the repository looking for 4.5 or whatever and update it. Bump version in t
* runtime/CSharp/runtime/CSharp/Antlr4.Runtime/Properties/AssemblyInfo.cs
* runtime/JavaScript/src/antlr4/package.json
* runtime/JavaScript/src/antlr4/Recognizer.js
* tool/src/org/antlr/v4/codegen/target/CppTarget.java
* tool/src/org/antlr/v4/codegen/target/CSharpTarget.java
* tool/src/org/antlr/v4/codegen/target/JavaScriptTarget.java
* tool/src/org/antlr/v4/codegen/target/Python2Target.java
* tool/src/org/antlr/v4/codegen/target/Python3Target.java

* runtime/Cpp/VERSION
* runtime/Cpp/RuntimeMetaData.cpp

Here is a simple script to display any line from the critical files with, say, `4.5` in it:

```bash
Expand Down Expand Up @@ -240,6 +243,52 @@ python setup.py sdist bdist_wininst upload -r pypi

Add links to the artifacts from download.html

### C++

The C++ target is the most complex one, because it addresses multiple platforms, which require individual handling. We have 4 scenarios to cover:

* **Windows**: static and dynamic libraries for the VC++ runtime 2013 or 2015 (corresponding to Visual Studio 2013 or 2015) + header files. All that in 32 and 64bit, debug + release.
* **MacOS**: static and dynamic release libraries + header files.
* **iOS**: no prebuilt binaries, but just a zip of the source, including the XCode project to build everything from source.
* **Linux**: no prebuilt binaries, but just a zip of the source code, including the cmake file to build everything from source there.

In theory we could also create a library for iOS, but that requires to sign it, which depends on an active iOS developer account. So we leave this up to the ANTLR user to build the iOS lib, like we do for Linux builds.

For each platform there's a deployment script which generates zip archives and copies them to the target folder. The Windows deployment script must be run on a machine with VS 2013 + VS 2015 installed. The Mac script must be run on a machine with XCode 7+ installed. The source script can be executed on any Linux or Mac box.

On a Mac (with XCode 7+ installed):

```bash
cd runtime/Cpp
./deploy-macos.sh
```

On any Mac or Linux machine:

```bash
cd runtime/Cpp
./deploy-source.sh
```

On a Windows machine the build scripts checks if VS 2013 and/or VS 2015 are installed and builds binaries for each, if found. This script requires 7z to be installed (http://7-zip.org).

```bash
cd runtime/Cpp
deploy-windows.cmd
```

Move target to website (**_rename to a specific ANTLR version first if needed_**):

```bash
pushd ~/antlr/sites/website-antlr4/download
git add antlr4cpp-runtime-macos.zip
git add antlr4cpp-runtime-windows.zip
git add antlr4cpp-runtime-source.zip
git commit -a -m 'update C++ runtime'
git push origin gh-pages
popd
```

## Update javadoc for runtime and tool

First gen javadoc:
Expand Down
Loading