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/09/22 14:42:30 UTC

svn commit: r1174096 [2/3] - in /uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide: core/parser/ formatter/ parser/ast/

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.java?rev=1174096&r1=1174095&r2=1174096&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.java Thu Sep 22 12:42:30 2011
@@ -1,3 +1,5 @@
+// $ANTLR 3.4 D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g 2011-09-12 13:04:54
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -15,10 +17,9 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- */
+*/
 
 package org.apache.uima.textmarker.ide.core.parser;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -39,8 +40,17 @@ import org.antlr.runtime.RecognitionExce
 import org.antlr.runtime.RecognizerSharedState;
 import org.antlr.runtime.Token;
 import org.antlr.runtime.TokenStream;
-import org.apache.uima.textmarker.ide.core.builder.DescriptorManager;
+import org.eclipse.dltk.ast.ASTNode;
+import org.eclipse.dltk.ast.DLTKToken;
+import org.eclipse.dltk.ast.declarations.Declaration;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+import org.eclipse.dltk.ast.expressions.BooleanLiteral;
+import org.eclipse.dltk.ast.expressions.Expression;
+import org.eclipse.dltk.ast.references.VariableReference;
+import org.eclipse.dltk.ast.statements.Statement;
+
 import org.apache.uima.textmarker.ide.core.extensions.TextMarkerExternalFactory;
+import org.apache.uima.textmarker.ide.core.builder.DescriptorManager;
 import org.apache.uima.textmarker.ide.parser.ast.ActionFactory;
 import org.apache.uima.textmarker.ide.parser.ast.ComponentDeclaration;
 import org.apache.uima.textmarker.ide.parser.ast.ComponentReference;
@@ -50,21938 +60,18624 @@ import org.apache.uima.textmarker.ide.pa
 import org.apache.uima.textmarker.ide.parser.ast.ScriptFactory;
 import org.apache.uima.textmarker.ide.parser.ast.StatementFactory;
 import org.apache.uima.textmarker.ide.parser.ast.TMTypeConstants;
-import org.apache.uima.textmarker.ide.parser.ast.TextMarkerAction;
 import org.apache.uima.textmarker.ide.parser.ast.TextMarkerBlock;
-import org.apache.uima.textmarker.ide.parser.ast.TextMarkerCondition;
 import org.apache.uima.textmarker.ide.parser.ast.TextMarkerExpression;
-import org.apache.uima.textmarker.ide.parser.ast.TextMarkerFeatureDeclaration;
-import org.apache.uima.textmarker.ide.parser.ast.TextMarkerPackageDeclaration;
 import org.apache.uima.textmarker.ide.parser.ast.TextMarkerRule;
 import org.apache.uima.textmarker.ide.parser.ast.TextMarkerRuleElement;
 import org.apache.uima.textmarker.ide.parser.ast.TextMarkerScriptBlock;
-import org.eclipse.dltk.ast.ASTNode;
-import org.eclipse.dltk.ast.DLTKToken;
-import org.eclipse.dltk.ast.declarations.Declaration;
-import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
-import org.eclipse.dltk.ast.expressions.BooleanLiteral;
-import org.eclipse.dltk.ast.expressions.Expression;
-import org.eclipse.dltk.ast.references.VariableReference;
-import org.eclipse.dltk.ast.statements.Statement;
+import org.apache.uima.textmarker.ide.parser.ast.TextMarkerAction;
+import org.apache.uima.textmarker.ide.parser.ast.TextMarkerCondition;
+import org.apache.uima.textmarker.ide.parser.ast.TextMarkerFeatureDeclaration;
+import org.apache.uima.textmarker.ide.parser.ast.TextMarkerPackageDeclaration;
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
 
