You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2011/08/01 17:28:50 UTC
svn commit: r1152828 [5/6] - in
/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.ui.utils: ./
META-INF/ bin/ icons/ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/uima/
src/main/java/org/...
Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.ui.utils/src/main/java/org/apache/uima/tm/textmarker/ui/convert/ConvertSyntaxParser.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.ui.utils/src/main/java/org/apache/uima/tm/textmarker/ui/convert/ConvertSyntaxParser.java?rev=1152828&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.ui.utils/src/main/java/org/apache/uima/tm/textmarker/ui/convert/ConvertSyntaxParser.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.ui.utils/src/main/java/org/apache/uima/tm/textmarker/ui/convert/ConvertSyntaxParser.java Mon Aug 1 15:28:46 2011
@@ -0,0 +1,8512 @@
+// $ANTLR 3.1.2 D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g 2009-08-17 15:43:13
+
+package org.apache.uima.tm.textmarker.ui.convert;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.antlr.runtime.BaseRecognizer;
+import org.antlr.runtime.BitSet;
+import org.antlr.runtime.CommonToken;
+import org.antlr.runtime.DFA;
+import org.antlr.runtime.EarlyExitException;
+import org.antlr.runtime.IntStream;
+import org.antlr.runtime.MismatchedSetException;
+import org.antlr.runtime.NoViableAltException;
+import org.antlr.runtime.Parser;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.RecognizerSharedState;
+import org.antlr.runtime.Token;
+import org.antlr.runtime.TokenStream;
+import org.apache.uima.tm.dltk.internal.core.builder.DescriptorManager;
+import org.apache.uima.tm.dltk.parser.ast.TextMarkerBlock;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+
+
+public class ConvertSyntaxParser extends Parser {
+ public static final String[] tokenNames = new String[] { "<invalid>", "<EOR>", "<DOWN>", "<UP>",
+ "DocComment", "Annotation", "ListIdentifier", "PackageString", "SEMI", "TypeSystemString",
+ "ScriptString", "EngineString", "IntString", "Identifier", "COMMA", "ASSIGN_EQUAL",
+ "DoubleString", "StringString", "BooleanString", "TypeString", "ConditionString", "ACTION",
+ "DECLARE", "LIST", "TABLE", "LPAREN", "RPAREN", "BlockString", "LCURLY", "RCURLY",
+ "StringLiteral", "STAR", "QUESTION", "PLUS", "LBRACK", "RBRACK", "AND", "INLIST", "MOFN",
+ "MINUS", "OR", "IF", "CREATE", "FILL", "CALL", "DOT", "BasicAnnotationType", "SLASH",
+ "PERCENT", "DecimalLiteral", "FloatingPointLiteral", "EXP", "LOGN", "SIN", "COS", "TAN",
+ "XOR", "EQUAL", "NOTEQUAL", "TRUE", "FALSE", "LESS", "GREATER", "GREATEREQUAL", "LESSEQUAL",
+ "IntegerTypeSuffix", "HexDigit", "Exponent", "FloatTypeSuffix", "EscapeSequence",
+ "UnicodeEscape", "OctalEscape", "Letter", "JavaIDDigit", "WS", "COMMENT", "LINE_COMMENT",
+ "'|'" };
+
+ public static final int STAR = 31;
+
+ public static final int LBRACK = 34;
+
+ public static final int FloatTypeSuffix = 68;
+
+ public static final int TypeString = 19;
+
+ public static final int TABLE = 24;
+
+ public static final int Exponent = 67;
+
+ public static final int GREATEREQUAL = 63;
+
+ public static final int LOGN = 52;
+
+ public static final int ASSIGN_EQUAL = 15;
+
+ public static final int TypeSystemString = 9;
+
+ public static final int AND = 36;
+
+ public static final int IntString = 12;
+
+ public static final int EOF = -1;
+
+ public static final int BlockString = 27;
+
+ public static final int HexDigit = 66;
+
+ public static final int Identifier = 13;
+
+ public static final int ACTION = 21;
+
+ public static final int LPAREN = 25;
+
+ public static final int IF = 41;
+
+ public static final int NOTEQUAL = 58;
+
+ public static final int RPAREN = 26;
+
+ public static final int CREATE = 42;
+
+ public static final int GREATER = 62;
+
+ public static final int SLASH = 47;
+
+ public static final int SIN = 53;
+
+ public static final int EXP = 51;
+
+ public static final int FILL = 43;
+
+ public static final int COMMA = 14;
+
+ public static final int COS = 54;
+
+ public static final int TAN = 55;
+
+ public static final int EQUAL = 57;
+
+ public static final int LESS = 61;
+
+ public static final int INLIST = 37;
+
+ public static final int PLUS = 33;
+
+ public static final int BooleanString = 18;
+
+ public static final int COMMENT = 75;
+
+ public static final int DOT = 45;
+
+ public static final int ListIdentifier = 6;
+
+ public static final int RBRACK = 35;
+
+ public static final int XOR = 56;
+
+ public static final int PERCENT = 48;
+
+ public static final int PackageString = 7;
+
+ public static final int LINE_COMMENT = 76;
+
+ public static final int IntegerTypeSuffix = 65;
+
+ public static final int LCURLY = 28;
+
+ public static final int ConditionString = 20;
+
+ public static final int MINUS = 39;
+
+ public static final int DecimalLiteral = 49;
+
+ public static final int LIST = 23;
+
+ public static final int TRUE = 59;
+
+ public static final int SEMI = 8;
+
+ public static final int StringString = 17;
+
+ public static final int StringLiteral = 30;
+
+ public static final int EngineString = 11;
+
+ public static final int ScriptString = 10;
+
+ public static final int WS = 74;
+
+ public static final int QUESTION = 32;
+
+ public static final int UnicodeEscape = 70;
+
+ public static final int FloatingPointLiteral = 50;
+
+ public static final int RCURLY = 29;
+
+ public static final int OR = 40;
+
+ public static final int JavaIDDigit = 73;
+
+ public static final int DECLARE = 22;
+
+ public static final int CALL = 44;
+
+ public static final int DocComment = 4;
+
+ public static final int MOFN = 38;
+
+ public static final int Annotation = 5;
+
+ public static final int FALSE = 60;
+
+ public static final int LESSEQUAL = 64;
+
+ public static final int Letter = 72;
+
+ public static final int OctalEscape = 71;
+
+ public static final int EscapeSequence = 69;
+
+ public static final int DoubleString = 16;
+
+ public static final int BasicAnnotationType = 46;
+
+ public static final int T__77 = 77;
+
+ // delegates
+ // delegators
+
+ public ConvertSyntaxParser(TokenStream input) {
+ this(input, new RecognizerSharedState());
+ }
+
+ public ConvertSyntaxParser(TokenStream input, RecognizerSharedState state) {
+ super(input, state);
+
+ }
+
+ public String[] getTokenNames() {
+ return ConvertSyntaxParser.tokenNames;
+ }
+
+ public String getGrammarFileName() {
+ return "D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g";
+ }
+
+ public ModuleDeclaration md;
+
+ private List<String> vars = new ArrayList<String>();
+
+ private Map<String, String> varTypeMap = new HashMap<String, String>();
+
+ private List lists = new ArrayList();
+
+ private List tables = new ArrayList();
+
+ public int length;
+
+ public DescriptorManager descriptor;
+
+ private int level = 0;
+
+ private String module;
+
+ private String packageString;
+
+ public StringBuilder builder = new StringBuilder();
+
+ public List<String> getVariables() {
+ return vars;
+ }
+
+ public Map<String, String> getVariableTypes() {
+ return varTypeMap;
+ }
+
+ public void addType(TextMarkerBlock parent, String type, String parentType) {
+ vars.add(type);
+ if (parentType == null || parentType.trim().equals("") || parentType.equals("Annotation")) {
+ parentType = "uima.tcas.Annotation";
+ // } else if(parentType.split(".").length > 1) {
+
+ } else {
+ parentType = parent.getNamespace() + "." + parentType.trim();
+ }
+ descriptor.addType(parent.getNamespace() + "." + type.trim(), "Type defined in "
+ + packageString + "." + module, parentType);
+ }
+
+ public void addPredefinedType(String type) {
+ vars.add(type);
+ varTypeMap.put(type, "TYPE");
+
+ }
+
+ public void addType(TextMarkerBlock parent, String name, String parentType, List featuresTypes,
+ List featuresNames) {
+ vars.add(name);
+ name = parent.getNamespace() + "." + name.trim();
+ if (parentType.equals("Annotation")) {
+ parentType = "uima.tcas.Annotation";
+ // } else if(parentType.split(".").length > 1) {
+
+ } else {
+ parentType = parent.getNamespace() + "." + parentType.trim();
+ }
+ descriptor.addType(name, "Type defined in " + packageString + "." + module, parentType);
+
+ for (int i = 0; i < featuresTypes.size(); i++) {
+ String ftype = (String) featuresTypes.get(i);
+ if (ftype.equals("Annotation")) {
+ ftype = "uima.tcas.Annotation";
+ } else if (ftype.equals("STRING")) {
+ ftype = "uima.cas.String";
+ } else if (ftype.equals("INT")) {
+ ftype = "uima.cas.Integer";
+ } else if (ftype.equals("DOUBLE")) {
+ ftype = "uima.cas.Double";
+ } else if (ftype.equals("BOOLEAN")) {
+ ftype = "uima.cas.Boolean";
+ } else if (ftype.equals("TYPE")) {
+ ftype = "uima.cas.String";
+ } else {
+ ftype = parent.getNamespace() + "." + ftype;
+ }
+ String fname = (String) featuresNames.get(i);
+ descriptor.addFeature(name, fname, fname, ftype);
+ }
+ }
+
+ public void addWordList(TextMarkerBlock parent, String list) {
+ lists.add(list);
+ }
+
+ public void addCSVTable(TextMarkerBlock parent, String table) {
+ tables.add(table);
+ }
+
+ public boolean isType(TextMarkerBlock parent, String type) {
+ return vars.contains(type);
+ }
+
+ public boolean isWordList(TextMarkerBlock parent, String list) {
+ return lists.contains(list);
+ }
+
+ public boolean isCSVTable(TextMarkerBlock parent, String table) {
+ return tables.contains(table);
+ }
+
+ public void addVariable(String var, String type, IntStream input) throws NoViableAltException {
+ if (!vars.contains(var)) {
+ vars.add(var);
+ varTypeMap.put(var, type);
+ }
+ }
+
+ public void addVariable(String var, String type) {
+ if (!vars.contains(var)) {
+ vars.add(var);
+ varTypeMap.put(var, type);
+ }
+ }
+
+ public boolean isVariable(String var) {
+ return vars.contains(var);
+ }
+
+ public boolean isVariableOfType(String var, String type) {
+ return vars.contains(var) && type.equals(varTypeMap.get(var));
+ }
+
+ public void checkVariable(String var, IntStream input) throws NoViableAltException {
+ if (!vars.contains(var)) {
+ throw new NoViableAltException("not declared \"" + var + "\"", 3, 0, input);
+ }
+ }
+
+ public void addImportTypeSystem(String descriptorLocation) {
+ descriptor.addTypeSystem(descriptorLocation);
+ }
+
+ public void addImportScript(Token module) {
+ descriptor.addScript(module.getText());
+ }
+
+ public void addImportEngine(Token module) {
+ descriptor.addEngine(module.getText());
+ }
+
+ protected static final int[] getBounds(Token t) {
+ if (t instanceof CommonToken) {
+ CommonToken ct = (CommonToken) t;
+ int[] bounds = { ct.getStartIndex(), ct.getStopIndex() };
+ return bounds;
+ }
+ return null;
+ }
+
+ // public String getTypeOf(String varName) {
+ // String vn = varTypeMap.get(varName);
+ // return vn != null? vn : "";
+ // }
+
+ // $ANTLR start "file_input"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:213:1:
+ // file_input : p= packageDeclaration gs= globalStatements s= statements EOF ;
+ public final void file_input() throws RecognitionException {
+ StringBuilder p = null;
+
+ StringBuilder gs = null;
+
+ StringBuilder s = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:219:2:
+ // (p= packageDeclaration gs= globalStatements s= statements EOF )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:220:2:
+ // p= packageDeclaration gs= globalStatements s= statements EOF
+ {
+ pushFollow(FOLLOW_packageDeclaration_in_file_input91);
+ p = packageDeclaration();
+
+ state._fsp--;
+ if (state.failed)
+ return;
+ if (state.backtracking == 0) {
+ if (p != null)
+ builder.append(p).append("\n");
+ }
+ pushFollow(FOLLOW_globalStatements_in_file_input106);
+ gs = globalStatements();
+
+ state._fsp--;
+ if (state.failed)
+ return;
+ if (state.backtracking == 0) {
+ if (gs != null)
+ builder.append(gs).append("\n");
+ }
+ pushFollow(FOLLOW_statements_in_file_input115);
+ s = statements();
+
+ state._fsp--;
+ if (state.failed)
+ return;
+ if (state.backtracking == 0) {
+ builder.append(s);
+ }
+ match(input, EOF, FOLLOW_EOF_in_file_input127);
+ if (state.failed)
+ return;
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return;
+ }
+
+ // $ANTLR end "file_input"
+
+ // $ANTLR start "packageDeclaration"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:246:1:
+ // packageDeclaration returns [StringBuilder pack = new StringBuilder()] : pString= PackageString
+ // p= dottedId SEMI ;
+ public final StringBuilder packageDeclaration() throws RecognitionException {
+ StringBuilder pack = new StringBuilder();
+
+ Token pString = null;
+ StringBuilder p = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:247:2:
+ // (pString= PackageString p= dottedId SEMI )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:247:4:
+ // pString= PackageString p= dottedId SEMI
+ {
+ pString = (Token) match(input, PackageString, FOLLOW_PackageString_in_packageDeclaration148);
+ if (state.failed)
+ return pack;
+ pushFollow(FOLLOW_dottedId_in_packageDeclaration154);
+ p = dottedId();
+
+ state._fsp--;
+ if (state.failed)
+ return pack;
+ match(input, SEMI, FOLLOW_SEMI_in_packageDeclaration156);
+ if (state.failed)
+ return pack;
+ if (state.backtracking == 0) {
+
+ // pack = StatementFactory.createPkgDeclaration(p, pString);
+ pack.append(pString.getText()).append(" ").append(p).append(";");
+
+ }
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return pack;
+ }
+
+ // $ANTLR end "packageDeclaration"
+
+ // $ANTLR start "statements"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:254:1:
+ // statements returns [StringBuilder stmts = new StringBuilder()] : (morestmts= statement )* ;
+ public final StringBuilder statements() throws RecognitionException {
+ StringBuilder stmts = new StringBuilder();
+
+ StringBuilder morestmts = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:255:2:
+ // ( (morestmts= statement )* )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:256:2:
+ // (morestmts= statement )*
+ {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:256:2:
+ // (morestmts= statement )*
+ loop1: do {
+ int alt1 = 2;
+ int LA1_0 = input.LA(1);
+
+ if (((LA1_0 >= IntString && LA1_0 <= Identifier)
+ || (LA1_0 >= DoubleString && LA1_0 <= TABLE) || LA1_0 == BlockString
+ || LA1_0 == StringLiteral || LA1_0 == BasicAnnotationType)) {
+ alt1 = 1;
+ }
+
+ switch (alt1) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:256:3:
+ // morestmts= statement
+ {
+ pushFollow(FOLLOW_statement_in_statements180);
+ morestmts = statement();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(morestmts);
+ }
+
+ }
+ break;
+
+ default:
+ break loop1;
+ }
+ } while (true);
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmts;
+ }
+
+ // $ANTLR end "statements"
+
+ // $ANTLR start "globalStatements"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:259:1:
+ // globalStatements returns [StringBuilder stmts = new StringBuilder()] : (morestmts=
+ // globalStatement )* ;
+ public final StringBuilder globalStatements() throws RecognitionException {
+ StringBuilder stmts = new StringBuilder();
+
+ StringBuilder morestmts = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:260:2:
+ // ( (morestmts= globalStatement )* )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:261:2:
+ // (morestmts= globalStatement )*
+ {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:261:2:
+ // (morestmts= globalStatement )*
+ loop2: do {
+ int alt2 = 2;
+ int LA2_0 = input.LA(1);
+
+ if (((LA2_0 >= TypeSystemString && LA2_0 <= EngineString))) {
+ alt2 = 1;
+ }
+
+ switch (alt2) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:261:3:
+ // morestmts= globalStatement
+ {
+ pushFollow(FOLLOW_globalStatement_in_globalStatements206);
+ morestmts = globalStatement();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(morestmts).append("\n");
+ }
+
+ }
+ break;
+
+ default:
+ break loop2;
+ }
+ } while (true);
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmts;
+ }
+
+ // $ANTLR end "globalStatements"
+
+ // $ANTLR start "globalStatement"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:265:1:
+ // globalStatement returns [StringBuilder stmts = new StringBuilder()] : stmtImport=
+ // importStatement ;
+ public final StringBuilder globalStatement() throws RecognitionException {
+ StringBuilder stmts = new StringBuilder();
+
+ StringBuilder stmtImport = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:266:2:
+ // (stmtImport= importStatement )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:267:2:
+ // stmtImport= importStatement
+ {
+ pushFollow(FOLLOW_importStatement_in_globalStatement232);
+ stmtImport = importStatement();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(stmtImport);
+ }
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmts;
+ }
+
+ // $ANTLR end "globalStatement"
+
+ // $ANTLR start "statement"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:270:1:
+ // statement returns [StringBuilder stmts = new StringBuilder()] : (stmts1= declaration |
+ // stmtVariable= variableDeclaration | stmt3= blockDeclaration | stmt2= simpleStatement ) ;
+ public final StringBuilder statement() throws RecognitionException {
+ StringBuilder stmts = new StringBuilder();
+
+ StringBuilder stmts1 = null;
+
+ StringBuilder stmtVariable = null;
+
+ StringBuilder stmt3 = null;
+
+ StringBuilder stmt2 = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:271:2:
+ // ( (stmts1= declaration | stmtVariable= variableDeclaration | stmt3= blockDeclaration |
+ // stmt2= simpleStatement ) )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:272:2:
+ // (stmts1= declaration | stmtVariable= variableDeclaration | stmt3= blockDeclaration | stmt2=
+ // simpleStatement )
+ {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:272:2:
+ // (stmts1= declaration | stmtVariable= variableDeclaration | stmt3= blockDeclaration |
+ // stmt2= simpleStatement )
+ int alt3 = 4;
+ switch (input.LA(1)) {
+ case DECLARE:
+ case LIST:
+ case TABLE: {
+ alt3 = 1;
+ }
+ break;
+ case IntString:
+ case DoubleString:
+ case StringString:
+ case BooleanString:
+ case TypeString:
+ case ConditionString:
+ case ACTION: {
+ alt3 = 2;
+ }
+ break;
+ case BlockString: {
+ alt3 = 3;
+ }
+ break;
+ case Identifier:
+ case StringLiteral:
+ case BasicAnnotationType: {
+ alt3 = 4;
+ }
+ break;
+ default:
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 3, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt3) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:272:4:
+ // stmts1= declaration
+ {
+ pushFollow(FOLLOW_declaration_in_statement258);
+ stmts1 = declaration();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(stmts1).append("\n");
+ }
+
+ }
+ break;
+ case 2:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:273:4:
+ // stmtVariable= variableDeclaration
+ {
+ pushFollow(FOLLOW_variableDeclaration_in_statement269);
+ stmtVariable = variableDeclaration();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(stmtVariable).append("\n");
+ }
+
+ }
+ break;
+ case 3:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:274:4:
+ // stmt3= blockDeclaration
+ {
+ pushFollow(FOLLOW_blockDeclaration_in_statement280);
+ stmt3 = blockDeclaration();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(stmt3).append("\n");
+ }
+
+ }
+ break;
+ case 4:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:275:4:
+ // stmt2= simpleStatement
+ {
+ pushFollow(FOLLOW_simpleStatement_in_statement291);
+ stmt2 = simpleStatement();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(stmt2).append("\n");
+ }
+
+ }
+ break;
+
+ }
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmts;
+ }
+
+ // $ANTLR end "statement"
+
+ // $ANTLR start "importStatement"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:279:1:
+ // importStatement returns [StringBuilder stmt = new StringBuilder()] : (system= TypeSystemString
+ // ts= dottedId SEMI | im= ScriptString name= dottedId SEMI | im= EngineString name= dottedId SEMI
+ // );
+ public final StringBuilder importStatement() throws RecognitionException {
+ StringBuilder stmt = new StringBuilder();
+
+ Token system = null;
+ Token im = null;
+ StringBuilder ts = null;
+
+ StringBuilder name = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:280:2:
+ // (system= TypeSystemString ts= dottedId SEMI | im= ScriptString name= dottedId SEMI | im=
+ // EngineString name= dottedId SEMI )
+ int alt4 = 3;
+ switch (input.LA(1)) {
+ case TypeSystemString: {
+ alt4 = 1;
+ }
+ break;
+ case ScriptString: {
+ alt4 = 2;
+ }
+ break;
+ case EngineString: {
+ alt4 = 3;
+ }
+ break;
+ default:
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmt;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 4, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt4) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:281:2:
+ // system= TypeSystemString ts= dottedId SEMI
+ {
+ system = (Token) match(input, TypeSystemString,
+ FOLLOW_TypeSystemString_in_importStatement317);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_dottedId_in_importStatement323);
+ ts = dottedId();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ match(input, SEMI, FOLLOW_SEMI_in_importStatement325);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(system.getText()).append(" ").append(ts).append(";");
+ }
+
+ }
+ break;
+ case 2:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:283:4:
+ // im= ScriptString name= dottedId SEMI
+ {
+ im = (Token) match(input, ScriptString, FOLLOW_ScriptString_in_importStatement338);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_dottedId_in_importStatement344);
+ name = dottedId();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ match(input, SEMI, FOLLOW_SEMI_in_importStatement346);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(im.getText()).append(" ").append(name).append(";");
+ }
+
+ }
+ break;
+ case 3:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:285:4:
+ // im= EngineString name= dottedId SEMI
+ {
+ im = (Token) match(input, EngineString, FOLLOW_EngineString_in_importStatement359);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_dottedId_in_importStatement365);
+ name = dottedId();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ match(input, SEMI, FOLLOW_SEMI_in_importStatement367);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(im.getText()).append(" ").append(name).append(";");
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmt;
+ }
+
+ // $ANTLR end "importStatement"
+
+ // $ANTLR start "variableDeclaration"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:289:1:
+ // variableDeclaration returns [StringBuilder stmt = new StringBuilder()] : (type= IntString id=
+ // Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value1= numberExpression )? SEMI | type=
+ // DoubleString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value2= numberExpression
+ // )? SEMI | type= StringString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value3=
+ // stringExpression )? SEMI | type= BooleanString id= Identifier ( COMMA id= Identifier )* (
+ // ASSIGN_EQUAL value4= booleanExpression )? SEMI | type= TypeString id= Identifier ( COMMA id=
+ // Identifier )* ( ASSIGN_EQUAL value5= annotationType )? SEMI | stmt1= conditionDeclaration |
+ // stmt2= actionDeclaration );
+ public final StringBuilder variableDeclaration() throws RecognitionException {
+ StringBuilder stmt = new StringBuilder();
+
+ Token type = null;
+ Token id = null;
+ StringBuilder value1 = null;
+
+ StringBuilder value2 = null;
+
+ StringBuilder value3 = null;
+
+ StringBuilder value4 = null;
+
+ StringBuilder value5 = null;
+
+ StringBuilder stmt1 = null;
+
+ StringBuilder stmt2 = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:291:2:
+ // (type= IntString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value1=
+ // numberExpression )? SEMI | type= DoubleString id= Identifier ( COMMA id= Identifier )* (
+ // ASSIGN_EQUAL value2= numberExpression )? SEMI | type= StringString id= Identifier ( COMMA
+ // id= Identifier )* ( ASSIGN_EQUAL value3= stringExpression )? SEMI | type= BooleanString id=
+ // Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value4= booleanExpression )? SEMI |
+ // type= TypeString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value5=
+ // annotationType )? SEMI | stmt1= conditionDeclaration | stmt2= actionDeclaration )
+ int alt15 = 7;
+ switch (input.LA(1)) {
+ case IntString: {
+ alt15 = 1;
+ }
+ break;
+ case DoubleString: {
+ alt15 = 2;
+ }
+ break;
+ case StringString: {
+ alt15 = 3;
+ }
+ break;
+ case BooleanString: {
+ alt15 = 4;
+ }
+ break;
+ case TypeString: {
+ alt15 = 5;
+ }
+ break;
+ case ConditionString: {
+ alt15 = 6;
+ }
+ break;
+ case ACTION: {
+ alt15 = 7;
+ }
+ break;
+ default:
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmt;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 15, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt15) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:293:2:
+ // type= IntString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value1=
+ // numberExpression )? SEMI
+ {
+ type = (Token) match(input, IntString, FOLLOW_IntString_in_variableDeclaration394);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration400);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(type.getText()).append(" ").append(id.getText());
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:294:3:
+ // ( COMMA id= Identifier )*
+ loop5: do {
+ int alt5 = 2;
+ int LA5_0 = input.LA(1);
+
+ if ((LA5_0 == COMMA)) {
+ alt5 = 1;
+ }
+
+ switch (alt5) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:294:4:
+ // COMMA id= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_variableDeclaration407);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration412);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(",").append(id.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop5;
+ }
+ } while (true);
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:295:6:
+ // ( ASSIGN_EQUAL value1= numberExpression )?
+ int alt6 = 2;
+ int LA6_0 = input.LA(1);
+
+ if ((LA6_0 == ASSIGN_EQUAL)) {
+ alt6 = 1;
+ }
+ switch (alt6) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:295:7:
+ // ASSIGN_EQUAL value1= numberExpression
+ {
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_variableDeclaration422);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_numberExpression_in_variableDeclaration428);
+ value1 = numberExpression();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(" = ").append(value1);
+ }
+
+ }
+ break;
+
+ }
+
+ match(input, SEMI, FOLLOW_SEMI_in_variableDeclaration436);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(";");
+ }
+
+ }
+ break;
+ case 2:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:298:2:
+ // type= DoubleString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value2=
+ // numberExpression )? SEMI
+ {
+ type = (Token) match(input, DoubleString, FOLLOW_DoubleString_in_variableDeclaration450);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration456);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(type.getText()).append(" ").append(id.getText());
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:299:4:
+ // ( COMMA id= Identifier )*
+ loop7: do {
+ int alt7 = 2;
+ int LA7_0 = input.LA(1);
+
+ if ((LA7_0 == COMMA)) {
+ alt7 = 1;
+ }
+
+ switch (alt7) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:299:5:
+ // COMMA id= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_variableDeclaration464);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration470);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(",").append(id.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop7;
+ }
+ } while (true);
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:300:7:
+ // ( ASSIGN_EQUAL value2= numberExpression )?
+ int alt8 = 2;
+ int LA8_0 = input.LA(1);
+
+ if ((LA8_0 == ASSIGN_EQUAL)) {
+ alt8 = 1;
+ }
+ switch (alt8) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:300:8:
+ // ASSIGN_EQUAL value2= numberExpression
+ {
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_variableDeclaration481);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_numberExpression_in_variableDeclaration487);
+ value2 = numberExpression();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(" = ").append(value2);
+ }
+
+ }
+ break;
+
+ }
+
+ match(input, SEMI, FOLLOW_SEMI_in_variableDeclaration494);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(";");
+ }
+
+ }
+ break;
+ case 3:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:303:2:
+ // type= StringString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value3=
+ // stringExpression )? SEMI
+ {
+ type = (Token) match(input, StringString, FOLLOW_StringString_in_variableDeclaration509);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration515);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(type.getText()).append(" ").append(id.getText());
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:304:4:
+ // ( COMMA id= Identifier )*
+ loop9: do {
+ int alt9 = 2;
+ int LA9_0 = input.LA(1);
+
+ if ((LA9_0 == COMMA)) {
+ alt9 = 1;
+ }
+
+ switch (alt9) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:304:5:
+ // COMMA id= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_variableDeclaration523);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration529);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(",").append(id.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop9;
+ }
+ } while (true);
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:305:7:
+ // ( ASSIGN_EQUAL value3= stringExpression )?
+ int alt10 = 2;
+ int LA10_0 = input.LA(1);
+
+ if ((LA10_0 == ASSIGN_EQUAL)) {
+ alt10 = 1;
+ }
+ switch (alt10) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:305:8:
+ // ASSIGN_EQUAL value3= stringExpression
+ {
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_variableDeclaration540);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_stringExpression_in_variableDeclaration546);
+ value3 = stringExpression();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(" = ").append(value3);
+ }
+
+ }
+ break;
+
+ }
+
+ match(input, SEMI, FOLLOW_SEMI_in_variableDeclaration553);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(";");
+ }
+
+ }
+ break;
+ case 4:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:308:2:
+ // type= BooleanString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value4=
+ // booleanExpression )? SEMI
+ {
+ type = (Token) match(input, BooleanString, FOLLOW_BooleanString_in_variableDeclaration568);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration574);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(type.getText()).append(" ").append(id.getText());
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:309:4:
+ // ( COMMA id= Identifier )*
+ loop11: do {
+ int alt11 = 2;
+ int LA11_0 = input.LA(1);
+
+ if ((LA11_0 == COMMA)) {
+ alt11 = 1;
+ }
+
+ switch (alt11) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:309:5:
+ // COMMA id= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_variableDeclaration582);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration588);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(",").append(id.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop11;
+ }
+ } while (true);
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:310:7:
+ // ( ASSIGN_EQUAL value4= booleanExpression )?
+ int alt12 = 2;
+ int LA12_0 = input.LA(1);
+
+ if ((LA12_0 == ASSIGN_EQUAL)) {
+ alt12 = 1;
+ }
+ switch (alt12) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:310:8:
+ // ASSIGN_EQUAL value4= booleanExpression
+ {
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_variableDeclaration599);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_booleanExpression_in_variableDeclaration605);
+ value4 = booleanExpression();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(" = ").append(value4);
+ }
+
+ }
+ break;
+
+ }
+
+ match(input, SEMI, FOLLOW_SEMI_in_variableDeclaration612);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(";");
+ }
+
+ }
+ break;
+ case 5:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:313:2:
+ // type= TypeString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL value5=
+ // annotationType )? SEMI
+ {
+ type = (Token) match(input, TypeString, FOLLOW_TypeString_in_variableDeclaration627);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration633);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(type.getText()).append(" ").append(id.getText());
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:314:4:
+ // ( COMMA id= Identifier )*
+ loop13: do {
+ int alt13 = 2;
+ int LA13_0 = input.LA(1);
+
+ if ((LA13_0 == COMMA)) {
+ alt13 = 1;
+ }
+
+ switch (alt13) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:314:5:
+ // COMMA id= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_variableDeclaration641);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_variableDeclaration647);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(",").append(id.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop13;
+ }
+ } while (true);
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:315:7:
+ // ( ASSIGN_EQUAL value5= annotationType )?
+ int alt14 = 2;
+ int LA14_0 = input.LA(1);
+
+ if ((LA14_0 == ASSIGN_EQUAL)) {
+ alt14 = 1;
+ }
+ switch (alt14) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:315:8:
+ // ASSIGN_EQUAL value5= annotationType
+ {
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_variableDeclaration658);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_annotationType_in_variableDeclaration664);
+ value5 = annotationType();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(" = ").append(value5);
+ }
+
+ }
+ break;
+
+ }
+
+ match(input, SEMI, FOLLOW_SEMI_in_variableDeclaration671);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(";");
+ }
+
+ }
+ break;
+ case 6:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:318:2:
+ // stmt1= conditionDeclaration
+ {
+ pushFollow(FOLLOW_conditionDeclaration_in_variableDeclaration686);
+ stmt1 = conditionDeclaration();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(stmt1);
+ }
+
+ }
+ break;
+ case 7:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:320:2:
+ // stmt2= actionDeclaration
+ {
+ pushFollow(FOLLOW_actionDeclaration_in_variableDeclaration698);
+ stmt2 = actionDeclaration();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(stmt2);
+ }
+
+ }
+ break;
+
+ }
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmt;
+ }
+
+ // $ANTLR end "variableDeclaration"
+
+ // $ANTLR start "conditionDeclaration"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:324:1:
+ // conditionDeclaration returns [StringBuilder stmt = new StringBuilder()] : declareToken=
+ // ConditionString id= Identifier ASSIGN_EQUAL conditions= conditionPart SEMI ;
+ public final StringBuilder conditionDeclaration() throws RecognitionException {
+ StringBuilder stmt = new StringBuilder();
+
+ Token declareToken = null;
+ Token id = null;
+ StringBuilder conditions = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:325:2:
+ // (declareToken= ConditionString id= Identifier ASSIGN_EQUAL conditions= conditionPart SEMI )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:326:2:
+ // declareToken= ConditionString id= Identifier ASSIGN_EQUAL conditions= conditionPart SEMI
+ {
+ declareToken = (Token) match(input, ConditionString,
+ FOLLOW_ConditionString_in_conditionDeclaration721);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_conditionDeclaration727);
+ if (state.failed)
+ return stmt;
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_conditionDeclaration730);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_conditionPart_in_conditionDeclaration738);
+ conditions = conditionPart();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ match(input, SEMI, FOLLOW_SEMI_in_conditionDeclaration740);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(declareToken.getText()).append(" ").append(id.getText()).append(" = ")
+ .append(conditions).append(";");
+ }
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmt;
+ }
+
+ // $ANTLR end "conditionDeclaration"
+
+ // $ANTLR start "actionDeclaration"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:335:1:
+ // actionDeclaration returns [StringBuilder stmt = new StringBuilder()] : declareToken= ACTION id=
+ // Identifier ASSIGN_EQUAL actions= actionPart SEMI ;
+ public final StringBuilder actionDeclaration() throws RecognitionException {
+ StringBuilder stmt = new StringBuilder();
+
+ Token declareToken = null;
+ Token id = null;
+ StringBuilder actions = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:336:2:
+ // (declareToken= ACTION id= Identifier ASSIGN_EQUAL actions= actionPart SEMI )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:337:2:
+ // declareToken= ACTION id= Identifier ASSIGN_EQUAL actions= actionPart SEMI
+ {
+ declareToken = (Token) match(input, ACTION, FOLLOW_ACTION_in_actionDeclaration768);
+ if (state.failed)
+ return stmt;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_actionDeclaration774);
+ if (state.failed)
+ return stmt;
+ match(input, ASSIGN_EQUAL, FOLLOW_ASSIGN_EQUAL_in_actionDeclaration777);
+ if (state.failed)
+ return stmt;
+ pushFollow(FOLLOW_actionPart_in_actionDeclaration784);
+ actions = actionPart();
+
+ state._fsp--;
+ if (state.failed)
+ return stmt;
+ match(input, SEMI, FOLLOW_SEMI_in_actionDeclaration786);
+ if (state.failed)
+ return stmt;
+ if (state.backtracking == 0) {
+ stmt.append(declareToken.getText()).append(" ").append(id.getText()).append(" = ")
+ .append(actions).append(";");
+ }
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmt;
+ }
+
+ // $ANTLR end "actionDeclaration"
+
+ // $ANTLR start "declaration"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:345:1:
+ // declaration returns [StringBuilder stmts = new StringBuilder()] : (declareToken= DECLARE
+ // (lazyParent= annotationType )? id= Identifier ( COMMA id= Identifier )* SEMI | listToken= LIST
+ // list= dottedIdentifier SEMI | tableToken= TABLE table= dottedIdentifier SEMI | declareToken=
+ // DECLARE type= annotationType id= Identifier ( LPAREN (obj1= annotationType | obj2= StringString
+ // | obj3= DoubleString | obj4= IntString | obj5= BooleanString ) fname= Identifier ( COMMA (obj1=
+ // annotationType | obj2= StringString | obj3= DoubleString | obj4= IntString | obj5=
+ // BooleanString ) fname= Identifier )* RPAREN ) SEMI ) ;
+ public final StringBuilder declaration() throws RecognitionException {
+ StringBuilder stmts = new StringBuilder();
+
+ Token declareToken = null;
+ Token id = null;
+ Token listToken = null;
+ Token tableToken = null;
+ Token obj2 = null;
+ Token obj3 = null;
+ Token obj4 = null;
+ Token obj5 = null;
+ Token fname = null;
+ StringBuilder lazyParent = null;
+
+ StringBuilder list = null;
+
+ StringBuilder table = null;
+
+ StringBuilder type = null;
+
+ StringBuilder obj1 = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:351:2:
+ // ( (declareToken= DECLARE (lazyParent= annotationType )? id= Identifier ( COMMA id=
+ // Identifier )* SEMI | listToken= LIST list= dottedIdentifier SEMI | tableToken= TABLE table=
+ // dottedIdentifier SEMI | declareToken= DECLARE type= annotationType id= Identifier ( LPAREN
+ // (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4= IntString | obj5=
+ // BooleanString ) fname= Identifier ( COMMA (obj1= annotationType | obj2= StringString |
+ // obj3= DoubleString | obj4= IntString | obj5= BooleanString ) fname= Identifier )* RPAREN )
+ // SEMI ) )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:353:2:
+ // (declareToken= DECLARE (lazyParent= annotationType )? id= Identifier ( COMMA id= Identifier
+ // )* SEMI | listToken= LIST list= dottedIdentifier SEMI | tableToken= TABLE table=
+ // dottedIdentifier SEMI | declareToken= DECLARE type= annotationType id= Identifier ( LPAREN
+ // (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4= IntString | obj5=
+ // BooleanString ) fname= Identifier ( COMMA (obj1= annotationType | obj2= StringString |
+ // obj3= DoubleString | obj4= IntString | obj5= BooleanString ) fname= Identifier )* RPAREN )
+ // SEMI )
+ {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:353:2:
+ // (declareToken= DECLARE (lazyParent= annotationType )? id= Identifier ( COMMA id=
+ // Identifier )* SEMI | listToken= LIST list= dottedIdentifier SEMI | tableToken= TABLE
+ // table= dottedIdentifier SEMI | declareToken= DECLARE type= annotationType id= Identifier
+ // ( LPAREN (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4=
+ // IntString | obj5= BooleanString ) fname= Identifier ( COMMA (obj1= annotationType | obj2=
+ // StringString | obj3= DoubleString | obj4= IntString | obj5= BooleanString ) fname=
+ // Identifier )* RPAREN ) SEMI )
+ int alt21 = 4;
+ switch (input.LA(1)) {
+ case DECLARE: {
+ int LA21_1 = input.LA(2);
+
+ if ((LA21_1 == Identifier)) {
+ int LA21_4 = input.LA(3);
+
+ if ((LA21_4 == Identifier)) {
+ int LA21_6 = input.LA(4);
+
+ if ((LA21_6 == LPAREN)) {
+ alt21 = 4;
+ } else if ((LA21_6 == SEMI || LA21_6 == COMMA)) {
+ alt21 = 1;
+ } else {
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 21, 6, input);
+
+ throw nvae;
+ }
+ } else if ((LA21_4 == SEMI || LA21_4 == COMMA)) {
+ alt21 = 1;
+ } else {
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 21, 4, input);
+
+ throw nvae;
+ }
+ } else if ((LA21_1 == BasicAnnotationType)) {
+ int LA21_5 = input.LA(3);
+
+ if ((LA21_5 == Identifier)) {
+ int LA21_6 = input.LA(4);
+
+ if ((LA21_6 == LPAREN)) {
+ alt21 = 4;
+ } else if ((LA21_6 == SEMI || LA21_6 == COMMA)) {
+ alt21 = 1;
+ } else {
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 21, 6, input);
+
+ throw nvae;
+ }
+ } else {
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 21, 5, input);
+
+ throw nvae;
+ }
+ } else {
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 21, 1, input);
+
+ throw nvae;
+ }
+ }
+ break;
+ case LIST: {
+ alt21 = 2;
+ }
+ break;
+ case TABLE: {
+ alt21 = 3;
+ }
+ break;
+ default:
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 21, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt21) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:353:3:
+ // declareToken= DECLARE (lazyParent= annotationType )? id= Identifier ( COMMA id=
+ // Identifier )* SEMI
+ {
+ declareToken = (Token) match(input, DECLARE, FOLLOW_DECLARE_in_declaration816);
+ if (state.failed)
+ return stmts;
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:353:35:
+ // (lazyParent= annotationType )?
+ int alt16 = 2;
+ int LA16_0 = input.LA(1);
+
+ if ((LA16_0 == Identifier)) {
+ int LA16_1 = input.LA(2);
+
+ if ((LA16_1 == Identifier)) {
+ alt16 = 1;
+ }
+ } else if ((LA16_0 == BasicAnnotationType)) {
+ alt16 = 1;
+ }
+ switch (alt16) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:353:35:
+ // lazyParent= annotationType
+ {
+ pushFollow(FOLLOW_annotationType_in_declaration822);
+ lazyParent = annotationType();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+
+ }
+ break;
+
+ }
+
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_declaration832);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(declareToken.getText()).append(" ");
+ if (lazyParent != null)
+ stmts.append(lazyParent).append(" ");
+ stmts.append(id.getText());
+
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:360:3:
+ // ( COMMA id= Identifier )*
+ loop17: do {
+ int alt17 = 2;
+ int LA17_0 = input.LA(1);
+
+ if ((LA17_0 == COMMA)) {
+ alt17 = 1;
+ }
+
+ switch (alt17) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:360:4:
+ // COMMA id= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_declaration843);
+ if (state.failed)
+ return stmts;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_declaration853);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(",").append(id.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop17;
+ }
+ } while (true);
+
+ match(input, SEMI, FOLLOW_SEMI_in_declaration863);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(";");
+ }
+
+ }
+ break;
+ case 2:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:365:4:
+ // listToken= LIST list= dottedIdentifier SEMI
+ {
+ listToken = (Token) match(input, LIST, FOLLOW_LIST_in_declaration881);
+ if (state.failed)
+ return stmts;
+ pushFollow(FOLLOW_dottedIdentifier_in_declaration891);
+ list = dottedIdentifier();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ match(input, SEMI, FOLLOW_SEMI_in_declaration896);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(listToken.getText()).append(" ").append(list).append(";");
+ }
+
+ }
+ break;
+ case 3:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:370:4:
+ // tableToken= TABLE table= dottedIdentifier SEMI
+ {
+ tableToken = (Token) match(input, TABLE, FOLLOW_TABLE_in_declaration909);
+ if (state.failed)
+ return stmts;
+ pushFollow(FOLLOW_dottedIdentifier_in_declaration919);
+ table = dottedIdentifier();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ match(input, SEMI, FOLLOW_SEMI_in_declaration924);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(tableToken.getText()).append(" ").append(table).append(";");
+ }
+
+ }
+ break;
+ case 4:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:377:2:
+ // declareToken= DECLARE type= annotationType id= Identifier ( LPAREN (obj1=
+ // annotationType | obj2= StringString | obj3= DoubleString | obj4= IntString | obj5=
+ // BooleanString ) fname= Identifier ( COMMA (obj1= annotationType | obj2= StringString
+ // | obj3= DoubleString | obj4= IntString | obj5= BooleanString ) fname= Identifier )*
+ // RPAREN ) SEMI
+ {
+ declareToken = (Token) match(input, DECLARE, FOLLOW_DECLARE_in_declaration939);
+ if (state.failed)
+ return stmts;
+ pushFollow(FOLLOW_annotationType_in_declaration946);
+ type = annotationType();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_declaration953);
+ if (state.failed)
+ return stmts;
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:380:3:
+ // ( LPAREN (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4=
+ // IntString | obj5= BooleanString ) fname= Identifier ( COMMA (obj1= annotationType |
+ // obj2= StringString | obj3= DoubleString | obj4= IntString | obj5= BooleanString )
+ // fname= Identifier )* RPAREN )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:380:4:
+ // LPAREN (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4=
+ // IntString | obj5= BooleanString ) fname= Identifier ( COMMA (obj1= annotationType |
+ // obj2= StringString | obj3= DoubleString | obj4= IntString | obj5= BooleanString )
+ // fname= Identifier )* RPAREN
+ {
+ match(input, LPAREN, FOLLOW_LPAREN_in_declaration959);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(declareToken.getText()).append(" ").append(type).append(" ").append(
+ id.getText()).append("(");
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:382:4:
+ // (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4= IntString |
+ // obj5= BooleanString )
+ int alt18 = 5;
+ switch (input.LA(1)) {
+ case Identifier:
+ case BasicAnnotationType: {
+ alt18 = 1;
+ }
+ break;
+ case StringString: {
+ alt18 = 2;
+ }
+ break;
+ case DoubleString: {
+ alt18 = 3;
+ }
+ break;
+ case IntString: {
+ alt18 = 4;
+ }
+ break;
+ case BooleanString: {
+ alt18 = 5;
+ }
+ break;
+ default:
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 18, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt18) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:383:4:
+ // obj1= annotationType
+ {
+ pushFollow(FOLLOW_annotationType_in_declaration979);
+ obj1 = annotationType();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj1);
+ }
+
+ }
+ break;
+ case 2:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:384:6:
+ // obj2= StringString
+ {
+ obj2 = (Token) match(input, StringString, FOLLOW_StringString_in_declaration992);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj2.getText());
+ }
+
+ }
+ break;
+ case 3:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:385:6:
+ // obj3= DoubleString
+ {
+ obj3 = (Token) match(input, DoubleString, FOLLOW_DoubleString_in_declaration1005);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj3.getText());
+ }
+
+ }
+ break;
+ case 4:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:386:6:
+ // obj4= IntString
+ {
+ obj4 = (Token) match(input, IntString, FOLLOW_IntString_in_declaration1018);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj4.getText());
+ }
+
+ }
+ break;
+ case 5:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:387:6:
+ // obj5= BooleanString
+ {
+ obj5 = (Token) match(input, BooleanString,
+ FOLLOW_BooleanString_in_declaration1031);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj5.getText());
+ }
+
+ }
+ break;
+
+ }
+
+ fname = (Token) match(input, Identifier, FOLLOW_Identifier_in_declaration1048);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(" ").append(fname.getText());
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:390:4:
+ // ( COMMA (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4=
+ // IntString | obj5= BooleanString ) fname= Identifier )*
+ loop20: do {
+ int alt20 = 2;
+ int LA20_0 = input.LA(1);
+
+ if ((LA20_0 == COMMA)) {
+ alt20 = 1;
+ }
+
+ switch (alt20) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:391:4:
+ // COMMA (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4=
+ // IntString | obj5= BooleanString ) fname= Identifier
+ {
+ match(input, COMMA, FOLLOW_COMMA_in_declaration1060);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(",");
+ }
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:392:4:
+ // (obj1= annotationType | obj2= StringString | obj3= DoubleString | obj4=
+ // IntString | obj5= BooleanString )
+ int alt19 = 5;
+ switch (input.LA(1)) {
+ case Identifier:
+ case BasicAnnotationType: {
+ alt19 = 1;
+ }
+ break;
+ case StringString: {
+ alt19 = 2;
+ }
+ break;
+ case DoubleString: {
+ alt19 = 3;
+ }
+ break;
+ case IntString: {
+ alt19 = 4;
+ }
+ break;
+ case BooleanString: {
+ alt19 = 5;
+ }
+ break;
+ default:
+ if (state.backtracking > 0) {
+ state.failed = true;
+ return stmts;
+ }
+ NoViableAltException nvae = new NoViableAltException("", 19, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt19) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:393:4:
+ // obj1= annotationType
+ {
+ pushFollow(FOLLOW_annotationType_in_declaration1076);
+ obj1 = annotationType();
+
+ state._fsp--;
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj1);
+ }
+
+ }
+ break;
+ case 2:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:394:6:
+ // obj2= StringString
+ {
+ obj2 = (Token) match(input, StringString,
+ FOLLOW_StringString_in_declaration1089);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj2.getText());
+ }
+
+ }
+ break;
+ case 3:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:395:6:
+ // obj3= DoubleString
+ {
+ obj3 = (Token) match(input, DoubleString,
+ FOLLOW_DoubleString_in_declaration1102);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj3.getText());
+ }
+
+ }
+ break;
+ case 4:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:396:6:
+ // obj4= IntString
+ {
+ obj4 = (Token) match(input, IntString, FOLLOW_IntString_in_declaration1115);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj4.getText());
+ }
+
+ }
+ break;
+ case 5:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:397:6:
+ // obj5= BooleanString
+ {
+ obj5 = (Token) match(input, BooleanString,
+ FOLLOW_BooleanString_in_declaration1128);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(obj5.getText());
+ }
+
+ }
+ break;
+
+ }
+
+ fname = (Token) match(input, Identifier, FOLLOW_Identifier_in_declaration1145);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+ stmts.append(" ").append(fname.getText());
+ }
+
+ }
+ break;
+
+ default:
+ break loop20;
+ }
+ } while (true);
+
+ match(input, RPAREN, FOLLOW_RPAREN_in_declaration1153);
+ if (state.failed)
+ return stmts;
+
+ }
+
+ match(input, SEMI, FOLLOW_SEMI_in_declaration1156);
+ if (state.failed)
+ return stmts;
+ if (state.backtracking == 0) {
+
+ stmts.append(")").append(";");
+
+ }
+
+ }
+ break;
+
+ }
+
+ }
+
+ }
+
+ catch (RecognitionException exception1) {
+
+ recover(input, exception1);
+ } catch (Throwable exception2) {
+
+ } finally {
+ }
+ return stmts;
+ }
+
+ // $ANTLR end "declaration"
+
+ // $ANTLR start "blockDeclaration"
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:411:1:
+ // blockDeclaration returns [StringBuilder block = new StringBuilder()] : declareToken=
+ // BlockString LPAREN id= Identifier RPAREN ( typeExpression )=>idRef= typeExpression (quantifier=
+ // quantifierPart )? ( (cp= conditionPart )=>cp= conditionPart )? (ap= actionPart )? LCURLY body=
+ // statements rc= RCURLY ;
+ public final StringBuilder blockDeclaration() throws RecognitionException {
+ StringBuilder block = new StringBuilder();
+
+ Token declareToken = null;
+ Token id = null;
+ Token rc = null;
+ StringBuilder idRef = null;
+
+ StringBuilder quantifier = null;
+
+ StringBuilder cp = null;
+
+ StringBuilder ap = null;
+
+ StringBuilder body = null;
+
+ try {
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:422:2:
+ // (declareToken= BlockString LPAREN id= Identifier RPAREN ( typeExpression )=>idRef=
+ // typeExpression (quantifier= quantifierPart )? ( (cp= conditionPart )=>cp= conditionPart )?
+ // (ap= actionPart )? LCURLY body= statements rc= RCURLY )
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:423:2:
+ // declareToken= BlockString LPAREN id= Identifier RPAREN ( typeExpression )=>idRef=
+ // typeExpression (quantifier= quantifierPart )? ( (cp= conditionPart )=>cp= conditionPart )?
+ // (ap= actionPart )? LCURLY body= statements rc= RCURLY
+ {
+ declareToken = (Token) match(input, BlockString, FOLLOW_BlockString_in_blockDeclaration1191);
+ if (state.failed)
+ return block;
+ match(input, LPAREN, FOLLOW_LPAREN_in_blockDeclaration1195);
+ if (state.failed)
+ return block;
+ id = (Token) match(input, Identifier, FOLLOW_Identifier_in_blockDeclaration1202);
+ if (state.failed)
+ return block;
+ match(input, RPAREN, FOLLOW_RPAREN_in_blockDeclaration1209);
+ if (state.failed)
+ return block;
+ pushFollow(FOLLOW_typeExpression_in_blockDeclaration1218);
+ idRef = typeExpression();
+
+ state._fsp--;
+ if (state.failed)
+ return block;
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:431:52:
+ // (quantifier= quantifierPart )?
+ int alt22 = 2;
+ int LA22_0 = input.LA(1);
+
+ if (((LA22_0 >= STAR && LA22_0 <= LBRACK))) {
+ alt22 = 1;
+ }
+ switch (alt22) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:431:52:
+ // quantifier= quantifierPart
+ {
+ pushFollow(FOLLOW_quantifierPart_in_blockDeclaration1224);
+ quantifier = quantifierPart();
+
+ state._fsp--;
+ if (state.failed)
+ return block;
+
+ }
+ break;
+
+ }
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:431:70:
+ // ( (cp= conditionPart )=>cp= conditionPart )?
+ int alt23 = 2;
+ alt23 = dfa23.predict(input);
+ switch (alt23) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:431:71:
+ // (cp= conditionPart )=>cp= conditionPart
+ {
+ pushFollow(FOLLOW_conditionPart_in_blockDeclaration1240);
+ cp = conditionPart();
+
+ state._fsp--;
+ if (state.failed)
+ return block;
+
+ }
+ break;
+
+ }
+
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:431:117:
+ // (ap= actionPart )?
+ int alt24 = 2;
+ int LA24_0 = input.LA(1);
+
+ if ((LA24_0 == LPAREN)) {
+ alt24 = 1;
+ }
+ switch (alt24) {
+ case 1:
+ // D:\\work\\workspace-tm\\org.apache.uima.tm.textmarker.ui.utils\\src\\de\\uniwue\\tm\\textmarker\\ui\\convert\\ConvertSyntax.g:431:117:
+ // ap= actionPart
+ {
+ pushFollow(FOLLOW_actionPart_in_blockDeclaration1248);
+ ap = actionPart();
+
+ state._fsp--;
+ if (state.failed)
+ return block;
+
+ }
+ break;
+
+ }
+
+ match(input, LCURLY, FOLLOW_LCURLY_in_blockDeclaration1256);
+ if (state.failed)
+ return block;
+ pushFollow(FOLLOW_statements_in_blockDeclaration1262);
+ body = statements();
+
+ state._fsp--;
+ if (state.failed)
+ return block;
+ rc = (Token) match(input, RCURLY, FOLLOW_RCURLY_in_blockDeclaration1268);
+ if (state.failed)
+ return block;
+ if (state.backtracking == 0) {
+ block.append(declareToken.getText()).append("(").append(id.getText()).append(") ");
+ if (quantifier == null) {
+ if (cp == null && ap == null)
+ block.append(idRef);
+ else if (cp == null)
+ block.append(idRef).append("{").append(ap).append("} ");
+ else if (ap == null)
[... 6146 lines stripped ...]