-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from zbynek/annotations-and-tests
Move displaced @deprecated annotations, add tests
- Loading branch information
Showing
23 changed files
with
388 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ target/ | |
.classpath | ||
.project | ||
.settings/ | ||
.idea | ||
bin/ | ||
|
||
local-repo/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* Copyright (c) 2006, Sun Microsystems, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of the Sun Microsystems, Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
This directory contains two examples using the modern template (compatible with GWT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.javacc.generator.java</groupId> | ||
<artifactId>examples</artifactId> | ||
<version>1.0.0</version> | ||
</parent> | ||
<groupId>org.javacc.generator.java.examples</groupId> | ||
<artifactId>gwt</artifactId> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>gwt1</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>GwtSimpleParser</mainClass> | ||
<arguments> | ||
<argument>${project.basedir}/simple/out</argument> | ||
<argument>${project.basedir}/simple/err</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>unicode</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>GwtUnicodeParser</mainClass> | ||
<arguments> | ||
<argument>${project.basedir}/unicode/out</argument> | ||
<argument>${project.basedir}/unicode/err</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>compare-simple</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<target> | ||
<available file="${project.basedir}/simple/out" property="isActualAvailable" /> | ||
<fail unless="isActualAvailable" message="${project.basedir}/simple/out does not exist!" /> | ||
<available file="${project.basedir}/simple/ref" property="isExpectedAvailable" /> | ||
<fail unless="isExpectedAvailable" message="${project.basedir}/simple/ref does not exist!" /> | ||
<condition property="files.match"> | ||
<filesmatch file1="${project.basedir}/simple/out" file2="${project.basedir}/simple/ref" textfile="true" /> | ||
</condition> | ||
<fail unless="files.match" message="${project.basedir}/simple/out does not match ${project.basedir}/simple/ref!" /> | ||
</target> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>compare-unicode</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<target> | ||
<available file="${project.basedir}/unicode/out" property="isActualAvailable" /> | ||
<fail unless="isActualAvailable" message="${project.basedir}/unicode/out does not exist!" /> | ||
<available file="${project.basedir}/unicode/ref" property="isExpectedAvailable" /> | ||
<fail unless="isExpectedAvailable" message="${project.basedir}/unicode/ref does not exist!" /> | ||
<condition property="files.match"> | ||
<filesmatch file1="${project.basedir}/unicode/out" file2="${project.basedir}/unicode/ref" textfile="true" /> | ||
</condition> | ||
<fail unless="files.match" message="${project.basedir}/unicode/out does not match ${project.basedir}/unicode/ref!" /> | ||
</target> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<name>JavaCC examples Java Simple</name> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
out | ||
err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* Copyright (c) 2006, Sun Microsystems, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of the Sun Microsystems, Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
|
||
options { | ||
LOOKAHEAD = 1; | ||
CHOICE_AMBIGUITY_CHECK = 2; | ||
OTHER_AMBIGUITY_CHECK = 1; | ||
STATIC = true; | ||
DEBUG_PARSER = false; | ||
DEBUG_LOOKAHEAD = false; | ||
DEBUG_TOKEN_MANAGER = false; | ||
ERROR_REPORTING = true; | ||
JAVA_UNICODE_ESCAPE = false; | ||
UNICODE_INPUT = false; | ||
IGNORE_CASE = false; | ||
USER_TOKEN_MANAGER = false; | ||
USER_CHAR_STREAM = false; | ||
BUILD_PARSER = true; | ||
BUILD_TOKEN_MANAGER = true; | ||
SANITY_CHECK = true; | ||
FORCE_LA_CHECK = false; | ||
JAVA_TEMPLATE_TYPE = "modern"; | ||
} | ||
|
||
PARSER_BEGIN(GwtSimpleParser) | ||
|
||
import java.io.IOException; | ||
import java.io.PrintStream; | ||
|
||
/** Simple brace matcher. */ | ||
public class GwtSimpleParser { | ||
|
||
/** Main entry point. */ | ||
public static void main(String args[]) throws ParseException, IOException { | ||
PrintStream output = System.out; | ||
PrintStream error = System.err; | ||
PrintStream prevOutput = null; | ||
PrintStream prevError = null; | ||
if (args.length == 2) { | ||
prevOutput = output; | ||
output = new PrintStream(args[0]); | ||
prevError = error; | ||
error = new PrintStream(args[1]); | ||
System.setOut(output); | ||
System.setErr(error); | ||
} | ||
try { | ||
GwtSimpleParser parser = new GwtSimpleParser(new StringProvider("A")); | ||
parser.Input(); | ||
} catch (Exception e) { | ||
error.println(e.getMessage()); | ||
} finally { | ||
if (prevOutput != null) System.setOut(prevOutput); | ||
if (prevError != null) System.setErr(prevError); | ||
} | ||
} | ||
|
||
} | ||
|
||
PARSER_END(GwtSimpleParser) | ||
|
||
/** Root production. */ | ||
void Input() : | ||
{} | ||
{ | ||
|
||
"A" { | ||
System.out.println("hello"); | ||
} <EOF> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* Copyright (c) 2006, Sun Microsystems, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of the Sun Microsystems, Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
|
||
options { | ||
LOOKAHEAD = 1; | ||
CHOICE_AMBIGUITY_CHECK = 2; | ||
OTHER_AMBIGUITY_CHECK = 1; | ||
STATIC = true; | ||
DEBUG_PARSER = false; | ||
DEBUG_LOOKAHEAD = false; | ||
DEBUG_TOKEN_MANAGER = false; | ||
ERROR_REPORTING = true; | ||
JAVA_UNICODE_ESCAPE = true; | ||
UNICODE_INPUT = false; | ||
IGNORE_CASE = false; | ||
USER_TOKEN_MANAGER = false; | ||
USER_CHAR_STREAM = false; | ||
BUILD_PARSER = true; | ||
BUILD_TOKEN_MANAGER = true; | ||
SANITY_CHECK = true; | ||
FORCE_LA_CHECK = false; | ||
JAVA_TEMPLATE_TYPE = "modern"; | ||
} | ||
|
||
PARSER_BEGIN(GwtUnicodeParser) | ||
|
||
import java.io.IOException; | ||
import java.io.PrintStream; | ||
|
||
/** Simple brace matcher. */ | ||
public class GwtUnicodeParser { | ||
|
||
/** Main entry point. */ | ||
public static void main(String args[]) throws ParseException, IOException { | ||
PrintStream output = System.out; | ||
PrintStream error = System.err; | ||
PrintStream prevOutput = null; | ||
PrintStream prevError = null; | ||
if (args.length == 2) { | ||
prevOutput = output; | ||
output = new PrintStream(args[0]); | ||
prevError = error; | ||
error = new PrintStream(args[1]); | ||
System.setOut(output); | ||
System.setErr(error); | ||
} | ||
try { | ||
GwtUnicodeParser parser = new GwtUnicodeParser(new StringProvider("A")); | ||
parser.Input(); | ||
} catch (Exception e) { | ||
error.println(e.getMessage()); | ||
} finally { | ||
if (prevOutput != null) System.setOut(prevOutput); | ||
if (prevError != null) System.setErr(prevError); | ||
} | ||
} | ||
|
||
} | ||
|
||
PARSER_END(GwtUnicodeParser) | ||
|
||
/** Root production. */ | ||
void Input() : | ||
{} | ||
{ | ||
|
||
"A" { | ||
System.out.println("hello"); | ||
} <EOF> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
out | ||
err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.