+@SuppressWarnings({"all", "warnings", "unchecked"})
 public class TextMarkerParser extends Parser {
-  public static final String[] tokenNames = new String[] { "<invalid>", "<EOR>", "<DOWN>", "<UP>",
-      "DocComment", "Annotation", "ListIdentifier", "TRIE", "CONTAINS", "DECLARE", "WORDLIST",
-      "WORDTABLE", "AND", "CONTEXTCOUNT", "COUNT", "TOTALCOUNT", "CURRENTCOUNT", "INLIST",
-      "ISINTAG", "LAST", "MOFN", "NEAR", "OR", "PARTOF", "PARTOFNEQ", "POSITION", "REGEXP",
-      "SCORE", "VOTE", "IF", "FEATURE", "PARSE", "CREATE", "GATHER", "FILL", "ATTRIBUTE", "COLOR",
-      "DEL", "LOG", "MARK", "MARKSCORE", "MARKONCE", "MARKFAST", "MARKTABLE", "MARKLAST",
-      "REPLACE", "RETAINMARKUP", "RETAINTYPE", "FILTERMARKUP", "FILTERTYPE", "CALL", "EXEC",
-      "ASSIGN", "SETFEATURE", "GETFEATURE", "UNMARK", "UNMARKALL", "TRANSFER", "EXPAND", "BEFORE",
-      "AFTER", "IS", "STARTSWITH", "ENDSWITH", "NOT", "ADD", "REMOVE", "REMOVEDUPLICATE", "MERGE",
-      "GET", "GETLIST", "SIZE", "MATCHEDTEXT", "REMOVESTRING", "CLEAR", "THEN",
-      "BasicAnnotationType", "LogLevel", "OldColor", "PackageString", "ScriptString",
-      "EngineString", "BlockString", "AutomataBlockString", "TypeString", "IntString",
-      "DoubleString", "StringString", "BooleanString", "TypeSystemString", "SymbolString",
-      "CONDITION", "ACTION", "BOOLEANLIST", "INTLIST", "DOUBLELIST", "STRINGLIST", "TYPELIST",
-      "EXP", "LOGN", "SIN", "COS", "TAN", "XOR", "TRUE", "FALSE", "HexDigit", "IntegerTypeSuffix",
-      "HexLiteral", "DecimalLiteral", "OctalLiteral", "Exponent", "FloatTypeSuffix",
-      "FloatingPointLiteral", "EscapeSequence", "CharacterLiteral", "StringLiteral",
-      "RessourceLiteral", "UnicodeEscape", "OctalEscape", "Letter", "JavaIDDigit", "Identifier",
-      "LPAREN", "RPAREN", "LBRACK", "RBRACK", "LCURLY", "RCURLY", "CIRCUMFLEX", "AT", "DOT",
-      "COLON", "COMMA", "SEMI", "PLUS", "MINUS", "STAR", "SLASH", "VBAR", "AMPER", "LESS",
-      "GREATER", "ASSIGN_EQUAL", "PERCENT", "QUESTION", "EQUAL", "NOTEQUAL", "ALT_NOTEQUAL",
-      "LESSEQUAL", "GREATEREQUAL", "WS", "COMMENT", "LINE_COMMENT" };
+    public static final String[] tokenNames = new String[] {
+        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "DocComment", "Annotation", "ListIdentifier", "TRIE", "CONTAINS", "DECLARE", "WORDLIST", "WORDTABLE", "AND", "CONTEXTCOUNT", "COUNT", "TOTALCOUNT", "CURRENTCOUNT", "INLIST", "ISINTAG", "LAST", "MOFN", "NEAR", "OR", "PARTOF", "PARTOFNEQ", "POSITION", "REGEXP", "SCORE", "VOTE", "IF", "FEATURE", "PARSE", "CREATE", "GATHER", "FILL", "ATTRIBUTE", "COLOR", "DEL", "LOG", "MARK", "MARKSCORE", "MARKONCE", "MARKFAST", "MARKTABLE", "MARKLAST", "REPLACE", "RETAINMARKUP", "RETAINTYPE", "FILTERMARKUP", "FILTERTYPE", "CALL", "EXEC", "ASSIGN", "SETFEATURE", "GETFEATURE", "UNMARK", "UNMARKALL", "TRANSFER", "EXPAND", "BEFORE", "AFTER", "IS", "STARTSWITH", "ENDSWITH", "NOT", "ADD", "REMOVE", "REMOVEDUPLICATE", "MERGE", "GET", "GETLIST", "SIZE", "MATCHEDTEXT", "REMOVESTRING", "CLEAR", "THEN", "BasicAnnotationType", "LogLevel", "OldColor", "PackageString", "ScriptString", "EngineString", "BlockString", "AutomataBlockString", "TypeString", "IntStrin
 g", "DoubleString", "StringString", "BooleanString", "TypeSystemString", "SymbolString", "CONDITION", "ACTION", "BOOLEANLIST", "INTLIST", "DOUBLELIST", "STRINGLIST", "TYPELIST", "EXP", "LOGN", "SIN", "COS", "TAN", "XOR", "TRUE", "FALSE", "HexDigit", "IntegerTypeSuffix", "HexLiteral", "DecimalLiteral", "OctalLiteral", "Exponent", "FloatTypeSuffix", "FloatingPointLiteral", "EscapeSequence", "CharacterLiteral", "StringLiteral", "RessourceLiteral", "UnicodeEscape", "OctalEscape", "Letter", "JavaIDDigit", "Identifier", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "LCURLY", "RCURLY", "CIRCUMFLEX", "AT", "DOT", "COLON", "COMMA", "SEMI", "PLUS", "MINUS", "STAR", "SLASH", "VBAR", "AMPER", "LESS", "GREATER", "ASSIGN_EQUAL", "PERCENT", "QUESTION", "EQUAL", "NOTEQUAL", "ALT_NOTEQUAL", "LESSEQUAL", "GREATEREQUAL", "WS", "COMMENT", "LINE_COMMENT"
+    };
+
+    public static final int EOF=-1;
+    public static final int STAR=137;
+    public static final int FloatTypeSuffix=112;
+    public static final int OctalLiteral=110;
+    public static final int FILTERMARKUP=48;
+    public static final int LOG=38;
+    public static final int CONTAINS=8;
+    public static final int REMOVE=66;
+    public static final int GREATEREQUAL=150;
+    public static final int MARKFAST=42;
+    public static final int MATCHEDTEXT=72;
+    public static final int CONDITION=91;
+    public static final int COUNT=14;
+    public static final int LOGN=99;
+    public static final int NOT=64;
+    public static final int Identifier=122;
+    public static final int ACTION=92;
+    public static final int NOTEQUAL=147;
+    public static final int CLEAR=74;
+    public static final int VBAR=139;
+    public static final int DOUBLELIST=95;
+    public static final int ENDSWITH=63;
+    public static final int RPAREN=124;
+    public static final int CREATE=32;
+    public static final int GREATER=142;
+    public static final int SIN=100;
+    public static final int EXP=98;
+    public static final int CURRENTCOUNT=16;
+    public static final int COS=101;
+    public static final int TAN=102;
+    public static final int TYPELIST=97;
+    public static final int LESS=141;
+    public static final int REGEXP=26;
+    public static final int GET=69;
+    public static final int PARTOF=23;
+    public static final int UNMARK=55;
+    public static final int LAST=19;
+    public static final int COMMENT=152;
+    public static final int REMOVEDUPLICATE=67;
+    public static final int UNMARKALL=56;
+    public static final int RBRACK=126;
+    public static final int NEAR=21;
+    public static final int LINE_COMMENT=153;
+    public static final int IntegerTypeSuffix=107;
+    public static final int MARKSCORE=40;
+    public static final int REMOVESTRING=73;
+    public static final int TRANSFER=57;
+    public static final int LCURLY=127;
+    public static final int TRIE=7;
+    public static final int FILTERTYPE=49;
+    public static final int RETAINMARKUP=46;
+    public static final int STRINGLIST=96;
+    public static final int MARKONCE=41;
+    public static final int ScriptString=80;
+    public static final int EngineString=81;
+    public static final int WS=151;
+    public static final int WORDTABLE=11;
+    public static final int WORDLIST=10;
+    public static final int AutomataBlockString=83;
+    public static final int FloatingPointLiteral=113;
+    public static final int INTLIST=94;
+    public static final int OR=22;
+    public static final int JavaIDDigit=121;
+    public static final int CALL=50;
+    public static final int Annotation=5;
+    public static final int FALSE=105;
+    public static final int LESSEQUAL=149;
+    public static final int RessourceLiteral=117;
+    public static final int VOTE=28;
+    public static final int Letter=120;
+    public static final int EscapeSequence=114;
+    public static final int SIZE=71;
+    public static final int BasicAnnotationType=76;
+    public static final int LBRACK=125;
+    public static final int CharacterLiteral=115;
+    public static final int DEL=37;
+    public static final int ATTRIBUTE=35;
+    public static final int TypeString=84;
+    public static final int Exponent=111;
+    public static final int ASSIGN_EQUAL=143;
+    public static final int RETAINTYPE=47;
+    public static final int AND=12;
+    public static final int TypeSystemString=89;
+    public static final int EXPAND=58;
+    public static final int BlockString=82;
+    public static final int IntString=85;
+    public static final int HexDigit=106;
+    public static final int COLOR=36;
+    public static final int LPAREN=123;
+    public static final int POSITION=25;
+    public static final int IF=29;
+    public static final int AT=130;
+    public static final int LogLevel=77;
+    public static final int SLASH=138;
+    public static final int THEN=75;
+    public static final int FILL=34;
+    public static final int COMMA=133;
+    public static final int IS=61;
+    public static final int AMPER=140;
+    public static final int REPLACE=45;
+    public static final int GETLIST=70;
+    public static final int EQUAL=146;
+    public static final int GATHER=33;
+    public static final int INLIST=17;
+    public static final int PLUS=135;
+    public static final int BooleanString=88;
+    public static final int GETFEATURE=54;
+    public static final int DOT=131;
+    public static final int ListIdentifier=6;
+    public static final int PARTOFNEQ=24;
+    public static final int BOOLEANLIST=93;
+    public static final int ADD=65;
+    public static final int MARKTABLE=43;
+    public static final int HexLiteral=108;
+    public static final int XOR=103;
+    public static final int PERCENT=144;
+    public static final int MARK=39;
+    public static final int PARSE=31;
+    public static final int PackageString=79;
+    public static final int OldColor=78;
+    public static final int MARKLAST=44;
+    public static final int MERGE=68;
+    public static final int CONTEXTCOUNT=13;
+    public static final int BEFORE=59;
+    public static final int EXEC=51;
+    public static final int MINUS=136;
+    public static final int AFTER=60;
+    public static final int DecimalLiteral=109;
+    public static final int SEMI=134;
+    public static final int TRUE=104;
+    public static final int FEATURE=30;
+    public static final int SymbolString=90;
+    public static final int COLON=132;
+    public static final int StringLiteral=116;
+    public static final int StringString=87;
+    public static final int SCORE=27;
+    public static final int QUESTION=145;
+    public static final int UnicodeEscape=118;
+    public static final int RCURLY=128;
+    public static final int STARTSWITH=62;
+    public static final int ASSIGN=52;
+    public static final int TOTALCOUNT=15;
+    public static final int DECLARE=9;
+    public static final int DocComment=4;
+    public static final int ISINTAG=18;
+    public static final int MOFN=20;
+    public static final int OctalEscape=119;
+    public static final int SETFEATURE=53;
+    public static final int DoubleString=86;
+    public static final int CIRCUMFLEX=129;
+    public static final int ALT_NOTEQUAL=148;
+
+    // delegates
+    public Parser[] getDelegates() {
+        return new Parser[] {};
+    }
+
+    // delegators
+
+
+    public TextMarkerParser(TokenStream input) {
+        this(input, new RecognizerSharedState());
+    }
+    public TextMarkerParser(TokenStream input, RecognizerSharedState state) {
+        super(input, state);
+    }
+
+    public String[] getTokenNames() { return TextMarkerParser.tokenNames; }
+    public String getGrammarFileName() { return "D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g"; }
+
+
+    	public DLTKTextMarkerErrorReporter reporter;
+    	public ModuleDeclaration md;
+    	private List<String> vars = new ArrayList<String>();	
+    	private Map<String, String> varTypeMap = new HashMap<String, String>();
+    	private Map<String, String> lists = new HashMap<String, String>();
+    	private Map<String, String> tables = new HashMap<String, String>();
+    	public int length;
+    	public DLTKTokenConverter converter;
+    	public DescriptorManager descriptor;
+    	private int level = 0;
+    	private TextMarkerExternalFactory external = new TextMarkerExternalFactory();
+    	
+    	private String module;
+    	private String packageString;
+    	
+    	
+    	public List<String> getVariables() {
+    		return vars;
+    	}
+    	
+    	public Map<String, String> getVariableTypes() {
+    		return varTypeMap;
+    	}
+    	
+    	DLTKToken toDLTK(Token token) {
+    		return converter.convert(token);
+    	}
+    	public void emitErrorMessage(String msg) {
+    		reporter.reportMessage(msg);
+    	}
+    	public void reportError(RecognitionException e) {
+    		if( reporter != null ) {
+    			reporter.reportError(e);
+    		}
+    	}
+    	
+    	public void addType(TextMarkerBlock parent, String type, String parentType) {
+    		vars.add(type);
+    		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<Token> featuresNames) {
+    	   	 name = parent.getNamespace() + "." + name.trim();
+    	   	 descriptor.addType(name, "Type defined in " + packageString + "." + module, parentType);
+    	    	for (int i = 0; i < featuresTypes.size(); i++) {
+    	    	  Object object = featuresTypes.get(i);
+    	    	  String ftype = "";
+    	    	  if (object instanceof ASTNode) {
+    	    		    ftype = ((ASTNode) object).toString();
+    		      } else if (object instanceof Token) {
+    	     	   ftype = ((Token) object).getText();
+    	     	 }
+    		      String fname = featuresNames.get(i).getText();
+    	     	 descriptor.addFeature(name, fname, fname, ftype);
+    	   	 }
+     	 }
+    	
+    	public void addWordList(TextMarkerBlock parent, String name, String list) {
+    		lists.put(name, list);
+    	}
+    	
+    	public void addCSVTable(TextMarkerBlock parent, String name, String table) {
+    		tables.put(name, table);
+    	}
+    	
+    	public boolean isType(TextMarkerBlock parent, String type) {
+    		return vars.contains(type);
+    	}
+    		
+    	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(ComponentDeclaration module) {
+    	    descriptor.addTypeSystem(module.getName());
+    	  }
+    	
+    	  public void addImportScript(ComponentDeclaration module) {
+    		    descriptor.addScript(module.getName());
+    		  }
+    	
+    	  public void addImportEngine(ComponentDeclaration module) {
+    		    descriptor.addEngine(module.getName());
+    		  }
+    	
+    	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-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:229:1: file_input[String module] : p= packageDeclaration gs= globalStatements s= statements EOF ;
+    public final void file_input(String module) throws RecognitionException {
+        TextMarkerPackageDeclaration p =null;
+
+        List<Statement> gs =null;
+
+        List<Statement> s =null;
+
+
+
+        TextMarkerScriptBlock rootBlock = null;
+        List<Statement> stmts = new ArrayList<Statement>();
+
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:234:2: (p= packageDeclaration gs= globalStatements s= statements EOF )
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:235:2: p= packageDeclaration gs= globalStatements s= statements EOF
+            {
+            pushFollow(FOLLOW_packageDeclaration_in_file_input73);
+            p=packageDeclaration();
 
-  public static final int STAR = 137;
+            state._fsp--;
+            if (state.failed) return ;
 
-  public static final int FloatTypeSuffix = 112;
+            if ( state.backtracking==0 ) {
+            	String packageName = "org.apache.uima.tm";
+            	if(p != null) {packageName = p.getName();}
+            	rootBlock = ScriptFactory.createScriptBlock(0,0,0,0,module, null, null, packageName);
+            	stmts.add(p);
+            	this.module = module;
+            	if(p != null) {
+            		this.packageString = p.getName();
+            	}
+            	}
 
-  public static final int OctalLiteral = 110;
+            if ( state.backtracking==0 ) {blockDeclaration_stack.push(new blockDeclaration_scope());((blockDeclaration_scope)blockDeclaration_stack.peek()).env = rootBlock;}
 
-  public static final int FILTERMARKUP = 48;
+            pushFollow(FOLLOW_globalStatements_in_file_input87);
+            gs=globalStatements();
 
-  public static final int LOG = 38;
+            state._fsp--;
+            if (state.failed) return ;
 
-  public static final int CONTAINS = 8;
+            pushFollow(FOLLOW_statements_in_file_input94);
+            s=statements();
 
-  public static final int REMOVE = 66;
+            state._fsp--;
+            if (state.failed) return ;
 
-  public static final int GREATEREQUAL = 150;
+            if ( state.backtracking==0 ) {
+            	  stmts.addAll(gs);
+            	  stmts.addAll(s);
+              	  for (Statement stmt : stmts){
+            		  if (stmt != null) {
+            		    md.addStatement(stmt);
+            		  }
+            	  };
+            	}
 
-  public static final int MARKFAST = 42;
+            match(input,EOF,FOLLOW_EOF_in_file_input100); if (state.failed) return ;
 
-  public static final int MATCHEDTEXT = 72;
+            }
 
-  public static final int CONDITION = 91;
+        }
 
-  public static final int COUNT = 14;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int LOGN = 99;
+        finally {
+        	// do for sure before leaving
+        }
+        return ;
+    }
+    // $ANTLR end "file_input"
 
