| 
 | 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.makumba.analyser.engine.SourceSyntaxPoints
public class SourceSyntaxPoints
The collection of syntax points in a source file gathered from a source analysis.
| Nested Class Summary | |
|---|---|
| static interface | SourceSyntaxPoints.PreprocessorClient | 
| Field Summary | |
|---|---|
| (package private)  SourceSyntaxPoints.PreprocessorClient | client | 
| (package private)  String | contentThe content, where comments are replaced by whitespace and include directives are replaced by included text | 
| (package private)  File | fileThe path of the analyzed file | 
| (package private)  ArrayList<Integer> | fileBeginningIndexesThe file beginnings, added in occuring order. | 
| (package private)  ArrayList<SourceSyntaxPoints> | fileBeginnings | 
| (package private)  long | lastChangedThe timestamp of the analyzed file. | 
| (package private)  ArrayList<SyntaxPoint> | lineBeginningsThe line beginnings, added in occuring order | 
| (package private)  int | offsetoffset in the including file | 
| (package private)  String | originalTextThe original text | 
| (package private)  SourceSyntaxPoints | parentthe parent, in which we are included | 
| (package private)  TreeSet<SyntaxPoint> | syntaxPointsThe syntax points, sorted | 
| Constructor Summary | |
|---|---|
| SourceSyntaxPoints(File f,
                   SourceSyntaxPoints.PreprocessorClient cl)The constructor inserts syntax points (begin and end) for every line in a text, and does preprocessing (uncomments text, includes other text). | |
| SourceSyntaxPoints(File f,
                   SourceSyntaxPoints.PreprocessorClient cl,
                   SourceSyntaxPoints parent,
                   String includeDirective,
                   int offset)The constructor inserts syntax points (begin and end) for every line in a text, and does preprocessing (uncomments text, includes other text). | |
| Method Summary | |
|---|---|
|  SyntaxPoint.End | addSyntaxPoints(int start,
                int end,
                String type,
                Object extra)Creates a beginning and end syntaxPoint for a syntax entity, and adds these to the collection of points. | 
| (package private)  SyntaxPoint.End | addSyntaxPoints1(int start,
                 int end,
                 String type,
                 Object extra) | 
| (package private)  SyntaxPoint.End | addSyntaxPointsCommon(int start,
                      int end,
                      String type,
                      Object extra)Creates begin- and end- syntaxpoints (but without setting the line and column fields) at given location and with given info, and adds them to the collection. | 
| (package private)  void | addSyntaxPointsLine(int start,
                    int end,
                    String type,
                    Object extra)Creates begin- and end- syntaxpoints for a full line in text. | 
|  void | discardPoints() | 
| (package private)  void | findLineBreaks()Finds the line breaks in the string | 
| (package private)  SourceSyntaxPoints | findSourceFile(int position)Finds the source file that contains the given syntax point | 
| (package private)  String | getContent() | 
|  File | getFile() | 
|  String | getLineText(int n)Gets the text of the line n. | 
|  SyntaxPoint[] | getSyntaxPoints()Returns the syntaxPoints. | 
| (package private)  void | include()Includes a file into the current content | 
|  void | include(File f,
        int position,
        String includeDirective)Includes the given file, at the given position, included by the given directive | 
| (package private)  String | readFile(String includeDirective)Reads the content of the JSP file into a string. | 
| (package private)  void | setLineAndColumn(SyntaxPoint point)Fills in the Line and Column for the given SyntaxPoint, based on the collection of lineBeginnings syntaxPoints. | 
|  String | toString() | 
| (package private)  void | treatLiterals(int patternIndex)Treat literals, to be specific creates a syntax point for them and then replaces their content. | 
| (package private)  boolean | unchanged()Checks if the file changed on the disk since it was last analysed. | 
| (package private)  void | unComment(int patternIndex)Treats comments, to be specific creates a syntax point for them and then replaces their content. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
File file
SourceSyntaxPoints.PreprocessorClient client
long lastChanged
TreeSet<SyntaxPoint> syntaxPoints
ArrayList<SyntaxPoint> lineBeginnings
ArrayList<Integer> fileBeginningIndexes
ArrayList<SourceSyntaxPoints> fileBeginnings
String originalText
String content
int offset
SourceSyntaxPoints parent
| Constructor Detail | 
|---|
public SourceSyntaxPoints(File f,
                          SourceSyntaxPoints.PreprocessorClient cl)
f - the parsed filecl - the preprocessor
public SourceSyntaxPoints(File f,
                          SourceSyntaxPoints.PreprocessorClient cl,
                          SourceSyntaxPoints parent,
                          String includeDirective,
                          int offset)
f - the parsed filecl - the preprocessorparent - the parent in which we are includedincludeDirective - the include directiveoffset - the offset at which the inclusion takes place| Method Detail | 
|---|
public String toString()
toString in class Objectvoid findLineBreaks()
public String getLineText(int n)
n - the line number
void include()
public void include(File f,
                    int position,
                    String includeDirective)
f - the file to be includedposition - the position of the included fileincludeDirective - the directive calling for the inclusionvoid unComment(int patternIndex)
patternIndex - the index at which the comment is storedvoid treatLiterals(int patternIndex)
patternIndex - the index at which the literal is stored
public SyntaxPoint.End addSyntaxPoints(int start,
                                       int end,
                                       String type,
                                       Object extra)
start - the starting positionend - the end positiontype - String stating the type of syntax pointextra - any extra info (for example the object created at the syntax pointaddSyntaxPointsCommon(int start, int end, String type, Object extra)
SyntaxPoint.End addSyntaxPoints1(int start,
                                 int end,
                                 String type,
                                 Object extra)
void setLineAndColumn(SyntaxPoint point)
point - the syntax point to be filled inSourceSyntaxPoints findSourceFile(int position)
position - position of the syntax point
SyntaxPoint.End addSyntaxPointsCommon(int start,
                                      int end,
                                      String type,
                                      Object extra)
start - the starting positionend - the end positiontype - String stating the type of syntax pointextra - any extra info (for example the object created at the syntax point
addSyntaxPoints(int, int, String, Object)
void addSyntaxPointsLine(int start,
                         int end,
                         String type,
                         Object extra)
start - the starting positionend - the end positiontype - String stating the type of syntax pointextra - any extra info (for example the object created at the syntax pointboolean unchanged()
false if unchanged, true otherwiseString readFile(String includeDirective)
includeDirective - the directive by which this file has been included
String getContent()
public SyntaxPoint[] getSyntaxPoints()
public void discardPoints()
public File getFile()
| 
 | 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||