Commit Graph

460 Commits

Author SHA1 Message Date
parrt adcf72b9a2 whitespace was being escaped to special characters even when printing to string should only do so when doing GUI tree
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9904]
2012-01-26 14:11:30 -08:00
parrt 9fd280b30e Lexer fields mv from x to _x
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9883]
2012-01-21 15:36:20 -08:00
parrt 6013c4c97d Added modeNames to gen'd lexers
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9878]
2012-01-21 15:10:46 -08:00
parrt 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.

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9877]
2012-01-21 15:01:05 -08:00
parrt 093a4f951b leave start/stop char index alone in CommonTokenFactory; refers to original text.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9867]
2012-01-14 11:18:23 -08:00
parrt 5bd780c235 in tree views, spaces/newlines were blanks. I converted to \n and middle dot
for space.

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9857]
2012-01-11 17:25:44 -08:00
parrt 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.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9854]
2012-01-11 11:00:05 -08:00
sharwell 742a08862f Merging dev changes to main
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9853]
2012-01-09 10:26:23 -08:00
parrt 4ae23f4a64 * 1+2*3 now gives new parse tree: (e (e 1) + (e (e 2) * (e 3))) See CHANGES.txt now too
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9833]
2012-01-05 12:27:14 -08:00
parrt cab41e41e3 had non-ascii char
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9812]
2012-01-04 09:05:31 -08:00
parrt 963ccd2700 added comment
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9797]
2012-01-03 12:46:51 -08:00
parrt 224a4bc9e1 changed formatting
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9796]
2012-01-03 12:46:39 -08:00
parrt 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.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9795]
2012-01-03 12:46:18 -08:00
parrt 5c328c7e3f Bug: didn't stop at end of stream during consume()
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9794]
2012-01-03 12:40:42 -08:00
parrt 5d60e85617 rm trace ATN state stuff. Will think about when we do debugging.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9792]
2012-01-03 11:07:49 -08:00
parrt c716a87544 move method down in file
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9791]
2012-01-03 11:05:40 -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 8846b98ee7 fix compile error
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9765]
2011-12-29 17:05:34 -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 3b51bb478d rm unneeded field
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9761]
2011-12-27 15:52:47 -08:00
parrt d01bde9125 added new reportAttemptingFullContext to strategy
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9760]
2011-12-27 15:25:01 -08:00
parrt bb960e3c37 improved data to report insuff. preds. also, it was detecting it improperly
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9758]
2011-12-27 14:11:41 -08:00
parrt 638969bed9 add '...' to diagnostics input
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9757]
2011-12-27 13:37:47 -08:00
parrt c1e199d77f added -tokens flag
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9756]
2011-12-26 18:10:29 -08:00
parrt bf8473e0fd add cmt
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9755]
2011-12-26 17:57:00 -08:00
parrt ce9638e59c was still creating dfa with sempreds
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9752]
2011-12-26 17:07:45 -08:00
parrt c1923a107e -tree => -print option
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9748]
2011-12-26 14:05:58 -08:00
parrt db655f8f2c add -gui option to view in gui window
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9747]
2011-12-26 13:06:05 -08:00
parrt 5c50e5f049 Wasn't using Udo's lib correctly
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9746]
2011-12-26 13:05:46 -08:00
parrt c6bde7e1e8 -ps arg wrong
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9745]
2011-12-26 11:13:46 -08:00
parrt adb91a9bde rm print
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9744]
2011-12-26 11:10:30 -08:00
parrt 494f519b05 add java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName [-tree | -ps file.ps] [input-filename]
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9743]
2011-12-26 11:03:51 -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
sharwell 79d1c40427 Integrate CL9648 to main (getAncestors returns Collections.emptyList() instead of null)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9649]
2011-12-17 11:42:26 -08:00
sharwell c59cf36f88 Integrate CL9646 to main (fix forward seek)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9647]
2011-12-17 09:51:18 -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
sharwell fa3483a7fc Merge CL9619 to main (fix CommonTokenStream.seek)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9620]
2011-12-15 07:27:52 -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 8d73f53775 check in start of new ATN sim engine; rm traversedPred in DFAState.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9598]
2011-12-13 14:38:30 -08:00
parrt 8f7fb98e16 added big comments
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9565]
2011-12-12 16:33:10 -08:00
parrt b9afdf6e07 rename var; add missing return
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9564]
2011-12-11 14:45:25 -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 8615fc26da rm dead code
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9562]
2011-12-11 13:03:34 -08:00
parrt 18ff004d83 playing; nop
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9560]
2011-12-11 12:29:27 -08:00
parrt d372d761d5 interim refactoring. much smaller execATN; removed prevAccept fields. useless.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9559]
2011-12-11 12:09:29 -08:00
parrt c3630843d2 add convenience method
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9558]
2011-12-11 11:23:42 -08:00
parrt 1923242b37 clean up comment
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9553]
2011-12-10 18:54:52 -08:00
parrt b89d7c0932 rm dead code
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9552]
2011-12-10 18:51:46 -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 b682450e29 add clone()
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9548]
2011-12-10 15:43:06 -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 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
parrt 28696fe2ff add toSet()
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9540]
2011-12-06 15:58:47 -08:00
parrt cc00494e9d add null chk
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9535]
2011-12-06 11:41:08 -08:00
parrt 27aca5a66e rm prints
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9533]
2011-12-06 11:24: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 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 110fafde5a change name
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9524]
2011-12-04 16:02:40 -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 2b8a821c21 turn off dbg print
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9517]
2011-12-03 14:16:47 -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
parrt cabe808c7f trivial change, gets small speed bump
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9514]
2011-12-02 12:22:35 -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
parrt ae74881de6 strip epsilons between alternative elements and also stripped the final epsilons before block ends. added an ATN visitor for general use. updated all of the unit tests so they pass new smaller ATNs. had to do some work in the serialization and deserialization to handle state numbers without state information. did not want to reorder state numbers during optimization.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9512]
2011-12-01 17:46:12 -08:00
sharwell 682e60b065 v4: DFAState.configs now ATNConfig[] instead of OrderedHashSet<ATNConfig>
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9511]
2011-12-01 17:04:25 -08:00
parrt 4d942c37c8 use RuleContext not ParserRuleContext during prediction
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9510]
2011-12-01 14:24:57 -08:00
parrt 4400ba169f refactored RuleContext to move all noncritical fields down into ParserRuleContext. Widespread but minor changes. Using the more specific ParserRuleContext where appropriate.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9509]
2011-12-01 14:01:00 -08:00
sharwell 38c69af805 v4: Back out changelist 9507 (PredictionContext optimization)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9508]
2011-12-01 13:14:37 -08:00
sharwell 11b6fa13f9 v4: PredictionContext optimization
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9507]
2011-12-01 13:13:24 -08:00
parrt a8219d943e got java LR parser working :) allows e A B C e type LR alts now
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9506]
2011-11-30 18:57:45 -08:00
parrt b6b4583b92 let it build DFA again.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9505]
2011-11-30 18:31:20 -08:00
parrt 8d7a97fb68 fixing some pred bugs. fixed unit testSimple in pred eval. optimized sem ctx.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9503]
2011-11-30 17:44:49 -08:00
Udo Borkowski 1bc3997930 add "useCurvedEdges" feature
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9502]
2011-11-30 17:10:46 -08:00
Udo Borkowski ef57f44240 add "useCurvedEdges" feature
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9501]
2011-11-30 16:12:35 -08:00
sharwell 8c3e8272d8 v4: System.out.format instead of System.out.println
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9496]
2011-11-30 08:50:25 -08:00
sharwell 583668746f v4: Optimize ATNState.onlyHasEpsilonTransitions (5-15% improvement during warmup)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9495]
2011-11-30 08:42:54 -08:00
sharwell 8096b3b4c4 v4: Check for early return conditions during DFA updates
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9494]
2011-11-30 07:05:38 -08:00
sharwell 83a5f592d0 v4: Convert do{...}while(true) to while(true){...}
Use CharStream.EOF instead of Token.EOF when referencing results of CharStream.LA

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9493]
2011-11-30 07:03:40 -08:00
sharwell befd9ba483 v4: Combine calls to Set.contains and Set.add
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9492]
2011-11-30 06:32:33 -08:00
sharwell 2bbb1ca132 v4: Fix Parser.reset (side effect fixes Parser.setInputStream)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9491]
2011-11-29 20:25:51 -08:00
sharwell 1be2e2c556 v4: Initial tracing support in the lexer
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9490]
2011-11-29 20:13:06 -08:00
sharwell fb3de170d1 v4: Add BaseRecognizer.isExpectedToken - *massive* performance improvement in DefaultErrorStrategy.sync()
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9489]
2011-11-29 19:43:33 -08:00
sharwell 07bbf42f8b v4: Add <?> to generic instance
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9488]
2011-11-29 19:31:25 -08:00
sharwell 99cf07cc3c v4: check for null
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9487]
2011-11-29 19:01:35 -08:00
sharwell a71a9f04ea v4: check for null before evaluating sempreds in the lexer (issue a warning if no recognizer is available for evaluation)
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9486]
2011-11-29 18:59:32 -08:00
sharwell c25f3ff3d8 Add type parameter to BailErrorStrategy since the class may safely be used with any type of recognizer
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9485]
2011-11-29 17:50:03 -08:00
parrt 2243cc2e81 wasn't seeing thru some preds.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9484]
2011-11-29 17:31:18 -08:00
parrt e00fa44996 Got validating and disambiguating predicates the way I want; widespread changes. DFAStates now have a list of predicate/alt pairs that they can test at except states. renamed Java.g4 to JavaLR.g4. LL(1) analysis did not fail when it's all predicates, which it must.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9482]
2011-11-29 15:46:51 -08:00
Udo Borkowski 4e30119ab6 fix various issues in TreeViewer
1) Issue: The tree "jumps" from a larger scale to a much smaller scale when starting dragging the scale slider.