-  public static final int NOT = 64;
 
-  public static final int EOF = -1;
 
-  public static final int Identifier = 122;
+    // $ANTLR start "packageDeclaration"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:263:1: packageDeclaration returns [TextMarkerPackageDeclaration pack] : pString= PackageString p= dottedId SEMI ;
+    public final TextMarkerPackageDeclaration packageDeclaration() throws RecognitionException {
+        TextMarkerPackageDeclaration pack = null;
 
-  public static final int ACTION = 92;
 
-  public static final int CLEAR = 74;
+        Token pString=null;
+        Token p =null;
 
-  public static final int NOTEQUAL = 147;
 
-  public static final int ENDSWITH = 63;
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:264:2: (pString= PackageString p= dottedId SEMI )
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:264:4: pString= PackageString p= dottedId SEMI
+            {
+            pString=(Token)match(input,PackageString,FOLLOW_PackageString_in_packageDeclaration121); if (state.failed) return pack;
 
-  public static final int DOUBLELIST = 95;
+            if ( state.backtracking==0 ) {
+            	pack = StatementFactory.createPkgDeclaration(p, pString);
+            	}
 
-  public static final int VBAR = 139;
+            pushFollow(FOLLOW_dottedId_in_packageDeclaration132);
+            p=dottedId();
 
-  public static final int RPAREN = 124;
+            state._fsp--;
+            if (state.failed) return pack;
 
-  public static final int CREATE = 32;
+            if ( state.backtracking==0 ) {
+            	pack = StatementFactory.createPkgDeclaration(p, pString);
+            	}
 
-  public static final int GREATER = 142;
+            match(input,SEMI,FOLLOW_SEMI_in_packageDeclaration139); if (state.failed) return pack;
 
-  public static final int SIN = 100;
+            if ( state.backtracking==0 ) {
+            	pack = StatementFactory.createPkgDeclaration(p, pString);
+            	}
 
-  public static final int EXP = 98;
+            }
 
-  public static final int CURRENTCOUNT = 16;
+        }
 
-  public static final int COS = 101;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int TAN = 102;
+        finally {
+        	// do for sure before leaving
+        }
+        return pack;
+    }
+    // $ANTLR end "packageDeclaration"
 
-  public static final int TYPELIST = 97;
 
-  public static final int LESS = 141;
 
-  public static final int REGEXP = 26;
+    // $ANTLR start "statements"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:278:1: statements returns [List<Statement> stmts = new ArrayList<Statement>()] : (morestmts= statement )* ;
+    public final List<Statement> statements() throws RecognitionException {
+        List<Statement> stmts =  new ArrayList<Statement>();
 
-  public static final int GET = 69;
 
-  public static final int UNMARK = 55;
+        List<Statement> morestmts =null;
 
-  public static final int PARTOF = 23;
 
-  public static final int LAST = 19;
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:279:2: ( (morestmts= statement )* )
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:280:2: (morestmts= statement )*
+            {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:280:2: (morestmts= statement )*
+            loop1:
+            do {
+                int alt1=2;
+                int LA1_0 = input.LA(1);
 
-  public static final int COMMENT = 152;
+                if ( ((LA1_0 >= DECLARE && LA1_0 <= WORDTABLE)||LA1_0==BasicAnnotationType||(LA1_0 >= BlockString && LA1_0 <= BooleanString)||(LA1_0 >= CONDITION && LA1_0 <= TYPELIST)||LA1_0==StringLiteral||(LA1_0 >= Identifier && LA1_0 <= LPAREN)) ) {
+                    alt1=1;
+                }
 
-  public static final int REMOVEDUPLICATE = 67;
 
-  public static final int UNMARKALL = 56;
+                switch (alt1) {
+            	case 1 :
+            	    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:280:3: morestmts= statement
+            	    {
+            	    pushFollow(FOLLOW_statement_in_statements163);
+            	    morestmts=statement();
+
+            	    state._fsp--;
+            	    if (state.failed) return stmts;
 
-  public static final int RBRACK = 126;
+            	    if ( state.backtracking==0 ) {if(morestmts != null) {stmts.addAll(morestmts);}}
 
-  public static final int NEAR = 21;
+            	    }
+            	    break;
 
-  public static final int LINE_COMMENT = 153;
+            	default :
+            	    break loop1;
+                }
+            } while (true);
 
-  public static final int IntegerTypeSuffix = 107;
 
-  public static final int MARKSCORE = 40;
+            }
 
-  public static final int REMOVESTRING = 73;
+        }
 
-  public static final int TRANSFER = 57;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int LCURLY = 127;
+        finally {
+        	// do for sure before leaving
+        }
+        return stmts;
+    }
+    // $ANTLR end "statements"
 
-  public static final int TRIE = 7;
 
-  public static final int FILTERTYPE = 49;
 
-  public static final int RETAINMARKUP = 46;
+    // $ANTLR start "globalStatements"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:283:1: globalStatements returns [List<Statement> stmts = new ArrayList<Statement>()] : (morestmts= globalStatement )* ;
+    public final List<Statement> globalStatements() throws RecognitionException {
+        List<Statement> stmts =  new ArrayList<Statement>();
 
-  public static final int STRINGLIST = 96;
 
-  public static final int MARKONCE = 41;
+        List<Statement> morestmts =null;
 
-  public static final int ScriptString = 80;
 
-  public static final int EngineString = 81;
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:284:2: ( (morestmts= globalStatement )* )
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:285:2: (morestmts= globalStatement )*
+            {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:285:2: (morestmts= globalStatement )*
+            loop2:
+            do {
+                int alt2=2;
+                int LA2_0 = input.LA(1);
 
-  public static final int WS = 151;
+                if ( ((LA2_0 >= ScriptString && LA2_0 <= EngineString)||LA2_0==TypeSystemString) ) {
+                    alt2=1;
+                }
 
-  public static final int WORDTABLE = 11;
 
-  public static final int WORDLIST = 10;
+                switch (alt2) {
+            	case 1 :
+            	    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:285:3: morestmts= globalStatement
+            	    {
+            	    pushFollow(FOLLOW_globalStatement_in_globalStatements189);
+            	    morestmts=globalStatement();
+
+            	    state._fsp--;
+            	    if (state.failed) return stmts;
 
-  public static final int AutomataBlockString = 83;
+            	    if ( state.backtracking==0 ) {if(morestmts != null) {stmts.addAll(morestmts);}}
 
-  public static final int FloatingPointLiteral = 113;
+            	    }
+            	    break;
 
-  public static final int INTLIST = 94;
+            	default :
+            	    break loop2;
+                }
+            } while (true);
 
-  public static final int OR = 22;
 
-  public static final int JavaIDDigit = 121;
+            }
 
-  public static final int CALL = 50;
+        }
 
