Commit Graph

1548 Commits

Author SHA1 Message Date
Terence Parr 742429a15d make sure that previous tree node's start/stop token indexes are correct after left-recur elim. 2014-06-02 13:45:10 -05:00
Sam Harwell e7a1d84197 Fix support for element options on semantic predicates in left recursive rules (fixes #590) 2014-06-01 22:33:43 -05:00
Sam Harwell be16c71e56 Merge pull request #583 from sharwell/atn-profiler
Atn profiler
2014-06-01 22:30:39 -05:00
Terence Parr 68b186e77d Add utility methods and track token indexes through the left recursive rule transformation to allow external tools to associate ATN states and transitions with original locations in the grammar source file 2014-06-01 22:30:33 -05:00
Terence Parr e570489d33 Simplify common code in XPath tests 2014-06-01 22:29:35 -05:00
Terence Parr fb49d7c6a2 initial profiler 2014-06-01 22:15:12 -05:00
Sam Harwell 46e1bad7b4 Simplify the GrammarAST constructors, and correct the token start/stop index not being set 2014-05-31 18:14:41 -05:00
Terence Parr f3fcf5a712 Merge pull request #569 from parrt/runtime-tool-version-sync
add tool-template and generatedcode-runtime version compatibility check
2014-05-28 18:02:14 -07:00
Terence Parr 9e77e28bc1 should not be a default version lest all targets pass by default. make sure java target and tool move in lockstep. Fixes #572 2014-05-28 17:55:32 -07:00
Terence Parr 0b8a70a2a4 tweaks per Sam's comment. define default version so targets don't fail to compile. 2014-05-28 11:26:44 -07:00
Terence Parr db0830e00d To get static checking I converted the version template to a method and also moved the compatibility check into the target so that in the worst-case target developers can override the compatibility check per their needs. I have also decided to throw an exception for the Java target when the code generation and runtime library versions are incompatible. Change the tool message per Sam's request. 2014-05-28 11:14:00 -07:00
Sam Harwell 938a39c057 Qualify references to the ATN class to avoid symbol conflicts with tokens named ATN (fixes #561) 2014-05-24 16:49:38 -05:00
Sam Harwell e0937a6322 Add regression test for #561 (token named ATN breaks reference to ATN.INVALID_ALT_NUMBER) 2014-05-24 13:14:08 -05:00
Terence Parr 813fefdbb7 Fixes #554 2014-05-24 12:13:31 -05:00
Terence Parr 4aec5aeac2 add basic code generation testing rig and 1st test. 2014-05-24 12:10:47 -05:00
Terence Parr a3d4ba53a3 add tool-template and generatedcode-runtime version compatibility check. Target authors add a VERSION template and supply a RuntimeMetaData.checkVersion() method. 2014-05-19 17:25:01 -07:00
Sam Harwell 65b176a36d Return predefined values instead of null for Grammar methods getTokenNames, getTokenDisplayNames, and getRuleNames
Improve consistency of Grammar methods for names of rules and tokens
2014-04-13 18:46:28 -05:00
Sam Harwell 7e2bf4a2d5 [maven-release-plugin] prepare for next development iteration 2014-04-06 21:19:40 -05:00
Sam Harwell 736a5f5905 [maven-release-plugin] prepare release 4.2.2 2014-04-06 21:18:12 -05:00
Sam Harwell 88c7d09c24 Add unit tests for grammars with multiple EOF transitions 2014-04-06 16:23:57 -05:00
Terence Parr da9186ed63 Merge pull request #134 from parrt/eval-preds-when-delaying-errors
When delaying error reporting because prediction escapes the decision en...
2014-04-02 09:41:09 -07:00
Sam Harwell ea4676b18a adaptivePredict never returns -1; it could return ATN.INVALID_ALT_NUMBER 2014-04-01 21:26:48 -05:00
Sam Harwell 8c8d4d754e Remove incorrectly generated call to adaptivePredict
This particular call to adaptivePredict did not correctly match the decision number to the preceding setState() call. In addition, since this code is generated only for a positive closure, the only possible alternative is the one that enters the loop; error handling is deferred to the alternative(s) within the body of the closure.
2014-04-01 21:26:47 -05:00
Terence Parr 69d4b423e1 When delaying error reporting because prediction escapes the decision entry rule, we should evaluate predicates to turn off any configurations that are invalid semantically. After that, we can collect the list of alternatives that are satisfied with the input thus far and then choose the minimum as before. Fixes #529 2014-04-01 16:49:30 -07:00
Sam Harwell f34adc916a Added Grammar.undefineRule to support undefining rules prior to AST construction 2014-03-29 16:13:36 -05:00
Sam Harwell 5a56cc1147 Documented Grammar.defineRule, and updated it to return true if the rule was added to the Grammar 2014-03-29 16:13:35 -05:00
Sam Harwell 2729f176b2 Add option TestPerformance.REPORT_SECOND_STAGE_RETRY 2014-03-29 13:12:35 -05:00
Sam Harwell 5be18445cd [maven-release-plugin] prepare for next development iteration 2014-03-25 10:57:46 -05:00
Sam Harwell 943aaa5d24 [maven-release-plugin] prepare release 4.2.1 2014-03-25 10:57:44 -05:00
Sam Harwell d8efb4ad44 Updated build to use latest releases of ANTLR 3 and ST 4 2014-03-25 10:48:00 -05:00
Sam Harwell dcff40df90 Generate complete documentation with the Tool 2014-03-25 10:43:59 -05:00
Sam Harwell 85f09126e2 Don't include the annotation processor registration in the shaded (complete) jar 2014-03-24 20:43:55 -05:00
Sam Harwell 6642a9222d Merge pull request #516 from sharwell/fix-515
Fix usage of assoc=right in Java-LR.g4 (fixes #515)
2014-03-24 20:05:21 -05:00
Sam Harwell 014785b70a Fix usage of assoc=right in Java-LR.g4 (fixes #515) 2014-03-24 20:05:19 -05:00
Terence Parr b4b91970bd Merge pull request #495 from aphyr/fix-load-string-grammar-npe
BasicSemanticChecks.checkGrammarName: allow null filenames.
2014-03-24 13:20:54 -07:00
Sam Harwell ea088eb893 Add compile error 159: RESERVED_RULE_NAME (fixes #500) 2014-03-23 21:49:27 -05:00
Sam Harwell 0ed651cbc6 Add compiler warning 158: FRAGMENT_ACTION_IGNORED (fixes #472) 2014-03-23 18:02:09 -05:00
Sam Harwell 2b3ef648f8 Add compiler warning 157: UNRECOGNIZED_ASSOC_OPTION (fixes #489) 2014-03-23 17:47:40 -05:00
Sam Harwell 480544b4fe Improve wording in description of error 152 2014-03-23 16:31:46 -05:00
Sam Harwell 3e054df98b Do not process grammars following an error during parsing (fixes #507) 2014-03-23 16:31:14 -05:00
Sam Harwell 7daae3a89b Add compiler error 156: unterminated string literal (improves reporting for #507) 2014-03-23 16:30:49 -05:00
Terence Parr 794e4a0b7b Merge pull request #501 from sharwell/fix-433
Fix 433
2014-03-23 11:30:00 -07:00
Terence Parr e66f663618 Merge pull request #503 from sharwell/fix-469
Fix 469
2014-03-23 11:25:59 -07:00
Sam Harwell cb0119e761 Add regression test for issue #509 2014-03-23 11:34:36 -05:00
Sam Harwell 6fc77cd88d Add regression test for #469 2014-03-20 09:20:31 -05:00
Sam Harwell f1692591cc Updated RuleFunction.addContextGetters to support multiple alternatives with the same label (fixes #433) 2014-03-20 08:35:18 -05:00
Sam Harwell 3c70fea32a Add regression test for issue #433 2014-03-20 08:35:17 -05:00
Kyle Kingsbury a74005972d BasicSemanticChecks.checkGrammarName: allow null filenames.
checkGrammarName assumes that all grammars come from actual files, but
grammars loaded using Tool.parseGrammarFromString use input streams
without source file names. This patch changes checkGrammarName to only verify
that grammar names and file names correspond when a file name is
available.
2014-03-18 16:54:43 -07:00
Sam Harwell d498292680 Add regression test for issue #461 (interpreter starting with LR rule) 2014-02-06 20:46:32 -06:00
Sam Harwell 06ab99d16d [maven-release-plugin] prepare for next development iteration 2014-02-04 17:19:12 -06:00