diff --git a/.gitignore b/.gitignore index fe3bec2ef12de9debced01035268946f36a1cbae..6aa49287512956886644f7ee8924b01287e203b7 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ tmp/ PROB_LOGFILE_IS_UNDEFINED .settings/org.eclipse.jdt.ui.prefs src/main/resources/build.properties -config.groovy \ No newline at end of file +config.groovy +local.* +Version.java diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..ca877fc8ab5ea36c00b4210e6a204592e624dc66 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: java + +before_install: +- openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in secring.gpg.enc -out secring.gpg -d +- openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in pubring.gpg.enc -out pubring.gpg -d +- openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in gradle.properties.enc -out gradle.properties -d + +script: gradle uploadArchives + +env: + global: + secure: kFKnWpX4wkRGZ6gdP5Y7Nl/Gd5EZYYuJfv8qU2wfullMfLxeB/N1ANhUVqS+pP9oTbA52SHy7gzHTKxk4aeYBgPoiVx4RwRFV1wPYzv9SENNGsHrDdtSNRGM0OBpDkem6rX+OZ5FJ2GRCtX5ba3frclo11HUiAsYvAtoX8sk6lU= diff --git a/README.md b/README.md index 7d9212fd45fb346c81334727a7bdb659b6d57aea..b5f617c3d815946e84fc05ad4bd7112312250fb3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ SableCC 3.2 - STUPS version === +[](https://travis-ci.org/bendisposto/sablecc-stups) + This work is based on SableCC 3.2 by Etienne Gagnon. Our version of SableCC enriches the abstract syntax tree with information about tokens. @@ -10,7 +12,7 @@ Contributors to the extension of SableCC are: - Marc Büngener - Jens Bendisposto -The authors of the SabelCC version this work is based on are listed in the AUTHORS file. +The authors of the SableCC version this work is based on are listed in the AUTHORS file. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,7 +22,7 @@ Lesser General Public License for more details. License --- -This derived work is like SableCC covered by the GNU Lesser General Public License. You can view the copyright notice and the exact terms of the license in the files LICENSE, AUTHORS and COPYING-LESSER. +This derived work is, like SableCC, covered by the GNU Lesser General Public License. You can view the copyright notice and the exact terms of the license in the files LICENSE, AUTHORS and COPYING-LESSER. Building --- @@ -31,4 +33,4 @@ Building Documentation --- -You can find complete and detailed documentation on the SableCC framework and syntax at the site http://sablecc.org/documentation.html \ No newline at end of file +You can find complete and detailed documentation on the SableCC framework and syntax at the site http://sablecc.org/documentation.html diff --git a/build.gradle b/build.gradle index 04fab62e14d7faa65cbf0dacd417d3a3ce997dcb..019f1d8d8a1c8df7a5dd1a0fadf16e23392fd756 100644 --- a/build.gradle +++ b/build.gradle @@ -3,28 +3,113 @@ apply plugin: 'eclipse' apply plugin: 'maven' -project.version = '3.2.8' -project.group = 'de.stups' +project.version = '3.2.11' +project.group = 'de.hhu.stups' +project.archivesBaseName = "sablecc" + allprojects { sourceCompatibility = 1.5 targetCompatibility = 1.5 } -repositories { - maven { - name "cobra" - url "http://cobra.cs.uni-duesseldorf.de/artifactory/repo" - } -} - dependencies { testCompile 'junit:junit:4.8.2' } -task deploy(dependsOn: [jar,test,javadoc], group: 'Build') + +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} + +task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource +} jar { manifest { attributes 'Main-Class': 'org.sablecc.sablecc.SableCC' } } + +artifacts { + archives javadocJar, sourcesJar +} + +task writeVersion() { + + doFirst { + def buildconstants_class = """ + package org.sablecc.sablecc; + + public class Version + { + public static final String VERSION = "${project.version}"; + } + """ + File f = file("src/main/java/org/sablecc/sablecc/Version.java") + f.delete() + f << buildconstants_class + } +} + +compileJava { + dependsOn = ['writeVersion'] +} + +task deploy(dependsOn: [jar,test,javadoc], group: 'Build') + +if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { + +apply plugin: 'signing' + +signing { + sign configurations.archives +} +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name 'SableCC - Stups fork' + packaging 'jar' + // optionally artifactId can be defined here + description 'This version of SableCC enriches the abstract syntax tree with information about tokens.' + url 'https://github.com/bendisposto/sablecc-stups' + + licenses { + license { + name 'GNU Lesser General Public License, Version 2.1' + url 'http://www.gnu.org/licenses/lgpl-2.1.html' + } + } + + scm { + connection 'scm:git:git://github.com/bendisposto/sablecc-stups.git' + developerConnection 'scm:git:git@github.com:bendisposto/sablecc-stups.git' + url 'https://github.com/bendisposto/sablecc-stups' + } + + + developers { + developer { + id 'bendisposto' + name 'Jens Bendisposto' + email 'jens@bendisposto.de' + } + } + } + } + } +} +} diff --git a/gradle.properties.enc b/gradle.properties.enc new file mode 100644 index 0000000000000000000000000000000000000000..86b5e6251ecf1be7fedf5aa3917a35b3c4238e3a --- /dev/null +++ b/gradle.properties.enc @@ -0,0 +1 @@ +Salted__��Ln��X��$��o� HJ��1����z����VI�2(�,IA�};p�^�E���{q ��m������1Vb7P�4��Moj^(�]l�pߝ[|�����U���S�ղD02��BO���z;�+1e#��/��3���`w�WO��-�6TR+Inx�B/l����G>�SNj&G!iSy+��#4�Xf�����}�ꏥ1�E�*��+��sS� \ No newline at end of file diff --git a/gradlew b/gradlew deleted file mode 100755 index d8809f151d58eff9f73febc85f35e2219b4ffdc1..0000000000000000000000000000000000000000 --- a/gradlew +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/bash - -############################################################################## -## ## -## Gradle wrapper script for UN*X ## -## ## -############################################################################## - -# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together. -# GRADLE_OPTS="$GRADLE_OPTS -Xmx512m" -# JAVA_OPTS="$JAVA_OPTS -Xmx512m" - -GRADLE_APP_NAME=Gradle - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set JAVA_HOME if it's not already set. -if [ -z "$JAVA_HOME" ] ; then - if $darwin ; then - [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home" - [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home" - else - javaExecutable="`which javac`" - [ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME." - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - [ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME." - javaExecutable="`readlink -f \"$javaExecutable\"`" - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - export JAVA_HOME="$javaHome" - fi -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"` - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain -CLASSPATH=`dirname "$0"`/gradle/wrapper/gradle-wrapper.jar -WRAPPER_PROPERTIES=`dirname "$0"`/gradle/wrapper/gradle-wrapper.properties -# Determine the Java command to use to start the JVM. -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="java" - fi -fi -if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -if [ -z "$JAVA_HOME" ] ; then - warn "JAVA_HOME environment variable is not set" -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name -if $darwin; then - JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME" -# we may also want to set -Xdock:image -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -GRADLE_APP_BASE_NAME=`basename "$0"` - -exec "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \ - -classpath "$CLASSPATH" \ - -Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \ - -Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \ - $STARTER_MAIN_CLASS \ - "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 4855abb8839d447313d36f1622fab09d0f8338b1..0000000000000000000000000000000000000000 --- a/gradlew.bat +++ /dev/null @@ -1,82 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem ## -@rem Gradle startup script for Windows ## -@rem ## -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together. -@rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m -@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512m - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=.\ - -@rem Find java.exe -set JAVA_EXE=java.exe -if not defined JAVA_HOME goto init - -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. -echo. -goto end - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain -set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar -set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties - -set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%" - -@rem Execute Gradle -"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1 - -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%" -exit /b "%ERRORLEVEL%" - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega \ No newline at end of file diff --git a/pubring.gpg.enc b/pubring.gpg.enc new file mode 100644 index 0000000000000000000000000000000000000000..96245b700e81bb5a2b5882ecbcbd895c6adffc6e Binary files /dev/null and b/pubring.gpg.enc differ diff --git a/secring.gpg.enc b/secring.gpg.enc new file mode 100644 index 0000000000000000000000000000000000000000..58887ef2640d034a8d79683138ff7711fe1e5677 Binary files /dev/null and b/secring.gpg.enc differ diff --git a/src/main/java/org/sablecc/sablecc/Inlining.java b/src/main/java/org/sablecc/sablecc/Inlining.java index ae8979d74fd7c405d61f62c70c7020785b918eac..a1361eda85327063dbbe6a6661a53e41d79e36f3 100644 --- a/src/main/java/org/sablecc/sablecc/Inlining.java +++ b/src/main/java/org/sablecc/sablecc/Inlining.java @@ -76,7 +76,7 @@ public class Inlining if(prodMustBeInlined.getValue()) { /* - Once we detect that the production can be inline, + Once we detect that the production can be inline, we try to inline each of its alternatives. */ LinkedList listOfAlts = new TypedLinkedList(NodeCast.instance); @@ -150,7 +150,7 @@ public class Inlining return inlinedAlternatives; } - /***************************************************************** + /* boolean containsDoubloons(List aList) { AAlt[] alts = (AAlt [])aList.toArray(new AAlt[0]); @@ -176,9 +176,9 @@ public class Inlining } } } - return false; + return false; } - /*****************************************************************/ + */ /* * Inlining of an alternative diff --git a/src/main/java/org/sablecc/sablecc/Version.java b/src/main/java/org/sablecc/sablecc/Version.java deleted file mode 100644 index c835fb3372f77ad068543bda1aee4f2d415dd95a..0000000000000000000000000000000000000000 --- a/src/main/java/org/sablecc/sablecc/Version.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.sablecc.sablecc; - -public class Version -{ - public static final String VERSION = "3.2"; -} diff --git a/src/main/resources/org/sablecc/sablecc/lexer.txt b/src/main/resources/org/sablecc/sablecc/lexer.txt index 92312f5275a60d69ea93939d9e89c5c9f1cbbf86..6f1938cf42987a992ae4e9eaa05fd07b3334ba0c 100644 --- a/src/main/resources/org/sablecc/sablecc/lexer.txt +++ b/src/main/resources/org/sablecc/sablecc/lexer.txt @@ -32,7 +32,6 @@ import $1$.*; import de.hhu.stups.sablecc.patch.*; import java.util.concurrent.LinkedBlockingQueue; - @SuppressWarnings({"unused"}) public class Lexer implements ITokenListContainer { diff --git a/src/main/resources/patchfiles/SourcePositions.txt b/src/main/resources/patchfiles/SourcePositions.txt index eabac62cdb0559a4070b955653cb97299e96aa74..eefe61eca54b46f0606e696a1347945e274d67d9 100644 --- a/src/main/resources/patchfiles/SourcePositions.txt +++ b/src/main/resources/patchfiles/SourcePositions.txt @@ -1,7 +1,7 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, +/** + * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) + * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) * */ package de.hhu.stups.sablecc.patch; @@ -23,9 +23,9 @@ public class SourcePositions { /** * Returns the {@link SourcecodeRange} of this {@link PositionedNode} or * <code>null</code> if no {@link SourcecodeRange} is available. - * - * @param node - * @return + * + * @param node the node with source code information + * @return the source code range of <code>node</code> */ public SourcecodeRange getSourcecodeRange(final PositionedNode node) { return positions.get(node); @@ -35,9 +35,9 @@ public class SourcePositions { * Returns the line in which this {@link PositionedNode} begins. The value * <code>0</code> is returned if no sourcecode range is available for this * {@link PositionedNode}. - * - * @param node - * @return + * + * @param node the node with source code information + * @return the line where the <code>node</code> starts */ public int getBeginLine(final PositionedNode node) { if (node instanceof IToken) { @@ -59,9 +59,9 @@ public class SourcePositions { * Returns the column of the first character of this {@link PositionedNode}, * i.e. the begin column. The value <code>0</code> is returned if no * sourcecode range is available for this {@link PositionedNode}. - * - * @param node - * @return + * + * @param node the node with source code information + * @return the begin column of <code>node</code> */ public int getBeginColumn(final PositionedNode node) { if (node instanceof IToken) { @@ -83,9 +83,9 @@ public class SourcePositions { * Returns the line in which the {@link PositionedNode} ends. The value * <code>0</code> is returned if no sourcecode range is available for this * {@link PositionedNode}. - * - * @param node - * @return + * + * @param node the node with source code information + * @return the end line of <code>node</code> */ public int getEndLine(final PositionedNode node) { // TODO handle multi line comments @@ -127,9 +127,9 @@ public class SourcePositions { * of the last character of the {@link PositionedNode}. The value * <code>0</code> is returned if no sourcecode range is available for this * {@link PositionedNode}. - * - * @param node - * @return + * + * @param node the node with source code information + * @return the end column of <code>node</code> */ public int getEndColumn(final PositionedNode node) { // TODO handle multi line comments @@ -159,12 +159,12 @@ public class SourcePositions { * private int getEndColumn(final TComment commentToken) { final String * asString = commentToken.getText(); final StringTokenizer tokenizer = new * StringTokenizer(asString, "\n\r"); - * + * * // multi line comment if (tokenizer.countTokens() > 1) { String line = * null; while (tokenizer.hasMoreTokens()) { line = tokenizer.nextToken(); } - * + * * if (line == null) { return 0; } - * + * * return line.length(); } // single line comment else { return * commentToken.getPos() + asString.length(); } } */ @@ -173,9 +173,9 @@ public class SourcePositions { * Returns the array of {@link IToken}s belonging to this * {@link PositionedNode}. The array may be empty, if no sourcecode range * can be determined for this {@link PositionedNode}. - * - * @param node - * @return + * + * @param node the node with source code information + * @return all tokens of <code>node</code> */ public IToken[] getTokens(final PositionedNode node) { if (node instanceof IToken) { @@ -225,13 +225,13 @@ public class SourcePositions { // TODO handle comments /* - * + * * public IToken getCommentBefore(final PositionedNode node) { final * SourcecodeRange range = getSourcecodeRange(node); final int beginIndex = * range.getBeginIndex(); if (beginIndex > 0) { final IToken token = * tokenList.get(beginIndex - 1); if (token instanceof TComment) { return * token; } else { return null; } } else { return null; } } - * + * * public IToken getCommentAfter(final PositionedNode node) { final * SourcecodeRange range = getSourcecodeRange(node); final int endIndex = * range.getEndIndex(); if (endIndex < tokenList.size() - 1) { final IToken @@ -239,15 +239,15 @@ public class SourcePositions { * return token; } else { return null; } } else { return null; } } public * IToken[] getIncludedComments(final PositionedNode node) { final * SourcecodeRange range = getSourcecodeRange(node); - * + * * if (range != null) { final int beginIndex = range.getBeginIndex(); final * int endIndex = range.getEndIndex(); final List<IToken> comments = new * ArrayList<IToken>(); - * + * * for (int i = 0; i + beginIndex <= endIndex; i++) { final IToken token = * tokenList.get(i + beginIndex); if (token instanceof TComment) { * comments.add(token); } } - * + * * return comments.toArray(new IToken[comments.size()]); } else { return new * IToken[0]; } } */ @@ -300,8 +300,8 @@ public class SourcePositions { * </p> * <p> * If no token list is available <code>-1</code> is returned. For - * <code>line < 0</code> the index <code>0</code> is returned. If - * <code>line >= 1 && column < 0</code> the line number is returned. + * <code>line < 0</code> the index <code>0</code> is returned. If + * <code>line >= 1 && column < 0</code> the line number is returned. * </p> * <p> * If the line matches but the requested column is beyond the max. length of @@ -312,7 +312,7 @@ public class SourcePositions { * <p> * <b>Attention</b>: Line and column counting starts at 1! * </p> - * + * * @param line * line of the position * @param column @@ -412,7 +412,7 @@ public class SourcePositions { /** * Compares the token position (within line only) with the column. - * + * * @param token * @param column * @return <code>-1</code> if <code>column < beginColumn</code>,