-  public static final int Annotation = 5;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int FALSE = 105;
+        finally {
+        	// do for sure before leaving
+        }
+        return stmts;
+    }
+    // $ANTLR end "globalStatements"
 
-  public static final int LESSEQUAL = 149;
 
-  public static final int RessourceLiteral = 117;
 
-  public static final int VOTE = 28;
+    // $ANTLR start "globalStatement"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:288:1: globalStatement returns [List<Statement> stmts = new ArrayList<Statement>()] : stmtImport= importStatement ;
+    public final List<Statement> globalStatement() throws RecognitionException {
+        List<Statement> stmts =  new ArrayList<Statement>();
 
-  public static final int Letter = 120;
 
-  public static final int EscapeSequence = 114;
+        Statement stmtImport =null;
 
-  public static final int SIZE = 71;
 
-  public static final int BasicAnnotationType = 76;
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:289:2: (stmtImport= importStatement )
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:290:2: stmtImport= importStatement
+            {
+            pushFollow(FOLLOW_importStatement_in_globalStatement213);
+            stmtImport=importStatement();
 
-  public static final int LBRACK = 125;
+            state._fsp--;
+            if (state.failed) return stmts;
 
-  public static final int CharacterLiteral = 115;
+            if ( state.backtracking==0 ) {stmts.add(stmtImport);}
 
-  public static final int DEL = 37;
+            }
 
-  public static final int ATTRIBUTE = 35;
+        }
 
-  public static final int TypeString = 84;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int Exponent = 111;
+        finally {
+        	// do for sure before leaving
+        }
+        return stmts;
+    }
+    // $ANTLR end "globalStatement"
 
-  public static final int ASSIGN_EQUAL = 143;
 
-  public static final int RETAINTYPE = 47;
 
-  public static final int AND = 12;
+    // $ANTLR start "statement"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:293:1: statement returns [List<Statement> stmts = new ArrayList<Statement>()] : (stmts1= declaration |stmtVariable= variableDeclaration |stmt3= blockDeclaration |stmt2= simpleStatement ) ;
+    public final List<Statement> statement() throws RecognitionException {
+        List<Statement> stmts =  new ArrayList<Statement>();
 
-  public static final int TypeSystemString = 89;
 
-  public static final int EXPAND = 58;
+        List<Statement> stmts1 =null;
 
-  public static final int BlockString = 82;
+        List<Statement> stmtVariable =null;
 
-  public static final int IntString = 85;
+        TextMarkerBlock stmt3 =null;
 
-  public static final int HexDigit = 106;
+        TextMarkerRule stmt2 =null;
 
-  public static final int COLOR = 36;
 
-  public static final int POSITION = 25;
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:294:2: ( (stmts1= declaration |stmtVariable= variableDeclaration |stmt3= blockDeclaration |stmt2= simpleStatement ) )
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:295:2: (stmts1= declaration |stmtVariable= variableDeclaration |stmt3= blockDeclaration |stmt2= simpleStatement )
+            {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:295:2: (stmts1= declaration |stmtVariable= variableDeclaration |stmt3= blockDeclaration |stmt2= simpleStatement )
+            int alt3=4;
+            switch ( input.LA(1) ) {
+            case DECLARE:
+                {
+                alt3=1;
+                }
+                break;
+            case WORDLIST:
+            case WORDTABLE:
+            case TypeString:
+            case IntString:
+            case DoubleString:
+            case StringString:
+            case BooleanString:
+            case CONDITION:
+            case ACTION:
+            case BOOLEANLIST:
+            case INTLIST:
+            case DOUBLELIST:
+            case STRINGLIST:
+            case TYPELIST:
+                {
+                alt3=2;
+                }
+                break;
+            case BlockString:
+            case AutomataBlockString:
+                {
+                alt3=3;
+                }
+                break;
+            case BasicAnnotationType:
+            case StringLiteral:
+            case Identifier:
+            case LPAREN:
+                {
+                alt3=4;
+                }
+                break;
+            default:
+                if (state.backtracking>0) {state.failed=true; return stmts;}
+                NoViableAltException nvae =
+                    new NoViableAltException("", 3, 0, input);
 
-  public static final int LPAREN = 123;
+                throw nvae;
 
-  public static final int IF = 29;
+            }
 
-  public static final int AT = 130;
+            switch (alt3) {
+                case 1 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:295:4: stmts1= declaration
+                    {
+                    pushFollow(FOLLOW_declaration_in_statement239);
+                    stmts1=declaration();
 
-  public static final int LogLevel = 77;
+                    state._fsp--;
+                    if (state.failed) return stmts;
 
-  public static final int SLASH = 138;
+                    if ( state.backtracking==0 ) {stmts.addAll(stmts1);}
 
-  public static final int THEN = 75;
+                    }
+                    break;
+                case 2 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:296:4: stmtVariable= variableDeclaration
+                    {
+                    pushFollow(FOLLOW_variableDeclaration_in_statement250);
+                    stmtVariable=variableDeclaration();
 
-  public static final int FILL = 34;
+                    state._fsp--;
+                    if (state.failed) return stmts;
 
-  public static final int COMMA = 133;
+                    if ( state.backtracking==0 ) {stmts.addAll(stmtVariable);}
 
-  public static final int IS = 61;
+                    }
+                    break;
+                case 3 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:297:4: stmt3= blockDeclaration
+                    {
+                    pushFollow(FOLLOW_blockDeclaration_in_statement261);
+                    stmt3=blockDeclaration();
 
-  public static final int GETLIST = 70;
+                    state._fsp--;
+                    if (state.failed) return stmts;
 
-  public static final int REPLACE = 45;
+                    if ( state.backtracking==0 ) {stmts.add(stmt3);}
 
-  public static final int AMPER = 140;
+                    }
+                    break;
+                case 4 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:299:4: stmt2= simpleStatement
+                    {
+                    pushFollow(FOLLOW_simpleStatement_in_statement274);
+                    stmt2=simpleStatement();
 
-  public static final int EQUAL = 146;
+                    state._fsp--;
+                    if (state.failed) return stmts;
 
-  public static final int GATHER = 33;
+                    if ( state.backtracking==0 ) {stmts.add(stmt2);}
 
-  public static final int INLIST = 17;
+                    }
+                    break;
 
-  public static final int PLUS = 135;
+            }
 
-  public static final int BooleanString = 88;
 
-  public static final int GETFEATURE = 54;
+            }
 
-  public static final int DOT = 131;
+        }
 
-  public static final int ListIdentifier = 6;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int PARTOFNEQ = 24;
+        finally {
+        	// do for sure before leaving
+        }
+        return stmts;
+    }
+    // $ANTLR end "statement"
 
-  public static final int ADD = 65;
 
-  public static final int BOOLEANLIST = 93;
 
-  public static final int MARKTABLE = 43;
+    // $ANTLR start "importStatement"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:305:1: importStatement returns [Statement stmt = null] : (im= TypeSystemString name= dottedComponentDeclaration SEMI |im= ScriptString name= dottedComponentDeclaration SEMI |im= EngineString name= dottedComponentDeclaration SEMI );
+    public final Statement importStatement() throws RecognitionException {
+        Statement stmt =  null;
 
-  public static final int HexLiteral = 108;
 
-  public static final int XOR = 103;
+        Token im=null;
+        ComponentDeclaration name =null;
 
-  public static final int MARK = 39;
 
-  public static final int PERCENT = 144;
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:306:2: (im= TypeSystemString name= dottedComponentDeclaration SEMI |im= ScriptString name= dottedComponentDeclaration SEMI |im= EngineString name= dottedComponentDeclaration 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);
 
-  public static final int PackageString = 79;
+                throw nvae;
 
-  public static final int PARSE = 31;
+            }
 