Cause: Initially the slider was not correctly positioned. It always assumed a scale of 1. 

Solution: I now calculate the initial slider position using the current scale (was 1.5).

---

2) Issue: NullPointerException when the scale slider is dragged to the very left.

Cause: The formula "v / 1000.0 + 1.0" results in a scale of 0.0 when using -1000 (left position). A scale of 0 is not supported.

Solution: in setScale I now check for "<= 0.0". In the case I use scale 1. In addition I changed the lower bound of the slider to -999, i.e. the left position represents the scale "0.001".

---

3) Issue: when scaling the scrollbars are not added/updated/removed

Cause: when scaling the preferred size of the TreeViewer must be updated as the ScrollPane refers to the preferredSize for scrolling.

Solution: now calling "updatePreferredSize" in setScale. This will set the preferred size to the "scaled tree size". It also ensures parents will be notified and the view is repainted.

---

4) Issue: only an upper left part of the tree is painted.

Cause: the TreeViewer overwrote the getWidth/Height and returned unchanged values (800x600). Only this area in painted. If the preferred size exceeded this size the remaining area was not painted.

Solution: Removed the overwrite of getWidth/Height. As one consequence the dialog will start at maximum size for large tree layouts.

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9481]
2011-11-29 07:40:09 -08:00
parrt 9a1a8428b5 got ambig pred thing working i think; unit tests. missing validating pred thing.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9480]
2011-11-28 19:16:45 -08:00
parrt e288ff3039 interim pred overhaul
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9479]
2011-11-28 09:37:29 -08:00