Java Code Examples for com.sun.tools.javac.util.Position#LineMap
The following examples show how to use
com.sun.tools.javac.util.Position#LineMap .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Checker.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public Boolean visitLiteral(LiteralTree tree, Trees trees) { TreePath path = getCurrentPath(); CompilationUnitTree unit = path.getCompilationUnit(); Position.LineMap lineMap = ((JCCompilationUnit)unit).lineMap; // long line = lineMap.getLineNumber(((JCTree)tree).pos/*trees.getSourcePositions().getStartPosition(tree)*/); // System.err.println(line + ": " + abbrev(tree)); Scope s = trees.getScope(path); if (tree.getKind() == Tree.Kind.STRING_LITERAL) check(s, tree.getValue().toString().trim()); return null; }
Example 2
Source File: SourcePositionImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private SourcePositionImpl(FileObject file, int position, Position.LineMap lineMap) { super(); this.filename = file; this.position = position; this.lineMap = lineMap; }
Example 3
Source File: SourcePositionImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private SourcePositionImpl(FileObject file, int position, Position.LineMap lineMap) { super(); this.filename = file; this.position = position; this.lineMap = lineMap; }
Example 4
Source File: CRTable.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** Source file positions in CRT are integers in the format: * {@literal line-number << LINESHIFT + column-number } */ private int encodePosition(int pos, Position.LineMap lineMap, Log log) { int line = lineMap.getLineNumber(pos); int col = lineMap.getColumnNumber(pos); int new_pos = Position.encodePosition(line, col); if (crtDebug) { System.out.println(", line = " + line + ", column = " + col + ", new_pos = " + new_pos); } if (new_pos == Position.NOPOS) log.warning(pos, Warnings.PositionOverflow(line)); return new_pos; }
Example 5
Source File: Checker.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public Boolean visitLiteral(LiteralTree tree, Trees trees) { TreePath path = getCurrentPath(); CompilationUnitTree unit = path.getCompilationUnit(); Position.LineMap lineMap = ((JCCompilationUnit)unit).lineMap; // long line = lineMap.getLineNumber(((JCTree)tree).pos/*trees.getSourcePositions().getStartPosition(tree)*/); // System.err.println(line + ": " + abbrev(tree)); Scope s = trees.getScope(path); if (tree.getKind() == Tree.Kind.STRING_LITERAL) check(s, tree.getValue().toString().trim()); return null; }
Example 6
Source File: SourcePositionImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private SourcePositionImpl(FileObject file, int position, Position.LineMap lineMap) { super(); this.filename = file; this.position = position; this.lineMap = lineMap; }
Example 7
Source File: JavacSourcePosition.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
JavacSourcePosition(JavaFileObject sourcefile, int pos, Position.LineMap lineMap) { this.sourcefile = sourcefile; this.pos = pos; this.lineMap = (pos != Position.NOPOS) ? lineMap : null; }
Example 8
Source File: JavacSourcePosition.java From javaide with GNU General Public License v3.0 | 5 votes |
JavacSourcePosition(JavaFileObject sourcefile, int pos, Position.LineMap lineMap) { this.sourcefile = sourcefile; this.pos = pos; this.lineMap = (pos != Position.NOPOS) ? lineMap : null; }
Example 9
Source File: JavacSourcePosition.java From hottub with GNU General Public License v2.0 | 5 votes |
JavacSourcePosition(JavaFileObject sourcefile, int pos, Position.LineMap lineMap) { this.sourcefile = sourcefile; this.pos = pos; this.lineMap = (pos != Position.NOPOS) ? lineMap : null; }
Example 10
Source File: SourcePositionImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
private SourcePositionImpl(FileObject file, int position, Position.LineMap lineMap) { super(); this.filename = file; this.position = position; this.lineMap = lineMap; }
Example 11
Source File: SourcePositionImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private SourcePositionImpl(FileObject file, int position, Position.LineMap lineMap) { super(); this.filename = file; this.position = position; this.lineMap = lineMap; }
Example 12
Source File: Checker.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Boolean visitLiteral(LiteralTree tree, Trees trees) { TreePath path = getCurrentPath(); CompilationUnitTree unit = path.getCompilationUnit(); Position.LineMap lineMap = ((JCCompilationUnit)unit).lineMap; // long line = lineMap.getLineNumber(((JCTree)tree).pos/*trees.getSourcePositions().getStartPosition(tree)*/); // System.err.println(line + ": " + abbrev(tree)); Scope s = trees.getScope(path); if (tree.getKind() == Tree.Kind.STRING_LITERAL) check(s, tree.getValue().toString().trim()); return null; }
Example 13
Source File: JavacSourcePosition.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
JavacSourcePosition(JavaFileObject sourcefile, int pos, Position.LineMap lineMap) { this.sourcefile = sourcefile; this.pos = pos; this.lineMap = (pos != Position.NOPOS) ? lineMap : null; }
Example 14
Source File: SourcePositionImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public static SourcePosition make(FileObject file, int pos, Position.LineMap lineMap) { if (file == null) return null; return new SourcePositionImpl(file, pos, lineMap); }
Example 15
Source File: SourcePositionImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public static SourcePosition make(FileObject file, int pos, Position.LineMap lineMap) { if (file == null) return null; return new SourcePositionImpl(file, pos, lineMap); }
Example 16
Source File: SourcePositionImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public static SourcePosition make(FileObject file, int pos, Position.LineMap lineMap) { if (file == null) return null; return new SourcePositionImpl(file, pos, lineMap); }
Example 17
Source File: DocCommentScanner.java From javaide with GNU General Public License v3.0 | 4 votes |
/** Build a map for translating between line numbers and * positions in the input. * * @return a LineMap */ public Position.LineMap getLineMap() { char[] buf = getRawCharacters(); return Position.makeLineMap(buf, buf.length, true); }
Example 18
Source File: SourcePositionImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public static SourcePosition make(FileObject file, int pos, Position.LineMap lineMap) { if (file == null) return null; return new SourcePositionImpl(file, pos, lineMap); }
Example 19
Source File: SourcePositionImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public static SourcePosition make(FileObject file, int pos, Position.LineMap lineMap) { if (file == null) return null; return new SourcePositionImpl(file, pos, lineMap); }
Example 20
Source File: JavaTokenizer.java From java-n-IDE-for-Android with Apache License 2.0 | 2 votes |
/** * Build a map for translating between line numbers and * positions in the input. * * @return a LineMap */ public Position.LineMap getLineMap() { return Position.makeLineMap(reader.getRawCharacters(), reader.buflen, false); }