-  public static final int OldColor = 78;
+            switch (alt4) {
+                case 1 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:307:2: im= TypeSystemString name= dottedComponentDeclaration SEMI
+                    {
+                    im=(Token)match(input,TypeSystemString,FOLLOW_TypeSystemString_in_importStatement303); if (state.failed) return stmt;
 
-  public static final int MERGE = 68;
+                    if ( state.backtracking==0 ) {stmt = StatementFactory.createImportTypeSystem(StatementFactory.createEmptyComponentDeclaration(im),im);}
 
-  public static final int MARKLAST = 44;
+                    pushFollow(FOLLOW_dottedComponentDeclaration_in_importStatement315);
+                    name=dottedComponentDeclaration();
 
-  public static final int CONTEXTCOUNT = 13;
+                    state._fsp--;
+                    if (state.failed) return stmt;
 
-  public static final int BEFORE = 59;
+                    if ( state.backtracking==0 ) {if(name != null) {stmt = StatementFactory.createImportTypeSystem(name,im);addImportTypeSystem(name);}}
 
-  public static final int EXEC = 51;
+                    match(input,SEMI,FOLLOW_SEMI_in_importStatement323); if (state.failed) return stmt;
 
-  public static final int AFTER = 60;
+                    }
+                    break;
+                case 2 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:312:4: im= ScriptString name= dottedComponentDeclaration SEMI
+                    {
+                    im=(Token)match(input,ScriptString,FOLLOW_ScriptString_in_importStatement333); if (state.failed) return stmt;
 
-  public static final int MINUS = 136;
+                    if ( state.backtracking==0 ) {stmt = StatementFactory.createImportScript(StatementFactory.createEmptyComponentDeclaration(im),im);}
 
-  public static final int DecimalLiteral = 109;
+                    pushFollow(FOLLOW_dottedComponentDeclaration_in_importStatement345);
+                    name=dottedComponentDeclaration();
 
-  public static final int TRUE = 104;
+                    state._fsp--;
+                    if (state.failed) return stmt;
 
-  public static final int SEMI = 134;
+                    if ( state.backtracking==0 ) {if(name != null) {stmt = StatementFactory.createImportScript(name,im);addImportScript(name);}}
 
-  public static final int FEATURE = 30;
+                    match(input,SEMI,FOLLOW_SEMI_in_importStatement353); if (state.failed) return stmt;
 
-  public static final int SymbolString = 90;
+                    }
+                    break;
+                case 3 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:317:4: im= EngineString name= dottedComponentDeclaration SEMI
+                    {
+                    im=(Token)match(input,EngineString,FOLLOW_EngineString_in_importStatement363); if (state.failed) return stmt;
 
-  public static final int StringString = 87;
+                    if ( state.backtracking==0 ) {stmt = StatementFactory.createImportEngine(StatementFactory.createEmptyComponentDeclaration(im),im);}
 
-  public static final int StringLiteral = 116;
+                    pushFollow(FOLLOW_dottedComponentDeclaration_in_importStatement375);
+                    name=dottedComponentDeclaration();
 
-  public static final int COLON = 132;
+                    state._fsp--;
+                    if (state.failed) return stmt;
 
-  public static final int SCORE = 27;
+                    if ( state.backtracking==0 ) {if(name != null) {stmt = StatementFactory.createImportEngine(name,im);addImportEngine(name);}}
 
-  public static final int QUESTION = 145;
+                    match(input,SEMI,FOLLOW_SEMI_in_importStatement383); if (state.failed) return stmt;
 
-  public static final int UnicodeEscape = 118;
+                    }
+                    break;
 
-  public static final int STARTSWITH = 62;
+            }
+        }
 
-  public static final int RCURLY = 128;
+        	catch (RecognitionException exception1) {
+        		if( reporter != null ) {
+        			reporter.reportError(exception1);
+        		}
+        		recover(input,exception1);
+        	}
+        	catch (Throwable exception2) {
+        		if( reporter != null ) {
+        			reporter.reportThrowable(exception2);
+        		}
+        	}
 
-  public static final int ASSIGN = 52;
+        finally {
+        	// do for sure before leaving
+        }
+        return stmt;
+    }
+    // $ANTLR end "importStatement"
 
-  public static final int TOTALCOUNT = 15;
 
-  public static final int DECLARE = 9;
 
-  public static final int ISINTAG = 18;
+    // $ANTLR start "variableDeclaration"
+    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:324:1: variableDeclaration returns [List<Statement> stmts = new ArrayList<Statement>()] : (type= IntString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= numberExpression )? SEMI |type= DoubleString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= numberExpression )? SEMI |type= StringString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= stringExpression )? SEMI |type= BooleanString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= booleanExpression )? SEMI |type= TypeString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= annotationType )? SEMI |type= WORDLIST id= Identifier ( ASSIGN_EQUAL list= wordListExpression )? SEMI |type= WORDTABLE id= Identifier ( ASSIGN_EQUAL table= wordTableExpression )? SEMI |type= BOOLEANLIST id= Identifier ( ASSIGN_EQUAL list= booleanL
 istExpression )? SEMI |type= INTLIST id= Identifier ( ASSIGN_EQUAL list= numberListExpression )? SEMI |type= DOUBLELIST id= Identifier ( ASSIGN_EQUAL list= numberListExpression )? SEMI |type= STRINGLIST id= Identifier ( ASSIGN_EQUAL list= stringListExpression )? SEMI |type= TYPELIST id= Identifier ( ASSIGN_EQUAL list= typeListExpression )? SEMI |stmt= conditionDeclaration |stmt= actionDeclaration );
+    public final List<Statement> variableDeclaration() throws RecognitionException {
+        List<Statement> stmts =  new ArrayList<Statement>();
 
-  public static final int DocComment = 4;
 
-  public static final int MOFN = 20;
+        Token type=null;
+        Token id=null;
+        Expression init =null;
 
-  public static final int SETFEATURE = 53;
+        Expression list =null;
 
-  public static final int OctalEscape = 119;
+        Expression table =null;
 
-  public static final int DoubleString = 86;
+        Statement stmt =null;
 
-  public static final int CIRCUMFLEX = 129;
 
-  public static final int ALT_NOTEQUAL = 148;
 
-  // delegates
-  // delegators
+        	List decls = new ArrayList();
 
-  public TextMarkerParser(TokenStream input) {
-    this(input, new RecognizerSharedState());
-  }
+        try {
+            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:328:2: (type= IntString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= numberExpression )? SEMI |type= DoubleString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= numberExpression )? SEMI |type= StringString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= stringExpression )? SEMI |type= BooleanString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= booleanExpression )? SEMI |type= TypeString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= annotationType )? SEMI |type= WORDLIST id= Identifier ( ASSIGN_EQUAL list= wordListExpression )? SEMI |type= WORDTABLE id= Identifier ( ASSIGN_EQUAL table= wordTableExpression )? SEMI |type= BOOLEANLIST id= Identifier ( ASSIGN_EQUAL list= booleanListExpression )? SEMI |type= INTLIST id= Identifier ( ASSIGN_EQUAL list= nu
 mberListExpression )? SEMI |type= DOUBLELIST id= Identifier ( ASSIGN_EQUAL list= numberListExpression )? SEMI |type= STRINGLIST id= Identifier ( ASSIGN_EQUAL list= stringListExpression )? SEMI |type= TYPELIST id= Identifier ( ASSIGN_EQUAL list= typeListExpression )? SEMI |stmt= conditionDeclaration |stmt= actionDeclaration )
+            int alt22=14;
+            switch ( input.LA(1) ) {
+            case IntString:
+                {
+                alt22=1;
+                }
+                break;
+            case DoubleString:
+                {
+                alt22=2;
+                }
+                break;
+            case StringString:
+                {
+                alt22=3;
+                }
+                break;
+            case BooleanString:
+                {
+                alt22=4;
+                }
+                break;
+            case TypeString:
+                {
+                alt22=5;
+                }
+                break;
+            case WORDLIST:
+                {
+                alt22=6;
+                }
+                break;
+            case WORDTABLE:
+                {
+                alt22=7;
+                }
+                break;
+            case BOOLEANLIST:
+                {
+                alt22=8;
+                }
+                break;
+            case INTLIST:
+                {
+                alt22=9;
+                }
+                break;
+            case DOUBLELIST:
+                {
+                alt22=10;
+                }
+                break;
+            case STRINGLIST:
+                {
+                alt22=11;
+                }
+                break;
+            case TYPELIST:
+                {
+                alt22=12;
+                }
+                break;
+            case CONDITION:
+                {
+                alt22=13;
+                }
+                break;
+            case ACTION:
+                {
+                alt22=14;
+                }
+                break;
+            default:
+                if (state.backtracking>0) {state.failed=true; return stmts;}
+                NoViableAltException nvae =
+                    new NoViableAltException("", 22, 0, input);
 
-  public TextMarkerParser(TokenStream input, RecognizerSharedState state) {
-    super(input, state);
+                throw nvae;
 
-  }
+            }
 
-  public String[] getTokenNames() {
-    return TextMarkerParser.tokenNames;
-  }
+            switch (alt22) {
+                case 1 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:329:2: type= IntString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= numberExpression )? SEMI
+                    {
+                    type=(Token)match(input,IntString,FOLLOW_IntString_in_variableDeclaration410); if (state.failed) return stmts;
 
-  public String getGrammarFileName() {
-    return "TextMarkerParser.g";
-  }
+                    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration416); if (state.failed) return stmts;
 
