| java.lang.Object org.makumba.analyser.engine.SourceSyntaxPoints
All known Subclasses: org.makumba.analyser.engine.JavaParseData, org.makumba.analyser.engine.JspParseData,
SourceSyntaxPoints | public class SourceSyntaxPoints (Code) | | The collection of syntax points in a source file gathered from a source analysis.
author: Cristian Bogdan version: $Id: SourceSyntaxPoints.java 1964 2007-10-29 23:40:16Z cristian_bogdan $ |
Inner Class :static interface PreprocessorClient | |
Constructor Summary | |
public | SourceSyntaxPoints(File f, PreprocessorClient cl) The constructor inserts syntax points (begin and end) for every line in a text, and does preprocessing
(uncomments text, includes other text). | public | SourceSyntaxPoints(File f, 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 | |
public 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. | SyntaxPoint.End | addSyntaxPoints1(int start, int end, String type, Object extra) | 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. | void | addSyntaxPointsLine(int start, int end, String type, Object extra) Creates begin- and end- syntaxpoints for a full line in text. | void | findLineBreaks() | SourceSyntaxPoints | findSourceFile(int position) | String | getContent() | public String | getLineText(int n) | public SyntaxPoint[] | getSyntaxPoints() Returns the syntaxPoints. | void | include() | public void | include(File f, int position, String includeDirective) | String | readFile(String includeDirective) Reads the content of the JSP file into a string. | void | setLineAndColumn(SyntaxPoint point) Fills in the Line and Column for the given SyntaxPoint, based on the collection of lineBeginnings syntaxPoints. | public String | toString() | void | treatLiterals(int patternIndex) Treat literals, to be specific creates a syntax point for them and then replaces their content. | void | unComment(int patternIndex) Treats comments, to be specific creates a syntax point for them and then replaces their content. | boolean | unchanged() Checks if the file changed on the disk since it was last analysed. |
client | PreprocessorClient client(Code) | | |
content | String content(Code) | | The content, where comments are replaced by whitespace and include directives are replaced by included text
|
file | File file(Code) | | The path of the analyzed file
|
fileBeginningIndexes | ArrayList fileBeginningIndexes(Code) | | The file beginnings, added in occuring order. When file F includes file I, I begins, then F begins again
|
lastChanged | long lastChanged(Code) | | The timestamp of the analyzed file. If it is found newer on disk, the cached object is discarded.
|
lineBeginnings | ArrayList lineBeginnings(Code) | | The line beginnings, added in occuring order
|
offset | int offset(Code) | | offset in the including file
|
syntaxPoints | TreeSet syntaxPoints(Code) | | The syntax points, sorted
|
SourceSyntaxPoints | public SourceSyntaxPoints(File f, PreprocessorClient cl)(Code) | | The constructor inserts syntax points (begin and end) for every line in a text, and does preprocessing
(uncomments text, includes other text). Most syntax colourers need to do specific operations at every line.
Parameters: f - the parsed file Parameters: cl - the preprocessor |
SourceSyntaxPoints | public SourceSyntaxPoints(File f, PreprocessorClient cl, SourceSyntaxPoints parent, String includeDirective, int offset)(Code) | | The constructor inserts syntax points (begin and end) for every line in a text, and does preprocessing
(uncomments text, includes other text). Most syntax colourers need to do specific operations at every line.
Parameters: f - the parsed file Parameters: cl - the preprocessor Parameters: parent - the parent in which we are included Parameters: includeDirective - the include directive Parameters: offset - the offset at which the inclusion takes place |
addSyntaxPointsCommon | SyntaxPoint.End addSyntaxPointsCommon(int start, int end, String type, Object extra)(Code) | | 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.
Parameters: start - the starting position Parameters: end - the end position Parameters: type - String stating the type of syntax point Parameters: extra - any extra info (for example the object created at the syntax point the created SyntaxPoint.End See Also: SourceSyntaxPoints.addSyntaxPoints(int,int,String,Object) |
addSyntaxPointsLine | void addSyntaxPointsLine(int start, int end, String type, Object extra)(Code) | | Creates begin- and end- syntaxpoints for a full line in text.
Parameters: start - the starting position Parameters: end - the end position Parameters: type - String stating the type of syntax point Parameters: extra - any extra info (for example the object created at the syntax point |
findLineBreaks | void findLineBreaks()(Code) | | Finds the line breaks in the string
|
findSourceFile | SourceSyntaxPoints findSourceFile(int position)(Code) | | Finds the source file that contains the given syntax point
Parameters: position - position of the syntax point |
getLineText | public String getLineText(int n)(Code) | | Gets the text of the line n
Parameters: n - the line number A String containing the text at the indicated line |
getSyntaxPoints | public SyntaxPoint[] getSyntaxPoints()(Code) | | Returns the syntaxPoints.
An array of SyntaxPoints |
include | void include()(Code) | | Includes a file into the current content
|
include | public void include(File f, int position, String includeDirective)(Code) | | Includes the given file, at the given position, included by the given directive
Parameters: f - the file to be included Parameters: position - the position of the included file Parameters: includeDirective - the directive calling for the inclusion |
readFile | String readFile(String includeDirective)(Code) | | Reads the content of the JSP file into a string.
Parameters: includeDirective - the directive by which this file has been included A String containing a JSP file |
setLineAndColumn | void setLineAndColumn(SyntaxPoint point)(Code) | | Fills in the Line and Column for the given SyntaxPoint, based on the collection of lineBeginnings syntaxPoints.
Parameters: point - the syntax point to be filled in |
treatLiterals | void treatLiterals(int patternIndex)(Code) | | Treat literals, to be specific creates a syntax point for them and then replaces their content.
Parameters: patternIndex - the index at which the literal is stored |
unComment | void unComment(int patternIndex)(Code) | | Treats comments, to be specific creates a syntax point for them and then replaces their content.
Parameters: patternIndex - the index at which the comment is stored |
unchanged | boolean unchanged()(Code) | | Checks if the file changed on the disk since it was last analysed.
false if unchanged, true otherwise |
|
|