diff --git a/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.pdf b/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.pdf index b63fd71c13f373038a1675d86cc1af8e5bf1c91f..70859b44db0316400ad521dc720552e329d0769d 100644 Binary files a/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.pdf and b/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.pdf differ diff --git a/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.tex b/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.tex index b4a1abb19074ffe87ab75b068ff15cbc0242581f..c0e3cc2ea6599c407b3175d93b6943b3386a56e2 100644 --- a/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.tex +++ b/cif/org.eclipse.escet.cif.metamodel/docs/cif_ecore_doc.tex @@ -103,7 +103,7 @@ % Document settings. \title{Compositional Interchange Format (CIF) Metamodel Reference Documentation (Incubation)} \author{Copyright (c) 2010, 2022 Contributors to the Eclipse Foundation} -\date{Version 2022-04-10} +\date{Version 2022-04-25} \titlepic{\includegraphics[width=0.5\textwidth]{figures/eclipse-incubation.png}} % Start of document. diff --git a/common/org.eclipse.escet.common.java/src/org/eclipse/escet/common/java/TextPosition.java b/common/org.eclipse.escet.common.java/src/org/eclipse/escet/common/java/TextPosition.java index a49258d00de2901d7767c05a12425a7c37598933..0ebdd95101caa14ff30951d4472a99b6f071c2b7 100644 --- a/common/org.eclipse.escet.common.java/src/org/eclipse/escet/common/java/TextPosition.java +++ b/common/org.eclipse.escet.common.java/src/org/eclipse/escet/common/java/TextPosition.java @@ -28,36 +28,38 @@ public class TextPosition implements Comparable { public final String source; /** - * The {@code 1}-based line index of the start (inclusive) of the position region, counted from the start of the - * text. + * The {@code 1}-based line index of the start (inclusive) of the position region with respect to the start of the + * source text. */ public final int startLine; /** - * The {@code 1}-based line index of the end (inclusive) of the position region, counted from the start of the text. + * The {@code 1}-based line index of the end (inclusive) of the position region with respect to the start of the + * source text. */ public final int endLine; /** - * The {@code 1}-based column index of the start (inclusive) of the position region, counted from the start of the - * text. + * The {@code 1}-based codepoint index at the {@code startLine} of the start (inclusive) of the position region with + * respect to the start of the line. */ public final int startColumn; /** - * The {@code 1}-based column index of the end (inclusive) of the position region, counted from the start of the - * text. + * The {@code 1}-based codepoint index at the {@code endLine} of the end (inclusive) of the position region with + * respect to the start of the line. */ public final int endColumn; /** - * The {@code 0}-based byte index of the start (inclusive) of the position region, counted from the start of the - * text. + * The {@code 0}-based codepoint index of the start (inclusive) of the position region with respect to the start of + * the source text. */ public final int startOffset; /** - * The {@code 0}-based byte index of the end (inclusive) of the position region, counted from the start of the text. + * The {@code 0}-based codepoint index of the end (inclusive) of the position region with respect to the start of + * the source text. */ public final int endOffset; @@ -66,18 +68,18 @@ public class TextPosition implements Comparable { * * @param location The location of the source file that contains the position. Must be an absolute path with * platform-specific path separators, but does not need to exist at the file system. - * @param startLine The {@code 1}-based line index of the start (inclusive) of the position region, counted from the - * start of the text. - * @param startColumn The {@code 1}-based column index of the start (inclusive) of the position region, counted from - * the start of the text. - * @param endLine The {@code 1}-based line index of the end (inclusive) of the position region, counted from the - * start of the text. - * @param endColumn The {@code 1}-based column index of the end (inclusive) of the position region, counted from the - * start of the text. - * @param startOffset The {@code 0}-based byte index of the start (inclusive) of the position region, counted from - * the start of the text. - * @param endOffset The {@code 0}-based byte index of the end (inclusive) of the position region, counted from the - * start of the text. + * @param startLine The {@code 1}-based line index of the start (inclusive) of the position region with respect to + * the start of the source text. + * @param startColumn The {@code 1}-based codepoint index at the {@code startLine} of the start (inclusive) of the + * position region with respect to the start of the line. + * @param endLine The {@code 1}-based line index of the end (inclusive) of the position region with respect to the + * start of the source text. + * @param endColumn The {@code 1}-based codepoint index at the {@code endLine} of the end (inclusive) of the + * position region with respect to the start of the line. + * @param startOffset The {@code 0}-based codepoint index of the start (inclusive) of the position region with + * respect to the start of the source text. + * @param endOffset The {@code 0}-based codepoint index of the end (inclusive) of the position region with respect + * to the start of the source text. */ public TextPosition(String location, int startLine, int startColumn, int endLine, int endColumn, int startOffset, int endOffset) @@ -91,18 +93,18 @@ public class TextPosition implements Comparable { * @param location The location of the source file that contains the position. Must be an absolute path with * platform-specific path separators, but does not need to exist at the file system. * @param source Source identification (usually a filename), may be {@code null}. - * @param startLine The {@code 1}-based line index of the start (inclusive) of the position region, counted from the - * start of the text. - * @param startColumn The {@code 1}-based column index of the start (inclusive) of the position region, counted from - * the start of the text. - * @param endLine The {@code 1}-based line index of the end (inclusive) of the position region, counted from the - * start of the text. - * @param endColumn The {@code 1}-based column index of the end (inclusive) of the position region, counted from the - * start of the text. - * @param startOffset The {@code 0}-based byte index of the start (inclusive) of the position region, counted from - * the start of the text. - * @param endOffset The {@code 0}-based byte index of the end (inclusive) of the position region, counted from the - * start of the text. + * @param startLine The {@code 1}-based line index of the start (inclusive) of the position region with respect to + * the start of the source text. + * @param startColumn The {@code 1}-based codepoint index at the {@code startLine} of the start (inclusive) of the + * position region with respect to the start of the line. + * @param endLine The {@code 1}-based line index of the end (inclusive) of the position region with respect to the + * start of the source text. + * @param endColumn The {@code 1}-based codepoint index at the {@code endLine} of the end (inclusive) of the + * position region with respect to the start of the line. + * @param startOffset The {@code 0}-based codepoint index of the start (inclusive) of the position region with + * respect to the start of the source text. + * @param endOffset The {@code 0}-based codepoint index of the end (inclusive) of the position region with respect + * to the start of the source text. */ public TextPosition(String location, String source, int startLine, int startColumn, int endLine, int endColumn, int startOffset, int endOffset) diff --git a/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.pdf b/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.pdf index b1e354ed7072aea06d2ba01be0d62871c484058b..b0226c625b505a27f5c8a6852c78644916f98d4f 100644 Binary files a/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.pdf and b/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.pdf differ diff --git a/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.tex b/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.tex index fafc4e0bc18063a6cfa00b927fd75cd03eb3c30e..298799676504588ff1417e1955790f716f2d5f36 100644 --- a/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.tex +++ b/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc.tex @@ -71,7 +71,7 @@ % Document settings. \title{Position Metamodel Reference Documentation (Incubation)} \author{Copyright (c) 2010, 2022 Contributors to the Eclipse Foundation} -\date{Version 2021-10-19} +\date{Version 2022-04-21} \titlepic{\includegraphics[width=0.5\textwidth]{figures/eclipse-incubation.png}} % Start of document. diff --git a/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc_details.tex b/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc_details.tex index 4c0c42f04157e48f678853ce7053c5aa521876f2..05b2ca48911334e9eed43295c1ddbbc7e93f44ba 100644 --- a/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc_details.tex +++ b/common/org.eclipse.escet.common.position.metamodel/docs/position_ecore_doc_details.tex @@ -22,6 +22,8 @@ Figure~\ref{fig:pkg:position} shows the \textit{position} package. The position package contains classes used to represent position information, for source tracking. A position is represented as a continuous region in a textual source (the \emph{source text}). +Positions are expressed as offset from the start of the text and as line and +column pair. Lines are delimited by a line-feed codepoint (U+000A). The \positionclass{Position} class represents actual position information. The abstract \positionclass{PositionObject} class can be used as a base class @@ -45,8 +47,8 @@ Position (source tracking) information. } \newcommand{\featdocuPositionendColumn}{ -The 1-based column index of the end (inclusive) of the position region, with -respect to the start of the source text. +The 1-based codepoint index at the \texttt{endLine} of the end (inclusive) of +the position region with respect to the start of the line. \begin{constraints} \citem{Position.endColumnValue} @@ -55,7 +57,7 @@ respect to the start of the source text. } \newcommand{\featdocuPositionendLine}{ -The 1-based line index of the end (inclusive) of the position region, with +The 1-based line index of the end (inclusive) of the position region with respect to the start of the source text. \begin{constraints} @@ -65,7 +67,7 @@ respect to the start of the source text. } \newcommand{\featdocuPositionendOffset}{ -The 0-based byte index of the end (inclusive) of the position region, with +The 0-based codepoint index of the end (inclusive) of the position region with respect to the start of the source text. \begin{constraints} @@ -86,8 +88,8 @@ Optional source identification. Usually, this is a file name. } \newcommand{\featdocuPositionstartColumn}{ -The 1-based column index of the start (inclusive) of the position region, with -respect to the start of the source text. +The 1-based codepoint index at the \texttt{startLine} of the start (inclusive) +of the position region with respect to the start of the line. \begin{constraints} \citem{Position.startColumnValue} @@ -96,7 +98,7 @@ respect to the start of the source text. } \newcommand{\featdocuPositionstartLine}{ -The 1-based line index of the start (inclusive) of the position region, with +The 1-based line index of the start (inclusive) of the position region with respect to the start of the source text. \begin{constraints} @@ -106,7 +108,7 @@ respect to the start of the source text. } \newcommand{\featdocuPositionstartOffset}{ -The 0-based byte index of the start (inclusive) of the position region, +The 0-based codepoint index of the start (inclusive) of the position region with respect to the start of the source text. \begin{constraints}