-  public DLTKTextMarkerErrorReporter reporter;
+                    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText()); decls.add(StatementFactory.createIntVariable(id, type));}
 
-  public ModuleDeclaration md;
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:330:3: ( COMMA id= Identifier )*
+                    loop5:
+                    do {
+                        int alt5=2;
+                        int LA5_0 = input.LA(1);
 
-  private List<String> vars = new ArrayList<String>();
+                        if ( (LA5_0==COMMA) ) {
+                            alt5=1;
+                        }
 
-  private Map<String, String> varTypeMap = new HashMap<String, String>();
 
-  private Map<String, String> lists = new HashMap<String, String>();
+                        switch (alt5) {
+                    	case 1 :
+                    	    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:330:4: COMMA id= Identifier
+                    	    {
+                    	    match(input,COMMA,FOLLOW_COMMA_in_variableDeclaration423); if (state.failed) return stmts;
 
-  private Map<String, String> tables = new HashMap<String, String>();
+                    	    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration428); if (state.failed) return stmts;
 
-  public int length;
+                    	    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText()); decls.add(StatementFactory.createIntVariable(id, type));}
 
-  public DLTKTokenConverter converter;
+                    	    }
+                    	    break;
 
-  public DescriptorManager descriptor;
+                    	default :
+                    	    break loop5;
+                        }
+                    } while (true);
 
-  private int level = 0;
 
-  private TextMarkerExternalFactory external = new TextMarkerExternalFactory();
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:331:6: ( ASSIGN_EQUAL init= numberExpression )?
+                    int alt6=2;
+                    int LA6_0 = input.LA(1);
 
-  private String module;
+                    if ( (LA6_0==ASSIGN_EQUAL) ) {
+                        alt6=1;
+                    }
+                    switch (alt6) {
+                        case 1 :
+                            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:331:7: ASSIGN_EQUAL init= numberExpression
+                            {
+                            match(input,ASSIGN_EQUAL,FOLLOW_ASSIGN_EQUAL_in_variableDeclaration438); if (state.failed) return stmts;
 
-  private String packageString;
+                            pushFollow(FOLLOW_numberExpression_in_variableDeclaration444);
+                            init=numberExpression();
 
-  public List<String> getVariables() {
-    return vars;
-  }
+                            state._fsp--;
+                            if (state.failed) return stmts;
 
-  public Map<String, String> getVariableTypes() {
-    return varTypeMap;
-  }
+                            }
+                            break;
 
-  DLTKToken toDLTK(Token token) {
-    return converter.convert(token);
-  }
+                    }
 
-  public void emitErrorMessage(String msg) {
-    reporter.reportMessage(msg);
-  }
 
-  public void reportError(RecognitionException e) {
-    if (reporter != null) {
-      reporter.reportError(e);
-    }
-  }
+                    match(input,SEMI,FOLLOW_SEMI_in_variableDeclaration449); if (state.failed) return stmts;
 
-  public void addType(TextMarkerBlock parent, String type, String parentType) {
-    vars.add(type);
-    descriptor.addType(parent.getNamespace() + "." + type.trim(), "Type defined in "
-            + packageString + "." + module, parentType);
-  }
+                    if ( state.backtracking==0 ) {
+                    		 stmts.add(StatementFactory.createDeclarationsStatement(type, decls, init));
+                    		 }
 
-  public void addPredefinedType(String type) {
-    vars.add(type);
-    varTypeMap.put(type, "TYPE");
+                    }
+                    break;
+                case 2 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:336:2: type= DoubleString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= numberExpression )? SEMI
+                    {
+                    type=(Token)match(input,DoubleString,FOLLOW_DoubleString_in_variableDeclaration463); if (state.failed) return stmts;
 
-  }
+                    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration469); if (state.failed) return stmts;
 
-  public void addType(TextMarkerBlock parent, String name, String parentType, List featuresTypes,
-          List<Token> featuresNames) {
-    name = parent.getNamespace() + "." + name.trim();
-    descriptor.addType(name, "Type defined in " + packageString + "." + module, parentType);
-    for (int i = 0; i < featuresTypes.size(); i++) {
-      Object object = featuresTypes.get(i);
-      String ftype = "";
-      if (object instanceof ASTNode) {
-        ftype = ((ASTNode) object).toString();
-      } else if (object instanceof Token) {
-        ftype = ((Token) object).getText();
-      }
-      String fname = featuresNames.get(i).getText();
-      descriptor.addFeature(name, fname, fname, ftype);
-    }
-  }
+                    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText());decls.add(StatementFactory.createDoubleVariable(id, type));}
 
-  public void addWordList(TextMarkerBlock parent, String name, String list) {
-    lists.put(name, list);
-  }
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:337:4: ( COMMA id= Identifier )*
+                    loop7:
+                    do {
+                        int alt7=2;
+                        int LA7_0 = input.LA(1);
 
-  public void addCSVTable(TextMarkerBlock parent, String name, String table) {
-    tables.put(name, table);
-  }
+                        if ( (LA7_0==COMMA) ) {
+                            alt7=1;
+                        }
 
-  public boolean isType(TextMarkerBlock parent, String type) {
-    return vars.contains(type);
-  }
 
-  public void addVariable(String var, String type, IntStream input) throws NoViableAltException {
-    if (!vars.contains(var)) {
-      vars.add(var);
-      varTypeMap.put(var, type);
-    }
-  }
+                        switch (alt7) {
+                    	case 1 :
+                    	    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:337:5: COMMA id= Identifier
+                    	    {
+                    	    match(input,COMMA,FOLLOW_COMMA_in_variableDeclaration477); if (state.failed) return stmts;
 
-  public void addVariable(String var, String type) {
-    if (!vars.contains(var)) {
-      vars.add(var);
-      varTypeMap.put(var, type);
-    }
-  }
+                    	    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration483); if (state.failed) return stmts;
 
-  public boolean isVariable(String var) {
-    return vars.contains(var);
-  }
+                    	    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText());decls.add(StatementFactory.createDoubleVariable(id, type));}
 
-  public boolean isVariableOfType(String var, String type) {
-    return vars.contains(var) && type.equals(varTypeMap.get(var));
-  }
+                    	    }
+                    	    break;
 
-  public void checkVariable(String var, IntStream input) throws NoViableAltException {
-    if (!vars.contains(var)) {
-      throw new NoViableAltException("not declared \"" + var + "\"", 3, 0, input);
-    }
-  }
+                    	default :
+                    	    break loop7;
+                        }
+                    } while (true);
 
-  public void addImportTypeSystem(ComponentDeclaration module) {
-    descriptor.addTypeSystem(module.getName());
-  }
 
-  public void addImportScript(ComponentDeclaration module) {
-    descriptor.addScript(module.getName());
-  }
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:338:7: ( ASSIGN_EQUAL init= numberExpression )?
+                    int alt8=2;
+                    int LA8_0 = input.LA(1);
 
-  public void addImportEngine(ComponentDeclaration module) {
-    descriptor.addEngine(module.getName());
-  }
+                    if ( (LA8_0==ASSIGN_EQUAL) ) {
+                        alt8=1;
+                    }
+                    switch (alt8) {
+                        case 1 :
+                            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:338:8: ASSIGN_EQUAL init= numberExpression
+                            {
+                            match(input,ASSIGN_EQUAL,FOLLOW_ASSIGN_EQUAL_in_variableDeclaration494); if (state.failed) return stmts;
 
-  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;
-  }
+                            pushFollow(FOLLOW_numberExpression_in_variableDeclaration500);
+                            init=numberExpression();
 
-  // public String getTypeOf(String varName) {
-  // String vn = varTypeMap.get(varName);
-  // return vn != null? vn : "";
-  // }
+                            state._fsp--;
+                            if (state.failed) return stmts;
 
-  // $ANTLR start "file_input"
-  // TextMarkerParser.g:210:1:
-  // file_input[String module] : p= packageDeclaration gs= globalStatements s= statements EOF ;
-  public final void file_input(String module) throws RecognitionException {
-    TextMarkerPackageDeclaration p = null;
+                            }
+                            break;
 
-    List<Statement> gs = null;
+                    }
 
-    List<Statement> s = null;
 
-    TextMarkerScriptBlock rootBlock = null;
-    List<Statement> stmts = new ArrayList<Statement>();
+                    match(input,SEMI,FOLLOW_SEMI_in_variableDeclaration505); if (state.failed) return stmts;
 
