Commit Graph

1832 Commits

Author SHA1 Message Date
Terence Parr 65e4dc47e1 fix unit tests for recent bug fix so that they work with JavaScript. 2015-01-22 17:00:07 -08:00
Terence Parr be03964df3 rm @NotNull and @Nullable from codebase to simplify 2015-01-22 14:34:51 -08:00
Terence Parr 7e21ec761e freshen unit tests 2015-01-22 11:44:01 -08:00
Terence Parr 017fbc8ef7 Make new unit tests compatible with all targets; refactor Generator to take cmd-line arg or current dir. rename some methods. add some output. 2015-01-21 17:12:24 -08:00
Terence Parr e2dc5e5d2e set Generator so that it builds with the current working directory as the main root antlr4 dir like bild.py does. 2015-01-21 10:59:31 -08:00
Terence Parr 41713e1869 revert to 353235c 2015-01-21 10:15:47 -08:00
Terence Parr 136e8a6286 tweak 2015-01-20 17:16:07 -08:00
Terence Parr bab8d2cf40 Merge branch 'master' into fix-recovery 2015-01-20 17:08:47 -08:00
Michael Peyton Jones 9e09e6a9c0 Don't consume after error recovery.
recoverInline should handle making sure that the token stream is
advanced to the appropriate position. It is difficult for the caller to
do that, as recoverInline may create a "new" token that is not actually
in the stream.
2015-01-20 14:18:40 +00:00
Michael Peyton Jones dea7c768d4 Test for recovery over-consumption 2015-01-20 10:54:53 +00:00
ericvergnaud 1926a1636a maven cleanup
- added note for maven developers
 - removed maven plugins
 - updated maven dependencies for dev only
 - added antlr4 annotations
