Commit Graph

5271 Commits

Author SHA1 Message Date
Mike Lischke b9f81ab04e Merge pull request #45 from RYDB3RG/master
small rule attribute fixes
2016-11-01 10:45:13 +01:00
kai stammerjohann af624e1321 contributors.txt update 2016-11-01 09:48:57 +01:00
kai stammerjohann f3c55be33c fix RulePropertyRef_stopHeaderHeader typo 2016-11-01 09:17:46 +01:00
kai stammerjohann 1feef18e3e ParserRuleContext init members 2016-11-01 09:06:27 +01:00
Mike Lischke f794820aaf Reworked mutex handling + updated C++ template for a var init
- Mutexes have been consolidated. Instead of one per DFA (which can easily get to hundreds of them) we only have one mutex in the Recognizer class and all other parties use this for serialization. It's only about protected the DFA anyway, which is stored in a recognizer (lexer/parser).
- ATNState::getStateType() returns a size_t value now (actually an enum).
- Replaced checks via RTTI for transitions by the (serialization) type of the transition, for simplicity.
- Added some missing initialization for fields in certain ATN state classes.
- Fixed mem leak in DFA by shadowing the s0 field. That way still have a ref to the self created instance, even is s0 was replaced later.
- Added variable init in code generation for a rule context declaration (e.g. for labels).
2016-10-29 14:46:38 +02:00
Peter Boyer 48e1f060d7 Merge pull request #78 from pemcconnell/master
http:// not allowed in go import path
2016-10-27 19:42:11 -04:00
Peter McConnell 0463e14e55 http:// not allowed in go import path 2016-10-26 14:55:19 +01:00
Mike Lischke c9f85f1d6a Merge pull request #41 from FloorGoddijn/master
cpp runtime: updated the vs2013 project reflecting the last changes
2016-10-22 16:10:35 +02:00
Floor 951d0f06d7 cpp runtime: updated the vs2013 project reflecting the last changes 2016-10-21 13:07:15 +02:00
Peter Boyer adef6f690a Cleanup var statements (#73)
* Cleanup var statements

* Fix type decl
2016-10-17 12:57:26 -04:00
Peter Boyer 07f7dae78f Fix type decl 2016-10-17 12:04:05 -04:00
Peter Boyer 191b8f9d58 Cleanup var statements 2016-10-17 11:41:56 -04:00
Mike Lischke 9e77edcb34 ATNState::transactions improvements
The transaction field was access with trivial getters and setters which server no real purpose, so I made the vector public and remove all the obsolete accessor functions. This simplifies the API (e.g. use .size() instead of getNumberOfTransitions()).
This change required a few other changes in runtime.

Additionally, I radically cut down the ATN::toString method to return only what the Java runtime is doing instead of a full dump of the state and it's transitions.
2016-10-14 17:10:00 +02:00
Mike Lischke aabf4baf60 Added default c-tor to ParseTree + improved createInstance.
createInstance now use move semantics for its parameters.
2016-10-14 17:05:00 +02:00
Mike Lischke 014070de66 Converted smart pointer for the rule context in RecognitionException
Since we pass around raw pointer for volatile references now, we must not create smart pointers from them or we will get a double free.
2016-10-14 17:03:38 +02:00
Terence Parr 52523024e0 Merge pull request #1306 from parrt/master
Enhance JavaScript ParseTreeVisitor, add tests (other targets ignore this functionality)
2016-10-13 16:47:23 -07:00
parrt aabd148bf4 Merge branch 'cgudrian-dfs' 2016-10-13 16:44:04 -07:00
parrt 285c7fca6c resolve contribs conflict 2016-10-13 16:21:00 -07:00
Peter Boyer 2444386091 Remove JavaScript PORT_DEBUG, re-enable runtime tests for other language targets (#69)
* Re-enable runtime tests for other language targets

* Fix typo in js code

* Remove PORT_DEBUG statements

* Fix missing

* Fix testAltNum
2016-10-13 17:06:22 -04:00
Terence Parr 8d0ae8599e Merge pull request #1221 from ericvergnaud/javascript-consistency
Following #1218, ensure consistency of ATNConfigSet hashing strategy …
2016-10-13 14:05:36 -07:00
Terence Parr 6d59acce4c Merge pull request #1304 from nielsbasjes/EditorConfig
Add .editorconfig
2016-10-13 14:00:56 -07:00
Niels Basjes 0bf739fa73 Added Niels Basjes to the contributers list 2016-10-13 22:53:12 +02:00
parrt 4312b37828 pull test changes in 2016-10-13 10:58:19 -07:00
Terence Parr b889c49bbe Merge pull request #1305 from sharwell/line-endings
Add default .gitattributes
2016-10-13 10:49:04 -07:00
Sam Harwell 3f103dab1a Add default .gitattributes 2016-10-13 05:49:38 -05:00
Niels Basjes 5b8d262c8e Updated the editorconfig based on Sam's feedback. 2016-10-13 09:28:16 +02:00
Christian Gudrian 07f57564ec Update contributors.txt
Added cgudrian
2016-10-13 07:41:17 +02:00
Niels Basjes 57f2e0f006 Introduce EditorConfig for easier configuration of IDEs 2016-10-12 16:25:53 +02:00
Peter Boyer 5cbc1b0ba8 Merge pull request #67 from pboyer/upstreamMerge
Merge with upstream antlr/antlr4
2016-10-12 10:20:06 -04:00
Christian Gudrian 29c1a9f222 removed reference to local node installation 2016-10-12 15:56:40 +02:00
Peter Boyer 42347c078b Fix merge failure 2016-10-12 09:53:43 -04:00
Peter Boyer 60662c4b70 Fix remaining tests (#64)
* Fix pred context typo

* Adjust array lengths

* PositionAdjustLexer test fix first steps

* allow virtual method calls from Lexer

* Hopefully fix issues with dup namedActions

* Make parser members

* Fix testParserProperty

* Fix LeftRecursion test failures
2016-10-12 09:49:42 -04:00
Mike Lischke a4e343806f Some small optimizations.
- No copy of a DFA state during ATN deserialization.
- Fixed memory leak of locally created s0 state in DFAState.
2016-10-12 11:06:51 +02:00
Mike Lischke 4897bd8571 Simplified memory management for volatile parsing part.
There are 2 parts in an ANTLR genrated parser where memory is allocated: the actual parsing (with or w/o creating a parse tree) and the prediction part (via DFA/ATN etc.). The first part is highly volatile as it recreates parse tree instances (the class) on each parser run. In fact also lexer tokens belong to that part, but are already managed via unique pointers. This first part works without any smart pointer now. Instead there is a simple tracker class which holds all created references and frees them when the parser is reset or destroyed. This is a bit less optimal if the parser is set to create no parse tree, as created rule context objects are not freed immediately (like with smart pointers), but during reset. On the other hand this change gives (depending on the input) a nice speed up (0%-100%, after the warm up phase). Additionally memory consumption drops by a good amount.

Everything in the simulartors (and interpreters) remains unchanged. This is the shared prediction part.
2016-10-11 13:49:02 +02:00
Peter Boyer 145bfca692 Update lexer_action.go (#62) 2016-10-08 23:03:11 -04:00
Christian Gudrian 75dd652d7a fixed visitAtom implementation
This implementation somehow got lost in rebasing.
2016-10-07 20:37:38 +02:00
Christian Gudrian e5bab64e4b ignoring the visitors tests for Java, C# and Python
The template implementations for these languages is pending.
2016-10-06 22:53:25 +02:00
Christian Gudrian 4842e61a06 generated test sources 2016-10-06 22:53:16 +02:00
Christian Gudrian cb590334bb the visit methods now return a value 2016-10-06 22:52:19 +02:00
Christian Gudrian eb292adb18 implemented templates for the JavaScript visitors 2016-10-06 22:52:19 +02:00
Christian Gudrian 0396561520 made visitAtom work for terminal nodes 2016-10-06 22:52:19 +02:00
Christian Gudrian a90c9d6669 started work at the Visitors templates by making a copy of the Listener templates 2016-10-06 22:46:54 +02:00
Peter Boyer 10f15cabf8 errorNode() impl (#59) 2016-10-06 16:19:05 -04:00
Peter Boyer a5859fd54e Fix PredictionContext merge() typo (#61)
* Fix pred context typo

* Adjust array lengths
2016-10-06 16:18:18 -04:00
Mike Lischke 2e92b38bf7 Updated unit tests after last refactoring. 2016-10-06 17:17:36 +02:00
Peter Boyer 499d9d3f89 Print test arrays in java style (#50)
* Print string rule invocation stack array in java style

* regen runtime tests

* Another array print fix

* Fixes to print array of terminal nodes:

* regen tests
2016-10-05 14:52:42 -04:00
Peter Boyer 9b76bc6a71 Update Go.stg 2016-10-05 12:04:01 -04:00
Peter Boyer bb9a08b158 Merge pull request #48 from runner-mei/patch-4
auto locate go path on the windows
2016-10-04 22:13:59 -04:00
Mike Lischke 6c225337ae Trying a different compiler in Travis CI. 2016-10-04 11:02:40 +02:00
Mike Lischke e8f00f8074 Another attempt for Travis CI. 2016-10-04 10:51:14 +02:00