-    try {
-      // TextMarkerParser.g:215:2:
-      // (p= packageDeclaration gs= globalStatements s= statements EOF )
-      // TextMarkerParser.g:216:2:
-      // p= packageDeclaration gs= globalStatements s= statements EOF
-      {
-        pushFollow(FOLLOW_packageDeclaration_in_file_input73);
-        p = packageDeclaration();
+                    if ( state.backtracking==0 ) {
+                    		 stmts.add(StatementFactory.createDeclarationsStatement(type, decls, init));
+                    		 }
 
-        state._fsp--;
-        if (state.failed)
-          return;
-        if (state.backtracking == 0) {
-
-          String packageName = "org.apache.uima.tm";
-          if (p != null) {
-            packageName = p.getName();
-          }
-          rootBlock = ScriptFactory.createScriptBlock(0, 0, 0, 0, module, null, null, packageName);
-          stmts.add(p);
-          this.module = module;
-          if (p != null) {
-            this.packageString = p.getName();
-          }
-
-        }
-        if (state.backtracking == 0) {
-          blockDeclaration_stack.push(new blockDeclaration_scope());
-          ((blockDeclaration_scope) blockDeclaration_stack.peek()).env = rootBlock;
-        }
-        pushFollow(FOLLOW_globalStatements_in_file_input87);
-        gs = globalStatements();
+                    }
+                    break;
+                case 3 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:343:2: type= StringString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= stringExpression )? SEMI
+                    {
+                    type=(Token)match(input,StringString,FOLLOW_StringString_in_variableDeclaration519); if (state.failed) return stmts;
 
-        state._fsp--;
-        if (state.failed)
-          return;
-        pushFollow(FOLLOW_statements_in_file_input94);
-        s = statements();
+                    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration525); if (state.failed) return stmts;
 
-        state._fsp--;
-        if (state.failed)
-          return;
-        if (state.backtracking == 0) {
-
-          stmts.addAll(gs);
-          stmts.addAll(s);
-          for (Statement stmt : stmts) {
-            if (stmt != null) {
-              md.addStatement(stmt);
-            }
-          }
-          ;
-
-        }
-        match(input, EOF, FOLLOW_EOF_in_file_input100);
-        if (state.failed)
-          return;
-
-      }
-
-    }
-
-    catch (RecognitionException exception1) {
-      if (reporter != null) {
-        reporter.reportError(exception1);
-      }
-      recover(input, exception1);
-    } catch (Throwable exception2) {
-      if (reporter != null) {
-        reporter.reportThrowable(exception2);
-      }
-    } finally {
-    }
-    return;
-  }
-
-  // $ANTLR end "file_input"
-
-  // $ANTLR start "packageDeclaration"
-  // TextMarkerParser.g:244:1:
-  // packageDeclaration returns [TextMarkerPackageDeclaration pack] : pString= PackageString p=
-  // dottedId SEMI ;
-  public final TextMarkerPackageDeclaration packageDeclaration() throws RecognitionException {
-    TextMarkerPackageDeclaration pack = null;
-
-    Token pString = null;
-    Token p = null;
-
-    try {
-      // TextMarkerParser.g:245:2:
-      // (pString= PackageString p= dottedId SEMI )
-      // TextMarkerParser.g:245:4:
-      // pString= PackageString p= dottedId SEMI
-      {
-        pString = (Token) match(input, PackageString, FOLLOW_PackageString_in_packageDeclaration121);
-        if (state.failed)
-          return pack;
-        if (state.backtracking == 0) {
+                    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText());decls.add(StatementFactory.createStringVariable(id, type));}
 
-          pack = StatementFactory.createPkgDeclaration(p, pString);
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:344:4: ( COMMA id= Identifier )*
+                    loop9:
+                    do {
+                        int alt9=2;
+                        int LA9_0 = input.LA(1);
 
-        }
-        pushFollow(FOLLOW_dottedId_in_packageDeclaration132);
-        p = dottedId();
+                        if ( (LA9_0==COMMA) ) {
+                            alt9=1;
+                        }
 
-        state._fsp--;
-        if (state.failed)
-          return pack;
-        if (state.backtracking == 0) {
 
-          pack = StatementFactory.createPkgDeclaration(p, pString);
+                        switch (alt9) {
+                    	case 1 :
+                    	    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:344:5: COMMA id= Identifier
+                    	    {
+                    	    match(input,COMMA,FOLLOW_COMMA_in_variableDeclaration533); if (state.failed) return stmts;
 
-        }
-        match(input, SEMI, FOLLOW_SEMI_in_packageDeclaration139);
-        if (state.failed)
-          return pack;
-        if (state.backtracking == 0) {
+                    	    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration539); if (state.failed) return stmts;
 
-          pack = StatementFactory.createPkgDeclaration(p, pString);
+                    	    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText());decls.add(StatementFactory.createStringVariable(id, type));}
 
-        }
+                    	    }
+                    	    break;
 
-      }
+                    	default :
+                    	    break loop9;
+                        }
+                    } while (true);
 
-    }
 
-    catch (RecognitionException exception1) {
-      if (reporter != null) {
-        reporter.reportError(exception1);
-      }
-      recover(input, exception1);
-    } catch (Throwable exception2) {
-      if (reporter != null) {
-        reporter.reportThrowable(exception2);
-      }
-    } finally {
-    }
-    return pack;
-  }
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:345:7: ( ASSIGN_EQUAL init= stringExpression )?
+                    int alt10=2;
+                    int LA10_0 = input.LA(1);
 
