Commit Graph

2403 Commits

Author SHA1 Message Date
Eric Vergnaud 0bd0a05f24 remove unnecessary test template 2020-10-03 17:17:56 +08:00
Eric Vergnaud 71cdf89eb3 generate es6 classes 2020-10-03 14:09:46 +08:00
Terence Parr da848154d8
Merge pull request #2906 from antlr/fix-template-issue
Fix template issue
2020-09-15 09:36:56 -07:00
Felix Nieuwenhuizen c128f0659b add missing semicolon to AltLabelStructDeclHeader
rules with alternative labels were generating Cpp header files with missing semicolons in declarations after PR#2806 removed duplicate semicolons.
StructDeclHeader and AltLabelStructDeclHeader differed in how attributes were declared
2020-09-13 19:20:23 +02:00
Eric Vergnaud c0bf19846c Fix #2745 2020-09-13 21:07:01 +08:00
Terence Parr 2aafb7f143
Merge pull request #2836 from sigmasoldi3r/master
[C++ codegen] Fixed deprecation warning for CPP targets > 17
2020-09-11 08:49:39 -07:00
Terence Parr ffef8cb278
Merge pull request #2850 from nburles/use_explicit_constructor
[C++ codegen] Add explicit keyword to constructor
2020-09-10 10:53:33 -07:00
Terence Parr 2b119be553
Merge pull request #2854 from nburles/fix_u8string_cpp20
[C++ codegen] Remove use of the u8"" string literal prefix
2020-09-10 10:52:46 -07:00
Terence Parr 630e4c0b7d
Merge pull request #2865 from nburles/fix_switch_missing_default_case
[C++ codegen] Add default cases to AltBlock and OptionalBlock
2020-09-10 10:52:25 -07:00
Pablo Blanco Celdrán 7d10669421
Merge branch 'master' into master 2020-09-10 17:55:55 +02:00
Felix Nieuwenhuizen 68e9a25bbe don't generate extra/duplicate semicolons 2020-08-19 18:25:19 +02:00
Terence Parr dfc7ffc39c
Merge branch 'master' into dart-clean 2020-07-27 11:33:40 -07:00
Nathan Burles 8b706e2427 Add default cases to AltBlock and OptionalBlock
All other switch statements have a default case (either "break" or
"<error>"), but these are missing.

Does not change functionality, simply fixes a warning - and allows a
project to build with -Werror.
2020-07-15 14:33:59 +01:00
Nathan Burles 1692ed2a17 Add explicit keyword to constructors
To avoid unexpected implicit casts.
2020-07-03 15:10:26 +01:00
Nathan Burles 09eb905332 Remove use of the u8"" string literal prefix
Prior to C++20, the type of a "UTF-8 encoded string literal" is char
const * - i.e. it is exactly the same as a non-prefixed string literal
(they are semantically different, but technically the same).

Since C++20, the type of a UTF-8 encoded string literal is changed to
char8_t const * - which is not convertable to char const *.  Even in
C++20, there is no actual change to how characters are stored, only the
type is changed (they are now semantically different, and supposed to be
technically different - but nothing in the language actually uses the
semantics).

