Skip to content

Commit

Permalink
Merge pull request #298 from sharwell/build-updates
Browse files Browse the repository at this point in the history
Build updates
  • Loading branch information
sharwell committed Jun 30, 2013
2 parents cb532e1 + 6236072 commit 3468a5f
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 280 deletions.
10 changes: 5 additions & 5 deletions antlr4-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.0.1-SNAPSHOT</version>
<version>4.1-SNAPSHOT</version>
</parent>

<artifactId>antlr4-maven-plugin</artifactId>
Expand Down Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<scope>compile</scope>
</dependency>

Expand All @@ -89,7 +89,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>

<!--
Expand Down Expand Up @@ -164,13 +164,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.2</version>
<version>3.3</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.6</version>
<version>2.7</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</target>

<target name="build-init" depends="basic-init">
<property name="version" value="4.0.1-dev"/>
<property name="version" value="4.1-dev"/>
<property name="build.sysclasspath" value="ignore"/>
<property name="install.root.dir" value="${dist.dir}/antlr-${version}" />
<property name="jar.file" value="${dist.dir}/antlr-${version}-complete.jar" />
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.0.1-SNAPSHOT</version>
<version>4.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>ANTLR 4</name>
Expand Down Expand Up @@ -132,7 +132,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<version>3.1</version>
<configuration>
<sourceDirectory>src</sourceDirectory>
<showWarnings>true</showWarnings>
Expand Down Expand Up @@ -181,7 +181,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<version>2.15</version>
</plugin>

<plugin>
Expand Down
2 changes: 1 addition & 1 deletion runtime/Java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.0.1-SNAPSHOT</version>
<version>4.1-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
35 changes: 17 additions & 18 deletions runtime/Java/src/org/antlr/v4/runtime/ANTLRErrorListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,35 @@

import java.util.BitSet;