-  // $ANTLR end "packageDeclaration"
+                    if ( (LA10_0==ASSIGN_EQUAL) ) {
+                        alt10=1;
+                    }
+                    switch (alt10) {
+                        case 1 :
+                            // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:345:8: ASSIGN_EQUAL init= stringExpression
+                            {
+                            match(input,ASSIGN_EQUAL,FOLLOW_ASSIGN_EQUAL_in_variableDeclaration550); if (state.failed) return stmts;
 
-  // $ANTLR start "statements"
-  // TextMarkerParser.g:259:1:
-  // statements returns [List<Statement> stmts = new ArrayList<Statement>()] : (morestmts= statement
-  // )* ;
-  public final List<Statement> statements() throws RecognitionException {
-    List<Statement> stmts = new ArrayList<Statement>();
+                            pushFollow(FOLLOW_stringExpression_in_variableDeclaration556);
+                            init=stringExpression();
 
-    List<Statement> morestmts = null;
+                            state._fsp--;
+                            if (state.failed) return stmts;
 
-    try {
-      // TextMarkerParser.g:260:2:
-      // ( (morestmts= statement )* )
-      // TextMarkerParser.g:261:2:
-      // (morestmts= statement )*
-      {
-        // TextMarkerParser.g:261:2:
-        // (morestmts= statement )*
-        loop1: do {
-          int alt1 = 2;
-          int LA1_0 = input.LA(1);
+                            }
+                            break;
 
-          if (((LA1_0 >= DECLARE && LA1_0 <= WORDTABLE) || LA1_0 == BasicAnnotationType
-                  || (LA1_0 >= BlockString && LA1_0 <= BooleanString)
-                  || (LA1_0 >= CONDITION && LA1_0 <= TYPELIST) || LA1_0 == StringLiteral || (LA1_0 >= Identifier && LA1_0 <= LPAREN))) {
-            alt1 = 1;
-          }
+                    }
 
-          switch (alt1) {
-            case 1:
-            // TextMarkerParser.g:261:3:
-            // morestmts= statement
-            {
-              pushFollow(FOLLOW_statement_in_statements163);
-              morestmts = statement();
 
-              state._fsp--;
-              if (state.failed)
-                return stmts;
-              if (state.backtracking == 0) {
-                if (morestmts != null) {
-                  stmts.addAll(morestmts);
-                }
-              }
+                    match(input,SEMI,FOLLOW_SEMI_in_variableDeclaration561); if (state.failed) return stmts;
 
-            }
-              break;
+                    if ( state.backtracking==0 ) {
+                    		 stmts.add(StatementFactory.createDeclarationsStatement(type, decls, init));
+                    		 }
 
-            default:
-              break loop1;
-          }
-        } while (true);
-
-      }
-
-    }
-
-    catch (RecognitionException exception1) {
-      if (reporter != null) {
-        reporter.reportError(exception1);
-      }
-      recover(input, exception1);
-    } catch (Throwable exception2) {
-      if (reporter != null) {
-        reporter.reportThrowable(exception2);
-      }
-    } finally {
-    }
-    return stmts;
-  }
-
-  // $ANTLR end "statements"
-
-  // $ANTLR start "globalStatements"
-  // TextMarkerParser.g:264:1:
-  // globalStatements returns [List<Statement> stmts = new ArrayList<Statement>()] : (morestmts=
-  // globalStatement )* ;
-  public final List<Statement> globalStatements() throws RecognitionException {
-    List<Statement> stmts = new ArrayList<Statement>();
-
-    List<Statement> morestmts = null;
-
-    try {
-      // TextMarkerParser.g:265:2:
-      // ( (morestmts= globalStatement )* )
-      // TextMarkerParser.g:266:2:
-      // (morestmts= globalStatement )*
-      {
-        // TextMarkerParser.g:266:2:
-        // (morestmts= globalStatement )*
-        loop2: do {
-          int alt2 = 2;
-          int LA2_0 = input.LA(1);
-
-          if (((LA2_0 >= ScriptString && LA2_0 <= EngineString) || LA2_0 == TypeSystemString)) {
-            alt2 = 1;
-          }
-
-          switch (alt2) {
-            case 1:
-            // TextMarkerParser.g:266:3:
-            // morestmts= globalStatement
-            {
-              pushFollow(FOLLOW_globalStatement_in_globalStatements189);
-              morestmts = globalStatement();
-
-              state._fsp--;
-              if (state.failed)
-                return stmts;
-              if (state.backtracking == 0) {
-                if (morestmts != null) {
-                  stmts.addAll(morestmts);
-                }
-              }
+                    }
+                    break;
+                case 4 :
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:350:2: type= BooleanString id= Identifier ( COMMA id= Identifier )* ( ASSIGN_EQUAL init= booleanExpression )? SEMI
+                    {
+                    type=(Token)match(input,BooleanString,FOLLOW_BooleanString_in_variableDeclaration575); if (state.failed) return stmts;
 
-            }
-              break;
+                    id=(Token)match(input,Identifier,FOLLOW_Identifier_in_variableDeclaration581); if (state.failed) return stmts;
 
-            default:
-              break loop2;
-          }
-        } while (true);
-
-      }
+                    if ( state.backtracking==0 ) {addVariable(id.getText(), type.getText());decls.add(StatementFactory.createBooleanVariable(id, type));}
 
-    }
+                    // D:\\work\\workspace-uima3\\uimaj-ep-textmarker-ide\\src\\main\\java\\org\\apache\\uima\\textmarker\\ide\\core\\parser\\TextMarkerParser.g:351:4: ( COMMA id= Identifier )*
+                    loop11:
+                    do {
+                        int alt11=2;
+                        int LA11_0 = input.LA(1);
 
-    catch (RecognitionException exception1) {
-      if (reporter != null) {
-        reporter.reportError(exception1);
-      }
-      recover(input, exception1);
-    } catch (Throwable exception2) {
-      if (reporter != null) {
-        reporter.reportThrowable(exception2);
-      }
-    } finally {
-    }
-    return stmts;
-  }
-
-  // $ANTLR end "globalStatements"
-
-  // $ANTLR start "globalStatement"
-  // TextMarkerParser.g:269:1:
-  // globalStatement returns [List<Statement> stmts = new ArrayList<Statement>()] : stmtImport=
-  // importStatement ;
-  public final List<Statement> globalStatement() throws RecognitionException {
-    List<Statement> stmts = new ArrayList<Statement>();
-
-    Statement stmtImport = null;
-
-    try {
-      // TextMarkerParser.g:270:2:
-      // (stmtImport= importStatement )
-      // TextMarkerParser.g:271:2:
-      // stmtImport= importStatement
-      {
-        pushFollow(FOLLOW_importStatement_in_globalStatement213);
-        stmtImport = importStatement();
+                        if ( (LA11_0==COMMA) ) {
+                            alt11=1;
+                        }
 
-        state._fsp--;
-        if (state.failed)
-          return stmts;
-        if (state.backtracking == 0) {
-          stmts.add(stmtImport);
-        }
-
-      }
-
-    }
-
-    catch (RecognitionException exception1) {
-      if (reporter != null) {
-        reporter.reportError(exception1);
-      }
-      recover(input, exception1);
-    } catch (Throwable exception2) {
-      if (reporter != null) {
-        reporter.reportThrowable(exception2);
-      }
-    } finally {
-    }
-    return stmts;
-  }
-
-  // $ANTLR end "globalStatement"
-
-  // $ANTLR start "statement"
-  // TextMarkerParser.g:274:1:
-  // statement returns [List<Statement> stmts = new ArrayList<Statement>()] : (stmts1= declaration |
-  // stmtVariable= variableDeclaration | stmt3= blockDeclaration | stmt2= simpleStatement ) ;
-  public final List<Statement> statement() throws RecognitionException {
-    List<Statement> stmts = new ArrayList<Statement>();
-
-    List<Statement> stmts1 = null;
-
-    List<Statement> stmtVariable = null;
-
-    TextMarkerBlock stmt3 = null;
-
-    TextMarkerRule stmt2 = null;
-
-    try {
-      // TextMarkerParser.g:275:2:
-      // ( (stmts1= declaration | stmtVariable= variableDeclaration | stmt3= blockDeclaration |
-      // stmt2= simpleStatement ) )
-      // TextMarkerParser.g:276:2:
-      // (stmts1= declaration | stmtVariable= variableDeclaration | stmt3= blockDeclaration | stmt2=
-      // simpleStatement )
-      {
-        // TextMarkerParser.g:276:2:
-        // (stmts1= declaration | stmtVariable= variableDeclaration | stmt3= blockDeclaration |
-        // stmt2= simpleStatement )
-        int alt3 = 4;
-        switch (input.LA(1)) {
-          case DECLARE: {
-            alt3 = 1;
-          }
-            break;
-          case WORDLIST:
-          case WORDTABLE:
-          case TypeString:
-          case IntString:
-          case DoubleString:
-          case StringString:
-          case BooleanString:
-          case CONDITION:
-          case ACTION:
-          case BOOLEANLIST:
-          case INTLIST:
-          case DOUBLELIST:
-          case STRINGLIST:
-          case TYPELIST: {
-            alt3 = 2;
-          }
-            break;
-          case BlockString:
-          case AutomataBlockString: {
-            alt3 = 3;
-          }
-            break;
-          case BasicAnnotationType:
-          case StringLiteral:
-          case Identifier:
-          case LPAREN: {
-            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:
-          // TextMarkerParser.g:276:4:
-          // stmts1= declaration
-          {
-            pushFollow(FOLLOW_declaration_in_statement239);
-            stmts1 = declaration();
-
-            state._fsp--;
-            if (state.failed)
-              return stmts;
-            if (state.backtracking == 0) {
-              stmts.addAll(stmts1);
-            }
-
-          }
-            break;
-          case 2:
-          // TextMarkerParser.g:277:4:
-          // stmtVariable= variableDeclaration
-          {
-            pushFollow(FOLLOW_variableDeclaration_in_statement250);
-            stmtVariable = variableDeclaration();
-
-            state._fsp--;
-            if (state.failed)
-              return stmts;
-            if (state.backtracking == 0) {
-              stmts.addAll(stmtVariable);
-            }
-
-          }
-            break;
-          case 3:
-          // TextMarkerParser.g:278:4:
-          // stmt3= blockDeclaration
-          {
-            pushFollow(FOLLOW_blockDeclaration_in_statement261);
-            stmt3 = blockDeclaration();
-
-            state._fsp--;
-            if (state.failed)
-              return stmts;
-            if (state.backtracking == 0) {
-              stmts.add(stmt3);
-            }
-
-          }
-            break;
-          case 4:
-          // TextMarkerParser.g:280:4:
-          // stmt2= simpleStatement
-          {
-            pushFollow(FOLLOW_simpleStatement_in_statement274);
-            stmt2 = simpleStatement();
-
-            state._fsp--;
-            if (state.failed)
-              return stmts;
-            if (state.backtracking == 0) {
-              stmts.add(stmt2);
-            }
-
-          }
-            break;
-
-        }
-
-      }
-
-    }
-
-    catch (RecognitionException exception1) {
-      if (reporter != null) {
-        reporter.reportError(exception1);
-      }
-      recover(input, exception1);
-    } catch (Throwable exception2) {
-      if (reporter != null) {
-        reporter.reportThrowable(exception2);
-      }
-    } finally {
-    }
-    return stmts;
-  }
-
-  // $ANTLR end "statement"
-
-  // $ANTLR start "importStatement"
-  // TextMarkerParser.g:286:1:
-  // importStatement returns [Statement stmt = null] : (im= TypeSystemString name=
-  // dottedComponentDeclaration SEMI | im= ScriptString name= dottedComponentDeclaration SEMI | im=
-  // EngineString name= dottedComponentDeclaration SEMI );
-  public final Statement importStatement() throws RecognitionException {
-    Statement stmt = null;
-
-    Token im = null;
-    ComponentDeclaration name = null;
-
-    try {
-      // TextMarkerParser.g:287:2:
-      // (im= TypeSystemString name= dottedComponentDeclaration SEMI | im= ScriptString name=
-      // dottedComponentDeclaration SEMI | im= EngineString name= dottedComponentDeclaration 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:
-        // TextMarkerParser.g:288:2:
-        // im= TypeSystemString name= dottedComponentDeclaration SEMI
-        {
-          im = (Token) match(input, TypeSystemString, FOLLOW_TypeSystemString_in_importStatement303);
-          if (state.failed)
-            return stmt;
-          if (state.backtracking == 0) {
-            stmt = StatementFactory.createImportTypeSystem(
-                    StatementFactory.createEmptyComponentDeclaration(im), im);
-          }
-          pushFollow(FOLLOW_dottedComponentDeclaration_in_importStatement315);
-          name = dottedComponentDeclaration();
-
-          state._fsp--;
-          if (state.failed)
-            return stmt;
-          if (state.backtracking == 0) {
-            if (name != null) {
-              stmt = StatementFactory.createImportTypeSystem(name, im);
-              addImportTypeSystem(name);
-            }
-          }
-          match(input, SEMI, FOLLOW_SEMI_in_importStatement323);
-          if (state.failed)
-            return stmt;
-
-        }
-          break;
-        case 2:
-        // TextMarkerParser.g:293:4:
-        // im= ScriptString name= dottedComponentDeclaration SEMI
-        {

[... 36326 lines stripped ...]