In short, removing the u8"" prefix has no effect prior to C++20, and
simply allows compilation to succeed since c++20.
2020-06-22 10:07:01 +01:00
Felix Nieuwenhuizen c134dac863 escape ? character in c++ codegen to prevent accidental trigraphs
(using an override of shouldUseUnicodeEscapeForCodePointInDoubleQuotedString in CppTarget)
2020-06-21 22:04:51 +02:00
Pablo Blanco Celdrán 739cb0b668
Merge branch 'master' into master 2020-06-06 19:59:20 +02:00
Pablo Blanco Celdrán e7a10a070a Fixed deprecation warning for CPP targets > 17 2020-06-04 15:55:39 +02:00
David MARKEY 2191c38619
Prefer "DebuggerNonUserCode" 2020-05-31 23:27:42 +02:00
David MARKEY 4cfbe5bd78
Update CSharp.stg 2020-05-31 19:07:13 +02:00
Larry Li 150ecabfff Add docs for Dart target 2020-05-31 00:35:07 +10:00
Larry Li 2cb1618009 fix: run dart analyzer against google pedantic 2020-05-29 11:08:55 +10:00
Larry Li 51a9691376 fix: incorrect code generation when there are more than 65 tokens 2020-05-25 23:07:27 +10:00
Larry Li 62d56d83ae Merge branch 'master' of github.com:antlr/antlr4 into dart-clean 2020-05-25 21:01:46 +10:00
Tristan Swadell f17b6b43e3 Remove extant variable 2020-05-01 02:19:58 -07:00
Tristan Swadell 69ba58ecbe Thread-safe ANTLR Go codegen 2020-05-01 01:57:54 -07:00
Camilo Roca 091976c497 fix: use prototype for lexer and method for parser 2020-03-20 15:21:57 +01:00
Camilo Roca 176f852bf1 refactored AltLabelStructDecl to use es6 class 2020-03-20 13:51:01 +01:00
Camilo Roca 8b7ac991bf refactored StructDel to use es6 class 2020-03-20 13:46:12 +01:00
Camilo Roca 42b9d8630c fix: no prototype use inside class definition
fix: no need to return this in constructor
2020-03-20 13:45:54 +01:00
Camilo Roca 297bde0926 refactored generated parser and lexer to be es6 classes 2020-03-20 12:42:48 +01:00
Terence Parr 38b1b9ac7f
Merge pull request #2749 from carocad/tree-classes
Javascript: migrate prototypical Tree objects to es6 classes
2020-02-23 10:12:14 -08:00
Camilo Roca a3d2ca7ef5 fix: removed unnecessary "interface" initialization on test suite 2020-02-23 13:09:36 +01:00
Daniel Pitts 0d73fc28e9 replace gramamr with grammar 2020-02-21 19:04:10 -08:00
Larry Li 46bd9e5569 add dart target 2020-01-19 18:22:06 +11:00
parrt f1ffc01723 [maven-release-plugin] prepare for next development iteration 2020-01-18 13:37:08 -08:00
parrt 3f41f283d1 [maven-release-plugin] prepare release antlr4-master-4.8-1 2020-01-18 13:37:01 -08:00
parrt 6c4b491d1b set version to 4.8-1 to fix release 2020-01-18 09:39:46 -08:00
parrt 666131841c [maven-release-plugin] prepare for next development iteration 2020-01-16 12:24:30 -08:00
parrt d569f91795 [maven-release-plugin] prepare release 4.8 2020-01-16 12:24:22 -08:00
parrt 6ad9646382 update version in code to 4.8 2020-01-16 12:18:17 -08:00
parrt 441fea52b1 update to 4.3 version 2020-01-16 12:05:03 -08:00
Terence Parr 340b95bded
Merge branch 'master' into master 2019-12-15 09:01:48 -08:00
Ewan Mellor 10d182cf66
[Swift] Change the generation of the copyFrom method to work around SR-10260.
This bug in Swift 5's compiler causes a SIL verification error when calling
super.foo without overriding foo in the subclass.  In our case, we are
generating a copyFrom implementation in the subclass, and calling
super.copyFrom.  Crucially, the subclass implementation uses the context
subtype for the argument, which means that it doesn't actually override the
superclass's implementation.  This then tickles the SIL verification bug.

Work around this by changing our autogenerated copyFrom definition to use
ParserRuleContext as the argument type.  This means that it actually
overrides the implementation in ParserRuleContext, and so the super.copyFrom
call is generated correctly.
2019-11-18 13:24:28 -08:00
Tabari Alexander 1304e1b8d4 Fix placement of members in JS target.
The location of <namedActions.members> was moved be in the lexer 
constructor, like it is for the parser constructor.
2019-10-29 11:36:47 -04:00
Juliana Amorim 25fa9b0de8 Fix codestyle and bugs in PHP.stg 2019-10-05 17:03:26 -03:00
Marcos Passos 24870012f5 Remove redundant assignment, optimize autoloading and tweak code style 2019-09-18 16:36:57 -03:00
Marcos Passos 789d746636 PHP Target 2019-09-14 09:39:58 -03:00
Iman Hosseini d667b90bc9
Fixed TextIO compatibility with 3.6+
Fixing this issue: https://github.com/antlr/antlr4/issues/2611 (and probably https://github.com/antlr/antlr4/issues/2193)
TextIO has moved since Python 3.6 so it should be imported considering the change for new versions.
2019-07-28 02:25:42 +04:30
Akos Kiss acbd582678 Clean up namespace of generated Python3 listeners
Added `del <file.parserName>` to the end of the `ListenerFile`
template the same way it is used in `VisitorFile`.
2019-03-24 12:24:19 +01:00