Commit Graph

  • 5cec4721ab Merge branch 'dev' Terence Parr 2012-02-01 16:02:21 -0800
  • c94037def5 fixed regression "a returns [int i] : A ;" didn't work. Terence Parr 2012-02-01 15:55:49 -0800
  • dfc3acb39a add README Terence Parr 2012-01-31 19:28:15 -0800
  • 5eb9ec9582 fixed bug in [a-z] Terence Parr 2012-01-30 18:08:22 -0800
  • c723bd9305 Merge commit '0a5803fab4296d489beec559e2c33118320bccca' into dev Terence Parr 2012-01-30 17:36:23 -0800
  • 0a5803fab4 useless tweaks Terence Parr 2012-01-30 17:09:29 -0800
  • 3cefd3832f tweak readme Terence Parr 2012-01-30 17:03:48 -0800
  • 433a30c584 Merge pull request #2 from parrt/dev Terence Parr 2012-01-30 17:00:20 -0800
  • 1cc7ac3410 added -trace to TestRig. fixed code gen issue for trace listener Terence Parr 2012-01-30 16:51:55 -0800
  • e90b322dd4 ~[] stuff is allowed and works inside sets etc... parrt 2012-01-28 14:36:46 -0800
  • 368b70d53c get 'x' not x in tokenNames parrt 2012-01-28 11:28:42 -0800
  • f4ecc75df5 allows " in [] char set now. parrt 2012-01-28 10:46:08 -0800
  • 043afd3767 shelve for pull at home; don't sync ;) parrt 2012-01-27 15:38:11 -0800
  • 09da63cfd4 rollback and do a real fix for whitespace escaping parrt 2012-01-27 12:00:30 -0800
  • 7498908d62 rollback and do a real fix for whitespace escaping parrt 2012-01-26 14:18:57 -0800
  • adcf72b9a2 whitespace was being escaped to special characters even when printing to string should only do so when doing GUI tree parrt 2012-01-26 14:11:30 -0800
  • 15d537ce6e Added ranges, escapes to [a-z] notation in lexer parrt 2012-01-22 11:37:15 -0800
  • 89ad588023 fix regression parrt 2012-01-22 09:55:13 -0800
  • 9ffe9d2ee3 must have forgotten to commit parrt 2012-01-21 21:21:35 -0800
  • 884472358d -> popMode was broken parrt 2012-01-21 21:21:19 -0800
  • 9fd280b30e Lexer fields mv from x to _x parrt 2012-01-21 15:36:20 -0800
  • 449c845dc0 more cleanup parrt 2012-01-21 15:29:33 -0800
  • fd0d280e6a cleanup parrt 2012-01-21 15:23:39 -0800
  • 4632d7f493 rule name change parrt 2012-01-21 15:16:00 -0800
  • 9ae5049d44 play with tests parrt 2012-01-21 15:15:01 -0800
  • 6013c4c97d Added modeNames to gen'd lexers parrt 2012-01-21 15:10:46 -0800
  • dc82edad02 Summary: we can have lexer commands like -> skip now. moved model.actions package to chunk type(foo) didn't match. ATNBuilder.g now tracks the outer alternative number and calls new factory commands on the lexer commands. Removed unnecessary resolveWithPredicate field from ATNConfig Added lexerActionIndex field to ATNConfig since we need to track whether we passed an action in an alternative will rule in the lexer. Renamed ruleIndex in DFAState and added the lexer action index so that we can execute lexer actions from the DFA. added functions to the grammar tree visitor for the lexer commands. Added templates for the lexer commands. Augmented the lexer ATN factory so that it constructs plain old actions from the lexer commands it finds. That way, the code generator doesn't know any different and generates an action. Augmented the lexer ATN simulator so that it fires a proper action index now. previously it only used the rule index, which of course doesn't work when you have more than one action in a rule. rm'd dup code from OutputModelController altered the epsilon edge removal optimization so that it could not remove actions in lexer rules. Added list of valid lexer commands in Rule. parrt 2012-01-21 15:01:05 -0800
  • d321bb7854 fixed comment parrt 2012-01-21 14:49:20 -0800
  • 06e771f33a rm dead str parrt 2012-01-21 14:35:41 -0800
  • b90d41b508 wasn't walking lexer rule trees right. parrt 2012-01-20 15:12:51 -0800
  • ec5e3e51b1 rm ForcedAction parrt 2012-01-20 15:12:32 -0800
  • 252cfbda78 v4: integrate 9870 to main (unit test for partially predicated alts) sharwell 2012-01-18 09:44:43 -0800
  • 491744f893 reuse of -> label on multiple alts in rule caused dup ctx object defs. parrt 2012-01-14 13:12:35 -0800
  • 093a4f951b leave start/stop char index alone in CommonTokenFactory; refers to original text. parrt 2012-01-14 11:18:23 -0800
  • 1ddf609e25 labels on tokens in left-recursive rules caused codegen exception. parrt 2012-01-14 10:18:19 -0800
  • 5bd780c235 in tree views, spaces/newlines were blanks. I converted to \n and middle dot for space. parrt 2012-01-11 17:25:44 -0800
  • 73793898a9 update grammars parrt 2012-01-11 11:21:05 -0800
  • b3c187e6c3 update changes parrt 2012-01-11 11:20:52 -0800
  • 848c6e4313 This change is a major restructuring of how left recursive rules are transformed. Previously I simply rewrote the grammar and ANTLR was none the wiser. However, it quickly became apparent that ANTLR needed to do many different things for recursive rules so I had to insert transformation later in the pipeline. Specifically, I needed it after Rule object creation. I made a special LeftRecursiveRule object that track information collected during transformation so that I could use it later. I made major changes to the left recursion templates as well as the little code snippets in Java.stg. I created a new template called LeftRecursiveRuleFunction an accompanying model object that handles the special case, even though there is some duplication. the biggest difference in the grammar is the introduction of => ID notation on any outermost alternative. This information is not added to the tree, instead the ALT node is annotated with the ID. Rule.getAltLabels() now looks also in the LeftRecursiveRuleAltInfo objects. I have moved to the left recursion transformation to its own object and have moved some objects into the analysis package. Further, I have split out the Rule object creation into its own RuleCollector. I renamed discoverAlt in the grammar tree visitor to be discoverOuterAlt an added discoverAlt so we can get information about individual alts even inside subrules. Listeners always get an event for the generic rule context, which is used if there is no specific label for an alternative. Added a list of iteration operations for LL(*) subrules. Split buildRuleFunction into buildLeftRecursiveRuleFunction and one for normal rule function creation. I have to insert lots of extra code to manage the contexts, but of course it's all done using the templates. As long as those templates are correct, this code generation mechanism will work. I removed the st field from the parser rule context. I injected the left recursion transformation inside the SemanticPipeline. Visitor dispatch methods are always added to the generated context structures. Fixed some unit tests. About 24 fail. parrt 2012-01-11 11:00:05 -0800
  • 742a08862f Merging dev changes to main sharwell 2012-01-09 10:26:23 -0800
  • e8ae8ee005 labels allowed in left recursive rule refs. parrt 2012-01-05 18:35:20 -0800
  • 4ae23f4a64 * 1+2*3 now gives new parse tree: (e (e 1) + (e (e 2) * (e 3))) See CHANGES.txt now too parrt 2012-01-05 12:27:14 -0800
  • 2e8a5f391a no more -trace parrt 2012-01-04 17:41:42 -0800
  • 78c7c254a0 rm cmt'd out prints parrt 2012-01-04 17:40:59 -0800
  • 7d68546dbe rm prints parrt 2012-01-04 17:37:15 -0800
  • e7f6ba5ac1 lr rules now gen only 1 rule e->e not e->e_ etc... altered tests to build parse trees. parrt 2012-01-04 17:36:24 -0800
  • e29b11882d fix unit tests parrt 2012-01-04 15:47:52 -0800
  • b2269a22f4 not needed parrt 2012-01-04 15:42:55 -0800
  • cab41e41e3 had non-ascii char parrt 2012-01-04 09:05:31 -0800
  • 963ccd2700 added comment parrt 2012-01-03 12:46:51 -0800
  • 224a4bc9e1 changed formatting parrt 2012-01-03 12:46:39 -0800
  • 8099cec3bd Added ctx to visitTerminal in parse tree listener. That should be useful information. made commensurate change in the parse tree walker to make sure I have a proper context to send to the visitTerminal method. renamed a few fields of parser/lexer to have _ in front to avoid name collisions with user actions. change the name of the listener method so that they're more explicit using the terms Error and Parser to identify what kind of listener we are adding or removing. Added a default TraceListener to Parser so that we can call setTrace(true) to have it start dumping out information as a first step in the debugging process. there are now multiple parse tree listeners possible because I made a list. we may want to pass in multiple actions to the parser. parrt 2012-01-03 12:46:18 -0800
  • 5c328c7e3f Bug: didn't stop at end of stream during consume() parrt 2012-01-03 12:40:42 -0800
  • 1d6bbb08c3 kill parrt 2012-01-03 12:30:21 -0800
  • 5d60e85617 rm trace ATN state stuff. Will think about when we do debugging. parrt 2012-01-03 11:07:49 -0800
  • c716a87544 move method down in file parrt 2012-01-03 11:05:40 -0800
  • 2d9139ca4d remove % from ActionSplitter.g parrt 2012-01-03 11:04:12 -0800
  • 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. parrt 2012-01-03 10:58:01 -0800
  • 3aeeb2b277 rename BaseREcognizer as Parser parrt 2012-01-02 18:36:59 -0800
  • 1b04195a2f removed all template / AST rewrite stuff; massive change; added -encoding tool option parrt 2012-01-02 18:13:16 -0800
  • 1921a46dd2 include ST v4 parrt 2012-01-02 17:11:39 -0800
  • ddb68aa948 new example parrt 2012-01-02 14:07:11 -0800
  • 3d620734af Merging CL9604 to main (optimized string literals in generated code) sharwell 2012-01-02 12:08:18 -0800
  • 9114749c51 add Main-Class:org.antlr.v4.Tool to manifest parrt 2012-01-01 14:41:44 -0800
  • 77c13da7c5 fix include parrt 2012-01-01 14:36:55 -0800
  • 5aada9b2a5 includes templates parrt 2012-01-01 11:53:57 -0800
  • 029eae90b7 no v2 in jar parrt 2012-01-01 11:39:27 -0800
  • 8b2abff09b make complete jar parrt 2012-01-01 11:24:26 -0800
  • 47bf5a086e add antlr3.4 jars parrt 2012-01-01 11:08:52 -0800
  • 93011a6195 add parrt 2012-01-01 10:35:31 -0800
  • 353ddc6c2b using wrong map class parrt 2012-01-01 10:27:51 -0800
  • dff466be66 literal rules like A:'a' not seen in modes; weren't in .tokens files parrt 2011-12-31 17:26:48 -0800
  • 8846b98ee7 fix compile error parrt 2011-12-29 17:05:34 -0800
  • 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. parrt 2011-12-29 17:04:40 -0800
  • 3a3ed27e60 add some tests parrt 2011-12-28 19:49:37 -0800
  • 52396d8f5f removed method call parrt 2011-12-27 16:31:09 -0800
  • 3b51bb478d rm unneeded field parrt 2011-12-27 15:52:47 -0800
  • d01bde9125 added new reportAttemptingFullContext to strategy parrt 2011-12-27 15:25:01 -0800
  • 9853061093 added null chk parrt 2011-12-27 14:32:19 -0800
  • bb960e3c37 improved data to report insuff. preds. also, it was detecting it improperly parrt 2011-12-27 14:11:41 -0800
  • 638969bed9 add '...' to diagnostics input parrt 2011-12-27 13:37:47 -0800
  • c1e199d77f added -tokens flag parrt 2011-12-26 18:10:29 -0800
  • bf8473e0fd add cmt parrt 2011-12-26 17:57:00 -0800
  • 24c572d055 oops. antlr was ok, it was javalr grammar. parrt 2011-12-26 17:14:29 -0800
  • 299c29d927 more lexer rule specialization in parser. got antlr almost back to working with new [Aa] notation in lexer. parrt 2011-12-26 17:09:01 -0800
  • ce9638e59c was still creating dfa with sempreds parrt 2011-12-26 17:07:45 -0800
  • 3fae7cc880 rm unnecessary code parrt 2011-12-26 16:56:51 -0800
  • d9efffd104 Add [abc] syntax to allow set of char in lexer; args aren't allowed so unambig. parrt 2011-12-26 15:58:40 -0800
  • 6fa5e52d5e added => skip, channel(99), more, mode(xx), push(xx), pop lexer syntax. separated lexer rules from others in parser / AST now. parrt 2011-12-26 15:14:49 -0800
  • c1923a107e -tree => -print option parrt 2011-12-26 14:05:58 -0800
  • db655f8f2c add -gui option to view in gui window parrt 2011-12-26 13:06:05 -0800
  • 5c50e5f049 Wasn't using Udo's lib correctly parrt 2011-12-26 13:05:46 -0800
  • c6bde7e1e8 -ps arg wrong parrt 2011-12-26 11:13:46 -0800
  • adb91a9bde rm print parrt 2011-12-26 11:10:30 -0800
  • 494f519b05 add java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName [-tree | -ps file.ps] [input-filename] parrt 2011-12-26 11:03:51 -0800
  • 6daa66f83f no more resolved bit in config. use ATNConfigSet all over. final clean up of ATN sim. parrt 2011-12-25 12:01:24 -0800
  • 79d1c40427 Integrate CL9648 to main (getAncestors returns Collections.emptyList() instead of null) sharwell 2011-12-17 11:42:26 -0800
  • c59cf36f88 Integrate CL9646 to main (fix forward seek) sharwell 2011-12-17 09:51:18 -0800
  • bb48deb354 tweak to dotgenerator, make parserinterp using new atn sim parrt 2011-12-16 18:15:56 -0800
  • 6b673a3b2e track stats properly parrt 2011-12-16 16:00:11 -0800