Commit Graph

1858 Commits

Author SHA1 Message Date
Terence Parr 184f711753 [maven-release-plugin] prepare for next development iteration 2016-01-30 10:01:53 -08:00
Terence Parr dcca95d4f0 [maven-release-plugin] prepare release 4.5.2 2016-01-30 10:01:48 -08:00
Terence Parr c92ddcbd06 update version to 4.5.2 in source / packaging stuff. 2016-01-30 09:54:47 -08:00
Terence Parr 1438ab817f why oh why does intellij skip changes when i push? 2015-12-08 11:38:35 -08:00
Terence Parr 99563b116e merging KvanTTT changes. 2015-12-08 11:38:08 -08:00
Terence Parr 6068a4a2c7 Merge pull request #1054 from abego/patch-4
Possible NullPointerException in ActionTranslater#translateActionChunk
2015-11-25 09:05:46 -08:00
Terence Parr 36d8d41def Merge pull request #1046 from abego/extraNullCheckInTestRig
Extra 'null' check in TestRig#process
2015-11-25 09:04:43 -08:00
Udo Borkowski 10edd9a243 Possible NullPointerException in ActionTranslater#translateActionChunk
The parameter `RuleFunction rf` in `ActionTranslater#translateActionChunk` may be `null`.

The method's implementation takes care of this by checking `rf` before making its `ruleCtx` the translator's nodeContext:

```
if ( rf!=null ) translator.nodeContext = rf.ruleCtx;
```

However in the statement following this code the check for `rf!=null` is missing. This will lead to a `NullPointerException` when  `altLabel` is defined and `rf` is `null`:

```
if ( altLabel!=null ) translator.nodeContext = rf.altLabelCtxs.get(altLabel);
```

To avoid the problem only access `rf.altLabelCtxs` when `rf` is not null:

```
if ( rf!=null ) {
    translator.nodeContext = rf.ruleCtx;
    if ( altLabel!=null ) translator.nodeContext = rf.altLabelCtxs.get(altLabel);
}
```
2015-11-25 00:37:48 +01:00
Terence Parr 15f69d6697 this->self. 2015-11-24 10:58:19 -08:00
Terence Parr 05b50325a8 Merge pull request #991 from michaelpj/sync-before-predict
Reinstitute `sync` calls before `adaptivePredict`
2015-11-19 12:37:09 -08:00
Udo Borkowski a71ffbe8bc Extra 'null' check in TestRig#process
After loading and casting the parserClass in TestRig#process using
`cl.loadClass(parserName).asSubclass(Parser.class)` there is a check if
the class returned by `#asSubclass` is not null:

```
parserClass = cl.loadClass(parserName).asSubclass(Parser.class);
if ( parserClass==null ) {
	System.err.println("Can't load "+parserName);
}
```

The method `#asSubclass` will never return `null`, but throw an
`ClassCastException` when the cast is not valid, therefore the check
can be removed.

