Package org.eclipse.m2m.atl.common
Class AtlNbCharFile
java.lang.Object
org.eclipse.m2m.atl.common.AtlNbCharFile
This class is used by a stackframe to compute char position in a file With the file name and project name,
this structure build a list for each line the position of its first char and the position of the tabs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns computes the char start position from the string "cursorLine:cursorColumn" given by Eclipse (tabs are 4 chars long by default, but it is user-configurable).int[]
getIndexChar
(String sourceLocation) Returns the index char in the source location.int[]
getIndexChar
(String sourceLocation, int tabWidth) Returns an array of int: first element is startChar, second element is endChar.
-
Constructor Details
-
AtlNbCharFile
The AtlNbCharFile constructor.- Parameters:
in
- the input stream
-
-
Method Details
-
getIndexChar
Returns the index char in the source location.- Parameters:
sourceLocation
- the source- Returns:
- the index char in the source location
-
getIndexChar
Returns an array of int: first element is startChar, second element is endChar. *- Parameters:
sourceLocation
- the string representing "startLine:startColumn-endLine:endColumn" the location given by antlr (tabs are 8 chars long)tabWidth
- the width of the tab- Returns:
- An array of int: first element is startChar, second element is endChar
-
getIndex
Returns computes the char start position from the string "cursorLine:cursorColumn" given by Eclipse (tabs are 4 chars long by default, but it is user-configurable).- Parameters:
cursorPosition
- the string representing the cursor position- Returns:
- computes the char start position from the string "cursorLine:cursorColumn" given by Eclipse (tabs are 4 chars long by default, but it is user-configurable)
- Throws:
NumberFormatException
IndexOutOfBoundsException
-