Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started removing JDT references from AST classes.
Change on 2016/07/12 by tball <tball@google.com> ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127230396
- Loading branch information
Showing
9 changed files
with
160 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
translator/src/main/java/com/google/devtools/j2objc/ast/SourcePosition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.devtools.j2objc.ast; | ||
|
||
/** | ||
* Source position information for an AST node. | ||
*/ | ||
public class SourcePosition { | ||
private int startPosition; | ||
private int length; | ||
private int lineNumber; | ||
|
||
/** | ||
* A pseudo-position used for nodes that are not derived from source code. | ||
*/ | ||
public static final SourcePosition NO_POSITION = new SourcePosition(-1, 0, -1); | ||
|
||
SourcePosition(int startPosition, int length) { | ||
this(startPosition, length, -1); | ||
} | ||
|
||
SourcePosition(int startPosition, int length, int lineNumber) { | ||
this.startPosition = startPosition; | ||
this.length = length; | ||
this.lineNumber = lineNumber; | ||
} | ||
|
||
public final int getStartPosition() { | ||
return startPosition; | ||
} | ||
|
||
public final int getLength() { | ||
return length; | ||
} | ||
|
||
public void setSourceRange(int newStartPosition, int newLength) { | ||
startPosition = newStartPosition; | ||
length = newLength; | ||
} | ||
|
||
public final int getLineNumber() { | ||
return lineNumber; | ||
} | ||
|
||
public void setLineNumber(int lineNumber) { | ||
this.lineNumber = lineNumber; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters