Created
April 15, 2014 00:04
-
-
Save ainslec/10691414 to your computer and use it in GitHub Desktop.
Sample GWT compatible JavaCC parser definition file
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
options { | |
static = false; | |
IGNORE_CASE = false; | |
JAVA_UNICODE_ESCAPE = true; | |
JDK_VERSION = "1.5"; | |
// Not yet detected as a valid option by the Eclipse plugin, but works nonetheless. This is essential for GWT compatible generated code. | |
JAVA_TEMPLATE_TYPE = "modern"; | |
} | |
PARSER_BEGIN(Parser) | |
package org.consoli.javaccgwt.example1.parse; | |
public class Parser { | |
} | |
PARSER_END(Parser) | |
SPECIAL_TOKEN : | |
{ | |
< WHITESPACE: " " | "\t" | "\n" | "\r" > | |
} | |
TOKEN : | |
{ | |
< ONE: "one" > | |
| < TWO: "two" > | |
| < THREE: "three" > | |
} | |
void parse() : {} | |
{ | |
( < ONE > | < TWO > | < THREE >)+ | |
< EOF > | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment