Commit Graph

696 Commits

Author SHA1 Message Date
Terence Parr 0f969af947 added in Sam's popAll to deal with loop end push/pop stuff. passes LR tests and all but 2 sempred tests. does some JavaLR.g4 parsing too. 2012-03-20 18:06:00 -07:00
Terence Parr 9318391664 tweak to fromRuleContext. more sempred tests work. 2012-03-20 12:32:28 -07:00
Terence Parr 55ed1a45bf lexer wasn't using new prediction context. weird. put in functionality for $ merge in full ctx mode. removed configs array in ATNConfigSet. ATNConfigSet wasn't tracking lexerActionIndex from config. ATNConfigSet now maps key to ATNConfig. 2012-03-20 12:12:18 -07:00
Terence Parr 5945b29a86 got more working 2012-03-19 19:58:04 -07:00
Terence Parr 7e9a86a3e1 got TestATNInterpreter working 2012-03-19 18:47:41 -07:00
Terence Parr 85b40c7d2e shelve 2012-03-19 17:47:57 -07:00
Terence Parr 7233177441 got integrated graph stacks to compile. commit so i can look at sam's 2012-03-18 15:20:52 -07:00
Terence Parr 3a79aa15ba move new classes into proper package locations 2012-03-18 13:45:13 -07:00
Terence Parr 9a0aaacbee rm k=1 chk to report early ambiguity. 2012-03-16 14:11:21 -07:00
Terence Parr 102980dffd make T.g same 2012-03-14 13:20:24 -07:00
Terence Parr 28ee391c81 Merge remote-tracking branch 'sharwell/loops-recursion-test' 2012-03-14 13:09:19 -07:00
Sam Harwell 0ec7f1528c Clean up testLoopsSimulateTailRecursion, move to TestFullContextParsing. 2012-03-14 15:04:01 -05:00
Sam Harwell ee0bc39b53 Add unit test for loopsSimulateTailRecursion 2012-03-14 14:08:22 -05:00
Terence Parr 6887c86d5e shelve 2012-03-14 12:04:18 -07:00
Terence Parr 2fc9760ba7 Merge remote-tracking branch 'sharwell/ambig-sempred' 2012-03-12 13:50:45 -07:00
Sam Harwell bbff5bd20a New tests related to if/if/else constructs 2012-03-12 07:26:39 -05:00
Sam Harwell 2cc39c2f9b Evaluate predicates for all ambiguous alternatives and report if still ambiguous after predicate evaluation. Remove misleading message insufficient predicates. Fixes antlr/antlr4#31. Partially addresses antlr/antlr4#39. 2012-03-10 16:16:39 -06:00
Sam Harwell 7525bb6e1d Semantic predicates now evaluate with standard min-alt selection 2012-03-08 13:53:45 -06:00
Terence Parr a9e74ce399 Merge branch 'failed-predicate-message' of git://github.com/sharwell/antlr4 2012-03-06 13:28:47 -08:00
Terence Parr ce142a2a4c Merge commit '51c38c1' 2012-03-06 13:27:46 -08:00
Sam Harwell 5280bc3280 Tweak doc comment 2012-03-06 07:34:20 -06:00
Sam Harwell c3cd99858c Reduce size of generated code by emitting predicate text instead of full failed predicate message 2012-02-29 08:14:42 -06:00
Sam Harwell 51c38c1103 Use single int _alt in generated code instead of a new _alt<choice.uniqueID> for each PlusBlock and StarBlock 2012-02-29 07:56:29 -06:00
Terence Parr dd69a7532d getToken/s returns TerminalNode now per Sam's suggestion. altered tests. seems correct. 2012-02-27 21:39:30 -08:00
Terence Parr ae08867ff3 alter visitTerminal interface, add visitErrorNode. 2012-02-26 22:07:45 -08:00
Terence Parr 67b2e6d7c1 forgot to move Pair etc... 2012-02-26 21:55:23 -08:00
Terence Parr 41be88dcd5 mv to runtime 2012-02-26 15:49:45 -08:00
Terence Parr b7da3361de fix bug. e : e '(' exprList ')' ... ; came back with e as a list not single element. 2012-02-26 15:33:05 -08:00
Terence Parr db1b86af91 alter visitTerminal interface, add visitErrorNode. 2012-02-25 17:03:41 -08:00
Terence Parr 600c4bbd91 crap. sun already made IdentityHashMap; rm'ing my version 2012-02-25 16:07:34 -08:00
Terence Parr 73ae2b0bfc Added ParseTreeProperty and added generically useful Map that ignores key.hashCode and equals() and simply uses key identity instead. In particular, this is useful for ANTLR because parse trees are actually interfaces laid on top of the rule context objects used by ANTLR's grammar analysis. These context objects use special equals methods and so on. Plus, when we want to annotate trees with values, we want a specific note to have a value. Identity is what we intend. 2012-02-25 13:43:32 -08:00
Sam Harwell 90bcfec456 Simplify CodeGenerator 2012-02-24 15:58:21 -06:00
Sam Harwell 019ea15e3f Catch specific RecognitionException instead of Exception 2012-02-23 16:45:35 -06:00
Sam Harwell 2c8ef6470f Despite being absurdly verbose in Java, use callable objects instead of reflection in CodeGenerator because the latter is prone to runtime errors and debugging headaches 2012-02-23 16:44:54 -06:00
Sam Harwell 9bf6f284df Code cleanup (little things like using .isEmpty() and StringBuilder, and specify some small-scale generic arguments) 2012-02-23 16:42:36 -06:00
Sam Harwell 1c8efd6a48 Allow contravariant error listeners 2012-02-23 16:13:13 -06:00
Sam Harwell 4ae58868d7 Compile listeners and visitors with the unit tests by default to help catch compile errors with them 2012-02-23 16:13:10 -06:00
Sam Harwell db4ce6dd8e Unexpected v3 RecognitionException should cause testActions to fail 2012-02-23 16:13:09 -06:00
Sam Harwell 5ab1c3319c Make sure failed compiles result in failed unit tests 2012-02-23 16:13:08 -06:00
Sam Harwell 44df49f24f Remove tree parser methods from BaseTest 2012-02-23 16:13:07 -06:00
Sam Harwell 1492648d26 Add missing @Override annotations 2012-02-23 16:13:06 -06:00
Terence Parr b459dafeb9 empty alternatives didn't trigger listener events. overrode getParent in ParserRuleContext to make type more specific. 2012-02-23 12:16:14 -08:00
Terence Parr 5a13ddc517 fix regression; LR rules weren't working 2012-02-23 11:37:50 -08:00
Terence Parr d30b36ca01 tweak to compile with 3.4 2012-02-23 10:05:43 -08:00
Sam Harwell 4aee8aa4dc Merge remote-tracking branch 'parrt/master' 2012-02-22 15:46:22 -06:00
Sam Harwell 7c0d5cd726 Fix use of v3 runtime generics 2012-02-22 15:44:17 -06:00
Terence Parr 8a34176d82 added listener unit tests. fixed bug that didn't create ctx getters properly for recursive rules. added Symbol extends Token to parse tree stuff. added visitTerminal to Visitor. recursive alts now track their original, unedited AltAST subtree so we can properly count rule refs etc... later. dup of RuleRefAST was making wrong node. don't gen dispatch methods if no listener. 2012-02-22 12:44:33 -08:00
Sam Harwell 05930b04ce Use Class.asSubclass instead of unchecked cast 2012-02-21 07:50:02 -06:00
Sam Harwell 1970ac240e Generalize several functions in TestPerformance 2012-02-20 20:59:06 -06:00
Sam Harwell 611728a380 Update testPerformance to show information about DFA states in the lexer 2012-02-20 18:51:26 -06:00