Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java

Issue 189433006: Support for DartBlockBody, DartExpressionBody, DartOmit in java2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 public static final Set<String> FORBIDDEN_NAMES = Sets.newHashSet(); 124 public static final Set<String> FORBIDDEN_NAMES = Sets.newHashSet();
125 private final Set<String> usedNames = Sets.newHashSet(); 125 private final Set<String> usedNames = Sets.newHashSet();
126 private final Set<ClassMember> privateClassMembers = Sets.newHashSet(); 126 private final Set<ClassMember> privateClassMembers = Sets.newHashSet();
127 private final Map<SimpleIdentifier, String> identifierToName = Maps.newHashMap (); 127 private final Map<SimpleIdentifier, String> identifierToName = Maps.newHashMap ();
128 private final Map<String, Object> signatureToBinding = Maps.newHashMap(); 128 private final Map<String, Object> signatureToBinding = Maps.newHashMap();
129 private final Map<Object, List<SimpleIdentifier>> bindingToIdentifiers = Maps. newHashMap(); 129 private final Map<Object, List<SimpleIdentifier>> bindingToIdentifiers = Maps. newHashMap();
130 private final Map<AstNode, IBinding> nodeToBinding = Maps.newHashMap(); 130 private final Map<AstNode, IBinding> nodeToBinding = Maps.newHashMap();
131 private final Map<AstNode, ITypeBinding> nodeToTypeBinding = Maps.newHashMap() ; 131 private final Map<AstNode, ITypeBinding> nodeToTypeBinding = Maps.newHashMap() ;
132 private final Map<InstanceCreationExpression, ClassDeclaration> anonymousDecla rations = Maps.newHashMap(); 132 private final Map<InstanceCreationExpression, ClassDeclaration> anonymousDecla rations = Maps.newHashMap();
133 private final Set<SimpleIdentifier> innerClassNames = Sets.newHashSet(); 133 private final Set<SimpleIdentifier> innerClassNames = Sets.newHashSet();
134 private final Map<AstNode, List<ParsedAnnotation>> nodeAnnotations = Maps.newH ashMap();
134 // information about constructors 135 // information about constructors
135 private int technicalConstructorIndex; 136 private int technicalConstructorIndex;
136 private final Map<IMethodBinding, ConstructorDescription> bindingToConstructor = Maps.newHashMap(); 137 private final Map<IMethodBinding, ConstructorDescription> bindingToConstructor = Maps.newHashMap();
137 private final Map<ConstructorDeclaration, IMethodBinding> constructorToBinding = Maps.newHashMap(); 138 private final Map<ConstructorDeclaration, IMethodBinding> constructorToBinding = Maps.newHashMap();
138 // information about inner classes 139 // information about inner classes
139 private int technicalInnerClassIndex; 140 private int technicalInnerClassIndex;
140 private int technicalAnonymousClassIndex; 141 private int technicalAnonymousClassIndex;
141 142
142 static { 143 static {
143 for (Keyword keyword : Keyword.values()) { 144 for (Keyword keyword : Keyword.values()) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 name = identifier.getName(); 418 name = identifier.getName();
418 } 419 }
419 return name; 420 return name;
420 } 421 }
421 422
422 public Map<CompilationUnitMember, File> getMemberToFile() { 423 public Map<CompilationUnitMember, File> getMemberToFile() {
423 return memberToFile; 424 return memberToFile;
424 } 425 }
425 426
426 /** 427 /**
428 * Returns all node annotations. Used for testing.
429 */
430 public Map<AstNode, List<ParsedAnnotation>> getNodeAnnotations() {
431 return nodeAnnotations;
432 }
433
434 /**
435 * Returns {@link ParsedAnnotation}s object for the Java annotation specified on the Java node of
436 * the given {@link AstNode}, maybe {@code null}.
437 */
438 public List<ParsedAnnotation> getNodeAnnotations(AstNode node) {
439 return nodeAnnotations.get(node);
440 }
441
442 /**
427 * @return some Java binding for the given Dart {@link AstNode}. 443 * @return some Java binding for the given Dart {@link AstNode}.
428 */ 444 */
429 public IBinding getNodeBinding(AstNode node) { 445 public IBinding getNodeBinding(AstNode node) {
430 return nodeToBinding.get(node); 446 return nodeToBinding.get(node);
431 } 447 }
432 448
433 /** 449 /**
434 * @return some Java {@link ITypeBinding} for the given Dart {@link AstNode}. 450 * @return some Java {@link ITypeBinding} for the given Dart {@link AstNode}.
435 */ 451 */
436 public ITypeBinding getNodeTypeBinding(AstNode node) { 452 public ITypeBinding getNodeTypeBinding(AstNode node) {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 664
649 /** 665 /**
650 * Remembers that given {@link SimpleIdentifier} is the name of inner class an d all references to 666 * Remembers that given {@link SimpleIdentifier} is the name of inner class an d all references to
651 * it should be renamed. 667 * it should be renamed.
652 */ 668 */
653 void putInnerClassName(SimpleIdentifier identifier) { 669 void putInnerClassName(SimpleIdentifier identifier) {
654 innerClassNames.add(identifier); 670 innerClassNames.add(identifier);
655 } 671 }
656 672
657 /** 673 /**
674 * Remembers the parsed annotation for the given node.
675 */
676 void putNodeAnnotation(AstNode node, ParsedAnnotation parsedAnnotation) {
677 List<ParsedAnnotation> annotations = nodeAnnotations.get(node);
678 if (annotations == null) {
679 annotations = Lists.newArrayList();
680 nodeAnnotations.put(node, annotations);
681 }
682 annotations.add(parsedAnnotation);
683 }
684
685 /**
658 * Remembers some Java binding for the given Dart {@link AstNode}. 686 * Remembers some Java binding for the given Dart {@link AstNode}.
659 */ 687 */
660 void putNodeBinding(AstNode node, IBinding binding) { 688 void putNodeBinding(AstNode node, IBinding binding) {
661 nodeToBinding.put(node, binding); 689 nodeToBinding.put(node, binding);
662 } 690 }
663 691
664 /** 692 /**
665 * Remembers Java {@link ITypeBinding} for the given Dart {@link AstNode}. 693 * Remembers Java {@link ITypeBinding} for the given Dart {@link AstNode}.
666 */ 694 */
667 void putNodeTypeBinding(AstNode node, ITypeBinding binding) { 695 void putNodeTypeBinding(AstNode node, ITypeBinding binding) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 } 1078 }
1051 } 1079 }
1052 } 1080 }
1053 } 1081 }
1054 } 1082 }
1055 } 1083 }
1056 } 1084 }
1057 }); 1085 });
1058 } 1086 }
1059 } 1087 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698