Commit Graph

538 Commits

Author SHA1 Message Date
parrt 1d6bbb08c3 kill
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9793]
2012-01-03 12:30:21 -08:00
parrt 2d9139ca4d remove % from ActionSplitter.g
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9790]
2012-01-03 11:04:12 -08:00
parrt 5c3c8d6e7a Added TokenFactory, CommonTokenFactory. Update the parser in the lexer with methods to set the factory. Alter the default error strategy and the lexer to use the factory. The parser's set token factory method updates the token source, usually the lexer, and the error handling strategy. I had to add the set token factory method to token source as well to make all of this work.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9789]
2012-01-03 10:58:01 -08:00
parrt 3aeeb2b277 rename BaseREcognizer as Parser
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9781]
2012-01-02 18:36:59 -08:00
parrt 1b04195a2f removed all template / AST rewrite stuff; massive change; added -encoding tool option
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9780]
2012-01-02 18:13:16 -08:00
parrt ddb68aa948 new example
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9778]
2012-01-02 14:07:11 -08:00
sharwell 3d620734af Merging CL9604 to main (optimized string literals in generated code)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9777]
2012-01-02 12:08:18 -08:00
parrt 353ddc6c2b using wrong map class
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9767]
2012-01-01 10:27:51 -08:00
parrt dff466be66 literal rules like A:'a' not seen in modes; weren't in .tokens files
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9766]
2011-12-31 17:26:48 -08:00
parrt a923ad8765 Major update to v4. I backed out a change I made on Christmas then mistakenly prevented any lexer DFA creation. Per http://www.antlr.org/wiki/display/~admin/2011/12/29/Flaw+in+ANTLR+v3+LL%28*%29+analysis+algorithm I fixed a major flaw in ANTLR's notion of context. To do that, I needed to create a new LoopEndState, with all of its fanout to the serialization and parser ATN construction. got a very good start on ParserATNPathFinder, which uses basic recursion to find all possible paths and return a tree with the possibilities. I left it in the condition where he would sometimes loop forever; it needs to track sets of configurations in the busy set; it using states at the moment. added a new signal from the interpreter: reportAttemptingFullContext. I fixed a bug where configuration sets derived from a configuration that had reachesIntoOuterContext>0 were not being considered as dipping into the outer context. The ambiguity checker needed to switch so that a check for exact matches not suffixes when doing full context. It's faster at the very least for full context. added some more support routines to DFA. Added TraceTree in support of the new ParserATNPathFinder.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9764]
2011-12-29 17:04:40 -08:00
parrt 3a3ed27e60 add some tests
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9763]
2011-12-28 19:49:37 -08:00
parrt 52396d8f5f removed method call
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9762]
2011-12-27 16:31:09 -08:00
parrt 9853061093 added null chk
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9759]
2011-12-27 14:32:19 -08:00
parrt 24c572d055 oops. antlr was ok, it was javalr grammar.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9754]
2011-12-26 17:14:29 -08:00
parrt 299c29d927 more lexer rule specialization in parser. got antlr almost back to working with new [Aa] notation in lexer.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9753]
2011-12-26 17:09:01 -08:00
parrt 3fae7cc880 rm unnecessary code
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9751]
2011-12-26 16:56:51 -08:00
parrt d9efffd104 Add [abc] syntax to allow set of char in lexer; args aren't allowed so unambig.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9750]
2011-12-26 15:58:40 -08:00
parrt 6fa5e52d5e added => skip, channel(99), more, mode(xx), push(xx), pop lexer syntax. separated lexer rules from others in parser / AST now.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9749]
2011-12-26 15:14:49 -08:00
parrt 6daa66f83f no more resolved bit in config. use ATNConfigSet all over. final clean up of ATN sim.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9741]
2011-12-25 12:01:24 -08:00
parrt bb48deb354 tweak to dotgenerator, make parserinterp using new atn sim
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9645]
2011-12-16 18:15:56 -08:00
parrt 6b673a3b2e track stats properly
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9643]
2011-12-16 16:00:11 -08:00
parrt ebd1fbb63d within 2 or 3 unit test of where I was before I got it the ATN simulator
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9642]
2011-12-16 15:07:28 -08:00
parrt 3d133e9417 broke out fullctx tests, some fixes.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9636]
2011-12-16 09:43:29 -08:00
parrt 1e8548297e mv comment over and make sure that the tree parsers use the new ATN engine
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9635]
2011-12-15 16:14:49 -08:00
parrt 5ad1505fdb almost got new ATN engine working; separated .* nongreedy tests, reorg args on reporting methods
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9627]
2011-12-15 11:03:41 -08:00
parrt 92279bd6db almost got prediction working
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9600]
2011-12-13 18:10:04 -08:00
parrt 3fb7466a80 another big reorg and fixed unit test. lots more sharing and splitting into methods; same 21/807 tests fail; java works.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9563]
2011-12-11 14:34:32 -08:00
parrt b379a56c7f was playing with test java
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9561]
2011-12-11 13:02:58 -08:00
parrt c32b703555 quote literal was not translated properly. updated Lexer to convert antlr literals to target literals properly. added unit test.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9557]
2011-12-11 10:37:27 -08:00
parrt c59b63c79b turn on in-VM exec for testing.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9551]
2011-12-10 18:17:29 -08:00
parrt 12aa6c2404 fix unit tests, bug in collecting preds and testing in DFA state
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9550]
2011-12-10 17:28:17 -08:00
parrt b1c7edb8d8 moved empty context chk for retry
altered args on reporting methods
reporting methods moved from parser to error strategy
fixed full ctx retry in DFA (used to only work in ATN)
i record conflictSet not just boolean in DFA
added debugging support to BaseRecognizer
added DiagnosticErrorStrategy

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9549]
2011-12-10 16:24:41 -08:00
parrt d170d89ce6 wasn't using some args
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9547]
2011-12-09 18:15:05 -08:00
parrt 131e9f7686 added comments, working on parser interpreter (not prediction) reorg. adding ParserInterpreter. adding unit tests.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9546]
2011-12-09 16:35:21 -08:00
parrt 63168c5577 added more dbg prints, turned on context sensitivity in test java lr.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9545]
2011-12-07 17:47:08 -08:00
parrt 9173367a1e fix unit test
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9544]
2011-12-07 13:27:22 -08:00
parrt 6c5f3655b9 dropped another eps edge; like 5% savings for JavaLR.g4
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9543]
2011-12-07 13:07:04 -08:00
parrt 946c59da14 added Sam's fix for def of ambiguous DFA state; added unit test but not working yet. rule ctx conflictsWith() consistent with v3 now; replaced some Set<Integer> with IntervalSet (for alt sets) and sped things up.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9541]
2011-12-06 17:10:53 -08:00
sharwell cb5d55512a v4: remove stale code (and fix broken build)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9539]
2011-12-06 13:31:34 -08:00
sharwell af8e1edb32 v4: Run unit tests in same process (30% performance improvement)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9538]
2011-12-06 13:30:05 -08:00
parrt 6e79c36861 add verbose dfa state option
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9537]
2011-12-06 12:09:19 -08:00
parrt afb89c56b9 fix a few unit tests
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9536]
2011-12-06 11:47:40 -08:00
sharwell edc4224b56 v4: updated atn graphs
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9531]
2011-12-06 10:46:33 -08:00
parrt cab803d5f3 tweak comment
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9528]
2011-12-05 09:44:40 -08:00
parrt 265a189a86 crap. fixing regression. was adding way too many followlinks.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9527]
2011-12-04 19:01:55 -08:00
parrt 2ddb8100e9 shrunk serialized ATN a bit
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9526]
2011-12-04 18:39:20 -08:00
parrt b09077209c fixed hideous bug found by sam in getAmbigAlts
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9525]
2011-12-04 18:21:24 -08:00
parrt 80fd90d363 rm'd epsilon transition in ATN after rule refs.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9518]
2011-12-03 14:52:24 -08:00
parrt f08e8fc098 predTransition was not passing along predicate properly. rm'd unneeded parameter. pass null if ctx independent pred. added 2 unit tests for non outer ctx check.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9516]
2011-12-03 14:12:06 -08:00
sharwell beec4ab721 v4: Back out changelist 9511 (change DFAState.configs to ATNConfig[])
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9513]
2011-12-02 10:04:34 -08:00