This commit is contained in:
Manu Sridharan 2013-05-30 14:42:03 -07:00
parent 547f0d276a
commit e41dc42276
2 changed files with 18 additions and 0 deletions

View File

@ -12,8 +12,17 @@ package com.ibm.wala.cast.js.html;
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
/**
* A {@link Position} for source code that has been included in some enclosing
* file, e.g., JavaScript code included in an HTML file via a script node.
*/
public interface IncludedPosition extends Position {
/**
* get the position of the containing script within the enclosing file. E.g.,
* for a position in JavaScript code included in an HTML file, returns the
* position of the relevant <code>&lt;script&gt;</code> tag in the HTML
*/
Position getIncludePosition();
}

View File

@ -15,9 +15,18 @@ import java.net.URL;
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
/**
* Represents a region of source code, with source locations. Regions can be
* added to other {@link SourceRegion}s, with nested source location information
* maintained.
*/
public class SourceRegion {
private final StringBuilder source = new StringBuilder();
/**
* source location information
*/
private FileMapping fileMapping;
private int currentLine = 1;