2015-01-19 23:04:46 +08:00
Terence Parr 8af4afc058 add intellij project files 2015-01-14 11:20:08 -08:00
Terence Parr 6d9d60ccda Copy stuff from the root pom to the individual poms and remove the root. Remove dependency on the annotations artifact which no longer exists. hardcode the version number everywhere to make sure I don't use a variable that doesn't exist. update bild so that it uses a new maven_deploy() function I put into bilder.py 2015-01-13 17:29:38 -08:00
Terence Parr 4f0f361d93 Fixes #670. Left recursive rules imported into a root grammar caused an error. All tests pass in all targets. 2015-01-12 13:05:03 -08:00
Terence Parr 64f6e196b2 add unit test that reproduces issue #670 2015-01-12 13:00:15 -08:00
Terence Parr 0c2a693638 remove unnecessary check for missing RULES node as that node is apparently always present; the tree construction rule is: -> ^(RULES rule*) 2015-01-12 12:59:36 -08:00
Terence Parr c9a51b98ae add nullptr check 2015-01-12 12:58:50 -08:00
Terence Parr 8c05364099 set versions to 4.5 2015-01-10 10:12:02 -08:00
Terence Parr a4909b3f52 remove constant word size in *code gen* for inline set testing. 2014-12-26 12:15:49 -08:00
Terence Parr 2a28a9b4f3 simplify. no need for listeners as System.err can be reset. 2014-12-17 10:57:20 -08:00
Terence Parr 49a8029985 allow 4.4-generated parsers to work with new 4.5 runtime. 2014-12-16 19:09:17 -08:00
Terence Parr eb9ee1bd80 urlloader.close() doesn't exist in java 1.6; removing for 1.6 compatibility. 2014-12-16 18:40:07 -08:00
ericvergnaud 38c4e2b002 moved from $self to $parser
- also adjusted generated tests for the above
- also adjusted generated tests for recent changes in Python/JavaScript
targets (token types are nos class members like Java/C#)
2014-12-02 23:44:21 +08:00
ericvergnaud a47ee4d853 add support for $self 2014-11-30 16:28:36 +08:00
ericvergnaud c4ec9e5e35 generate tests for IE 2014-11-23 18:46:14 +08:00
ericvergnaud 78027ed0f0 add edit warnings + fix chrome location + make locations relative 2014-11-23 15:50:31 +08:00
Terence Parr 958f2fdf6e merge from master into release branch 2014-11-22 10:47:29 -08:00
ericvergnaud 8228987b4f prepare release
all tests pass (commented out performance and alternate quotes)
added test for complement set
tests regenerated to fix results after bug fixes and « huge string »
issue in java 1.7+
bild.py review to fix numerous bugs
2014-11-23 02:06:47 +08:00
ericvergnaud 8a87b70859 add test generation for all existing targets 2014-11-16 18:46:13 +08:00
Terence Parr 53c53948df Merge branch 'issue-TokenStreamRewriter' of github.com:parrt/antlr4 into parrt-issue-TokenStreamRewriter 2014-11-15 18:19:41 -08:00
Terence Parr 29c2712ae1 fetched runtime-tests-generator branch into master and did a manual merge. Fixes #76 as I was right there anyway. 2014-11-15 18:13:22 -08:00
ericvergnaud 5847fd6995 preparing for CSharp 2014-11-09 13:22:52 +08:00
ericvergnaud 86fc7fd44d Tests generator and generated tests for Java
As of commit, the generator produces tests for Java, Python 2 and 3,
NodeJS and Safari.
It’s a great relief to seethe full set of runtime tests pas identically
on all targets
The previous tests are now located at org.antlr.v4.test.tool, the files
have been cleaned up to remove duplicates
2014-11-01 01:47:19 +08:00
ericvergnaud 97a2946a2d latest selenium driver 2014-10-29 04:33:37 +08:00
Michael Peyton Jones f3abfb79b7 Remove special offset handling for EOFs.
They can just use the position provided by the lexer.
2014-10-27 17:38:25 +00:00
ericvergnaud 537819ba47 minor changes for Safari support 2014-10-27 03:38:24 +08:00
ericvergnaud 129cbbbece java tests validated 2014-10-25 04:07:49 +08:00
ericvergnaud ba76b053a7 validate SemPredEvalParser tests 2014-10-25 03:40:35 +08:00
ericvergnaud 2716bbd62d validated ParseTrees tests 2014-10-25 02:49:22 +08:00
ericvergnaud 5ee6990f8c validated Listeners tests 2014-10-25 02:39:39 +08:00
ericvergnaud 740c30d21d validated LeftRecursion tests 2014-10-25 02:21:41 +08:00
ericvergnaud 31812721c8 validate FullContextParsing tests 2014-10-25 01:07:31 +08:00
ericvergnaud e39ac5a197 validated CompositeParsers tests 2014-10-25 00:56:08 +08:00
ericvergnaud 0c112e97c8 validate ParserErrors tests 2014-10-25 00:30:20 +08:00
ericvergnaud 6067aee458 validated ParserExec tests 2014-10-25 00:06:47 +08:00
ericvergnaud e03c7d44e5 validated Sets tests 2014-10-24 22:46:12 +08:00
ericvergnaud f99acb7202 validated CompositeLexers 2014-10-24 22:26:34 +08:00
ericvergnaud e97083fd81 validated SemPredEvalLexer 2014-10-24 22:15:05 +08:00
ericvergnaud a683f05f6a add missing test in LexerExec, fix LexerErrors 2014-10-24 08:17:28 +08:00
ericvergnaud 809bac2591 generation of TestLexerExec for Java 2014-10-24 01:12:36 +08:00
ericvergnaud 85388803c6 test templates complete 2014-10-19 11:53:00 +08:00
ericvergnaud fe0d1e43e2 progress 2014-10-19 10:59:34 +08:00
ericvergnaud 3d04a72d52 progress 2014-10-16 23:53:54 +08:00
ericvergnaud 4f657e3e52 progress 2014-10-16 23:19:59 +08:00
ericvergnaud f22acf701e progress 2014-10-16 22:57:29 +08:00
ericvergnaud 50466f61dd progress 2014-10-15 23:15:13 +08:00
ericvergnaud 4df40e58e2 progress 2014-10-15 22:16:24 +08:00
ericvergnaud ea20af25ab work in progress 2014-10-14 00:17:03 +08:00
Terence Parr 68bf457b87 Merge pull request #734 from sharwell/refactor-basetest-options
Refactor and document configurable options for BaseTest
2014-10-06 10:19:23 -07:00
Sam Harwell f8d7e77c43 Merge pull request #735 from sharwell/test-jar
Create a test jar to assist in testing other language targets
2014-10-05 14:49:51 -05:00
Sam Harwell f026bb7d01 Provide tokenNames to the code generator for improved compatibility with templates that haven't updated to the new Vocabulary interface 2014-10-05 14:44:23 -05:00
Sam Harwell cedbee27b2 Create a test jar to assist in testing other language targets 2014-10-05 12:50:46 -05:00
Sam Harwell 844d89350f Refactor and document configurable options for BaseTest 2014-10-04 17:02:18 -05:00
ericvergnaud 368c142be8 Merge pull request #729 from ericvergnaud/improve-management-of-test-directories
improve management of test directories
2014-10-05 00:44:34 +08:00
ericvergnaud abf1052426 Merge pull request #730 from ericvergnaud/improve-test-granularity
improve test granularity
2014-10-05 00:39:49 +08:00
ericvergnaud ba5f6d8919 Fixed a discarded test 2014-10-05 00:36:37 +08:00
ericvergnaud 343a10a1b3 Merge pull request #731 from ericvergnaud/enable-browser-javascript-testing
enable testing of javascript runtime in browsers
2014-10-04 21:27:56 +08:00
ericvergnaud 7841db1eeb enable testing of javascript runtime in browsers 2014-10-04 11:46:53 +08:00
ericvergnaud 89d80cc8ed improve test granularity 2014-10-04 11:42:29 +08:00
ericvergnaud e38eec4d95 improve management of test directories 2014-10-04 11:34:34 +08:00
ericvergnaud 6f35cf231b improve debuggability of generated recognizer 2014-10-04 11:28:36 +08:00
Sam Harwell 798af94b90 Improved deterministic code generation output 2014-09-30 20:19:08 -05:00
Terence Parr badc21bf49 Merge pull request #724 from sharwell/fix-709
Deterministic output improvements
2014-09-29 09:40:03 -07:00
Terence Parr aab59cb62d Merge pull request #723 from sharwell/fix-465
Move DOC_COMMENT tokens to the comments channel
2014-09-29 09:37:47 -07:00
Terence Parr 11aed36aa4 Merge pull request #722 from sharwell/fix-667
Fix multiple issues with getSourceName
2014-09-29 09:36:41 -07:00
Terence Parr 6c531dc429 Merge pull request #720 from sharwell/cache-java-templates
Cache the Java code generation templates
2014-09-29 09:35:23 -07:00
Terence Parr b960d4b39d Merge pull request #712 from sharwell/fix-711
Improve runtime vocabulary information
2014-09-29 09:32:51 -07:00
Sam Harwell 2777bc4d26 Output listener and visitor methods in grammar order 2014-09-28 16:02:21 -05:00
Sam Harwell 08ed19078d Deterministic token names and types for string literals 2014-09-28 16:02:01 -05:00
Sam Harwell 0942edbedd Use LinkedHashMap for deterministic behavior in Graph class 2014-09-28 15:32:08 -05:00
Sam Harwell dd3eaaa31a Define a constant for the comments channel number 2014-09-28 15:03:14 -05:00
Sam Harwell 00227078e6 Move doc comments to comments channel (fixes #465) 2014-09-28 15:02:48 -05:00
Sam Harwell 88d46ee54b Cache the Java code generation templates 2014-09-28 13:08:48 -05:00
Sam Harwell cfb95ed95a Add missing Deprecated annotation (fixes build warning) 2014-09-28 13:08:21 -05:00
Sam Harwell 90071c69b8 Fix getSourceName returning null (fixes #667) 2014-09-28 12:12:15 -05:00
Sam Harwell 35bbdfb65c Allow XPath matching by literal or symbolic name (fixes #579) 2014-09-26 21:37:13 -05:00
Sam Harwell 0be4a3aaeb Fix test compile error by avoiding string literal assignments for the large lexer test 2014-09-26 21:37:12 -05:00
Sam Harwell d476d3e5d9 Implement token vocabulary (fixes #711) 2014-09-26 21:37:11 -05:00
Sam Harwell daa462206a Extract abstract model class Recognizer (parent of Parser and Lexer) 2014-09-26 17:34:30 -05:00
Terence Parr f143495ab2 Merge pull request #713 from sharwell/fix-707
Improved support for recursive imports
2014-09-26 14:40:36 -07:00
Terence Parr 0d18457c6d Merge pull request #716 from sharwell/fix-670
Add regression test for #670
2014-09-26 14:31:10 -07:00
Sam Harwell 3137672390 Add regression test for #670 2014-09-25 21:47:41 -05:00
Sam Harwell 4422e0ff12 Deprecate ALL_OPS_NEED_SAME_ASSOC (fixes #652) 2014-09-25 21:30:41 -05:00
Sam Harwell f78f6ceef0 Suppress OPTIONS_IN_DELEGATE warning if all options match the root grammar (fixes #707) 2014-09-25 21:18:55 -05:00
Sam Harwell 4b7873783d Remove logging code which has a detrimental performance impact on processing recursive imports 2014-09-25 21:18:54 -05:00
Sam Harwell e4c193005e Fix exponential complexity of recursive imports 2014-09-25 21:18:54 -05:00
Sam Harwell 9d6a6bd3a8 Add regression test for exponential complexity of recursive imports 2014-09-25 21:18:53 -05:00
Sam Harwell afadc2d976 Include initial value for attributes in generated code (fixes #672) 2014-09-19 17:05:20 -05:00
Terence Parr 6e581b3be6 Merge pull request #691 from sharwell/fix-688
Improved support for zero-length lexer tokens
2014-09-02 13:25:14 -07:00
Terence Parr a0584a2c31 token types bumped by 1 I assume due to recent lexer updates for 0-length tokens or for channel thing? 2014-09-01 13:25:30 -07:00
Terence Parr 7bf47e1670 Merge pull request #694 from sharwell/fix-309
Implement channels{} block
2014-09-01 12:56:57 -07:00
Sam Harwell 1f7220756a Place error 160 in the correct order in ErrorType.java 2014-09-01 13:29:12 -05:00
Sam Harwell cacd317d02 Implement support for defining custom channels in the channels{} construct in lexer grammars (fixes #309) 2014-09-01 13:28:08 -05:00
Sam Harwell e497efaa58 Support zero-length empty lexer rules with lexer commands (fixes #687) 2014-08-28 23:45:52 -05:00
Sam Harwell 6790b25e5b Support zero-length tokens in the lexer (fixes #688) 2014-08-28 23:45:07 -05:00
Sam Harwell 0c1178bf3a Include precedence in rule invocations when -atn is specified 2014-08-28 23:24:06 -05:00
Sam Harwell 99dd914045 Fix assignment of precedence for binary expressions with an implicit operator (e.g. testDuplicatedLeftRecursiveCall) 2014-08-28 23:23:26 -05:00
Sam Harwell a7f53ce396 Support list labels on the recursive atom in a left-recursive rule (fixes #677) 2014-08-09 11:07:15 -05:00
Sam Harwell 399a1df047 Add regression tests for #677 2014-08-09 10:55:20 -05:00
Sam Harwell 550a737acf Make sure code generation was successful before attempting to compile 2014-08-09 10:55:19 -05:00
Sam Harwell 8e69a5b99d Update CodeGenPipeline.process to check for errors before writing output files 2014-08-09 10:26:21 -05:00
Terence Parr 73d2f1f688 simplify; + node always points at loopback now. 2014-07-17 18:37:57 -07:00
Terence Parr aff865d1a7 Make the plus tree node point at loopback always. 2014-07-17 17:29:35 -07:00
Terence Parr 94c1c77652 If there is no loopentry decision, have + AST point to loopback 2014-07-16 20:59:39 -07:00
Terence Parr 2ca20e00ff Remove unneeded createATN(). 2014-07-16 20:37:15 -07:00
Terence Parr bb389782da Fixes #661. A parser rule reference within a lexer rule would get a bad error message and then an exception. Further, errors within the grammar tree visitor would go to standard error instead of to an error manager because none of the subclasses implemented getErrorManager(). Introduced an error type for this error PARSER_RULE_REF_IN_LEXER_RULE. Added to unit test. 2014-07-11 12:09:47 -07:00
Terence Parr 83411ef056 add test 2014-07-10 18:00:16 -07:00
Terence Parr 9b76e6423c refine error type 2014-07-05 19:08:31 -07:00
Terence Parr e1ba264d93 move common char encoding up to Target; same works for Python. 2014-07-03 10:54:49 -07:00
Terence Parr 07b7a4b334 I messed up the merge a bit in ErrorType. Made something into a grammar error not tool error. changed tool error back so it does not accept a token in the grammar. 2014-06-30 16:24:43 -07:00
Terence Parr d85ea0649a Merge branch 'err-msgs-upgrade'
Conflicts:
	tool/src/org/antlr/v4/tool/ErrorType.java
2014-06-30 15:59:19 -07:00
Terence Parr 1b7cdc4328 move templatesExist to Target 2014-06-30 15:38:15 -07:00
Terence Parr e3fc04bda1 put good quotes back in. rm unneeded arg to left-recur msg. 2014-06-30 15:16:20 -07:00
Terence Parr f1d782ffe1 Add convenience methods for detecting missing targets. At a few bail out points so that we don't try anything that will need code generator if we get an improper target. 2014-06-30 11:49:30 -07:00
Terence Parr f0ab9b1415 use assoc value's token. 2014-06-30 09:26:02 -07:00
Terence Parr 36425dd59c Big change to error messages themselves by removing single quotes for non input text stuff. Made cannot_find_tokens_file more specific (split it). Added offending token information to a lot of the messages. It now only prints the file name and not the full path to the file in error messages. Re-factored the ANTLRMessage hierarchy to share fields. Getting the offending token required number of methods to take different arguments. removed the default ST listener in the error manager as it is apparently unused. Cannot find imported grammar is now a grammar error not a tool error. 2014-06-29 21:39:15 -07:00
Terence Parr 4f7f8538ac add new panic() method, though not yet used. revert to java target if cannot find specified target 2014-06-29 13:02:34 -07:00
Terence Parr 2e352e2697 add unit tests for -o and -lib; improve BaseTest: refactor writeFile to Utils. -o options and others not accepted by antlr(). 2014-06-29 12:21:39 -05:00
Terence Parr a07d523c81 add comment 2014-06-29 09:43:24 -07:00
Sam Harwell 91206869c5 Prepare for next development iteration 2014-06-28 22:40:33 -05:00
Terence Parr 8937e0d16e repl space with tabs. 2014-06-28 14:56:47 -07:00
Terence Parr 4acb1091de refactor for reuse, make target check majorminor only. 2014-06-28 14:55:34 -07:00
Sam Harwell 7d88b0106a [maven-release-plugin] prepare for next development iteration 2014-06-18 21:25:44 -05:00
Sam Harwell 201eeb147d [maven-release-plugin] prepare release 4.3 2014-06-18 21:24:24 -05:00
Sam Harwell bbac283ba2 Add @since documentation to key new exposed API types/methods 2014-06-18 19:48:07 -05:00
Sam Harwell a72058bc67 Update dependency versions 2014-06-18 19:37:30 -05:00
Sam Harwell 3378be9c79 Update all version numbers for consistency prior to the 4.3 release 2014-06-18 19:37:29 -05:00
Sam Harwell 6949e832d9 Updated comments to clarify recent changes in code 2014-06-18 19:12:26 -05:00
Sam Harwell 7b88a6dbeb Update the assignment of Tool.VERSION (fixes #634)
* Reference RuntimeMetaData.VERSION so there are fewer version numbers to update during a release
* Assign the value in a static initializer so it's not a compile-time constant
2014-06-18 17:43:47 -05:00
Sam Harwell fab3a83107 Remove ability to reference enclosing rule by name, in favor of always using $ctx (fixes #571) 2014-06-16 18:06:09 -05:00
Terence Parr 91752af88d Merge pull request #623 from parrt/fix-set-subtract
getMinElement now supports values < 0.  Checked and shouldn't affect any...
2014-06-16 12:41:50 -07:00
Sam Harwell 2920ad0d1a * Updated documentation for IntSet
* Reimplemented IntervalSet.subtract and IntervalSet.complement to operate over the complete range of supported values
* Expanded several methods in IntervalSet to operate on any IntSet
* Mark COMPLETE_CHAR_SET and EMPTY_SET as read-only
2014-06-16 14:23:52 -05:00
Terence Parr 0575c59fc6 Merge pull request #629 from sharwell/fix-542
Consistent handling of element options applied to alternatives
2014-06-16 10:44:35 -07:00
Sam Harwell 6eeafacb88 Consistent handling of element options applied to alternatives (fixes #542) 2014-06-16 12:41:31 -05:00
Sam Harwell a812c32a22 Support multiple epsilon elements at the end of a left-recursive rule alternative (fixes #625) 2014-06-16 12:08:56 -05:00
Sam Harwell 9cbf473195 Add regression tests for #625 2014-06-16 12:08:56 -05:00
Terence Parr 51430018d0 getMinElement now supports values < 0. Checked and shouldn't affect any uses. subtract() from set with EOF, wiped out all negative values. added tests. 2014-06-14 13:14:32 -07:00
Terence Parr 633d4e2e19 Merge pull request #620 from sharwell/fix-543
Fix documentation comments generated for labeled alternatives
2014-06-10 16:45:21 -07:00
Terence Parr 662ef9bfac Merge pull request #619 from sharwell/sempred
Updated documentation and add argument validation assertion for SemPred
2014-06-10 16:44:23 -07:00
Terence Parr 63069a571d Merge pull request #618 from sharwell/fix-563
Fix cases where file encoding was not handled properly in the tool
2014-06-10 16:43:51 -07:00