This commit fixes:
- In MingGW
warning: declaration 'class std::exception' does not declare anything
- In Clang (I tested with clang-tidy on Windows specifically)
error: forward declaration of class cannot have a nested name
specifier [clang-diagnostic-error]
This adds an Automatic-Module-Name entry to the runtime jar in order to
provide a stable name upon which other modules can depend. The module
name chosen was "org.antlr.antlr4.runtime". This closely matches the
Maven artifact name with the obviously change that the module name
doesn't contain a hyphen (hyphens can't be used in module names at
the language level in Java).
Fix#2163
The shared s0 state in a DFA was deleted when setting a new one (from the DFA entries possibly). That could led to a situation where a valid reference was deleted, even though it's still needed.
Additionally fixed some formattings and updated the XCode projects in the demo.
Parser::exitRule() in the C++ runtime is a virtual function which is not
reimplemented anywhere. OTOH, it is invoked during the execution of
every rule, which can cause a noticeable performance hit. This commit
removes its virtual qualifier. It should make a difference particularly
for large grammars, because the number of rules corresponds to the
number of the Parser object's virtual functions, and, consequently, its
vtable lookup time.
Tested with a VHDL grammar of 436 rules, where it brings down parsing
time from 75 to 44 seconds on unoptimized compilation, i.e. a 40% speed
gain. Still a lot slower than an equivalent java parser, though, which
takes 2.64 seconds for the same input.
Add missing override markers to the following functions of the C++
runtime:
- TokensStartState::getStateType()
- TagChunk::toString()
- TextChunk::toString()
The missing markers made builds against the API with -Wsuggest-override
choke.