/** How to emit recognition errors */
/** How to emit recognition errors. */
public interface ANTLRErrorListener {
/** Upon syntax error, notify any interested parties. This is not
* how to recover from errors or compute error messages. The
* parser ANTLRErrorStrategy specifies how to recover from syntax
* errors and how to compute error messages. This listener's job
* is simply to emit a computed message, though it has enough
* information to create its own message in many cases.
*
* The RecognitionException is non-null for all syntax errors
* except when we discover mismatched token errors that we can
* recover from in-line, without returning from the surrounding
* rule (via the single token insertion and deletion mechanism).
/**
* Upon syntax error, notify any interested parties. This is not how to
* recover from errors or compute error messages. {@link ANTLRErrorStrategy}
* specifies how to recover from syntax errors and how to compute error
* messages. This listener's job is simply to emit a computed message,
* though it has enough information to create its own message in many cases.
* <p/>
* The {@link RecognitionException} is non-null for all syntax errors except
* when we discover mismatched token errors that we can recover from
* in-line, without returning from the surrounding rule (via the single
* token insertion and deletion mechanism).
*
* @param recognizer
* What parser got the error. From this
* object, you can access the context as well
* as the input stream.
* @param offendingSymbol
* The offending token in the input token
* stream, unless recognizer is a lexer (then it's null) If
* no viable alternative error, e has token at which we
* stream, unless recognizer is a lexer (then it's null). If
* no viable alternative error, {@code e} has token at which we
* started production for the decision.
* @param line
* At what line in input to the error occur? This always refers to
* stopTokenIndex
* The line number in the input where the error occurred.
* @param charPositionInLine
* At what character position within that line did the error occur.
* The character position within that line where the error occurred.
* @param msg
* The message to emit
* The message to emit.
* @param e
* The exception generated by the parser that led to
* the reporting of an error. It is null in the case where
Expand Down
7 changes: 3 additions & 4 deletions runtime/Java/src/org/antlr/v4/runtime/ANTLRFileStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
import java.io.InputStreamReader;
import java.util.Arrays;

/** This is an ANTLRInputStream that is loaded from a file
* all at once when you construct the object. This is a special case
* since we know the exact size of the object to load. We can avoid lots
* of data copying.
/**
* This is an {@link ANTLRInputStream} that is loaded from a file all at once
* when you construct the object.
*/
public class ANTLRFileStream extends ANTLRInputStream {
protected String fileName;
Expand Down
10 changes: 6 additions & 4 deletions runtime/Java/src/org/antlr/v4/runtime/ANTLRInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
import java.io.Reader;
import java.util.Arrays;

/** Vacuum all input from a Reader/InputStream and then treat it like a char[] buffer.
* Can also pass in a string or char[] to use.
*
* If you need encoding, pass in stream/reader with correct encoding.
/**
* Vacuum all input from a {@link Reader}/{@link InputStream} and then treat it
* like a {@code char[]} buffer. Can also pass in a {@link String} or
* {@code char[]} to use.
* <p/>
* If you need encoding, pass in stream/reader with correct encoding.
*/
public class ANTLRInputStream implements CharStream {
public static final int READ_BUFFER_SIZE = 1024;
Expand Down
50 changes: 25 additions & 25 deletions runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,38 @@
import java.util.List;
import java.util.Set;

/** Buffer all input tokens but do on-demand fetching of new tokens from
* lexer. Useful when the parser or lexer has to set context/mode info before
* proper lexing of future tokens. The ST template parser needs this,
* for example, because it has to constantly flip back and forth between
* inside/output templates. E.g., <names:{hi, <it>}> has to parse names
* as part of an expression but "hi, <it>" as a nested template.
*
* You can't use this stream if you pass whitespace or other off-channel
* tokens to the parser. The stream can't ignore off-channel tokens.
* (UnbufferedTokenStream is the same way.) Use CommonTokenStream.
*
* This is not a subclass of UnbufferedTokenStream because I don't want
* to confuse small moving window of tokens it uses for the full buffer.
/**
* Buffer all input tokens but do on-demand fetching of new tokens from lexer.
* Useful when the parser or lexer has to set context/mode info before proper
* lexing of future tokens. The ST template parser needs this, for example,
* because it has to constantly flip back and forth between inside/output
* templates. E.g., {@code <names:{hi, <it>}>} has to parse names as part of an
* expression but {@code "hi, <it>"} as a nested template.
* <p/>
* You can't use this stream if you pass whitespace or other off-channel tokens
* to the parser. The stream can't ignore off-channel tokens.
* ({@link UnbufferedTokenStream} is the same way.) Use
* {@link CommonTokenStream}.
*/
public class BufferedTokenStream implements TokenStream {
@NotNull
protected TokenSource tokenSource;

/** Record every single token pulled from the source so we can reproduce
* chunks of it later. The buffer in LookaheadStream overlaps sometimes
* as its moving window moves through the input. This list captures
* everything so we can access complete input text.
*/
/**
* Record every single token pulled from the source so we can reproduce
* chunks of it later. This list captures everything so we can access
* complete input text.
*/
protected List<Token> tokens = new ArrayList<Token>(100);

/** The index into the tokens list of the current token (next token
* to consume). tokens[p] should be LT(1). p=-1 indicates need
* to initialize with first token. The ctor doesn't get a token.
* First call to LT(1) or whatever gets the first token and sets p=0;
*/
/**
* The index into {@link #tokens} of the current token (next token to
* consume). {@link #tokens}{@code [}{@link #p}{@code ]} should be
* {@link #LT LT(1)}. {@link #p}{@code =-1} indicates need to initialize
* with first token. The constructor doesn't get a token. First call to
* {@link #LT LT(1)} or whatever gets the first token and sets
* {@link #p}{@code =0;}.
*/
protected int p = -1;

/**
Expand All @@ -92,8 +94,6 @@ public BufferedTokenStream(TokenSource tokenSource) {
@Override
public int index() { return p; }

// public int range() { return range; }

@Override
public int mark() {
return 0;
Expand Down
Loading

0 comments on commit 3468a5f

Please sign in to comment.