See also: [TestRig#process Documentation](http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#asSubclass(java.lang.Class\))
2015-11-19 18:27:32 +01:00
Michael Peyton Jones 42cb08f46a Add proper qualifiers to the JS and Python errHandler calls 2015-11-19 16:40:17 +00:00
Michael Peyton Jones b48c86cc30 Use correct sync method in C# codegen 2015-11-18 11:22:53 +00:00
Terence Parr c77c2a39e9 Merge pull request #1031 from HSorensen/patch-1
Update TestRig.java help text with correct package name
2015-11-12 14:00:42 -08:00
HSorensen dcbe2ae806 TreeViewer: Fix NPE
The `selectedTree.getSelectionPath()` return null if nothing is selected.
Added check to avoid NPE:
```java
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at org.antlr.v4.gui.TreeViewer$4.valueChanged(TreeViewer.java:376)
	at javax.swing.JTree.fireValueChanged(JTree.java:2921)
	at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3382)
	at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:635)
	at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1093)
	at javax.swing.tree.DefaultTreeSelectionModel.removeSelectionPaths(DefaultTreeSelectionModel.java:502)
	at javax.swing.JTree.removeDescendantSelectedPaths(JTree.java:3714)
	at javax.swing.JTree.setExpandedState(JTree.java:3597)
	at javax.swing.JTree.collapsePath(JTree.java:2231)
	at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2297)
	at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2273)
	at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2231)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3600)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3548)
	at java.awt.Component.processMouseEvent(Component.java:6524)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6292)
	at java.awt.Container.processEvent(Container.java:2234)
	at java.awt.Component.dispatchEventImpl(Component.java:4883)
	at java.awt.Container.dispatchEventImpl(Container.java:2292)
	at java.awt.Component.dispatchEvent(Component.java:4705)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4530)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
	at java.awt.Container.dispatchEventImpl(Container.java:2278)
	at java.awt.Window.dispatchEventImpl(Window.java:2739)
	at java.awt.Component.dispatchEvent(Component.java:4705)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
	at java.awt.EventQueue.access$400(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:697)
	at java.awt.EventQueue$3.run(EventQueue.java:691)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:719)
	at java.awt.EventQueue$4.run(EventQueue.java:717)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
```
2015-10-29 08:56:42 -07:00
Ivan Kochurkin d692e1f0d9 Fixed @sharwell remarks: typos and etc. 2015-10-28 13:22:21 +03:00
HSorensen 84c283c3a9 Update TestRig.java
The help and error message from the TestRig program refers to the old `runtime.misc` instead of the new `gui` package:
```
java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName
  [-tokens] [-tree] [-gui] [-ps file.ps] [-encoding encodingname]
  [-trace] [-diagnostics] [-SLL]
  [input-filename(s)]
Use startRuleName='tokens' if GrammarName is a lexer grammar.
Omitting input-filename makes rig read from stdin.
```
2015-10-27 21:34:39 -07:00
Bryan Wilhelm 1ed689c31c Handle left-recursion overloads by disabling ambiguous method reference warning. 2015-10-12 20:26:22 -04:00
Ivan Kochurkin 8bf480dcc5 Fixed non-informative NullPointerException. Empty strings now not allowed. fixed #959. 2015-10-12 16:33:32 +03:00
Bryan Wilhelm 3ae2b34d5f Resolve unlabeled left-recursive rules method names. 2015-10-09 22:03:24 -04:00
Bryan Wilhelm 8f53a8e03c Resolve overloaded labeled method. When left recursion is used the rule method is overloaded. When not resolved a C# compiler is generated and defaults to the parameterless method. This explicitly sets it to the parameterless method. 2015-10-09 21:33:13 -04:00
Ivan Kochurkin 78427bae79 Fixed typos in comments. 2015-10-07 23:19:54 +03:00
Ivan Kochurkin a7a9804ecd Restrict certain token, channel, mode names. fixed #1015
Clear error (can not use or declare mode with reserved name) instead of "Serialized ATN data element out of range." exception from #967.
2015-10-07 23:15:21 +03:00
Ivan Kochurkin 935c25b110 Removed wildcard imports.
Fixed test with equal mode and token name.
2015-10-07 17:57:16 +03:00
Bryan Wilhelm fce6c086d2 Update doc comment in C# target base listener and visitor classes to use correct method name. 2015-10-06 21:34:17 -04:00
Ivan Kochurkin a14ba03b6e Changed error code (170), added grammar sample to description. 2015-10-06 18:11:40 +03:00
Ivan Kochurkin a87ac8664b Error in case of mode conflicts with token. fixed #996 2015-10-06 17:39:01 +03:00
Eric Vergnaud 2f082e29fc fix mono 3.12.1 stack overflow on ubuntu with 60k+ string concat expression #2 2015-09-19 02:30:13 +08:00
Eric Vergnaud 7743e44517 fix mono 3.12.1 stack overflow on ubuntu with 60k+ string concat expression 2015-09-19 01:59:22 +08:00
Michael Peyton Jones 09588d2936 Update templates for other languages similarly 2015-09-07 17:39:41 +01:00
Michael Peyton Jones 797cf08111 Delete remaining commented out syncs.
These sync calls are truly redundant - when we are in a simple
alternative block, we can recover sufficiently with `recoverInline`, and
so the syncs do not add anything.
2015-09-07 17:37:05 +01:00
Michael Peyton Jones 940cbcf19f Uncomment syncs before adaptivePredict
These allow slightly better error recovery before we run
`adaptivePredict`, as illustrated by the test.
2015-09-07 11:56:30 +01:00
Eric Vergnaud ee3d29cc50 Fixes an issue pointed out by Mike Cargal, where null literals where registered as 'null' instead of null in both lexicalNames and symbolicNames, thus resulting in erroneous error messages when handling parsing errors. 2015-09-03 20:59:50 +08:00
parrt c07aa4ede1 [maven-release-plugin] prepare for next development iteration 2015-08-20 12:11:58 -07:00
parrt 3611fde621 [maven-release-plugin] prepare release 4.5.1-1 2015-08-20 12:11:55 -07:00
Jason van Zyl 9623d955a0 Add Main-Class attribute to shaded tool JAR 2015-08-20 13:06:37 -04:00
parrt 3d181af904 [maven-release-plugin] prepare for next development iteration 2015-07-15 14:45:48 -07:00
parrt 79dae1e6f6 [maven-release-plugin] prepare release 4.5.1 2015-07-15 14:45:45 -07:00
Terence Parr b555099842 Merge pull request #955 from parrt/move-swing-dependency
move swing related stuff out of runtime package into org.antlr.v4.gui
2015-07-14 17:27:51 -07:00
Terence Parr b395127e73 move swing related stuff out of runtime package into org.antlr.v4.gui 2015-07-14 14:29:41 -07:00
Eric Vergnaud d1eb13cddc Fix antlr4-javascript #36.
Octal is not supported in strict mode.
2015-07-05 13:19:50 +08:00
Jason van Zyl a142a5bc62 Create shaded tool JAR
Which contains:
 - Antlr runtime classes
 - String template classes
 - Tree layout classes
2015-06-30 12:07:36 -04:00
parrt b05e3ccdb8 messing with poms to get test generation in there. it doesn't seem to compiled and properly though. mvn compile works but mvn install doesn't finished compiling generated tests. 2015-06-29 18:09:38 -07:00
Sam Harwell 157749e825 Generate tests during the build
This commit enables the runtime test generator during the Maven build,
process which means the Java runtime receives the same comprehensive
testing during a Maven build as it does during a build with bild.py.
2015-06-29 18:09:38 -07:00
Terence Parr f4709f2973 tweak pom to give version of maven-jar-plugin so it doesn't fail. success reported for "maven test" but no tests run. ;) 2015-06-29 18:09:37 -07:00
parrt b3133abb21 gitignore was dropping all my target generators. ugh. 2015-06-29 18:09:37 -07:00
parrt da818c0c5c got javascript/node tests passing; folded in all js targets 2015-06-29 18:09:36 -07:00
parrt 8e89af918f all Python2 runtime tests pass 2015-06-29 18:09:35 -07:00
parrt d1f95085fe all Python3 runtime tests pass. Using same "get resource" mechanism to find runtime python code as I did for C#. 2015-06-29 18:09:35 -07:00
parrt e8c4bc4b09 Manual copy/add-to-git from antlr4-csharp repo (w/o history) to show how C# target should get injected into main antlr4 repo. Pieces go into tool for code gen, runtime-testsuite, and of course the runtime module. 2015-06-29 18:09:34 -07:00