[jboss-svn-commits] JBL Code SVN: r20411 - in labs/jbossrules/trunk/drools-compiler/src/main: resources/org/drools/lang/dsl and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jun 10 20:18:54 EDT 2008


Author: mattgeis
Date: 2008-06-10 20:18:54 -0400 (Tue, 10 Jun 2008)
New Revision: 20411

Modified:
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapLexer.java
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapParser.java
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapWalker.java
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLTokenizedMappingFile.java
   labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMap.g
   labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMapWalker.g
Log:
JBRULES-1633: Parse entire DSL file in one go, rather than line by line.


Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapLexer.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapLexer.java	2008-06-10 19:28:45 UTC (rev 20410)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapLexer.java	2008-06-11 00:18:54 UTC (rev 20411)
@@ -1,6 +1,9 @@
-// $ANTLR 3.0.1 DSLMap.g 2008-05-27 14:03:45
+// $ANTLR 3.0.1 DSLMap.g 2008-06-10 17:00:29
 
 	package org.drools.lang.dsl;
+	import java.util.List;
+	import java.util.ArrayList;
+	import org.drools.lang.dsl.DSLMappingParseException;
 
 
 import org.antlr.runtime.*;
@@ -54,10 +57,10 @@
     public final void mWS() throws RecognitionException {
         try {
             int _type = WS;
-            // DSLMap.g:254:9: ( ( ' ' | '\\t' | '\\f' )+ )
-            // DSLMap.g:254:17: ( ' ' | '\\t' | '\\f' )+
+            // DSLMap.g:268:9: ( ( ' ' | '\\t' | '\\f' )+ )
+            // DSLMap.g:268:17: ( ' ' | '\\t' | '\\f' )+
             {
-            // DSLMap.g:254:17: ( ' ' | '\\t' | '\\f' )+
+            // DSLMap.g:268:17: ( ' ' | '\\t' | '\\f' )+
             int cnt1=0;
             loop1:
             do {
@@ -115,10 +118,10 @@
     public final void mEOL() throws RecognitionException {
         try {
             int _type = EOL;
-            // DSLMap.g:261:6: ( ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' ) )
-            // DSLMap.g:262:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
+            // DSLMap.g:275:6: ( ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' ) )
+            // DSLMap.g:276:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
             {
-            // DSLMap.g:262:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
+            // DSLMap.g:276:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )
             int alt2=3;
             int LA2_0 = input.LA(1);
 
@@ -137,13 +140,13 @@
             else {
                 if (backtracking>0) {failed=true; return ;}
                 NoViableAltException nvae =
-                    new NoViableAltException("262:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )", 2, 0, input);
+                    new NoViableAltException("276:6: ( ( '\\r\\n' )=> '\\r\\n' | '\\r' | '\\n' )", 2, 0, input);
 
                 throw nvae;
             }
             switch (alt2) {
                 case 1 :
-                    // DSLMap.g:262:14: ( '\\r\\n' )=> '\\r\\n'
+                    // DSLMap.g:276:14: ( '\\r\\n' )=> '\\r\\n'
                     {
                     match("\r\n"); if (failed) return ;
 
@@ -151,14 +154,14 @@
                     }
                     break;
                 case 2 :
-                    // DSLMap.g:263:25: '\\r'
+                    // DSLMap.g:277:25: '\\r'
                     {
                     match('\r'); if (failed) return ;
 
                     }
                     break;
                 case 3 :
-                    // DSLMap.g:264:25: '\\n'
+                    // DSLMap.g:278:25: '\\n'
                     {
                     match('\n'); if (failed) return ;
 
@@ -180,8 +183,8 @@
     // $ANTLR start EscapeSequence
     public final void mEscapeSequence() throws RecognitionException {
         try {
-            // DSLMap.g:270:5: ( '\\\\' ( 'b' | 'B' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' | '.' | 'o' | 'x' | 'a' | 'e' | 'c' | 'd' | 'D' | 's' | 'S' | 'w' | 'W' | 'p' | 'A' | 'G' | 'Z' | 'z' | 'Q' | 'E' | '*' | '[' | ']' | '(' | ')' | '$' | '^' | '{' | '}' | '?' | '+' | '-' | '&' | '|' | '=' | 'u' | '0' | '#' ) )
-            // DSLMap.g:270:9: '\\\\' ( 'b' | 'B' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' | '.' | 'o' | 'x' | 'a' | 'e' | 'c' | 'd' | 'D' | 's' | 'S' | 'w' | 'W' | 'p' | 'A' | 'G' | 'Z' | 'z' | 'Q' | 'E' | '*' | '[' | ']' | '(' | ')' | '$' | '^' | '{' | '}' | '?' | '+' | '-' | '&' | '|' | '=' | 'u' | '0' | '#' )
+            // DSLMap.g:284:5: ( '\\\\' ( 'b' | 'B' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' | '.' | 'o' | 'x' | 'a' | 'e' | 'c' | 'd' | 'D' | 's' | 'S' | 'w' | 'W' | 'p' | 'A' | 'G' | 'Z' | 'z' | 'Q' | 'E' | '*' | '[' | ']' | '(' | ')' | '$' | '^' | '{' | '}' | '?' | '+' | '-' | '&' | '|' | '=' | 'u' | '0' | '#' ) )
+            // DSLMap.g:284:9: '\\\\' ( 'b' | 'B' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' | '.' | 'o' | 'x' | 'a' | 'e' | 'c' | 'd' | 'D' | 's' | 'S' | 'w' | 'W' | 'p' | 'A' | 'G' | 'Z' | 'z' | 'Q' | 'E' | '*' | '[' | ']' | '(' | ')' | '$' | '^' | '{' | '}' | '?' | '+' | '-' | '&' | '|' | '=' | 'u' | '0' | '#' )
             {
             match('\\'); if (failed) return ;
             if ( (input.LA(1)>='\"' && input.LA(1)<='$')||(input.LA(1)>='&' && input.LA(1)<='+')||(input.LA(1)>='-' && input.LA(1)<='.')||input.LA(1)=='0'||input.LA(1)=='='||input.LA(1)=='?'||(input.LA(1)>='A' && input.LA(1)<='B')||(input.LA(1)>='D' && input.LA(1)<='E')||input.LA(1)=='G'||input.LA(1)=='Q'||input.LA(1)=='S'||input.LA(1)=='W'||(input.LA(1)>='Z' && input.LA(1)<='^')||(input.LA(1)>='a' && input.LA(1)<='f')||(input.LA(1)>='n' && input.LA(1)<='p')||(input.LA(1)>='r' && input.LA(1)<='u')||(input.LA(1)>='w' && input.LA(1)<='x')||(input.LA(1)>='z' && input.LA(1)<='}') ) {
@@ -208,8 +211,8 @@
     public final void mLEFT_SQUARE() throws RecognitionException {
         try {
             int _type = LEFT_SQUARE;
-            // DSLMap.g:277:9: ( '[' )
-            // DSLMap.g:277:11: '['
+            // DSLMap.g:291:9: ( '[' )
+            // DSLMap.g:291:11: '['
             {
             match('['); if (failed) return ;
 
@@ -226,8 +229,8 @@
     public final void mRIGHT_SQUARE() throws RecognitionException {
         try {
             int _type = RIGHT_SQUARE;
-            // DSLMap.g:281:9: ( ']' )
-            // DSLMap.g:281:11: ']'
+            // DSLMap.g:295:9: ( ']' )
+            // DSLMap.g:295:11: ']'
             {
             match(']'); if (failed) return ;
 
@@ -244,8 +247,8 @@
     public final void mLEFT_CURLY() throws RecognitionException {
         try {
             int _type = LEFT_CURLY;
-            // DSLMap.g:285:9: ( '{' )
-            // DSLMap.g:285:11: '{'
+            // DSLMap.g:299:9: ( '{' )
+            // DSLMap.g:299:11: '{'
             {
             match('{'); if (failed) return ;
 
@@ -262,8 +265,8 @@
     public final void mRIGHT_CURLY() throws RecognitionException {
         try {
             int _type = RIGHT_CURLY;
-            // DSLMap.g:289:9: ( '}' )
-            // DSLMap.g:289:11: '}'
+            // DSLMap.g:303:9: ( '}' )
+            // DSLMap.g:303:11: '}'
             {
             match('}'); if (failed) return ;
 
@@ -280,8 +283,8 @@
     public final void mEQUALS() throws RecognitionException {
         try {
             int _type = EQUALS;
-            // DSLMap.g:292:8: ( '=' )
-            // DSLMap.g:292:10: '='
+            // DSLMap.g:306:8: ( '=' )
+            // DSLMap.g:306:10: '='
             {
             match('='); if (failed) return ;
 
@@ -298,8 +301,8 @@
     public final void mDOT() throws RecognitionException {
         try {
             int _type = DOT;
-            // DSLMap.g:295:5: ( '.' )
-            // DSLMap.g:295:7: '.'
+            // DSLMap.g:309:5: ( '.' )
+            // DSLMap.g:309:7: '.'
             {
             match('.'); if (failed) return ;
 
@@ -316,8 +319,8 @@
     public final void mPOUND() throws RecognitionException {
         try {
             int _type = POUND;
-            // DSLMap.g:298:9: ( '#' )
-            // DSLMap.g:298:11: '#'
+            // DSLMap.g:312:9: ( '#' )
+            // DSLMap.g:312:11: '#'
             {
             match('#'); if (failed) return ;
 
@@ -334,8 +337,8 @@
     public final void mCOLON() throws RecognitionException {
         try {
             int _type = COLON;
-            // DSLMap.g:301:7: ( ':' )
-            // DSLMap.g:301:9: ':'
+            // DSLMap.g:315:7: ( ':' )
+            // DSLMap.g:315:9: ':'
             {
             match(':'); if (failed) return ;
 
@@ -352,8 +355,8 @@
     public final void mCOMMA() throws RecognitionException {
         try {
             int _type = COMMA;
-            // DSLMap.g:304:7: ( ',' )
-            // DSLMap.g:304:9: ','
+            // DSLMap.g:318:7: ( ',' )
+            // DSLMap.g:318:9: ','
             {
             match(','); if (failed) return ;
 
@@ -370,11 +373,11 @@
     public final void mLINE_COMMENT() throws RecognitionException {
         try {
             int _type = LINE_COMMENT;
-            // DSLMap.g:312:2: ( POUND ( options {greedy=false; } : . )* EOL )
-            // DSLMap.g:312:4: POUND ( options {greedy=false; } : . )* EOL
+            // DSLMap.g:326:2: ( POUND ( options {greedy=false; } : . )* EOL )
+            // DSLMap.g:326:4: POUND ( options {greedy=false; } : . )* EOL
             {
             mPOUND(); if (failed) return ;
-            // DSLMap.g:312:10: ( options {greedy=false; } : . )*
+            // DSLMap.g:326:10: ( options {greedy=false; } : . )*
             loop3:
             do {
                 int alt3=2;
@@ -393,7 +396,7 @@
 
                 switch (alt3) {
             	case 1 :
-            	    // DSLMap.g:312:37: .
+            	    // DSLMap.g:326:37: .
             	    {
             	    matchAny(); if (failed) return ;
 
@@ -420,10 +423,10 @@
     public final void mLITERAL() throws RecognitionException {
         try {
             int _type = LITERAL;
-            // DSLMap.g:320:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' | '\\u00c0' .. '\\u00ff' | MISC | EscapeSequence | DOT )+ )
-            // DSLMap.g:320:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' | '\\u00c0' .. '\\u00ff' | MISC | EscapeSequence | DOT )+
+            // DSLMap.g:334:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' | '\\u00c0' .. '\\u00ff' | MISC | EscapeSequence | DOT )+ )
+            // DSLMap.g:334:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' | '\\u00c0' .. '\\u00ff' | MISC | EscapeSequence | DOT )+
             {
-            // DSLMap.g:320:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' | '\\u00c0' .. '\\u00ff' | MISC | EscapeSequence | DOT )+
+            // DSLMap.g:334:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' | '\\u00c0' .. '\\u00ff' | MISC | EscapeSequence | DOT )+
             int cnt4=0;
             loop4:
             do {
@@ -614,56 +617,56 @@
 
                 switch (alt4) {
             	case 1 :
-            	    // DSLMap.g:320:5: 'a' .. 'z'
+            	    // DSLMap.g:334:5: 'a' .. 'z'
             	    {
             	    matchRange('a','z'); if (failed) return ;
 
             	    }
             	    break;
             	case 2 :
-            	    // DSLMap.g:320:14: 'A' .. 'Z'
+            	    // DSLMap.g:334:14: 'A' .. 'Z'
             	    {
             	    matchRange('A','Z'); if (failed) return ;
 
             	    }
             	    break;
             	case 3 :
-            	    // DSLMap.g:320:23: '_'
+            	    // DSLMap.g:334:23: '_'
             	    {
             	    match('_'); if (failed) return ;
 
             	    }
             	    break;
             	case 4 :
-            	    // DSLMap.g:320:27: '0' .. '9'
+            	    // DSLMap.g:334:27: '0' .. '9'
             	    {
             	    matchRange('0','9'); if (failed) return ;
 
             	    }
             	    break;
             	case 5 :
-            	    // DSLMap.g:320:36: '\\u00c0' .. '\\u00ff'
+            	    // DSLMap.g:334:36: '\\u00c0' .. '\\u00ff'
             	    {
             	    matchRange('\u00C0','\u00FF'); if (failed) return ;
 
             	    }
             	    break;
             	case 6 :
-            	    // DSLMap.g:320:55: MISC
+            	    // DSLMap.g:334:55: MISC
             	    {
             	    mMISC(); if (failed) return ;
 
             	    }
             	    break;
             	case 7 :
-            	    // DSLMap.g:320:60: EscapeSequence
+            	    // DSLMap.g:334:60: EscapeSequence
             	    {
             	    mEscapeSequence(); if (failed) return ;
 
             	    }
             	    break;
             	case 8 :
-            	    // DSLMap.g:320:75: DOT
+            	    // DSLMap.g:334:75: DOT
             	    {
             	    mDOT(); if (failed) return ;
 
@@ -693,7 +696,7 @@
     // $ANTLR start MISC
     public final void mMISC() throws RecognitionException {
         try {
-            // DSLMap.g:324:7: ( '>' | '<' | '!' | '@' | '$' | '%' | '^' | '*' | '-' | '+' | '?' | '/' | '\\'' | '\"' | '|' | '&' | '(' | ')' | ';' )
+            // DSLMap.g:338:7: ( '>' | '<' | '!' | '@' | '$' | '%' | '^' | '*' | '-' | '+' | '?' | '/' | '\\'' | '\"' | '|' | '&' | '(' | ')' | ';' )
             // DSLMap.g:
             {
             if ( (input.LA(1)>='!' && input.LA(1)<='\"')||(input.LA(1)>='$' && input.LA(1)<='+')||input.LA(1)=='-'||input.LA(1)=='/'||(input.LA(1)>=';' && input.LA(1)<='<')||(input.LA(1)>='>' && input.LA(1)<='@')||input.LA(1)=='^'||input.LA(1)=='|' ) {
@@ -1048,8 +1051,8 @@
 
     // $ANTLR start synpred1
     public final void synpred1_fragment() throws RecognitionException {   
-        // DSLMap.g:262:14: ( '\\r\\n' )
-        // DSLMap.g:262:16: '\\r\\n'
+        // DSLMap.g:276:14: ( '\\r\\n' )
+        // DSLMap.g:276:16: '\\r\\n'
         {
         match("\r\n"); if (failed) return ;
 

Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapParser.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapParser.java	2008-06-10 19:28:45 UTC (rev 20410)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapParser.java	2008-06-11 00:18:54 UTC (rev 20411)
@@ -1,6 +1,9 @@
-// $ANTLR 3.0.1 DSLMap.g 2008-05-27 14:03:44
+// $ANTLR 3.0.1 DSLMap.g 2008-06-10 17:00:29
 
 	package org.drools.lang.dsl;
+	import java.util.List;
+	import java.util.ArrayList;
+	import org.drools.lang.dsl.DSLMappingParseException;
 
 
 import org.antlr.runtime.*;
@@ -69,6 +72,12 @@
     
     //we may not need the check on [], as the LITERAL token being examined 
     //should not have them.
+    	
+    	private List errorList = new ArrayList();
+    	public List getErrorList(){
+    		return errorList;
+    	}
+    
     	private boolean validateLT(int LTNumber, String text){
     		if (null == input) return false;
     		if (null == input.LT(LTNumber)) return false;
@@ -86,15 +95,18 @@
     		return validateLT(1, text);
     	}
     	
-    	protected void mismatch(IntStream input, int ttype, BitSet follow)
-    		throws RecognitionException{
-    		throw new MismatchedTokenException(ttype, input);
+    	public void reportError(RecognitionException re) {
+    		// if we've already reported an error and have not matched a token
+    		// yet successfully, don't report any errors.
+    		if (errorRecovery) {
+    			return;
+    		}
+    		errorRecovery = true;
+    	
+    		String error = "Error parsing mapping entry: " + getErrorMessage(re, tokenNames);
+    		DSLMappingParseException exception = new DSLMappingParseException (error, re.line);
+    		errorList.add(exception);
     	}
-    
-    	public void recoverFromMismatchedSet(IntStream input,
-    		RecognitionException e, BitSet follow) throws RecognitionException{
-    		throw e;
-    	}
     	
 
 
@@ -104,7 +116,7 @@
     };
 
     // $ANTLR start mapping_file
-    // DSLMap.g:76:1: mapping_file : ( statement )* -> ^( VT_DSL_GRAMMAR ( statement )* ) ;
+    // DSLMap.g:84:1: mapping_file : ( statement )* -> ^( VT_DSL_GRAMMAR ( statement )* ) ;
     public final mapping_file_return mapping_file() throws RecognitionException {
         mapping_file_return retval = new mapping_file_return();
         retval.start = input.LT(1);
@@ -116,10 +128,10 @@
 
         RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
         try {
-            // DSLMap.g:77:2: ( ( statement )* -> ^( VT_DSL_GRAMMAR ( statement )* ) )
-            // DSLMap.g:77:4: ( statement )*
+            // DSLMap.g:85:2: ( ( statement )* -> ^( VT_DSL_GRAMMAR ( statement )* ) )
+            // DSLMap.g:85:4: ( statement )*
             {
-            // DSLMap.g:77:4: ( statement )*
+            // DSLMap.g:85:4: ( statement )*
             loop1:
             do {
                 int alt1=2;
@@ -134,7 +146,7 @@
             	case 1 :
             	    // DSLMap.g:0:0: statement
             	    {
-            	    pushFollow(FOLLOW_statement_in_mapping_file262);
+            	    pushFollow(FOLLOW_statement_in_mapping_file255);
             	    statement1=statement();
             	    _fsp--;
             	    if (failed) return retval;
@@ -160,14 +172,14 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 78:2: -> ^( VT_DSL_GRAMMAR ( statement )* )
+            // 86:2: -> ^( VT_DSL_GRAMMAR ( statement )* )
             {
-                // DSLMap.g:78:5: ^( VT_DSL_GRAMMAR ( statement )* )
+                // DSLMap.g:86:5: ^( VT_DSL_GRAMMAR ( statement )* )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_DSL_GRAMMAR, "VT_DSL_GRAMMAR"), root_1);
 
-                // DSLMap.g:78:22: ( statement )*
+                // DSLMap.g:86:22: ( statement )*
                 while ( stream_statement.hasNext() ) {
                     adaptor.addChild(root_1, stream_statement.next());
 
@@ -190,10 +202,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -206,7 +218,7 @@
     };
 
     // $ANTLR start statement
-    // DSLMap.g:81:1: statement : ( entry | comment | EOL );
+    // DSLMap.g:89:1: statement : ( entry | comment | EOL );
     public final statement_return statement() throws RecognitionException {
         statement_return retval = new statement_return();
         retval.start = input.LT(1);
@@ -222,7 +234,7 @@
         Object EOL4_tree=null;
 
         try {
-            // DSLMap.g:82:2: ( entry | comment | EOL )
+            // DSLMap.g:90:2: ( entry | comment | EOL )
             int alt2=3;
             switch ( input.LA(1) ) {
             case LEFT_SQUARE:
@@ -243,18 +255,18 @@
             default:
                 if (backtracking>0) {failed=true; return retval;}
                 NoViableAltException nvae =
-                    new NoViableAltException("81:1: statement : ( entry | comment | EOL );", 2, 0, input);
+                    new NoViableAltException("89:1: statement : ( entry | comment | EOL );", 2, 0, input);
 
                 throw nvae;
             }
 
             switch (alt2) {
                 case 1 :
-                    // DSLMap.g:82:4: entry
+                    // DSLMap.g:90:4: entry
                     {
                     root_0 = (Object)adaptor.nil();
 
-                    pushFollow(FOLLOW_entry_in_statement285);
+                    pushFollow(FOLLOW_entry_in_statement278);
                     entry2=entry();
                     _fsp--;
                     if (failed) return retval;
@@ -263,11 +275,11 @@
                     }
                     break;
                 case 2 :
-                    // DSLMap.g:83:4: comment
+                    // DSLMap.g:91:4: comment
                     {
                     root_0 = (Object)adaptor.nil();
 
-                    pushFollow(FOLLOW_comment_in_statement292);
+                    pushFollow(FOLLOW_comment_in_statement285);
                     comment3=comment();
                     _fsp--;
                     if (failed) return retval;
@@ -276,12 +288,12 @@
                     }
                     break;
                 case 3 :
-                    // DSLMap.g:84:4: EOL
+                    // DSLMap.g:92:4: EOL
                     {
                     root_0 = (Object)adaptor.nil();
 
                     EOL4=(Token)input.LT(1);
-                    match(input,EOL,FOLLOW_EOL_in_statement298); if (failed) return retval;
+                    match(input,EOL,FOLLOW_EOL_in_statement291); if (failed) return retval;
 
                     }
                     break;
@@ -294,10 +306,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -310,7 +322,7 @@
     };
 
     // $ANTLR start comment
-    // DSLMap.g:89:1: comment : LINE_COMMENT -> ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT ) ;
+    // DSLMap.g:97:1: comment : LINE_COMMENT -> ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT ) ;
     public final comment_return comment() throws RecognitionException {
         comment_return retval = new comment_return();
         retval.start = input.LT(1);
@@ -323,11 +335,11 @@
         RewriteRuleTokenStream stream_LINE_COMMENT=new RewriteRuleTokenStream(adaptor,"token LINE_COMMENT");
 
         try {
-            // DSLMap.g:89:9: ( LINE_COMMENT -> ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT ) )
-            // DSLMap.g:89:11: LINE_COMMENT
+            // DSLMap.g:97:9: ( LINE_COMMENT -> ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT ) )
+            // DSLMap.g:97:11: LINE_COMMENT
             {
             LINE_COMMENT5=(Token)input.LT(1);
-            match(input,LINE_COMMENT,FOLLOW_LINE_COMMENT_in_comment314); if (failed) return retval;
+            match(input,LINE_COMMENT,FOLLOW_LINE_COMMENT_in_comment307); if (failed) return retval;
             if ( backtracking==0 ) stream_LINE_COMMENT.add(LINE_COMMENT5);
 
 
@@ -342,9 +354,9 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 90:2: -> ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT )
+            // 98:2: -> ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT )
             {
-                // DSLMap.g:90:5: ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT )
+                // DSLMap.g:98:5: ^( VT_COMMENT[$LINE_COMMENT, \"COMMENT\"] LINE_COMMENT )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_COMMENT, LINE_COMMENT5,  "COMMENT"), root_1);
@@ -367,10 +379,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -383,7 +395,7 @@
     };
 
     // $ANTLR start entry
-    // DSLMap.g:94:1: entry : scope_section ( meta_section )? key_section EQUALS value_section ( EOL | EOF ) -> ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) ;
+    // DSLMap.g:102:1: entry : scope_section ( meta_section )? key_section EQUALS value_section ( EOL | EOF ) -> ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) ;
     public final entry_return entry() throws RecognitionException {
         entry_return retval = new entry_return();
         retval.start = input.LT(1);
@@ -413,15 +425,15 @@
         RewriteRuleSubtreeStream stream_scope_section=new RewriteRuleSubtreeStream(adaptor,"rule scope_section");
         RewriteRuleSubtreeStream stream_meta_section=new RewriteRuleSubtreeStream(adaptor,"rule meta_section");
         try {
-            // DSLMap.g:94:8: ( scope_section ( meta_section )? key_section EQUALS value_section ( EOL | EOF ) -> ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) )
-            // DSLMap.g:94:10: scope_section ( meta_section )? key_section EQUALS value_section ( EOL | EOF )
+            // DSLMap.g:102:8: ( scope_section ( meta_section )? key_section EQUALS value_section ( EOL | EOF ) -> ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) )
+            // DSLMap.g:102:10: scope_section ( meta_section )? key_section EQUALS value_section ( EOL | EOF )
             {
-            pushFollow(FOLLOW_scope_section_in_entry339);
+            pushFollow(FOLLOW_scope_section_in_entry332);
             scope_section6=scope_section();
             _fsp--;
             if (failed) return retval;
             if ( backtracking==0 ) stream_scope_section.add(scope_section6.getTree());
-            // DSLMap.g:94:24: ( meta_section )?
+            // DSLMap.g:102:24: ( meta_section )?
             int alt3=2;
             int LA3_0 = input.LA(1);
 
@@ -451,7 +463,7 @@
                 case 1 :
                     // DSLMap.g:0:0: meta_section
                     {
-                    pushFollow(FOLLOW_meta_section_in_entry341);
+                    pushFollow(FOLLOW_meta_section_in_entry334);
                     meta_section7=meta_section();
                     _fsp--;
                     if (failed) return retval;
@@ -462,21 +474,21 @@
 
             }
 
-            pushFollow(FOLLOW_key_section_in_entry344);
+            pushFollow(FOLLOW_key_section_in_entry337);
             key_section8=key_section();
             _fsp--;
             if (failed) return retval;
             if ( backtracking==0 ) stream_key_section.add(key_section8.getTree());
             EQUALS9=(Token)input.LT(1);
-            match(input,EQUALS,FOLLOW_EQUALS_in_entry346); if (failed) return retval;
+            match(input,EQUALS,FOLLOW_EQUALS_in_entry339); if (failed) return retval;
             if ( backtracking==0 ) stream_EQUALS.add(EQUALS9);
 
-            pushFollow(FOLLOW_value_section_in_entry348);
+            pushFollow(FOLLOW_value_section_in_entry341);
             value_section10=value_section();
             _fsp--;
             if (failed) return retval;
             if ( backtracking==0 ) stream_value_section.add(value_section10.getTree());
-            // DSLMap.g:94:71: ( EOL | EOF )
+            // DSLMap.g:102:71: ( EOL | EOF )
             int alt4=2;
             int LA4_0 = input.LA(1);
 
@@ -489,26 +501,26 @@
             else {
                 if (backtracking>0) {failed=true; return retval;}
                 NoViableAltException nvae =
-                    new NoViableAltException("94:71: ( EOL | EOF )", 4, 0, input);
+                    new NoViableAltException("102:71: ( EOL | EOF )", 4, 0, input);
 
                 throw nvae;
             }
             switch (alt4) {
                 case 1 :
-                    // DSLMap.g:94:72: EOL
+                    // DSLMap.g:102:72: EOL
                     {
                     EOL11=(Token)input.LT(1);
-                    match(input,EOL,FOLLOW_EOL_in_entry351); if (failed) return retval;
+                    match(input,EOL,FOLLOW_EOL_in_entry344); if (failed) return retval;
                     if ( backtracking==0 ) stream_EOL.add(EOL11);
 
 
                     }
                     break;
                 case 2 :
-                    // DSLMap.g:94:76: EOF
+                    // DSLMap.g:102:76: EOF
                     {
                     EOF12=(Token)input.LT(1);
-                    match(input,EOF,FOLLOW_EOF_in_entry353); if (failed) return retval;
+                    match(input,EOF,FOLLOW_EOF_in_entry346); if (failed) return retval;
                     if ( backtracking==0 ) stream_EOF.add(EOF12);
 
 
@@ -529,15 +541,15 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 95:2: -> ^( VT_ENTRY scope_section ( meta_section )? key_section value_section )
+            // 103:2: -> ^( VT_ENTRY scope_section ( meta_section )? key_section value_section )
             {
-                // DSLMap.g:95:5: ^( VT_ENTRY scope_section ( meta_section )? key_section value_section )
+                // DSLMap.g:103:5: ^( VT_ENTRY scope_section ( meta_section )? key_section value_section )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_ENTRY, "VT_ENTRY"), root_1);
 
                 adaptor.addChild(root_1, stream_scope_section.next());
-                // DSLMap.g:95:30: ( meta_section )?
+                // DSLMap.g:103:30: ( meta_section )?
                 if ( stream_meta_section.hasNext() ) {
                     adaptor.addChild(root_1, stream_meta_section.next());
 
@@ -562,10 +574,15 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch ( RecognitionException e ) {
+            
+            		reportError( e );
+            	
+        }
+        catch ( RewriteEmptyStreamException e ) {
+            
+            	
+        }
         finally {
         }
         return retval;
@@ -578,7 +595,7 @@
     };
 
     // $ANTLR start scope_section
-    // DSLMap.g:100:1: scope_section : LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? ) ;
+    // DSLMap.g:113:1: scope_section : LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? ) ;
     public final scope_section_return scope_section() throws RecognitionException {
         scope_section_return retval = new scope_section_return();
         retval.start = input.LT(1);
@@ -605,14 +622,14 @@
         RewriteRuleSubtreeStream stream_keyword_key=new RewriteRuleSubtreeStream(adaptor,"rule keyword_key");
         RewriteRuleSubtreeStream stream_consequence_key=new RewriteRuleSubtreeStream(adaptor,"rule consequence_key");
         try {
-            // DSLMap.g:101:2: ( LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? ) )
-            // DSLMap.g:101:4: LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE
+            // DSLMap.g:114:2: ( LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? ) )
+            // DSLMap.g:114:4: LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE
             {
             LEFT_SQUARE13=(Token)input.LT(1);
-            match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_scope_section384); if (failed) return retval;
+            match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_scope_section392); if (failed) return retval;
             if ( backtracking==0 ) stream_LEFT_SQUARE.add(LEFT_SQUARE13);
 
-            // DSLMap.g:102:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )
+            // DSLMap.g:115:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )
             int alt5=4;
             int LA5_0 = input.LA(1);
 
@@ -634,7 +651,7 @@
                 else {
                     if (backtracking>0) {failed=true; return retval;}
                     NoViableAltException nvae =
-                        new NoViableAltException("102:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )", 5, 1, input);
+                        new NoViableAltException("115:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )", 5, 1, input);
 
                     throw nvae;
                 }
@@ -642,15 +659,15 @@
             else {
                 if (backtracking>0) {failed=true; return retval;}
                 NoViableAltException nvae =
-                    new NoViableAltException("102:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )", 5, 0, input);
+                    new NoViableAltException("115:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )", 5, 0, input);
 
                 throw nvae;
             }
             switch (alt5) {
                 case 1 :
-                    // DSLMap.g:102:4: value1= condition_key
+                    // DSLMap.g:115:4: value1= condition_key
                     {
-                    pushFollow(FOLLOW_condition_key_in_scope_section392);
+                    pushFollow(FOLLOW_condition_key_in_scope_section400);
                     value1=condition_key();
                     _fsp--;
                     if (failed) return retval;
@@ -659,9 +676,9 @@
                     }
                     break;
                 case 2 :
-                    // DSLMap.g:103:5: value2= consequence_key
+                    // DSLMap.g:116:5: value2= consequence_key
                     {
-                    pushFollow(FOLLOW_consequence_key_in_scope_section401);
+                    pushFollow(FOLLOW_consequence_key_in_scope_section409);
                     value2=consequence_key();
                     _fsp--;
                     if (failed) return retval;
@@ -670,9 +687,9 @@
                     }
                     break;
                 case 3 :
-                    // DSLMap.g:104:5: value3= keyword_key
+                    // DSLMap.g:117:5: value3= keyword_key
                     {
-                    pushFollow(FOLLOW_keyword_key_in_scope_section409);
+                    pushFollow(FOLLOW_keyword_key_in_scope_section417);
                     value3=keyword_key();
                     _fsp--;
                     if (failed) return retval;
@@ -681,9 +698,9 @@
                     }
                     break;
                 case 4 :
-                    // DSLMap.g:105:5: value4= any_key
+                    // DSLMap.g:118:5: value4= any_key
                     {
-                    pushFollow(FOLLOW_any_key_in_scope_section417);
+                    pushFollow(FOLLOW_any_key_in_scope_section425);
                     value4=any_key();
                     _fsp--;
                     if (failed) return retval;
@@ -695,7 +712,7 @@
             }
 
             RIGHT_SQUARE14=(Token)input.LT(1);
-            match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_scope_section425); if (failed) return retval;
+            match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_scope_section433); if (failed) return retval;
             if ( backtracking==0 ) stream_RIGHT_SQUARE.add(RIGHT_SQUARE14);
 
 
@@ -714,32 +731,32 @@
             RewriteRuleSubtreeStream stream_value3=new RewriteRuleSubtreeStream(adaptor,"token value3",value3!=null?value3.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 108:2: -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? )
+            // 121:2: -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? )
             {
-                // DSLMap.g:108:5: ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? )
+                // DSLMap.g:121:5: ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_SCOPE, LEFT_SQUARE13,  "SCOPE SECTION"), root_1);
 
-                // DSLMap.g:108:47: ( $value1)?
+                // DSLMap.g:121:47: ( $value1)?
                 if ( stream_value1.hasNext() ) {
                     adaptor.addChild(root_1, stream_value1.next());
 
                 }
                 stream_value1.reset();
-                // DSLMap.g:108:56: ( $value2)?
+                // DSLMap.g:121:56: ( $value2)?
                 if ( stream_value2.hasNext() ) {
                     adaptor.addChild(root_1, stream_value2.next());
 
                 }
                 stream_value2.reset();
-                // DSLMap.g:108:65: ( $value3)?
+                // DSLMap.g:121:65: ( $value3)?
                 if ( stream_value3.hasNext() ) {
                     adaptor.addChild(root_1, stream_value3.next());
 
                 }
                 stream_value3.reset();
-                // DSLMap.g:108:74: ( $value4)?
+                // DSLMap.g:121:74: ( $value4)?
                 if ( stream_value4.hasNext() ) {
                     adaptor.addChild(root_1, stream_value4.next());
 
@@ -762,10 +779,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -778,7 +795,7 @@
     };
 
     // $ANTLR start meta_section
-    // DSLMap.g:113:1: meta_section : LEFT_SQUARE ( LITERAL )? RIGHT_SQUARE -> ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? ) ;
+    // DSLMap.g:127:1: meta_section : LEFT_SQUARE ( LITERAL )? RIGHT_SQUARE -> ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? ) ;
     public final meta_section_return meta_section() throws RecognitionException {
         meta_section_return retval = new meta_section_return();
         retval.start = input.LT(1);
@@ -797,14 +814,14 @@
         RewriteRuleTokenStream stream_RIGHT_SQUARE=new RewriteRuleTokenStream(adaptor,"token RIGHT_SQUARE");
 
         try {
-            // DSLMap.g:114:2: ( LEFT_SQUARE ( LITERAL )? RIGHT_SQUARE -> ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? ) )
-            // DSLMap.g:114:4: LEFT_SQUARE ( LITERAL )? RIGHT_SQUARE
+            // DSLMap.g:128:2: ( LEFT_SQUARE ( LITERAL )? RIGHT_SQUARE -> ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? ) )
+            // DSLMap.g:128:4: LEFT_SQUARE ( LITERAL )? RIGHT_SQUARE
             {
             LEFT_SQUARE15=(Token)input.LT(1);
-            match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_meta_section463); if (failed) return retval;
+            match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_meta_section473); if (failed) return retval;
             if ( backtracking==0 ) stream_LEFT_SQUARE.add(LEFT_SQUARE15);
 
-            // DSLMap.g:114:16: ( LITERAL )?
+            // DSLMap.g:128:16: ( LITERAL )?
             int alt6=2;
             int LA6_0 = input.LA(1);
 
@@ -816,7 +833,7 @@
                     // DSLMap.g:0:0: LITERAL
                     {
                     LITERAL16=(Token)input.LT(1);
-                    match(input,LITERAL,FOLLOW_LITERAL_in_meta_section465); if (failed) return retval;
+                    match(input,LITERAL,FOLLOW_LITERAL_in_meta_section475); if (failed) return retval;
                     if ( backtracking==0 ) stream_LITERAL.add(LITERAL16);
 
 
@@ -826,7 +843,7 @@
             }
 
             RIGHT_SQUARE17=(Token)input.LT(1);
-            match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_meta_section468); if (failed) return retval;
+            match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_meta_section478); if (failed) return retval;
             if ( backtracking==0 ) stream_RIGHT_SQUARE.add(RIGHT_SQUARE17);
 
 
@@ -841,14 +858,14 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 115:2: -> ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? )
+            // 129:2: -> ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? )
             {
-                // DSLMap.g:115:5: ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? )
+                // DSLMap.g:129:5: ^( VT_META[$LEFT_SQUARE, \"META SECTION\"] ( LITERAL )? )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_META, LEFT_SQUARE15,  "META SECTION"), root_1);
 
-                // DSLMap.g:115:45: ( LITERAL )?
+                // DSLMap.g:129:45: ( LITERAL )?
                 if ( stream_LITERAL.hasNext() ) {
                     adaptor.addChild(root_1, stream_LITERAL.next());
 
@@ -871,10 +888,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -887,7 +904,7 @@
     };
 
     // $ANTLR start key_section
-    // DSLMap.g:118:1: key_section : (ks= key_sentence )+ -> ^( VT_ENTRY_KEY ( key_sentence )+ ) ;
+    // DSLMap.g:132:1: key_section : (ks= key_sentence )+ -> ^( VT_ENTRY_KEY ( key_sentence )+ ) ;
     public final key_section_return key_section() throws RecognitionException {
         key_section_return retval = new key_section_return();
         retval.start = input.LT(1);
@@ -899,10 +916,10 @@
 
         RewriteRuleSubtreeStream stream_key_sentence=new RewriteRuleSubtreeStream(adaptor,"rule key_sentence");
         try {
-            // DSLMap.g:119:2: ( (ks= key_sentence )+ -> ^( VT_ENTRY_KEY ( key_sentence )+ ) )
-            // DSLMap.g:119:4: (ks= key_sentence )+
+            // DSLMap.g:133:2: ( (ks= key_sentence )+ -> ^( VT_ENTRY_KEY ( key_sentence )+ ) )
+            // DSLMap.g:133:4: (ks= key_sentence )+
             {
-            // DSLMap.g:119:6: (ks= key_sentence )+
+            // DSLMap.g:133:6: (ks= key_sentence )+
             int cnt7=0;
             loop7:
             do {
@@ -918,7 +935,7 @@
             	case 1 :
             	    // DSLMap.g:0:0: ks= key_sentence
             	    {
-            	    pushFollow(FOLLOW_key_sentence_in_key_section492);
+            	    pushFollow(FOLLOW_key_sentence_in_key_section502);
             	    ks=key_sentence();
             	    _fsp--;
             	    if (failed) return retval;
@@ -949,9 +966,9 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 120:2: -> ^( VT_ENTRY_KEY ( key_sentence )+ )
+            // 134:2: -> ^( VT_ENTRY_KEY ( key_sentence )+ )
             {
-                // DSLMap.g:120:5: ^( VT_ENTRY_KEY ( key_sentence )+ )
+                // DSLMap.g:134:5: ^( VT_ENTRY_KEY ( key_sentence )+ )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_ENTRY_KEY, "VT_ENTRY_KEY"), root_1);
@@ -981,10 +998,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -997,7 +1014,7 @@
     };
 
     // $ANTLR start key_sentence
-    // DSLMap.g:123:1: key_sentence : ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] );
+    // DSLMap.g:137:1: key_sentence : ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] );
     public final key_sentence_return key_sentence() throws RecognitionException {
         key_sentence_return retval = new key_sentence_return();
         retval.start = input.LT(1);
@@ -1014,7 +1031,7 @@
                 String text = "";
 
         try {
-            // DSLMap.g:127:2: ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] )
+            // DSLMap.g:141:2: ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] )
             int alt8=2;
             int LA8_0 = input.LA(1);
 
@@ -1027,17 +1044,17 @@
             else {
                 if (backtracking>0) {failed=true; return retval;}
                 NoViableAltException nvae =
-                    new NoViableAltException("123:1: key_sentence : ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] );", 8, 0, input);
+                    new NoViableAltException("137:1: key_sentence : ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] );", 8, 0, input);
 
                 throw nvae;
             }
             switch (alt8) {
                 case 1 :
-                    // DSLMap.g:127:4: variable_definition
+                    // DSLMap.g:141:4: variable_definition
                     {
                     root_0 = (Object)adaptor.nil();
 
-                    pushFollow(FOLLOW_variable_definition_in_key_sentence523);
+                    pushFollow(FOLLOW_variable_definition_in_key_sentence533);
                     variable_definition18=variable_definition();
                     _fsp--;
                     if (failed) return retval;
@@ -1046,9 +1063,9 @@
                     }
                     break;
                 case 2 :
-                    // DSLMap.g:128:4: cb= key_chunk
+                    // DSLMap.g:142:4: cb= key_chunk
                     {
-                    pushFollow(FOLLOW_key_chunk_in_key_sentence530);
+                    pushFollow(FOLLOW_key_chunk_in_key_sentence540);
                     cb=key_chunk();
                     _fsp--;
                     if (failed) return retval;
@@ -1068,7 +1085,7 @@
                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
                     root_0 = (Object)adaptor.nil();
-                    // 129:2: -> VT_LITERAL[$cb.start, text]
+                    // 143:2: -> VT_LITERAL[$cb.start, text]
                     {
                         adaptor.addChild(root_0, adaptor.create(VT_LITERAL, ((Token)cb.start),  text));
 
@@ -1087,10 +1104,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1103,7 +1120,7 @@
     };
 
     // $ANTLR start key_chunk
-    // DSLMap.g:132:1: key_chunk : ( literal )+ ;
+    // DSLMap.g:146:1: key_chunk : ( literal )+ ;
     public final key_chunk_return key_chunk() throws RecognitionException {
         key_chunk_return retval = new key_chunk_return();
         retval.start = input.LT(1);
@@ -1115,12 +1132,12 @@
 
 
         try {
-            // DSLMap.g:133:2: ( ( literal )+ )
-            // DSLMap.g:133:4: ( literal )+
+            // DSLMap.g:147:2: ( ( literal )+ )
+            // DSLMap.g:147:4: ( literal )+
             {
             root_0 = (Object)adaptor.nil();
 
-            // DSLMap.g:133:4: ( literal )+
+            // DSLMap.g:147:4: ( literal )+
             int cnt9=0;
             loop9:
             do {
@@ -1142,7 +1159,7 @@
             	case 1 :
             	    // DSLMap.g:0:0: literal
             	    {
-            	    pushFollow(FOLLOW_literal_in_key_chunk551);
+            	    pushFollow(FOLLOW_literal_in_key_chunk561);
             	    literal19=literal();
             	    _fsp--;
             	    if (failed) return retval;
@@ -1171,10 +1188,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1187,7 +1204,7 @@
     };
 
     // $ANTLR start value_section
-    // DSLMap.g:136:1: value_section : ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) ;
+    // DSLMap.g:150:1: value_section : ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) ;
     public final value_section_return value_section() throws RecognitionException {
         value_section_return retval = new value_section_return();
         retval.start = input.LT(1);
@@ -1199,10 +1216,10 @@
 
         RewriteRuleSubtreeStream stream_value_sentence=new RewriteRuleSubtreeStream(adaptor,"rule value_sentence");
         try {
-            // DSLMap.g:137:2: ( ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) )
-            // DSLMap.g:137:4: ( value_sentence )+
+            // DSLMap.g:151:2: ( ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) )
+            // DSLMap.g:151:4: ( value_sentence )+
             {
-            // DSLMap.g:137:4: ( value_sentence )+
+            // DSLMap.g:151:4: ( value_sentence )+
             int cnt10=0;
             loop10:
             do {
@@ -1218,7 +1235,7 @@
             	case 1 :
             	    // DSLMap.g:0:0: value_sentence
             	    {
-            	    pushFollow(FOLLOW_value_sentence_in_value_section566);
+            	    pushFollow(FOLLOW_value_sentence_in_value_section576);
             	    value_sentence20=value_sentence();
             	    _fsp--;
             	    if (failed) return retval;
@@ -1249,9 +1266,9 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 138:2: -> ^( VT_ENTRY_VAL ( value_sentence )+ )
+            // 152:2: -> ^( VT_ENTRY_VAL ( value_sentence )+ )
             {
-                // DSLMap.g:138:5: ^( VT_ENTRY_VAL ( value_sentence )+ )
+                // DSLMap.g:152:5: ^( VT_ENTRY_VAL ( value_sentence )+ )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_ENTRY_VAL, "VT_ENTRY_VAL"), root_1);
@@ -1281,10 +1298,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1297,7 +1314,7 @@
     };
 
     // $ANTLR start value_sentence
-    // DSLMap.g:141:1: value_sentence : ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] );
+    // DSLMap.g:155:1: value_sentence : ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] );
     public final value_sentence_return value_sentence() throws RecognitionException {
         value_sentence_return retval = new value_sentence_return();
         retval.start = input.LT(1);
@@ -1314,7 +1331,7 @@
                 String text = "";
 
         try {
-            // DSLMap.g:145:2: ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] )
+            // DSLMap.g:159:2: ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] )
             int alt11=2;
             int LA11_0 = input.LA(1);
 
@@ -1327,17 +1344,17 @@
             else {
                 if (backtracking>0) {failed=true; return retval;}
                 NoViableAltException nvae =
-                    new NoViableAltException("141:1: value_sentence : ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] );", 11, 0, input);
+                    new NoViableAltException("155:1: value_sentence : ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] );", 11, 0, input);
 
                 throw nvae;
             }
             switch (alt11) {
                 case 1 :
-                    // DSLMap.g:145:4: variable_reference
+                    // DSLMap.g:159:4: variable_reference
                     {
                     root_0 = (Object)adaptor.nil();
 
-                    pushFollow(FOLLOW_variable_reference_in_value_sentence597);
+                    pushFollow(FOLLOW_variable_reference_in_value_sentence607);
                     variable_reference21=variable_reference();
                     _fsp--;
                     if (failed) return retval;
@@ -1346,9 +1363,9 @@
                     }
                     break;
                 case 2 :
-                    // DSLMap.g:146:4: vc= value_chunk
+                    // DSLMap.g:160:4: vc= value_chunk
                     {
-                    pushFollow(FOLLOW_value_chunk_in_value_sentence604);
+                    pushFollow(FOLLOW_value_chunk_in_value_sentence614);
                     vc=value_chunk();
                     _fsp--;
                     if (failed) return retval;
@@ -1368,7 +1385,7 @@
                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
                     root_0 = (Object)adaptor.nil();
-                    // 147:2: -> VT_LITERAL[$vc.start, text]
+                    // 161:2: -> VT_LITERAL[$vc.start, text]
                     {
                         adaptor.addChild(root_0, adaptor.create(VT_LITERAL, ((Token)vc.start),  text));
 
@@ -1387,10 +1404,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1403,7 +1420,7 @@
     };
 
     // $ANTLR start value_chunk
-    // DSLMap.g:150:1: value_chunk : ( literal | EQUALS | COMMA )+ ;
+    // DSLMap.g:164:1: value_chunk : ( literal | EQUALS | COMMA )+ ;
     public final value_chunk_return value_chunk() throws RecognitionException {
         value_chunk_return retval = new value_chunk_return();
         retval.start = input.LT(1);
@@ -1419,12 +1436,12 @@
         Object COMMA24_tree=null;
 
         try {
-            // DSLMap.g:151:2: ( ( literal | EQUALS | COMMA )+ )
-            // DSLMap.g:151:4: ( literal | EQUALS | COMMA )+
+            // DSLMap.g:165:2: ( ( literal | EQUALS | COMMA )+ )
+            // DSLMap.g:165:4: ( literal | EQUALS | COMMA )+
             {
             root_0 = (Object)adaptor.nil();
 
-            // DSLMap.g:151:4: ( literal | EQUALS | COMMA )+
+            // DSLMap.g:165:4: ( literal | EQUALS | COMMA )+
             int cnt12=0;
             loop12:
             do {
@@ -1471,9 +1488,9 @@
 
                 switch (alt12) {
             	case 1 :
-            	    // DSLMap.g:151:5: literal
+            	    // DSLMap.g:165:5: literal
             	    {
-            	    pushFollow(FOLLOW_literal_in_value_chunk626);
+            	    pushFollow(FOLLOW_literal_in_value_chunk636);
             	    literal22=literal();
             	    _fsp--;
             	    if (failed) return retval;
@@ -1482,10 +1499,10 @@
             	    }
             	    break;
             	case 2 :
-            	    // DSLMap.g:151:13: EQUALS
+            	    // DSLMap.g:165:13: EQUALS
             	    {
             	    EQUALS23=(Token)input.LT(1);
-            	    match(input,EQUALS,FOLLOW_EQUALS_in_value_chunk628); if (failed) return retval;
+            	    match(input,EQUALS,FOLLOW_EQUALS_in_value_chunk638); if (failed) return retval;
             	    if ( backtracking==0 ) {
             	    EQUALS23_tree = (Object)adaptor.create(EQUALS23);
             	    adaptor.addChild(root_0, EQUALS23_tree);
@@ -1494,10 +1511,10 @@
             	    }
             	    break;
             	case 3 :
-            	    // DSLMap.g:151:20: COMMA
+            	    // DSLMap.g:165:20: COMMA
             	    {
             	    COMMA24=(Token)input.LT(1);
-            	    match(input,COMMA,FOLLOW_COMMA_in_value_chunk630); if (failed) return retval;
+            	    match(input,COMMA,FOLLOW_COMMA_in_value_chunk640); if (failed) return retval;
             	    if ( backtracking==0 ) {
             	    COMMA24_tree = (Object)adaptor.create(COMMA24);
             	    adaptor.addChild(root_0, COMMA24_tree);
@@ -1526,10 +1543,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1542,7 +1559,7 @@
     };
 
     // $ANTLR start literal
-    // DSLMap.g:154:1: literal : ( LITERAL | COLON | LEFT_SQUARE | RIGHT_SQUARE ) ;
+    // DSLMap.g:168:1: literal : ( LITERAL | COLON | LEFT_SQUARE | RIGHT_SQUARE ) ;
     public final literal_return literal() throws RecognitionException {
         literal_return retval = new literal_return();
         retval.start = input.LT(1);
@@ -1554,8 +1571,8 @@
         Object set25_tree=null;
 
         try {
-            // DSLMap.g:156:2: ( ( LITERAL | COLON | LEFT_SQUARE | RIGHT_SQUARE ) )
-            // DSLMap.g:156:4: ( LITERAL | COLON | LEFT_SQUARE | RIGHT_SQUARE )
+            // DSLMap.g:170:2: ( ( LITERAL | COLON | LEFT_SQUARE | RIGHT_SQUARE ) )
+            // DSLMap.g:170:4: ( LITERAL | COLON | LEFT_SQUARE | RIGHT_SQUARE )
             {
             root_0 = (Object)adaptor.nil();
 
@@ -1569,7 +1586,7 @@
                 if (backtracking>0) {failed=true; return retval;}
                 MismatchedSetException mse =
                     new MismatchedSetException(null,input);
-                recoverFromMismatchedSet(input,mse,FOLLOW_set_in_literal648);    throw mse;
+                recoverFromMismatchedSet(input,mse,FOLLOW_set_in_literal658);    throw mse;
             }
 
 
@@ -1582,10 +1599,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1598,7 +1615,7 @@
     };
 
     // $ANTLR start variable_definition
-    // DSLMap.g:160:1: variable_definition : lc= LEFT_CURLY name= LITERAL ( COLON pat= pattern )? rc= RIGHT_CURLY -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name) -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name) VT_SPACE -> ^( VT_VAR_DEF $name) ;
+    // DSLMap.g:174:1: variable_definition : lc= LEFT_CURLY name= LITERAL ( COLON pat= pattern )? rc= RIGHT_CURLY -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name) -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name) VT_SPACE -> ^( VT_VAR_DEF $name) ;
     public final variable_definition_return variable_definition() throws RecognitionException {
         variable_definition_return retval = new variable_definition_return();
         retval.start = input.LT(1);
@@ -1627,11 +1644,11 @@
                 boolean hasSpaceAfter = false;
 
         try {
-            // DSLMap.g:166:2: (lc= LEFT_CURLY name= LITERAL ( COLON pat= pattern )? rc= RIGHT_CURLY -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name) -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name) VT_SPACE -> ^( VT_VAR_DEF $name) )
-            // DSLMap.g:166:4: lc= LEFT_CURLY name= LITERAL ( COLON pat= pattern )? rc= RIGHT_CURLY
+            // DSLMap.g:180:2: (lc= LEFT_CURLY name= LITERAL ( COLON pat= pattern )? rc= RIGHT_CURLY -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name) -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name) VT_SPACE -> ^( VT_VAR_DEF $name) )
+            // DSLMap.g:180:4: lc= LEFT_CURLY name= LITERAL ( COLON pat= pattern )? rc= RIGHT_CURLY
             {
             lc=(Token)input.LT(1);
-            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition684); if (failed) return retval;
+            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition694); if (failed) return retval;
             if ( backtracking==0 ) stream_LEFT_CURLY.add(lc);
 
             if ( backtracking==0 ) {
@@ -1641,10 +1658,10 @@
               		
             }
             name=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition695); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition705); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(name);
 
-            // DSLMap.g:171:15: ( COLON pat= pattern )?
+            // DSLMap.g:185:15: ( COLON pat= pattern )?
             int alt13=2;
             int LA13_0 = input.LA(1);
 
@@ -1653,13 +1670,13 @@
             }
             switch (alt13) {
                 case 1 :
-                    // DSLMap.g:171:17: COLON pat= pattern
+                    // DSLMap.g:185:17: COLON pat= pattern
                     {
                     COLON26=(Token)input.LT(1);
-                    match(input,COLON,FOLLOW_COLON_in_variable_definition699); if (failed) return retval;
+                    match(input,COLON,FOLLOW_COLON_in_variable_definition709); if (failed) return retval;
                     if ( backtracking==0 ) stream_COLON.add(COLON26);
 
-                    pushFollow(FOLLOW_pattern_in_variable_definition703);
+                    pushFollow(FOLLOW_pattern_in_variable_definition713);
                     pat=pattern();
                     _fsp--;
                     if (failed) return retval;
@@ -1674,7 +1691,7 @@
             }
 
             rc=(Token)input.LT(1);
-            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition712); if (failed) return retval;
+            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition722); if (failed) return retval;
             if ( backtracking==0 ) stream_RIGHT_CURLY.add(rc);
 
             if ( backtracking==0 ) {
@@ -1696,10 +1713,10 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 176:2: -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+            // 190:2: -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
             if (hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) {
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
-                // DSLMap.g:176:70: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+                // DSLMap.g:190:70: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1711,9 +1728,9 @@
                 }
 
             }
-            else // 177:2: -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+            else // 191:2: -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
             if (!hasSpaceBefore && !"".equals(text)  && !hasSpaceAfter) {
-                // DSLMap.g:177:63: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+                // DSLMap.g:191:63: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1725,10 +1742,10 @@
                 }
 
             }
-            else // 178:2: -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name)
+            else // 192:2: -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name)
             if (hasSpaceBefore  && !hasSpaceAfter) {
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
-                // DSLMap.g:178:51: ^( VT_VAR_DEF $name)
+                // DSLMap.g:192:51: ^( VT_VAR_DEF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1739,9 +1756,9 @@
                 }
 
             }
-            else // 179:2: -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name)
+            else // 193:2: -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name)
             if (!hasSpaceBefore  && !hasSpaceAfter) {
-                // DSLMap.g:179:44: ^( VT_VAR_DEF $name)
+                // DSLMap.g:193:44: ^( VT_VAR_DEF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1752,10 +1769,10 @@
                 }
 
             }
-            else // 181:2: -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE
+            else // 195:2: -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE
             if (hasSpaceBefore && !"".equals(text) && hasSpaceAfter) {
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
-                // DSLMap.g:181:69: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+                // DSLMap.g:195:69: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1768,9 +1785,9 @@
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
 
             }
-            else // 182:2: -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE
+            else // 196:2: -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) VT_SPACE
             if (!hasSpaceBefore && !"".equals(text)  && hasSpaceAfter) {
-                // DSLMap.g:182:62: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+                // DSLMap.g:196:62: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1783,10 +1800,10 @@
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
 
             }
-            else // 183:2: -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) VT_SPACE
+            else // 197:2: -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name) VT_SPACE
             if (hasSpaceBefore  && hasSpaceAfter) {
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
-                // DSLMap.g:183:50: ^( VT_VAR_DEF $name)
+                // DSLMap.g:197:50: ^( VT_VAR_DEF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1798,9 +1815,9 @@
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
 
             }
-            else // 184:2: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name) VT_SPACE
+            else // 198:2: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name) VT_SPACE
             if (!hasSpaceBefore  && hasSpaceAfter) {
-                // DSLMap.g:184:43: ^( VT_VAR_DEF $name)
+                // DSLMap.g:198:43: ^( VT_VAR_DEF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1812,9 +1829,9 @@
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
 
             }
-            else // 185:2: -> ^( VT_VAR_DEF $name)
+            else // 199:2: -> ^( VT_VAR_DEF $name)
             {
-                // DSLMap.g:185:5: ^( VT_VAR_DEF $name)
+                // DSLMap.g:199:5: ^( VT_VAR_DEF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1837,10 +1854,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1853,7 +1870,7 @@
     };
 
     // $ANTLR start variable_definition2
-    // DSLMap.g:188:1: variable_definition2 : LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> ^( VT_VAR_DEF $name) ;
+    // DSLMap.g:202:1: variable_definition2 : LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> ^( VT_VAR_DEF $name) ;
     public final variable_definition2_return variable_definition2() throws RecognitionException {
         variable_definition2_return retval = new variable_definition2_return();
         retval.start = input.LT(1);
@@ -1880,18 +1897,18 @@
                 String text = "";
 
         try {
-            // DSLMap.g:192:2: ( LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> ^( VT_VAR_DEF $name) )
-            // DSLMap.g:192:4: LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY
+            // DSLMap.g:206:2: ( LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> ^( VT_VAR_DEF $name) )
+            // DSLMap.g:206:4: LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY
             {
             LEFT_CURLY27=(Token)input.LT(1);
-            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition2888); if (failed) return retval;
+            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition2898); if (failed) return retval;
             if ( backtracking==0 ) stream_LEFT_CURLY.add(LEFT_CURLY27);
 
             name=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition2892); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition2902); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(name);
 
-            // DSLMap.g:192:28: ( COLON pat= pattern )?
+            // DSLMap.g:206:28: ( COLON pat= pattern )?
             int alt14=2;
             int LA14_0 = input.LA(1);
 
@@ -1900,13 +1917,13 @@
             }
             switch (alt14) {
                 case 1 :
-                    // DSLMap.g:192:30: COLON pat= pattern
+                    // DSLMap.g:206:30: COLON pat= pattern
                     {
                     COLON28=(Token)input.LT(1);
-                    match(input,COLON,FOLLOW_COLON_in_variable_definition2896); if (failed) return retval;
+                    match(input,COLON,FOLLOW_COLON_in_variable_definition2906); if (failed) return retval;
                     if ( backtracking==0 ) stream_COLON.add(COLON28);
 
-                    pushFollow(FOLLOW_pattern_in_variable_definition2900);
+                    pushFollow(FOLLOW_pattern_in_variable_definition2910);
                     pat=pattern();
                     _fsp--;
                     if (failed) return retval;
@@ -1921,7 +1938,7 @@
             }
 
             RIGHT_CURLY29=(Token)input.LT(1);
-            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition2907); if (failed) return retval;
+            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition2917); if (failed) return retval;
             if ( backtracking==0 ) stream_RIGHT_CURLY.add(RIGHT_CURLY29);
 
 
@@ -1937,9 +1954,9 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 193:2: -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+            // 207:2: -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
             if (!"".equals(text)) {
-                // DSLMap.g:193:25: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
+                // DSLMap.g:207:25: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1951,9 +1968,9 @@
                 }
 
             }
-            else // 194:2: -> ^( VT_VAR_DEF $name)
+            else // 208:2: -> ^( VT_VAR_DEF $name)
             {
-                // DSLMap.g:194:5: ^( VT_VAR_DEF $name)
+                // DSLMap.g:208:5: ^( VT_VAR_DEF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
@@ -1976,10 +1993,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -1992,7 +2009,7 @@
     };
 
     // $ANTLR start pattern
-    // DSLMap.g:198:1: pattern : ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+ ;
+    // DSLMap.g:212:1: pattern : ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+ ;
     public final pattern_return pattern() throws RecognitionException {
         pattern_return retval = new pattern_return();
         retval.start = input.LT(1);
@@ -2016,12 +2033,12 @@
         Object RIGHT_SQUARE36_tree=null;
 
         try {
-            // DSLMap.g:199:9: ( ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+ )
-            // DSLMap.g:199:11: ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+
+            // DSLMap.g:213:9: ( ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+ )
+            // DSLMap.g:213:11: ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+
             {
             root_0 = (Object)adaptor.nil();
 
-            // DSLMap.g:199:11: ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+
+            // DSLMap.g:213:11: ( literal | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+
             int cnt15=0;
             loop15:
             do {
@@ -2068,9 +2085,9 @@
 
                 switch (alt15) {
             	case 1 :
-            	    // DSLMap.g:199:13: literal
+            	    // DSLMap.g:213:13: literal
             	    {
-            	    pushFollow(FOLLOW_literal_in_pattern958);
+            	    pushFollow(FOLLOW_literal_in_pattern968);
             	    literal30=literal();
             	    _fsp--;
             	    if (failed) return retval;
@@ -2079,21 +2096,21 @@
             	    }
             	    break;
             	case 2 :
-            	    // DSLMap.g:200:13: LEFT_CURLY literal RIGHT_CURLY
+            	    // DSLMap.g:214:13: LEFT_CURLY literal RIGHT_CURLY
             	    {
             	    LEFT_CURLY31=(Token)input.LT(1);
-            	    match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_pattern972); if (failed) return retval;
+            	    match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_pattern982); if (failed) return retval;
             	    if ( backtracking==0 ) {
             	    LEFT_CURLY31_tree = (Object)adaptor.create(LEFT_CURLY31);
             	    adaptor.addChild(root_0, LEFT_CURLY31_tree);
             	    }
-            	    pushFollow(FOLLOW_literal_in_pattern974);
+            	    pushFollow(FOLLOW_literal_in_pattern984);
             	    literal32=literal();
             	    _fsp--;
             	    if (failed) return retval;
             	    if ( backtracking==0 ) adaptor.addChild(root_0, literal32.getTree());
             	    RIGHT_CURLY33=(Token)input.LT(1);
-            	    match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_pattern976); if (failed) return retval;
+            	    match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_pattern986); if (failed) return retval;
             	    if ( backtracking==0 ) {
             	    RIGHT_CURLY33_tree = (Object)adaptor.create(RIGHT_CURLY33);
             	    adaptor.addChild(root_0, RIGHT_CURLY33_tree);
@@ -2102,21 +2119,21 @@
             	    }
             	    break;
             	case 3 :
-            	    // DSLMap.g:201:13: LEFT_SQUARE pattern RIGHT_SQUARE
+            	    // DSLMap.g:215:13: LEFT_SQUARE pattern RIGHT_SQUARE
             	    {
             	    LEFT_SQUARE34=(Token)input.LT(1);
-            	    match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_pattern990); if (failed) return retval;
+            	    match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_pattern1000); if (failed) return retval;
             	    if ( backtracking==0 ) {
             	    LEFT_SQUARE34_tree = (Object)adaptor.create(LEFT_SQUARE34);
             	    adaptor.addChild(root_0, LEFT_SQUARE34_tree);
             	    }
-            	    pushFollow(FOLLOW_pattern_in_pattern992);
+            	    pushFollow(FOLLOW_pattern_in_pattern1002);
             	    pattern35=pattern();
             	    _fsp--;
             	    if (failed) return retval;
             	    if ( backtracking==0 ) adaptor.addChild(root_0, pattern35.getTree());
             	    RIGHT_SQUARE36=(Token)input.LT(1);
-            	    match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_pattern994); if (failed) return retval;
+            	    match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_pattern1004); if (failed) return retval;
             	    if ( backtracking==0 ) {
             	    RIGHT_SQUARE36_tree = (Object)adaptor.create(RIGHT_SQUARE36);
             	    adaptor.addChild(root_0, RIGHT_SQUARE36_tree);
@@ -2145,10 +2162,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2161,7 +2178,7 @@
     };
 
     // $ANTLR start variable_reference
-    // DSLMap.g:206:1: variable_reference : lc= LEFT_CURLY name= LITERAL rc= RIGHT_CURLY -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_REF $name) VT_SPACE -> ^( VT_VAR_REF $name) ;
+    // DSLMap.g:220:1: variable_reference : lc= LEFT_CURLY name= LITERAL rc= RIGHT_CURLY -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_REF $name) VT_SPACE -> ^( VT_VAR_REF $name) ;
     public final variable_reference_return variable_reference() throws RecognitionException {
         variable_reference_return retval = new variable_reference_return();
         retval.start = input.LT(1);
@@ -2184,25 +2201,25 @@
                 boolean hasSpaceAfter = false;
 
         try {
-            // DSLMap.g:211:2: (lc= LEFT_CURLY name= LITERAL rc= RIGHT_CURLY -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_REF $name) VT_SPACE -> ^( VT_VAR_REF $name) )
-            // DSLMap.g:211:4: lc= LEFT_CURLY name= LITERAL rc= RIGHT_CURLY
+            // DSLMap.g:225:2: (lc= LEFT_CURLY name= LITERAL rc= RIGHT_CURLY -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_REF $name) VT_SPACE -> ^( VT_VAR_REF $name) )
+            // DSLMap.g:225:4: lc= LEFT_CURLY name= LITERAL rc= RIGHT_CURLY
             {
             lc=(Token)input.LT(1);
-            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_reference1029); if (failed) return retval;
+            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_reference1039); if (failed) return retval;
             if ( backtracking==0 ) stream_LEFT_CURLY.add(lc);
 
             if ( backtracking==0 ) {
-              //try too figure out how to get " {name} " to realize there's a space infron of the { char
+              
               		CommonToken back2 =  (CommonToken)input.LT(-2);
               		if( back2!=null && back2.getStopIndex() < ((CommonToken)lc).getStartIndex() -1 ) hasSpaceBefore = true; 
               		
             }
             name=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference1040); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference1050); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(name);
 
             rc=(Token)input.LT(1);
-            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_reference1044); if (failed) return retval;
+            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_reference1054); if (failed) return retval;
             if ( backtracking==0 ) stream_RIGHT_CURLY.add(rc);
 
             if ( backtracking==0 ) {
@@ -2221,10 +2238,10 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 218:2: -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE
+            // 232:2: -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE
             if (hasSpaceBefore && hasSpaceAfter) {
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
-                // DSLMap.g:218:49: ^( VT_VAR_REF $name)
+                // DSLMap.g:232:49: ^( VT_VAR_REF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_REF, "VT_VAR_REF"), root_1);
@@ -2236,10 +2253,10 @@
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
 
             }
-            else // 219:2: -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name)
+            else // 233:2: -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name)
             if (hasSpaceBefore && !hasSpaceAfter) {
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
-                // DSLMap.g:219:50: ^( VT_VAR_REF $name)
+                // DSLMap.g:233:50: ^( VT_VAR_REF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_REF, "VT_VAR_REF"), root_1);
@@ -2250,9 +2267,9 @@
                 }
 
             }
-            else // 220:2: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_REF $name) VT_SPACE
+            else // 234:2: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_REF $name) VT_SPACE
             if (!hasSpaceBefore && hasSpaceAfter) {
-                // DSLMap.g:220:42: ^( VT_VAR_REF $name)
+                // DSLMap.g:234:42: ^( VT_VAR_REF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_REF, "VT_VAR_REF"), root_1);
@@ -2264,9 +2281,9 @@
                 adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
 
             }
-            else // 221:2: -> ^( VT_VAR_REF $name)
+            else // 235:2: -> ^( VT_VAR_REF $name)
             {
-                // DSLMap.g:221:6: ^( VT_VAR_REF $name)
+                // DSLMap.g:235:6: ^( VT_VAR_REF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_REF, "VT_VAR_REF"), root_1);
@@ -2289,10 +2306,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2305,7 +2322,7 @@
     };
 
     // $ANTLR start variable_reference2
-    // DSLMap.g:225:1: variable_reference2 : LEFT_CURLY name= LITERAL RIGHT_CURLY -> ^( VT_VAR_REF $name) ;
+    // DSLMap.g:239:1: variable_reference2 : LEFT_CURLY name= LITERAL RIGHT_CURLY -> ^( VT_VAR_REF $name) ;
     public final variable_reference2_return variable_reference2() throws RecognitionException {
         variable_reference2_return retval = new variable_reference2_return();
         retval.start = input.LT(1);
@@ -2324,19 +2341,19 @@
         RewriteRuleTokenStream stream_LEFT_CURLY=new RewriteRuleTokenStream(adaptor,"token LEFT_CURLY");
 
         try {
-            // DSLMap.g:226:2: ( LEFT_CURLY name= LITERAL RIGHT_CURLY -> ^( VT_VAR_REF $name) )
-            // DSLMap.g:226:4: LEFT_CURLY name= LITERAL RIGHT_CURLY
+            // DSLMap.g:240:2: ( LEFT_CURLY name= LITERAL RIGHT_CURLY -> ^( VT_VAR_REF $name) )
+            // DSLMap.g:240:4: LEFT_CURLY name= LITERAL RIGHT_CURLY
             {
             LEFT_CURLY37=(Token)input.LT(1);
-            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_reference21122); if (failed) return retval;
+            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_reference21132); if (failed) return retval;
             if ( backtracking==0 ) stream_LEFT_CURLY.add(LEFT_CURLY37);
 
             name=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference21126); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference21136); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(name);
 
             RIGHT_CURLY38=(Token)input.LT(1);
-            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_reference21128); if (failed) return retval;
+            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_reference21138); if (failed) return retval;
             if ( backtracking==0 ) stream_RIGHT_CURLY.add(RIGHT_CURLY38);
 
 
@@ -2352,9 +2369,9 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 227:2: -> ^( VT_VAR_REF $name)
+            // 241:2: -> ^( VT_VAR_REF $name)
             {
-                // DSLMap.g:227:5: ^( VT_VAR_REF $name)
+                // DSLMap.g:241:5: ^( VT_VAR_REF $name)
                 {
                 Object root_1 = (Object)adaptor.nil();
                 root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_REF, "VT_VAR_REF"), root_1);
@@ -2377,10 +2394,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2393,7 +2410,7 @@
     };
 
     // $ANTLR start condition_key
-    // DSLMap.g:231:1: condition_key : {...}?value= LITERAL -> VT_CONDITION[$value] ;
+    // DSLMap.g:245:1: condition_key : {...}?value= LITERAL -> VT_CONDITION[$value] ;
     public final condition_key_return condition_key() throws RecognitionException {
         condition_key_return retval = new condition_key_return();
         retval.start = input.LT(1);
@@ -2406,15 +2423,15 @@
         RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
 
         try {
-            // DSLMap.g:232:2: ({...}?value= LITERAL -> VT_CONDITION[$value] )
-            // DSLMap.g:232:4: {...}?value= LITERAL
+            // DSLMap.g:246:2: ({...}?value= LITERAL -> VT_CONDITION[$value] )
+            // DSLMap.g:246:4: {...}?value= LITERAL
             {
             if ( !(validateIdentifierKey("condition")||validateIdentifierKey("when")) ) {
                 if (backtracking>0) {failed=true; return retval;}
                 throw new FailedPredicateException(input, "condition_key", "validateIdentifierKey(\"condition\")||validateIdentifierKey(\"when\")");
             }
             value=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_condition_key1157); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_condition_key1167); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(value);
 
 
@@ -2429,7 +2446,7 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 233:2: -> VT_CONDITION[$value]
+            // 247:2: -> VT_CONDITION[$value]
             {
                 adaptor.addChild(root_0, adaptor.create(VT_CONDITION, value));
 
@@ -2446,10 +2463,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2462,7 +2479,7 @@
     };
 
     // $ANTLR start consequence_key
-    // DSLMap.g:236:1: consequence_key : {...}?value= LITERAL -> VT_CONSEQUENCE[$value] ;
+    // DSLMap.g:250:1: consequence_key : {...}?value= LITERAL -> VT_CONSEQUENCE[$value] ;
     public final consequence_key_return consequence_key() throws RecognitionException {
         consequence_key_return retval = new consequence_key_return();
         retval.start = input.LT(1);
@@ -2475,15 +2492,15 @@
         RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
 
         try {
-            // DSLMap.g:237:2: ({...}?value= LITERAL -> VT_CONSEQUENCE[$value] )
-            // DSLMap.g:237:4: {...}?value= LITERAL
+            // DSLMap.g:251:2: ({...}?value= LITERAL -> VT_CONSEQUENCE[$value] )
+            // DSLMap.g:251:4: {...}?value= LITERAL
             {
             if ( !(validateIdentifierKey("consequence")||validateIdentifierKey("then")) ) {
                 if (backtracking>0) {failed=true; return retval;}
                 throw new FailedPredicateException(input, "consequence_key", "validateIdentifierKey(\"consequence\")||validateIdentifierKey(\"then\")");
             }
             value=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_consequence_key1180); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_consequence_key1190); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(value);
 
 
@@ -2498,7 +2515,7 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 238:2: -> VT_CONSEQUENCE[$value]
+            // 252:2: -> VT_CONSEQUENCE[$value]
             {
                 adaptor.addChild(root_0, adaptor.create(VT_CONSEQUENCE, value));
 
@@ -2515,10 +2532,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2531,7 +2548,7 @@
     };
 
     // $ANTLR start keyword_key
-    // DSLMap.g:241:1: keyword_key : {...}?value= LITERAL -> VT_KEYWORD[$value] ;
+    // DSLMap.g:255:1: keyword_key : {...}?value= LITERAL -> VT_KEYWORD[$value] ;
     public final keyword_key_return keyword_key() throws RecognitionException {
         keyword_key_return retval = new keyword_key_return();
         retval.start = input.LT(1);
@@ -2544,15 +2561,15 @@
         RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
 
         try {
-            // DSLMap.g:242:2: ({...}?value= LITERAL -> VT_KEYWORD[$value] )
-            // DSLMap.g:242:4: {...}?value= LITERAL
+            // DSLMap.g:256:2: ({...}?value= LITERAL -> VT_KEYWORD[$value] )
+            // DSLMap.g:256:4: {...}?value= LITERAL
             {
             if ( !(validateIdentifierKey("keyword")) ) {
                 if (backtracking>0) {failed=true; return retval;}
                 throw new FailedPredicateException(input, "keyword_key", "validateIdentifierKey(\"keyword\")");
             }
             value=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_keyword_key1203); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_keyword_key1213); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(value);
 
 
@@ -2567,7 +2584,7 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 243:2: -> VT_KEYWORD[$value]
+            // 257:2: -> VT_KEYWORD[$value]
             {
                 adaptor.addChild(root_0, adaptor.create(VT_KEYWORD, value));
 
@@ -2584,10 +2601,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2600,7 +2617,7 @@
     };
 
     // $ANTLR start any_key
-    // DSLMap.g:246:1: any_key : {...}?value= LITERAL -> VT_ANY[$value] ;
+    // DSLMap.g:260:1: any_key : {...}?value= LITERAL -> VT_ANY[$value] ;
     public final any_key_return any_key() throws RecognitionException {
         any_key_return retval = new any_key_return();
         retval.start = input.LT(1);
@@ -2613,15 +2630,15 @@
         RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
 
         try {
-            // DSLMap.g:247:2: ({...}?value= LITERAL -> VT_ANY[$value] )
-            // DSLMap.g:247:4: {...}?value= LITERAL
+            // DSLMap.g:261:2: ({...}?value= LITERAL -> VT_ANY[$value] )
+            // DSLMap.g:261:4: {...}?value= LITERAL
             {
             if ( !(validateIdentifierKey("*")) ) {
                 if (backtracking>0) {failed=true; return retval;}
                 throw new FailedPredicateException(input, "any_key", "validateIdentifierKey(\"*\")");
             }
             value=(Token)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_any_key1226); if (failed) return retval;
+            match(input,LITERAL,FOLLOW_LITERAL_in_any_key1236); if (failed) return retval;
             if ( backtracking==0 ) stream_LITERAL.add(value);
 
 
@@ -2636,7 +2653,7 @@
             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
 
             root_0 = (Object)adaptor.nil();
-            // 248:2: -> VT_ANY[$value]
+            // 262:2: -> VT_ANY[$value]
             {
                 adaptor.addChild(root_0, adaptor.create(VT_ANY, value));
 
@@ -2653,10 +2670,10 @@
                 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
             }
         }
-        
-        	catch (RecognitionException e) {
-        		throw e;
-        	}
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
         finally {
         }
         return retval;
@@ -2665,10 +2682,10 @@
 
     // $ANTLR start synpred4
     public final void synpred4_fragment() throws RecognitionException {   
-        // DSLMap.g:94:24: ( meta_section )
-        // DSLMap.g:94:24: meta_section
+        // DSLMap.g:102:24: ( meta_section )
+        // DSLMap.g:102:24: meta_section
         {
-        pushFollow(FOLLOW_meta_section_in_synpred4341);
+        pushFollow(FOLLOW_meta_section_in_synpred4334);
         meta_section();
         _fsp--;
         if (failed) return ;
@@ -2679,10 +2696,10 @@
 
     // $ANTLR start synpred6
     public final void synpred6_fragment() throws RecognitionException {   
-        // DSLMap.g:102:4: ( condition_key )
-        // DSLMap.g:102:4: condition_key
+        // DSLMap.g:115:4: ( condition_key )
+        // DSLMap.g:115:4: condition_key
         {
-        pushFollow(FOLLOW_condition_key_in_synpred6392);
+        pushFollow(FOLLOW_condition_key_in_synpred6400);
         condition_key();
         _fsp--;
         if (failed) return ;
@@ -2693,10 +2710,10 @@
 
     // $ANTLR start synpred7
     public final void synpred7_fragment() throws RecognitionException {   
-        // DSLMap.g:103:5: ( consequence_key )
-        // DSLMap.g:103:5: consequence_key
+        // DSLMap.g:116:5: ( consequence_key )
+        // DSLMap.g:116:5: consequence_key
         {
-        pushFollow(FOLLOW_consequence_key_in_synpred7401);
+        pushFollow(FOLLOW_consequence_key_in_synpred7409);
         consequence_key();
         _fsp--;
         if (failed) return ;
@@ -2707,10 +2724,10 @@
 
     // $ANTLR start synpred8
     public final void synpred8_fragment() throws RecognitionException {   
-        // DSLMap.g:104:5: ( keyword_key )
-        // DSLMap.g:104:5: keyword_key
+        // DSLMap.g:117:5: ( keyword_key )
+        // DSLMap.g:117:5: keyword_key
         {
-        pushFollow(FOLLOW_keyword_key_in_synpred8409);
+        pushFollow(FOLLOW_keyword_key_in_synpred8417);
         keyword_key();
         _fsp--;
         if (failed) return ;
@@ -2721,10 +2738,10 @@
 
     // $ANTLR start synpred12
     public final void synpred12_fragment() throws RecognitionException {   
-        // DSLMap.g:133:4: ( literal )
-        // DSLMap.g:133:4: literal
+        // DSLMap.g:147:4: ( literal )
+        // DSLMap.g:147:4: literal
         {
-        pushFollow(FOLLOW_literal_in_synpred12551);
+        pushFollow(FOLLOW_literal_in_synpred12561);
         literal();
         _fsp--;
         if (failed) return ;
@@ -2735,10 +2752,10 @@
 
     // $ANTLR start synpred15
     public final void synpred15_fragment() throws RecognitionException {   
-        // DSLMap.g:151:5: ( literal )
-        // DSLMap.g:151:5: literal
+        // DSLMap.g:165:5: ( literal )
+        // DSLMap.g:165:5: literal
         {
-        pushFollow(FOLLOW_literal_in_synpred15626);
+        pushFollow(FOLLOW_literal_in_synpred15636);
         literal();
         _fsp--;
         if (failed) return ;
@@ -2749,10 +2766,10 @@
 
     // $ANTLR start synpred16
     public final void synpred16_fragment() throws RecognitionException {   
-        // DSLMap.g:151:13: ( EQUALS )
-        // DSLMap.g:151:13: EQUALS
+        // DSLMap.g:165:13: ( EQUALS )
+        // DSLMap.g:165:13: EQUALS
         {
-        match(input,EQUALS,FOLLOW_EQUALS_in_synpred16628); if (failed) return ;
+        match(input,EQUALS,FOLLOW_EQUALS_in_synpred16638); if (failed) return ;
 
         }
     }
@@ -2760,10 +2777,10 @@
 
     // $ANTLR start synpred17
     public final void synpred17_fragment() throws RecognitionException {   
-        // DSLMap.g:151:20: ( COMMA )
-        // DSLMap.g:151:20: COMMA
+        // DSLMap.g:165:20: ( COMMA )
+        // DSLMap.g:165:20: COMMA
         {
-        match(input,COMMA,FOLLOW_COMMA_in_synpred17630); if (failed) return ;
+        match(input,COMMA,FOLLOW_COMMA_in_synpred17640); if (failed) return ;
 
         }
     }
@@ -2771,10 +2788,10 @@
 
     // $ANTLR start synpred23
     public final void synpred23_fragment() throws RecognitionException {   
-        // DSLMap.g:199:13: ( literal )
-        // DSLMap.g:199:13: literal
+        // DSLMap.g:213:13: ( literal )
+        // DSLMap.g:213:13: literal
         {
-        pushFollow(FOLLOW_literal_in_synpred23958);
+        pushFollow(FOLLOW_literal_in_synpred23968);
         literal();
         _fsp--;
         if (failed) return ;
@@ -2785,15 +2802,15 @@
 
     // $ANTLR start synpred25
     public final void synpred25_fragment() throws RecognitionException {   
-        // DSLMap.g:201:13: ( LEFT_SQUARE pattern RIGHT_SQUARE )
-        // DSLMap.g:201:13: LEFT_SQUARE pattern RIGHT_SQUARE
+        // DSLMap.g:215:13: ( LEFT_SQUARE pattern RIGHT_SQUARE )
+        // DSLMap.g:215:13: LEFT_SQUARE pattern RIGHT_SQUARE
         {
-        match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_synpred25990); if (failed) return ;
-        pushFollow(FOLLOW_pattern_in_synpred25992);
+        match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_synpred251000); if (failed) return ;
+        pushFollow(FOLLOW_pattern_in_synpred251002);
         pattern();
         _fsp--;
         if (failed) return ;
-        match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_synpred25994); if (failed) return ;
+        match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_synpred251004); if (failed) return ;
 
         }
     }
@@ -2943,76 +2960,76 @@
 
  
 
-    public static final BitSet FOLLOW_statement_in_mapping_file262 = new BitSet(new long[]{0x0000000000B00002L});
-    public static final BitSet FOLLOW_entry_in_statement285 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_comment_in_statement292 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_EOL_in_statement298 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LINE_COMMENT_in_comment314 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_scope_section_in_entry339 = new BitSet(new long[]{0x000000001B800000L});
-    public static final BitSet FOLLOW_meta_section_in_entry341 = new BitSet(new long[]{0x000000001B800000L});
-    public static final BitSet FOLLOW_key_section_in_entry344 = new BitSet(new long[]{0x0000000000400000L});
-    public static final BitSet FOLLOW_EQUALS_in_entry346 = new BitSet(new long[]{0x000000001FC00000L});
-    public static final BitSet FOLLOW_value_section_in_entry348 = new BitSet(new long[]{0x0000000000100000L});
-    public static final BitSet FOLLOW_EOL_in_entry351 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_EOF_in_entry353 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LEFT_SQUARE_in_scope_section384 = new BitSet(new long[]{0x0000000002000000L});
-    public static final BitSet FOLLOW_condition_key_in_scope_section392 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_consequence_key_in_scope_section401 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_keyword_key_in_scope_section409 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_any_key_in_scope_section417 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_RIGHT_SQUARE_in_scope_section425 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LEFT_SQUARE_in_meta_section463 = new BitSet(new long[]{0x0000000003000000L});
-    public static final BitSet FOLLOW_LITERAL_in_meta_section465 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_RIGHT_SQUARE_in_meta_section468 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_key_sentence_in_key_section492 = new BitSet(new long[]{0x000000001B800002L});
-    public static final BitSet FOLLOW_variable_definition_in_key_sentence523 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_key_chunk_in_key_sentence530 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_literal_in_key_chunk551 = new BitSet(new long[]{0x000000000B800002L});
-    public static final BitSet FOLLOW_value_sentence_in_value_section566 = new BitSet(new long[]{0x000000001FC00002L});
-    public static final BitSet FOLLOW_variable_reference_in_value_sentence597 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_value_chunk_in_value_sentence604 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_literal_in_value_chunk626 = new BitSet(new long[]{0x000000000FC00002L});
-    public static final BitSet FOLLOW_EQUALS_in_value_chunk628 = new BitSet(new long[]{0x000000000FC00002L});
-    public static final BitSet FOLLOW_COMMA_in_value_chunk630 = new BitSet(new long[]{0x000000000FC00002L});
-    public static final BitSet FOLLOW_set_in_literal648 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_definition684 = new BitSet(new long[]{0x0000000002000000L});
-    public static final BitSet FOLLOW_LITERAL_in_variable_definition695 = new BitSet(new long[]{0x0000000028000000L});
-    public static final BitSet FOLLOW_COLON_in_variable_definition699 = new BitSet(new long[]{0x000000001B800000L});
-    public static final BitSet FOLLOW_pattern_in_variable_definition703 = new BitSet(new long[]{0x0000000020000000L});
-    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_definition712 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_definition2888 = new BitSet(new long[]{0x0000000002000000L});
-    public static final BitSet FOLLOW_LITERAL_in_variable_definition2892 = new BitSet(new long[]{0x0000000028000000L});
-    public static final BitSet FOLLOW_COLON_in_variable_definition2896 = new BitSet(new long[]{0x000000001B800000L});
-    public static final BitSet FOLLOW_pattern_in_variable_definition2900 = new BitSet(new long[]{0x0000000020000000L});
-    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_definition2907 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_literal_in_pattern958 = new BitSet(new long[]{0x000000001B800002L});
-    public static final BitSet FOLLOW_LEFT_CURLY_in_pattern972 = new BitSet(new long[]{0x000000000B800000L});
-    public static final BitSet FOLLOW_literal_in_pattern974 = new BitSet(new long[]{0x0000000020000000L});
-    public static final BitSet FOLLOW_RIGHT_CURLY_in_pattern976 = new BitSet(new long[]{0x000000001B800002L});
-    public static final BitSet FOLLOW_LEFT_SQUARE_in_pattern990 = new BitSet(new long[]{0x000000001B800000L});
-    public static final BitSet FOLLOW_pattern_in_pattern992 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_RIGHT_SQUARE_in_pattern994 = new BitSet(new long[]{0x000000001B800002L});
-    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_reference1029 = new BitSet(new long[]{0x0000000002000000L});
-    public static final BitSet FOLLOW_LITERAL_in_variable_reference1040 = new BitSet(new long[]{0x0000000020000000L});
-    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_reference1044 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_reference21122 = new BitSet(new long[]{0x0000000002000000L});
-    public static final BitSet FOLLOW_LITERAL_in_variable_reference21126 = new BitSet(new long[]{0x0000000020000000L});
-    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_reference21128 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LITERAL_in_condition_key1157 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LITERAL_in_consequence_key1180 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LITERAL_in_keyword_key1203 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LITERAL_in_any_key1226 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_meta_section_in_synpred4341 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_condition_key_in_synpred6392 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_consequence_key_in_synpred7401 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_keyword_key_in_synpred8409 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_literal_in_synpred12551 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_literal_in_synpred15626 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_EQUALS_in_synpred16628 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_COMMA_in_synpred17630 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_literal_in_synpred23958 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LEFT_SQUARE_in_synpred25990 = new BitSet(new long[]{0x000000001B800000L});
-    public static final BitSet FOLLOW_pattern_in_synpred25992 = new BitSet(new long[]{0x0000000001000000L});
-    public static final BitSet FOLLOW_RIGHT_SQUARE_in_synpred25994 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_statement_in_mapping_file255 = new BitSet(new long[]{0x0000000000B00002L});
+    public static final BitSet FOLLOW_entry_in_statement278 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_comment_in_statement285 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_EOL_in_statement291 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LINE_COMMENT_in_comment307 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_scope_section_in_entry332 = new BitSet(new long[]{0x000000001B800000L});
+    public static final BitSet FOLLOW_meta_section_in_entry334 = new BitSet(new long[]{0x000000001B800000L});
+    public static final BitSet FOLLOW_key_section_in_entry337 = new BitSet(new long[]{0x0000000000400000L});
+    public static final BitSet FOLLOW_EQUALS_in_entry339 = new BitSet(new long[]{0x000000001FC00000L});
+    public static final BitSet FOLLOW_value_section_in_entry341 = new BitSet(new long[]{0x0000000000100000L});
+    public static final BitSet FOLLOW_EOL_in_entry344 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_EOF_in_entry346 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LEFT_SQUARE_in_scope_section392 = new BitSet(new long[]{0x0000000002000000L});
+    public static final BitSet FOLLOW_condition_key_in_scope_section400 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_consequence_key_in_scope_section409 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_keyword_key_in_scope_section417 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_any_key_in_scope_section425 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_RIGHT_SQUARE_in_scope_section433 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LEFT_SQUARE_in_meta_section473 = new BitSet(new long[]{0x0000000003000000L});
+    public static final BitSet FOLLOW_LITERAL_in_meta_section475 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_RIGHT_SQUARE_in_meta_section478 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_key_sentence_in_key_section502 = new BitSet(new long[]{0x000000001B800002L});
+    public static final BitSet FOLLOW_variable_definition_in_key_sentence533 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_key_chunk_in_key_sentence540 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_literal_in_key_chunk561 = new BitSet(new long[]{0x000000000B800002L});
+    public static final BitSet FOLLOW_value_sentence_in_value_section576 = new BitSet(new long[]{0x000000001FC00002L});
+    public static final BitSet FOLLOW_variable_reference_in_value_sentence607 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_value_chunk_in_value_sentence614 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_literal_in_value_chunk636 = new BitSet(new long[]{0x000000000FC00002L});
+    public static final BitSet FOLLOW_EQUALS_in_value_chunk638 = new BitSet(new long[]{0x000000000FC00002L});
+    public static final BitSet FOLLOW_COMMA_in_value_chunk640 = new BitSet(new long[]{0x000000000FC00002L});
+    public static final BitSet FOLLOW_set_in_literal658 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_definition694 = new BitSet(new long[]{0x0000000002000000L});
+    public static final BitSet FOLLOW_LITERAL_in_variable_definition705 = new BitSet(new long[]{0x0000000028000000L});
+    public static final BitSet FOLLOW_COLON_in_variable_definition709 = new BitSet(new long[]{0x000000001B800000L});
+    public static final BitSet FOLLOW_pattern_in_variable_definition713 = new BitSet(new long[]{0x0000000020000000L});
+    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_definition722 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_definition2898 = new BitSet(new long[]{0x0000000002000000L});
+    public static final BitSet FOLLOW_LITERAL_in_variable_definition2902 = new BitSet(new long[]{0x0000000028000000L});
+    public static final BitSet FOLLOW_COLON_in_variable_definition2906 = new BitSet(new long[]{0x000000001B800000L});
+    public static final BitSet FOLLOW_pattern_in_variable_definition2910 = new BitSet(new long[]{0x0000000020000000L});
+    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_definition2917 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_literal_in_pattern968 = new BitSet(new long[]{0x000000001B800002L});
+    public static final BitSet FOLLOW_LEFT_CURLY_in_pattern982 = new BitSet(new long[]{0x000000000B800000L});
+    public static final BitSet FOLLOW_literal_in_pattern984 = new BitSet(new long[]{0x0000000020000000L});
+    public static final BitSet FOLLOW_RIGHT_CURLY_in_pattern986 = new BitSet(new long[]{0x000000001B800002L});
+    public static final BitSet FOLLOW_LEFT_SQUARE_in_pattern1000 = new BitSet(new long[]{0x000000001B800000L});
+    public static final BitSet FOLLOW_pattern_in_pattern1002 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_RIGHT_SQUARE_in_pattern1004 = new BitSet(new long[]{0x000000001B800002L});
+    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_reference1039 = new BitSet(new long[]{0x0000000002000000L});
+    public static final BitSet FOLLOW_LITERAL_in_variable_reference1050 = new BitSet(new long[]{0x0000000020000000L});
+    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_reference1054 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LEFT_CURLY_in_variable_reference21132 = new BitSet(new long[]{0x0000000002000000L});
+    public static final BitSet FOLLOW_LITERAL_in_variable_reference21136 = new BitSet(new long[]{0x0000000020000000L});
+    public static final BitSet FOLLOW_RIGHT_CURLY_in_variable_reference21138 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LITERAL_in_condition_key1167 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LITERAL_in_consequence_key1190 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LITERAL_in_keyword_key1213 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LITERAL_in_any_key1236 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_meta_section_in_synpred4334 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_condition_key_in_synpred6400 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_consequence_key_in_synpred7409 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_keyword_key_in_synpred8417 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_literal_in_synpred12561 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_literal_in_synpred15636 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_EQUALS_in_synpred16638 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_COMMA_in_synpred17640 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_literal_in_synpred23968 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_LEFT_SQUARE_in_synpred251000 = new BitSet(new long[]{0x000000001B800000L});
+    public static final BitSet FOLLOW_pattern_in_synpred251002 = new BitSet(new long[]{0x0000000001000000L});
+    public static final BitSet FOLLOW_RIGHT_SQUARE_in_synpred251004 = new BitSet(new long[]{0x0000000000000002L});
 
 }
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapWalker.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapWalker.java	2008-06-10 19:28:45 UTC (rev 20410)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLMapWalker.java	2008-06-11 00:18:54 UTC (rev 20411)
@@ -1,4 +1,4 @@
-// $ANTLR 3.0.1 DSLMapWalker.g 2008-05-27 14:03:46
+// $ANTLR 3.0.1 DSLMapWalker.g 2008-06-10 17:00:30
 
 	package org.drools.lang.dsl;
 	
@@ -64,7 +64,7 @@
 
 
     // $ANTLR start mapping_file
-    // DSLMapWalker.g:17:1: mapping_file returns [DSLMapping mapping] : ^( VT_DSL_GRAMMAR ( entry )* ) ;
+    // DSLMapWalker.g:17:1: mapping_file returns [DSLMapping mapping] : ^( VT_DSL_GRAMMAR ( valid_entry )* ) ;
     public final DSLMapping mapping_file() throws RecognitionException {
         mapping_file_stack.push(new mapping_file_scope());
         DSLMapping mapping = null;
@@ -73,30 +73,30 @@
         	((mapping_file_scope)mapping_file_stack.peek()).retval = new DefaultDSLMapping() ;
 
         try {
-            // DSLMapWalker.g:24:2: ( ^( VT_DSL_GRAMMAR ( entry )* ) )
-            // DSLMapWalker.g:24:4: ^( VT_DSL_GRAMMAR ( entry )* )
+            // DSLMapWalker.g:24:2: ( ^( VT_DSL_GRAMMAR ( valid_entry )* ) )
+            // DSLMapWalker.g:24:4: ^( VT_DSL_GRAMMAR ( valid_entry )* )
             {
             match(input,VT_DSL_GRAMMAR,FOLLOW_VT_DSL_GRAMMAR_in_mapping_file54); 
 
             if ( input.LA(1)==Token.DOWN ) {
                 match(input, Token.DOWN, null); 
-                // DSLMapWalker.g:24:21: ( entry )*
+                // DSLMapWalker.g:24:21: ( valid_entry )*
                 loop1:
                 do {
                     int alt1=2;
                     int LA1_0 = input.LA(1);
 
-                    if ( (LA1_0==VT_ENTRY) ) {
+                    if ( ((LA1_0>=VT_COMMENT && LA1_0<=VT_ENTRY)) ) {
                         alt1=1;
                     }
 
 
                     switch (alt1) {
                 	case 1 :
-                	    // DSLMapWalker.g:24:21: entry
+                	    // DSLMapWalker.g:24:21: valid_entry
                 	    {
-                	    pushFollow(FOLLOW_entry_in_mapping_file56);
-                	    entry();
+                	    pushFollow(FOLLOW_valid_entry_in_mapping_file56);
+                	    valid_entry();
                 	    _fsp--;
 
 
@@ -112,12 +112,7 @@
                 match(input, Token.UP, null); 
             }
             
-            		//System.out.println("done parsing file");
-            		//System.out.println(((mapping_file_scope)mapping_file_stack.peek()).retval.dumpFile());
             		mapping = ((mapping_file_scope)mapping_file_stack.peek()).retval;
-            		//java.io.StringWriter sw = new java.io.StringWriter();
-            		//((mapping_file_scope)mapping_file_stack.peek()).retval.saveMapping(sw);
-            		//System.out.println(sw.toString());
             	
 
             }
@@ -135,49 +130,17 @@
     // $ANTLR end mapping_file
 
 
-    // $ANTLR start mapping_entry
-    // DSLMapWalker.g:35:1: mapping_entry : ent= entry ;
-    public final void mapping_entry() throws RecognitionException {
-        DSLMappingEntry ent = null;
-
-
-        try {
-            // DSLMapWalker.g:36:2: (ent= entry )
-            // DSLMapWalker.g:36:4: ent= entry
-            {
-            pushFollow(FOLLOW_entry_in_mapping_entry76);
-            ent=entry();
-            _fsp--;
-
-            
-            		((mapping_file_scope)mapping_file_stack.peek()).retval.addEntry(ent);
-            		//System.out.println("mapping size is now " + ((mapping_file_scope)mapping_file_stack.peek()).retval.getEntries().size());
-            	
-
-            }
-
-        }
-        catch (RecognitionException re) {
-            reportError(re);
-            recover(input,re);
-        }
-        finally {
-        }
-        return ;
-    }
-    // $ANTLR end mapping_entry
-
-
     // $ANTLR start valid_entry
-    // DSLMapWalker.g:43:1: valid_entry returns [DSLMappingEntry mappingEntry] : (ent= entry | VT_COMMENT );
+    // DSLMapWalker.g:30:1: valid_entry returns [DSLMappingEntry mappingEntry] : (ent= entry | ^( VT_COMMENT lc= LINE_COMMENT ) );
     public final DSLMappingEntry valid_entry() throws RecognitionException {
         DSLMappingEntry mappingEntry = null;
 
+        CommonTree lc=null;
         DSLMappingEntry ent = null;
 
 
         try {
-            // DSLMapWalker.g:44:2: (ent= entry | VT_COMMENT )
+            // DSLMapWalker.g:31:2: (ent= entry | ^( VT_COMMENT lc= LINE_COMMENT ) )
             int alt2=2;
             int LA2_0 = input.LA(1);
 
@@ -189,26 +152,32 @@
             }
             else {
                 NoViableAltException nvae =
-                    new NoViableAltException("43:1: valid_entry returns [DSLMappingEntry mappingEntry] : (ent= entry | VT_COMMENT );", 2, 0, input);
+                    new NoViableAltException("30:1: valid_entry returns [DSLMappingEntry mappingEntry] : (ent= entry | ^( VT_COMMENT lc= LINE_COMMENT ) );", 2, 0, input);
 
                 throw nvae;
             }
             switch (alt2) {
                 case 1 :
-                    // DSLMapWalker.g:44:4: ent= entry
+                    // DSLMapWalker.g:31:4: ent= entry
                     {
-                    pushFollow(FOLLOW_entry_in_valid_entry97);
+                    pushFollow(FOLLOW_entry_in_valid_entry78);
                     ent=entry();
                     _fsp--;
 
-                    mappingEntry = ent;
+                    mappingEntry = ent; 
 
                     }
                     break;
                 case 2 :
-                    // DSLMapWalker.g:45:4: VT_COMMENT
+                    // DSLMapWalker.g:32:4: ^( VT_COMMENT lc= LINE_COMMENT )
                     {
-                    match(input,VT_COMMENT,FOLLOW_VT_COMMENT_in_valid_entry104); 
+                    match(input,VT_COMMENT,FOLLOW_VT_COMMENT_in_valid_entry86); 
+
+                    match(input, Token.DOWN, null); 
+                    lc=(CommonTree)input.LT(1);
+                    match(input,LINE_COMMENT,FOLLOW_LINE_COMMENT_in_valid_entry90); 
+
+                    match(input, Token.UP, null); 
                     mappingEntry = null;
 
                     }
@@ -237,7 +206,7 @@
 
 
     // $ANTLR start entry
-    // DSLMapWalker.g:49:1: entry returns [DSLMappingEntry mappingEntry] : ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) ;
+    // DSLMapWalker.g:36:1: entry returns [DSLMappingEntry mappingEntry] : ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) ;
     public final DSLMappingEntry entry() throws RecognitionException {
         entry_stack.push(new entry_scope());
         DSLMappingEntry mappingEntry = null;
@@ -249,17 +218,17 @@
         	((entry_scope)entry_stack.peek()).valuebuffer = new StringBuffer();
 
         try {
-            // DSLMapWalker.g:63:2: ( ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) )
-            // DSLMapWalker.g:63:4: ^( VT_ENTRY scope_section ( meta_section )? key_section value_section )
+            // DSLMapWalker.g:50:2: ( ^( VT_ENTRY scope_section ( meta_section )? key_section value_section ) )
+            // DSLMapWalker.g:50:4: ^( VT_ENTRY scope_section ( meta_section )? key_section value_section )
             {
-            match(input,VT_ENTRY,FOLLOW_VT_ENTRY_in_entry132); 
+            match(input,VT_ENTRY,FOLLOW_VT_ENTRY_in_entry119); 
 
             match(input, Token.DOWN, null); 
-            pushFollow(FOLLOW_scope_section_in_entry134);
+            pushFollow(FOLLOW_scope_section_in_entry121);
             scope_section();
             _fsp--;
 
-            // DSLMapWalker.g:63:29: ( meta_section )?
+            // DSLMapWalker.g:50:29: ( meta_section )?
             int alt3=2;
             int LA3_0 = input.LA(1);
 
@@ -268,9 +237,9 @@
             }
             switch (alt3) {
                 case 1 :
-                    // DSLMapWalker.g:63:29: meta_section
+                    // DSLMapWalker.g:50:29: meta_section
                     {
-                    pushFollow(FOLLOW_meta_section_in_entry136);
+                    pushFollow(FOLLOW_meta_section_in_entry123);
                     meta_section();
                     _fsp--;
 
@@ -280,31 +249,21 @@
 
             }
 
-            pushFollow(FOLLOW_key_section_in_entry139);
+            pushFollow(FOLLOW_key_section_in_entry126);
             key_section();
             _fsp--;
 
             ((entry_scope)entry_stack.peek()).retval.variables = ((entry_scope)entry_stack.peek()).variables; ((entry_scope)entry_stack.peek()).retval.setMappingKey(((entry_scope)entry_stack.peek()).keybuffer.toString());
-            pushFollow(FOLLOW_value_section_in_entry145);
+            pushFollow(FOLLOW_value_section_in_entry132);
             value_section();
             _fsp--;
 
 
             match(input, Token.UP, null); 
             
-            		//System.out.println("for this entry, metadata is " + ((entry_scope)entry_stack.peek()).retval.getMetaData().getMetaData());
-            		//System.out.println("variables are " + ((entry_scope)entry_stack.peek()).variables);
-            		
-            		//System.out.println("keybuffer: " + ((entry_scope)entry_stack.peek()).keybuffer);
-            		//System.out.println("valuebuffer: " + ((entry_scope)entry_stack.peek()).valuebuffer);
-            //		((mapping_file_scope)mapping_file_stack.peek()).retval.addEntry(((entry_scope)entry_stack.peek()).retval);
-            //		System.out.println("mapping size is now " + ((mapping_file_scope)mapping_file_stack.peek()).retval.getEntries().size());
-            		//((entry_scope)entry_stack.peek()).retval.variables = ((entry_scope)entry_stack.peek()).variables;
-            		//((entry_scope)entry_stack.peek()).retval.setMappingKey(((entry_scope)entry_stack.peek()).keybuffer.toString());
             		((entry_scope)entry_stack.peek()).retval.setMappingValue(((entry_scope)entry_stack.peek()).valuebuffer.toString());
-            		//System.out.println("keypattern is " + ((entry_scope)entry_stack.peek()).retval.getKeyPattern());
-            		//System.out.println("valuepattern is " + ((entry_scope)entry_stack.peek()).retval.getValuePattern());
             		mappingEntry = ((entry_scope)entry_stack.peek()).retval;
+            		((mapping_file_scope)mapping_file_stack.peek()).retval.addEntry(mappingEntry);
             	
 
             }
@@ -323,20 +282,20 @@
 
 
     // $ANTLR start scope_section
-    // DSLMapWalker.g:83:1: scope_section : ^(thescope= VT_SCOPE ( condition_key )? ( consequence_key )? ( keyword_key )? ( any_key )? ) ;
+    // DSLMapWalker.g:60:1: scope_section : ^(thescope= VT_SCOPE ( condition_key )? ( consequence_key )? ( keyword_key )? ( any_key )? ) ;
     public final void scope_section() throws RecognitionException {
         CommonTree thescope=null;
 
         try {
-            // DSLMapWalker.g:84:2: ( ^(thescope= VT_SCOPE ( condition_key )? ( consequence_key )? ( keyword_key )? ( any_key )? ) )
-            // DSLMapWalker.g:84:4: ^(thescope= VT_SCOPE ( condition_key )? ( consequence_key )? ( keyword_key )? ( any_key )? )
+            // DSLMapWalker.g:61:2: ( ^(thescope= VT_SCOPE ( condition_key )? ( consequence_key )? ( keyword_key )? ( any_key )? ) )
+            // DSLMapWalker.g:61:4: ^(thescope= VT_SCOPE ( condition_key )? ( consequence_key )? ( keyword_key )? ( any_key )? )
             {
             thescope=(CommonTree)input.LT(1);
-            match(input,VT_SCOPE,FOLLOW_VT_SCOPE_in_scope_section165); 
+            match(input,VT_SCOPE,FOLLOW_VT_SCOPE_in_scope_section152); 
 
             if ( input.LA(1)==Token.DOWN ) {
                 match(input, Token.DOWN, null); 
-                // DSLMapWalker.g:84:24: ( condition_key )?
+                // DSLMapWalker.g:61:24: ( condition_key )?
                 int alt4=2;
                 int LA4_0 = input.LA(1);
 
@@ -345,9 +304,9 @@
                 }
                 switch (alt4) {
                     case 1 :
-                        // DSLMapWalker.g:84:24: condition_key
+                        // DSLMapWalker.g:61:24: condition_key
                         {
-                        pushFollow(FOLLOW_condition_key_in_scope_section167);
+                        pushFollow(FOLLOW_condition_key_in_scope_section154);
                         condition_key();
                         _fsp--;
 
@@ -357,7 +316,7 @@
 
                 }
 
-                // DSLMapWalker.g:84:39: ( consequence_key )?
+                // DSLMapWalker.g:61:39: ( consequence_key )?
                 int alt5=2;
                 int LA5_0 = input.LA(1);
 
@@ -366,9 +325,9 @@
                 }
                 switch (alt5) {
                     case 1 :
-                        // DSLMapWalker.g:84:39: consequence_key
+                        // DSLMapWalker.g:61:39: consequence_key
                         {
-                        pushFollow(FOLLOW_consequence_key_in_scope_section170);
+                        pushFollow(FOLLOW_consequence_key_in_scope_section157);
                         consequence_key();
                         _fsp--;
 
@@ -378,7 +337,7 @@
 
                 }
 
-                // DSLMapWalker.g:84:56: ( keyword_key )?
+                // DSLMapWalker.g:61:56: ( keyword_key )?
                 int alt6=2;
                 int LA6_0 = input.LA(1);
 
@@ -387,9 +346,9 @@
                 }
                 switch (alt6) {
                     case 1 :
-                        // DSLMapWalker.g:84:56: keyword_key
+                        // DSLMapWalker.g:61:56: keyword_key
                         {
-                        pushFollow(FOLLOW_keyword_key_in_scope_section173);
+                        pushFollow(FOLLOW_keyword_key_in_scope_section160);
                         keyword_key();
                         _fsp--;
 
@@ -399,7 +358,7 @@
 
                 }
 
-                // DSLMapWalker.g:84:69: ( any_key )?
+                // DSLMapWalker.g:61:69: ( any_key )?
                 int alt7=2;
                 int LA7_0 = input.LA(1);
 
@@ -408,9 +367,9 @@
                 }
                 switch (alt7) {
                     case 1 :
-                        // DSLMapWalker.g:84:69: any_key
+                        // DSLMapWalker.g:61:69: any_key
                         {
-                        pushFollow(FOLLOW_any_key_in_scope_section176);
+                        pushFollow(FOLLOW_any_key_in_scope_section163);
                         any_key();
                         _fsp--;
 
@@ -439,19 +398,19 @@
 
 
     // $ANTLR start meta_section
-    // DSLMapWalker.g:89:1: meta_section : ^( VT_META (metalit= LITERAL )? ) ;
+    // DSLMapWalker.g:66:1: meta_section : ^( VT_META (metalit= LITERAL )? ) ;
     public final void meta_section() throws RecognitionException {
         CommonTree metalit=null;
 
         try {
-            // DSLMapWalker.g:90:2: ( ^( VT_META (metalit= LITERAL )? ) )
-            // DSLMapWalker.g:90:4: ^( VT_META (metalit= LITERAL )? )
+            // DSLMapWalker.g:67:2: ( ^( VT_META (metalit= LITERAL )? ) )
+            // DSLMapWalker.g:67:4: ^( VT_META (metalit= LITERAL )? )
             {
-            match(input,VT_META,FOLLOW_VT_META_in_meta_section193); 
+            match(input,VT_META,FOLLOW_VT_META_in_meta_section180); 
 
             if ( input.LA(1)==Token.DOWN ) {
                 match(input, Token.DOWN, null); 
-                // DSLMapWalker.g:90:21: (metalit= LITERAL )?
+                // DSLMapWalker.g:67:21: (metalit= LITERAL )?
                 int alt8=2;
                 int LA8_0 = input.LA(1);
 
@@ -460,10 +419,10 @@
                 }
                 switch (alt8) {
                     case 1 :
-                        // DSLMapWalker.g:90:21: metalit= LITERAL
+                        // DSLMapWalker.g:67:21: metalit= LITERAL
                         {
                         metalit=(CommonTree)input.LT(1);
-                        match(input,LITERAL,FOLLOW_LITERAL_in_meta_section197); 
+                        match(input,LITERAL,FOLLOW_LITERAL_in_meta_section184); 
 
                         }
                         break;
@@ -496,16 +455,16 @@
 
 
     // $ANTLR start key_section
-    // DSLMapWalker.g:100:1: key_section : ^( VT_ENTRY_KEY ( key_sentence )+ ) ;
+    // DSLMapWalker.g:77:1: key_section : ^( VT_ENTRY_KEY ( key_sentence )+ ) ;
     public final void key_section() throws RecognitionException {
         try {
-            // DSLMapWalker.g:101:2: ( ^( VT_ENTRY_KEY ( key_sentence )+ ) )
-            // DSLMapWalker.g:101:4: ^( VT_ENTRY_KEY ( key_sentence )+ )
+            // DSLMapWalker.g:78:2: ( ^( VT_ENTRY_KEY ( key_sentence )+ ) )
+            // DSLMapWalker.g:78:4: ^( VT_ENTRY_KEY ( key_sentence )+ )
             {
-            match(input,VT_ENTRY_KEY,FOLLOW_VT_ENTRY_KEY_in_key_section214); 
+            match(input,VT_ENTRY_KEY,FOLLOW_VT_ENTRY_KEY_in_key_section201); 
 
             match(input, Token.DOWN, null); 
-            // DSLMapWalker.g:101:19: ( key_sentence )+
+            // DSLMapWalker.g:78:19: ( key_sentence )+
             int cnt9=0;
             loop9:
             do {
@@ -519,9 +478,9 @@
 
                 switch (alt9) {
             	case 1 :
-            	    // DSLMapWalker.g:101:19: key_sentence
+            	    // DSLMapWalker.g:78:19: key_sentence
             	    {
-            	    pushFollow(FOLLOW_key_sentence_in_key_section216);
+            	    pushFollow(FOLLOW_key_sentence_in_key_section203);
             	    key_sentence();
             	    _fsp--;
 
@@ -540,9 +499,6 @@
 
 
             match(input, Token.UP, null); 
-            
-            		//((entry_scope)entry_stack.peek()).retval.setMappingKey(((entry_scope)entry_stack.peek()).keybuffer.toString());
-            	
 
             }
 
@@ -559,12 +515,12 @@
 
 
     // $ANTLR start key_sentence
-    // DSLMapWalker.g:107:1: key_sentence : ( variable_definition | vtl= VT_LITERAL | VT_SPACE );
+    // DSLMapWalker.g:81:1: key_sentence : ( variable_definition | vtl= VT_LITERAL | VT_SPACE );
     public final void key_sentence() throws RecognitionException {
         CommonTree vtl=null;
 
         try {
-            // DSLMapWalker.g:108:2: ( variable_definition | vtl= VT_LITERAL | VT_SPACE )
+            // DSLMapWalker.g:82:2: ( variable_definition | vtl= VT_LITERAL | VT_SPACE )
             int alt10=3;
             switch ( input.LA(1) ) {
             case VT_VAR_DEF:
@@ -584,16 +540,16 @@
                 break;
             default:
                 NoViableAltException nvae =
-                    new NoViableAltException("107:1: key_sentence : ( variable_definition | vtl= VT_LITERAL | VT_SPACE );", 10, 0, input);
+                    new NoViableAltException("81:1: key_sentence : ( variable_definition | vtl= VT_LITERAL | VT_SPACE );", 10, 0, input);
 
                 throw nvae;
             }
 
             switch (alt10) {
                 case 1 :
-                    // DSLMapWalker.g:108:4: variable_definition
+                    // DSLMapWalker.g:82:4: variable_definition
                     {
-                    pushFollow(FOLLOW_variable_definition_in_key_sentence234);
+                    pushFollow(FOLLOW_variable_definition_in_key_sentence218);
                     variable_definition();
                     _fsp--;
 
@@ -601,21 +557,20 @@
                     }
                     break;
                 case 2 :
-                    // DSLMapWalker.g:109:4: vtl= VT_LITERAL
+                    // DSLMapWalker.g:83:4: vtl= VT_LITERAL
                     {
                     vtl=(CommonTree)input.LT(1);
-                    match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_key_sentence241); 
+                    match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_key_sentence225); 
                     
-                    		//System.out.println("in key_sentence, literal is " + vtl.getText());
                     		((entry_scope)entry_stack.peek()).keybuffer.append(vtl.getText());
                     	
 
                     }
                     break;
                 case 3 :
-                    // DSLMapWalker.g:114:4: VT_SPACE
+                    // DSLMapWalker.g:87:4: VT_SPACE
                     {
-                    match(input,VT_SPACE,FOLLOW_VT_SPACE_in_key_sentence250); 
+                    match(input,VT_SPACE,FOLLOW_VT_SPACE_in_key_sentence234); 
                     
                     		((entry_scope)entry_stack.peek()).keybuffer.append("\\s+");
                     	
@@ -637,16 +592,16 @@
 
 
     // $ANTLR start value_section
-    // DSLMapWalker.g:124:1: value_section : ^( VT_ENTRY_VAL ( value_sentence )+ ) ;
+    // DSLMapWalker.g:93:1: value_section : ^( VT_ENTRY_VAL ( value_sentence )+ ) ;
     public final void value_section() throws RecognitionException {
         try {
-            // DSLMapWalker.g:128:2: ( ^( VT_ENTRY_VAL ( value_sentence )+ ) )
-            // DSLMapWalker.g:128:4: ^( VT_ENTRY_VAL ( value_sentence )+ )
+            // DSLMapWalker.g:97:2: ( ^( VT_ENTRY_VAL ( value_sentence )+ ) )
+            // DSLMapWalker.g:97:4: ^( VT_ENTRY_VAL ( value_sentence )+ )
             {
-            match(input,VT_ENTRY_VAL,FOLLOW_VT_ENTRY_VAL_in_value_section273); 
+            match(input,VT_ENTRY_VAL,FOLLOW_VT_ENTRY_VAL_in_value_section255); 
 
             match(input, Token.DOWN, null); 
-            // DSLMapWalker.g:128:19: ( value_sentence )+
+            // DSLMapWalker.g:97:19: ( value_sentence )+
             int cnt11=0;
             loop11:
             do {
@@ -660,9 +615,9 @@
 
                 switch (alt11) {
             	case 1 :
-            	    // DSLMapWalker.g:128:19: value_sentence
+            	    // DSLMapWalker.g:97:19: value_sentence
             	    {
-            	    pushFollow(FOLLOW_value_sentence_in_value_section275);
+            	    pushFollow(FOLLOW_value_sentence_in_value_section257);
             	    value_sentence();
             	    _fsp--;
 
@@ -681,9 +636,6 @@
 
 
             match(input, Token.UP, null); 
-            
-            		//((entry_scope)entry_stack.peek()).retval.setMappingValue(((entry_scope)entry_stack.peek()).valuebuffer.toString());
-            	
 
             }
 
@@ -703,12 +655,12 @@
 
 
     // $ANTLR start value_sentence
-    // DSLMapWalker.g:134:1: value_sentence : ( variable_reference | vtl= VT_LITERAL | VT_SPACE );
+    // DSLMapWalker.g:100:1: value_sentence : ( variable_reference | vtl= VT_LITERAL | VT_SPACE );
     public final void value_sentence() throws RecognitionException {
         CommonTree vtl=null;
 
         try {
-            // DSLMapWalker.g:135:2: ( variable_reference | vtl= VT_LITERAL | VT_SPACE )
+            // DSLMapWalker.g:101:2: ( variable_reference | vtl= VT_LITERAL | VT_SPACE )
             int alt12=3;
             switch ( input.LA(1) ) {
             case VT_VAR_REF:
@@ -728,16 +680,16 @@
                 break;
             default:
                 NoViableAltException nvae =
-                    new NoViableAltException("134:1: value_sentence : ( variable_reference | vtl= VT_LITERAL | VT_SPACE );", 12, 0, input);
+                    new NoViableAltException("100:1: value_sentence : ( variable_reference | vtl= VT_LITERAL | VT_SPACE );", 12, 0, input);
 
                 throw nvae;
             }
 
             switch (alt12) {
                 case 1 :
-                    // DSLMapWalker.g:135:4: variable_reference
+                    // DSLMapWalker.g:101:4: variable_reference
                     {
-                    pushFollow(FOLLOW_variable_reference_in_value_sentence295);
+                    pushFollow(FOLLOW_variable_reference_in_value_sentence274);
                     variable_reference();
                     _fsp--;
 
@@ -745,21 +697,20 @@
                     }
                     break;
                 case 2 :
-                    // DSLMapWalker.g:136:4: vtl= VT_LITERAL
+                    // DSLMapWalker.g:102:4: vtl= VT_LITERAL
                     {
                     vtl=(CommonTree)input.LT(1);
-                    match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_value_sentence302); 
+                    match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_value_sentence281); 
                     
-                    		//System.out.println("in value_sentence, literal is " + vtl.getText());
                     		((entry_scope)entry_stack.peek()).valuebuffer.append(vtl.getText().replaceAll("\\$", "\\\\\\$"));
                     	
 
                     }
                     break;
                 case 3 :
-                    // DSLMapWalker.g:141:4: VT_SPACE
+                    // DSLMapWalker.g:106:4: VT_SPACE
                     {
-                    match(input,VT_SPACE,FOLLOW_VT_SPACE_in_value_sentence310); 
+                    match(input,VT_SPACE,FOLLOW_VT_SPACE_in_value_sentence289); 
                     
                     		((entry_scope)entry_stack.peek()).valuebuffer.append(" ");
                     	
@@ -781,19 +732,16 @@
 
 
     // $ANTLR start literal
-    // DSLMapWalker.g:151:1: literal : theliteral= VT_LITERAL ;
+    // DSLMapWalker.g:112:1: literal : theliteral= VT_LITERAL ;
     public final void literal() throws RecognitionException {
         CommonTree theliteral=null;
 
         try {
-            // DSLMapWalker.g:152:2: (theliteral= VT_LITERAL )
-            // DSLMapWalker.g:152:4: theliteral= VT_LITERAL
+            // DSLMapWalker.g:113:2: (theliteral= VT_LITERAL )
+            // DSLMapWalker.g:113:4: theliteral= VT_LITERAL
             {
             theliteral=(CommonTree)input.LT(1);
-            match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_literal330); 
-            
-            	//System.out.println("theliteral is " + theliteral.getText());
-            	
+            match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_literal307); 
 
             }
 
@@ -810,21 +758,21 @@
 
 
     // $ANTLR start variable_definition
-    // DSLMapWalker.g:159:1: variable_definition : ^( VT_VAR_DEF varname= LITERAL (pattern= VT_PATTERN )? ) ;
+    // DSLMapWalker.g:116:1: variable_definition : ^( VT_VAR_DEF varname= LITERAL (pattern= VT_PATTERN )? ) ;
     public final void variable_definition() throws RecognitionException {
         CommonTree varname=null;
         CommonTree pattern=null;
 
         try {
-            // DSLMapWalker.g:161:2: ( ^( VT_VAR_DEF varname= LITERAL (pattern= VT_PATTERN )? ) )
-            // DSLMapWalker.g:161:6: ^( VT_VAR_DEF varname= LITERAL (pattern= VT_PATTERN )? )
+            // DSLMapWalker.g:117:2: ( ^( VT_VAR_DEF varname= LITERAL (pattern= VT_PATTERN )? ) )
+            // DSLMapWalker.g:117:6: ^( VT_VAR_DEF varname= LITERAL (pattern= VT_PATTERN )? )
             {
-            match(input,VT_VAR_DEF,FOLLOW_VT_VAR_DEF_in_variable_definition351); 
+            match(input,VT_VAR_DEF,FOLLOW_VT_VAR_DEF_in_variable_definition323); 
 
             match(input, Token.DOWN, null); 
             varname=(CommonTree)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition355); 
-            // DSLMapWalker.g:161:42: (pattern= VT_PATTERN )?
+            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition327); 
+            // DSLMapWalker.g:117:42: (pattern= VT_PATTERN )?
             int alt13=2;
             int LA13_0 = input.LA(1);
 
@@ -833,10 +781,10 @@
             }
             switch (alt13) {
                 case 1 :
-                    // DSLMapWalker.g:161:42: pattern= VT_PATTERN
+                    // DSLMapWalker.g:117:42: pattern= VT_PATTERN
                     {
                     pattern=(CommonTree)input.LT(1);
-                    match(input,VT_PATTERN,FOLLOW_VT_PATTERN_in_variable_definition359); 
+                    match(input,VT_PATTERN,FOLLOW_VT_PATTERN_in_variable_definition331); 
 
                     }
                     break;
@@ -846,7 +794,6 @@
 
             match(input, Token.UP, null); 
             
-            		//System.out.println("variable " + varname.getText() + " defined with pattern " + pattern);
             		((entry_scope)entry_stack.peek()).counter++;
             		((entry_scope)entry_stack.peek()).variables.put(varname.getText(), new Integer(((entry_scope)entry_stack.peek()).counter));
             		((entry_scope)entry_stack.peek()).keybuffer.append(pattern != null? "(" + pattern.getText() + ")" : "(.*?)");
@@ -867,25 +814,24 @@
 
 
     // $ANTLR start variable_reference
-    // DSLMapWalker.g:171:1: variable_reference : ^(varref= VT_VAR_REF lit= LITERAL ) ;
+    // DSLMapWalker.g:126:1: variable_reference : ^(varref= VT_VAR_REF lit= LITERAL ) ;
     public final void variable_reference() throws RecognitionException {
         CommonTree varref=null;
         CommonTree lit=null;
 
         try {
-            // DSLMapWalker.g:172:2: ( ^(varref= VT_VAR_REF lit= LITERAL ) )
-            // DSLMapWalker.g:172:4: ^(varref= VT_VAR_REF lit= LITERAL )
+            // DSLMapWalker.g:127:2: ( ^(varref= VT_VAR_REF lit= LITERAL ) )
+            // DSLMapWalker.g:127:4: ^(varref= VT_VAR_REF lit= LITERAL )
             {
             varref=(CommonTree)input.LT(1);
-            match(input,VT_VAR_REF,FOLLOW_VT_VAR_REF_in_variable_reference381); 
+            match(input,VT_VAR_REF,FOLLOW_VT_VAR_REF_in_variable_reference353); 
 
             match(input, Token.DOWN, null); 
             lit=(CommonTree)input.LT(1);
-            match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference385); 
+            match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference357); 
 
             match(input, Token.UP, null); 
             
-            		//System.out.println("varref is " + varref.getText() + " and points to " + lit.getText());
             		((entry_scope)entry_stack.peek()).valuebuffer.append("$" + ((entry_scope)entry_stack.peek()).variables.get(lit.getText()));
             	
 
@@ -904,13 +850,13 @@
 
 
     // $ANTLR start condition_key
-    // DSLMapWalker.g:179:1: condition_key : VT_CONDITION ;
+    // DSLMapWalker.g:133:1: condition_key : VT_CONDITION ;
     public final void condition_key() throws RecognitionException {
         try {
-            // DSLMapWalker.g:180:2: ( VT_CONDITION )
-            // DSLMapWalker.g:180:4: VT_CONDITION
+            // DSLMapWalker.g:134:2: ( VT_CONDITION )
+            // DSLMapWalker.g:134:4: VT_CONDITION
             {
-            match(input,VT_CONDITION,FOLLOW_VT_CONDITION_in_condition_key403); 
+            match(input,VT_CONDITION,FOLLOW_VT_CONDITION_in_condition_key375); 
             ((entry_scope)entry_stack.peek()).retval.setSection(DSLMappingEntry.CONDITION);
 
             }
@@ -928,13 +874,13 @@
 
 
     // $ANTLR start consequence_key
-    // DSLMapWalker.g:184:1: consequence_key : VT_CONSEQUENCE ;
+    // DSLMapWalker.g:138:1: consequence_key : VT_CONSEQUENCE ;
     public final void consequence_key() throws RecognitionException {
         try {
-            // DSLMapWalker.g:185:2: ( VT_CONSEQUENCE )
-            // DSLMapWalker.g:185:4: VT_CONSEQUENCE
+            // DSLMapWalker.g:139:2: ( VT_CONSEQUENCE )
+            // DSLMapWalker.g:139:4: VT_CONSEQUENCE
             {
-            match(input,VT_CONSEQUENCE,FOLLOW_VT_CONSEQUENCE_in_consequence_key418); 
+            match(input,VT_CONSEQUENCE,FOLLOW_VT_CONSEQUENCE_in_consequence_key390); 
             ((entry_scope)entry_stack.peek()).retval.setSection(DSLMappingEntry.CONSEQUENCE);
 
             }
@@ -952,13 +898,13 @@
 
 
     // $ANTLR start keyword_key
-    // DSLMapWalker.g:189:1: keyword_key : VT_KEYWORD ;
+    // DSLMapWalker.g:143:1: keyword_key : VT_KEYWORD ;
     public final void keyword_key() throws RecognitionException {
         try {
-            // DSLMapWalker.g:190:2: ( VT_KEYWORD )
-            // DSLMapWalker.g:190:4: VT_KEYWORD
+            // DSLMapWalker.g:144:2: ( VT_KEYWORD )
+            // DSLMapWalker.g:144:4: VT_KEYWORD
             {
-            match(input,VT_KEYWORD,FOLLOW_VT_KEYWORD_in_keyword_key433); 
+            match(input,VT_KEYWORD,FOLLOW_VT_KEYWORD_in_keyword_key405); 
             ((entry_scope)entry_stack.peek()).retval.setSection(DSLMappingEntry.KEYWORD);
 
             }
@@ -976,13 +922,13 @@
 
 
     // $ANTLR start any_key
-    // DSLMapWalker.g:194:1: any_key : VT_ANY ;
+    // DSLMapWalker.g:148:1: any_key : VT_ANY ;
     public final void any_key() throws RecognitionException {
         try {
-            // DSLMapWalker.g:195:2: ( VT_ANY )
-            // DSLMapWalker.g:195:4: VT_ANY
+            // DSLMapWalker.g:149:2: ( VT_ANY )
+            // DSLMapWalker.g:149:4: VT_ANY
             {
-            match(input,VT_ANY,FOLLOW_VT_ANY_in_any_key448); 
+            match(input,VT_ANY,FOLLOW_VT_ANY_in_any_key420); 
             ((entry_scope)entry_stack.peek()).retval.setSection(DSLMappingEntry.ANY);
 
             }
@@ -1002,41 +948,41 @@
  
 
     public static final BitSet FOLLOW_VT_DSL_GRAMMAR_in_mapping_file54 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_entry_in_mapping_file56 = new BitSet(new long[]{0x0000000000000048L});
-    public static final BitSet FOLLOW_entry_in_mapping_entry76 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_entry_in_valid_entry97 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_COMMENT_in_valid_entry104 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_ENTRY_in_entry132 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_scope_section_in_entry134 = new BitSet(new long[]{0x0000000000003000L});
-    public static final BitSet FOLLOW_meta_section_in_entry136 = new BitSet(new long[]{0x0000000000002000L});
-    public static final BitSet FOLLOW_key_section_in_entry139 = new BitSet(new long[]{0x0000000000004000L});
-    public static final BitSet FOLLOW_value_section_in_entry145 = new BitSet(new long[]{0x0000000000000008L});
-    public static final BitSet FOLLOW_VT_SCOPE_in_scope_section165 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_condition_key_in_scope_section167 = new BitSet(new long[]{0x0000000000000E08L});
-    public static final BitSet FOLLOW_consequence_key_in_scope_section170 = new BitSet(new long[]{0x0000000000000C08L});
-    public static final BitSet FOLLOW_keyword_key_in_scope_section173 = new BitSet(new long[]{0x0000000000000808L});
-    public static final BitSet FOLLOW_any_key_in_scope_section176 = new BitSet(new long[]{0x0000000000000008L});
-    public static final BitSet FOLLOW_VT_META_in_meta_section193 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_LITERAL_in_meta_section197 = new BitSet(new long[]{0x0000000000000008L});
-    public static final BitSet FOLLOW_VT_ENTRY_KEY_in_key_section214 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_key_sentence_in_key_section216 = new BitSet(new long[]{0x00000000000A8008L});
-    public static final BitSet FOLLOW_variable_definition_in_key_sentence234 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_LITERAL_in_key_sentence241 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_SPACE_in_key_sentence250 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_ENTRY_VAL_in_value_section273 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_value_sentence_in_value_section275 = new BitSet(new long[]{0x00000000000B0008L});
-    public static final BitSet FOLLOW_variable_reference_in_value_sentence295 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_LITERAL_in_value_sentence302 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_SPACE_in_value_sentence310 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_LITERAL_in_literal330 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_VAR_DEF_in_variable_definition351 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_LITERAL_in_variable_definition355 = new BitSet(new long[]{0x0000000000040008L});
-    public static final BitSet FOLLOW_VT_PATTERN_in_variable_definition359 = new BitSet(new long[]{0x0000000000000008L});
-    public static final BitSet FOLLOW_VT_VAR_REF_in_variable_reference381 = new BitSet(new long[]{0x0000000000000004L});
-    public static final BitSet FOLLOW_LITERAL_in_variable_reference385 = new BitSet(new long[]{0x0000000000000008L});
-    public static final BitSet FOLLOW_VT_CONDITION_in_condition_key403 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_CONSEQUENCE_in_consequence_key418 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_KEYWORD_in_keyword_key433 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_VT_ANY_in_any_key448 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_valid_entry_in_mapping_file56 = new BitSet(new long[]{0x0000000000000068L});
+    public static final BitSet FOLLOW_entry_in_valid_entry78 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_COMMENT_in_valid_entry86 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_LINE_COMMENT_in_valid_entry90 = new BitSet(new long[]{0x0000000000000008L});
+    public static final BitSet FOLLOW_VT_ENTRY_in_entry119 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_scope_section_in_entry121 = new BitSet(new long[]{0x0000000000003000L});
+    public static final BitSet FOLLOW_meta_section_in_entry123 = new BitSet(new long[]{0x0000000000002000L});
+    public static final BitSet FOLLOW_key_section_in_entry126 = new BitSet(new long[]{0x0000000000004000L});
+    public static final BitSet FOLLOW_value_section_in_entry132 = new BitSet(new long[]{0x0000000000000008L});
+    public static final BitSet FOLLOW_VT_SCOPE_in_scope_section152 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_condition_key_in_scope_section154 = new BitSet(new long[]{0x0000000000000E08L});
+    public static final BitSet FOLLOW_consequence_key_in_scope_section157 = new BitSet(new long[]{0x0000000000000C08L});
+    public static final BitSet FOLLOW_keyword_key_in_scope_section160 = new BitSet(new long[]{0x0000000000000808L});
+    public static final BitSet FOLLOW_any_key_in_scope_section163 = new BitSet(new long[]{0x0000000000000008L});
+    public static final BitSet FOLLOW_VT_META_in_meta_section180 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_LITERAL_in_meta_section184 = new BitSet(new long[]{0x0000000000000008L});
+    public static final BitSet FOLLOW_VT_ENTRY_KEY_in_key_section201 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_key_sentence_in_key_section203 = new BitSet(new long[]{0x00000000000A8008L});
+    public static final BitSet FOLLOW_variable_definition_in_key_sentence218 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_LITERAL_in_key_sentence225 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_SPACE_in_key_sentence234 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_ENTRY_VAL_in_value_section255 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_value_sentence_in_value_section257 = new BitSet(new long[]{0x00000000000B0008L});
+    public static final BitSet FOLLOW_variable_reference_in_value_sentence274 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_LITERAL_in_value_sentence281 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_SPACE_in_value_sentence289 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_LITERAL_in_literal307 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_VAR_DEF_in_variable_definition323 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_LITERAL_in_variable_definition327 = new BitSet(new long[]{0x0000000000040008L});
+    public static final BitSet FOLLOW_VT_PATTERN_in_variable_definition331 = new BitSet(new long[]{0x0000000000000008L});
+    public static final BitSet FOLLOW_VT_VAR_REF_in_variable_reference353 = new BitSet(new long[]{0x0000000000000004L});
+    public static final BitSet FOLLOW_LITERAL_in_variable_reference357 = new BitSet(new long[]{0x0000000000000008L});
+    public static final BitSet FOLLOW_VT_CONDITION_in_condition_key375 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_CONSEQUENCE_in_consequence_key390 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_KEYWORD_in_keyword_key405 = new BitSet(new long[]{0x0000000000000002L});
+    public static final BitSet FOLLOW_VT_ANY_in_any_key420 = new BitSet(new long[]{0x0000000000000002L});
 
 }
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLTokenizedMappingFile.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLTokenizedMappingFile.java	2008-06-10 19:28:45 UTC (rev 20410)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/dsl/DSLTokenizedMappingFile.java	2008-06-11 00:18:54 UTC (rev 20411)
@@ -1,9 +1,7 @@
 package org.drools.lang.dsl;
 
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.Reader;
-import java.io.StringReader;
 import java.util.LinkedList;
 import org.antlr.runtime.ANTLRReaderStream;
 import org.antlr.runtime.CharStream;
@@ -13,50 +11,41 @@
 import org.antlr.runtime.tree.CommonTreeNodeStream;
 
 public class DSLTokenizedMappingFile extends DSLMappingFile {
+	
+	
 	public DSLTokenizedMappingFile() {
         super();
     }
 	
 	public boolean parseAndLoad(final Reader dsl) throws IOException {
-        String line = null;
-        int linecounter = 0;
-        final BufferedReader dslFileReader = new BufferedReader( dsl );
-        this.mapping = new DefaultDSLMapping();
         this.errors = new LinkedList();
-        //Note: Use a string builder for 1.5 targets
-        StringBuffer sb = new StringBuffer();
-        while ( (line = dslFileReader.readLine()) != null ) {
-            linecounter++;
-            String trimmedline = line.trim() + "\n"; //this can be more efficient, get rid of trim(), iterate-- over last chars only.
-            try{
-            	final DSLMappingEntry entry = buildEntry(trimmedline);
-            	if(entry != null) this.mapping.addEntry(entry);//will be null if a comment
-            }catch(Exception re){
-            	final String error = "Error parsing mapping entry: " + line;
-            	final DSLMappingParseException exception = 
-            		new DSLMappingParseException( error, linecounter );
-            	this.errors.add( exception );
-            }
-        }
-        return this.errors.isEmpty();
+		try{
+			this.mapping = buildFileMapping(dsl);		
+		}catch(Exception e){
+			final String error = "Error parsing mapping file: " + e.getMessage();
+        	final DSLMappingParseException exception = 
+        		new DSLMappingParseException( error, -1 );
+        	this.errors.add( exception );
+		}
+		return this.errors.isEmpty();
     }
 	
-	private DSLMappingEntry buildEntry(String line) throws IOException, RecognitionException{
-		StringReader sr = new StringReader(line);
-		ANTLRReaderStream reader = new ANTLRReaderStream(sr);
-		DSLMapWalker walker = buildEntryWalker(reader);
-		DSLMappingEntry entry = walker.valid_entry();
-		return entry;
+	private DSLMapping buildFileMapping(Reader dsl) throws IOException, RecognitionException{
+		ANTLRReaderStream reader = new ANTLRReaderStream(dsl);
+		DSLMapWalker walker = buildFileMappingWalker(reader);
+		DSLMapping mapping = walker.mapping_file();
+		return mapping;
 	}
 	
-	private DSLMapWalker buildEntryWalker(CharStream stream) throws RecognitionException{
+	private DSLMapWalker buildFileMappingWalker(CharStream stream) throws RecognitionException{
 		DSLMapLexer lexer = new DSLMapLexer(stream);
 		CommonTokenStream tokens = new CommonTokenStream();
 		tokens.setTokenSource(lexer);
 		DSLMapParser parser = new DSLMapParser(tokens);
-		DSLMapParser.statement_return example = parser.statement();
+		DSLMapParser.mapping_file_return example = parser.mapping_file();
+		this.errors.addAll(parser.getErrorList());
 		CommonTree tree = (CommonTree) example.getTree();
-		//System.out.println(tree.toStringTree());
+//		System.out.println(tree.toStringTree());
 		
 		CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
 		DSLMapWalker walker = new DSLMapWalker(nodes);

Modified: labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMap.g
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMap.g	2008-06-10 19:28:45 UTC (rev 20410)
+++ labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMap.g	2008-06-11 00:18:54 UTC (rev 20411)
@@ -27,15 +27,27 @@
 
 @parser::header {
 	package org.drools.lang.dsl;
+	import java.util.List;
+	import java.util.ArrayList;
+	import org.drools.lang.dsl.DSLMappingParseException;
 }
 
 @lexer::header {
 	package org.drools.lang.dsl;
+	import java.util.List;
+	import java.util.ArrayList;
+	import org.drools.lang.dsl.DSLMappingParseException;
 }
 
 @parser::members {
 //we may not need the check on [], as the LITERAL token being examined 
 //should not have them.
+	
+	private List errorList = new ArrayList();
+	public List getErrorList(){
+		return errorList;
+	}
+
 	private boolean validateLT(int LTNumber, String text){
 		if (null == input) return false;
 		if (null == input.LT(LTNumber)) return false;
@@ -53,25 +65,21 @@
 		return validateLT(1, text);
 	}
 	
-	protected void mismatch(IntStream input, int ttype, BitSet follow)
-		throws RecognitionException{
-		throw new MismatchedTokenException(ttype, input);
+	public void reportError(RecognitionException re) {
+		// if we've already reported an error and have not matched a token
+		// yet successfully, don't report any errors.
+		if (errorRecovery) {
+			return;
+		}
+		errorRecovery = true;
+	
+		String error = "Error parsing mapping entry: " + getErrorMessage(re, tokenNames);
+		DSLMappingParseException exception = new DSLMappingParseException (error, re.line);
+		errorList.add(exception);
 	}
-
-	public void recoverFromMismatchedSet(IntStream input,
-		RecognitionException e, BitSet follow) throws RecognitionException{
-		throw e;
-	}
 	
 }
 
-
- at rulecatch {
-	catch (RecognitionException e) {
-		throw e;
-	}
-}
-
 // PARSER RULES
 mapping_file
 	: statement* 
@@ -94,9 +102,14 @@
 entry 	: scope_section meta_section? key_section EQUALS value_section (EOL|EOF)
 	-> ^(VT_ENTRY scope_section meta_section? key_section value_section)
 	;
+	catch [ RecognitionException e ] {
+		reportError( e );
+	}
+	catch [ RewriteEmptyStreamException e ] {
+	}
 
+	
 
-
 scope_section 
 	: LEFT_SQUARE 
 		(value1=condition_key 
@@ -107,6 +120,7 @@
 	RIGHT_SQUARE
 	-> ^(VT_SCOPE[$LEFT_SQUARE, "SCOPE SECTION"] $value1? $value2? $value3? $value4?)
 	;
+	
 
 
 	
@@ -116,7 +130,7 @@
 	;
 
 key_section
-	: key_sentence+
+	: ks=key_sentence+
 	-> ^(VT_ENTRY_KEY key_sentence+ )
 	;
  
@@ -171,7 +185,6 @@
 	name=LITERAL ( COLON pat=pattern {text = $pat.text;} )? rc=RIGHT_CURLY
 	{
 	CommonToken rc1 = (CommonToken)input.LT(1);
-	//System.out.println("lt1 from rc: " + rc1.getText());
 	if(!"=".equals(rc1.getText()) && ((CommonToken)rc).getStopIndex() < rc1.getStartIndex() - 1) hasSpaceAfter = true;
 	}
 	-> {hasSpaceBefore && !"".equals(text) && !hasSpaceAfter}? VT_SPACE ^(VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )  //pat can be null if there's no pattern here
@@ -210,12 +223,7 @@
         boolean hasSpaceAfter = false;
 }	
 	: lc=LEFT_CURLY 
-		{//try too figure out how to get " {name} " to realize there's a space infron of the { char
-		//System.out.println("input is a " + input.getClass().getName());
-		//System.out.println("input is: " + input.toString());
-		//System.out.println("input LA[1]: " + input.LA(1));
-		
-		//System.out.println("lc start is: " + ((CommonToken)lc).getStartIndex() );
+		{
 		CommonToken back2 =  (CommonToken)input.LT(-2);
 		if( back2!=null && back2.getStopIndex() < ((CommonToken)lc).getStartIndex() -1 ) hasSpaceBefore = true; 
 		} 

Modified: labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMapWalker.g
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMapWalker.g	2008-06-10 19:28:45 UTC (rev 20410)
+++ labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/dsl/DSLMapWalker.g	2008-06-11 00:18:54 UTC (rev 20411)
@@ -1,193 +1,151 @@
-tree grammar DSLMapWalker;
-
-options {
-	tokenVocab=DSLMap;
-	ASTLabelType=CommonTree;
-}
-
- at treeparser::header {
-	package org.drools.lang.dsl;
-	
-	import java.util.Map;
-	import java.util.HashMap;
-	
-}
-
-
-mapping_file returns [DSLMapping mapping]
-scope {
-	DSLMapping retval;
-}
- at init {
-	$mapping_file::retval = new DefaultDSLMapping() ;
-}
-	: ^(VT_DSL_GRAMMAR entry*)
-	{
-		//System.out.println("done parsing file");
-		//System.out.println($mapping_file::retval.dumpFile());
-		$mapping = $mapping_file::retval;
-		//java.io.StringWriter sw = new java.io.StringWriter();
-		//$mapping_file::retval.saveMapping(sw);
-		//System.out.println(sw.toString());
-	}
-	;
-	
-mapping_entry 
-	: ent=entry
-	{
-		$mapping_file::retval.addEntry(ent);
-		//System.out.println("mapping size is now " + $mapping_file::retval.getEntries().size());
-	}
-	;
-	
-valid_entry returns [DSLMappingEntry mappingEntry]
-	: ent=entry {$mappingEntry = ent;}
-	| VT_COMMENT {$mappingEntry = null;}
-	;
-
-
-entry returns [DSLMappingEntry mappingEntry]
-scope {
-	Map variables;
-	AntlrDSLMappingEntry retval;
-	int counter;
-	StringBuffer keybuffer;
-	StringBuffer valuebuffer;
-}
- at init {
-	$entry::retval = new AntlrDSLMappingEntry() ;
-	$entry::variables = new HashMap();
-	$entry::keybuffer = new StringBuffer();
-	$entry::valuebuffer = new StringBuffer();
-}
-	: ^(VT_ENTRY scope_section meta_section? key_section {$entry::retval.variables = $entry::variables; $entry::retval.setMappingKey($entry::keybuffer.toString());}
-		value_section)
-	{
-		//System.out.println("for this entry, metadata is " + $entry::retval.getMetaData().getMetaData());
-		//System.out.println("variables are " + $entry::variables);
-		
-		//System.out.println("keybuffer: " + $entry::keybuffer);
-		//System.out.println("valuebuffer: " + $entry::valuebuffer);
-//		$mapping_file::retval.addEntry($entry::retval);
-//		System.out.println("mapping size is now " + $mapping_file::retval.getEntries().size());
-		//$entry::retval.variables = $entry::variables;
-		//$entry::retval.setMappingKey($entry::keybuffer.toString());
-		$entry::retval.setMappingValue($entry::valuebuffer.toString());
-		//System.out.println("keypattern is " + $entry::retval.getKeyPattern());
-		//System.out.println("valuepattern is " + $entry::retval.getValuePattern());
-		$mappingEntry = $entry::retval;
-	}
-	;
-
-
-scope_section 
-	: ^(thescope=VT_SCOPE condition_key? consequence_key? keyword_key? any_key?)
-	;
-
-
-	
-meta_section
-	: ^(VT_META metalit=LITERAL?)
-	{
-		if ( $metalit == null || $metalit.text == null || $metalit.text.length() == 0 ) {
-			$entry::retval.setMetaData(DSLMappingEntry.EMPTY_METADATA);
-		} else {
-        		$entry::retval.setMetaData(new DSLMappingEntry.DefaultDSLEntryMetaData( $metalit.text ));
-	        }
-	}
-	;
-
-key_section
-	: ^(VT_ENTRY_KEY key_sentence+ )
-	{
-		//$entry::retval.setMappingKey($entry::keybuffer.toString());
-	}
-	;
- 
-key_sentence
-	: variable_definition
-	| vtl=VT_LITERAL 
-	{
-		//System.out.println("in key_sentence, literal is " + $vtl.text);
-		$entry::keybuffer.append($vtl.text);
-	}
-	| VT_SPACE
-	{
-		$entry::keybuffer.append("\\s+");
-	}
-	;		
-/*
-key_chunk
-	: literal+
-	;		
-*/	
-value_section
-	: ^(VT_ENTRY_VAL value_sentence+ )
-	{
-		//$entry::retval.setMappingValue($entry::valuebuffer.toString());
-	}
-	;
-	
-value_sentence 	
-	: variable_reference
-	| vtl=VT_LITERAL
-	{
-		//System.out.println("in value_sentence, literal is " + $vtl.text);
-		$entry::valuebuffer.append($vtl.text.replaceAll("\\$", "\\\\\\$"));
-	}
-	| VT_SPACE
-	{
-		$entry::valuebuffer.append(" ");
-	}
-	;	
-/*	
-value_chunk
-	: (literal|EQUALS)+
-	;	
-*/	
-literal 
-	: theliteral=VT_LITERAL {//System.out.println("theliteral is " + $theliteral.text);}
-	;	
-
-
-variable_definition
-
-	:   ^(VT_VAR_DEF varname=LITERAL pattern=VT_PATTERN? )
-	{
-		//System.out.println("variable " + $varname.text + " defined with pattern " + $pattern);
-		$entry::counter++;
-		$entry::variables.put($varname.text, new Integer($entry::counter));
-		$entry::keybuffer.append($pattern != null? "(" + $pattern.text + ")" : "(.*?)");
-	}
-	;
-
-
-variable_reference 
-	: ^(varref=VT_VAR_REF lit=LITERAL ) 
-	{
-		//System.out.println("varref is " + $varref.text + " and points to " + $lit.text);
-		$entry::valuebuffer.append("$" + $entry::variables.get($lit.text));
-	}
-	;	
-
-condition_key
-	: VT_CONDITION
-	{$entry::retval.setSection(DSLMappingEntry.CONDITION);}
-	;
-
-consequence_key 
-	: VT_CONSEQUENCE
-	{$entry::retval.setSection(DSLMappingEntry.CONSEQUENCE);}
-	;
-
-keyword_key 
-	: VT_KEYWORD
-	{$entry::retval.setSection(DSLMappingEntry.KEYWORD);}
-	;
-
-any_key 
-	: VT_ANY
-	{$entry::retval.setSection(DSLMappingEntry.ANY);}
-	;
-	
-	
+tree grammar DSLMapWalker;
+
+options {
+	tokenVocab=DSLMap;
+	ASTLabelType=CommonTree;
+}
+
+ at treeparser::header {
+	package org.drools.lang.dsl;
+	
+	import java.util.Map;
+	import java.util.HashMap;
+	
+}
+
+
+mapping_file returns [DSLMapping mapping]
+scope {
+	DSLMapping retval;
+}
+ at init {
+	$mapping_file::retval = new DefaultDSLMapping() ;
+}
+	: ^(VT_DSL_GRAMMAR valid_entry*)
+	{
+		$mapping = $mapping_file::retval;
+	}
+	;
+
+valid_entry returns [DSLMappingEntry mappingEntry]
+	: ent=entry {$mappingEntry = ent; }
+	| ^(VT_COMMENT lc=LINE_COMMENT) {$mappingEntry = null;}
+	;
+
+
+entry returns [DSLMappingEntry mappingEntry]
+scope {
+	Map variables;
+	AntlrDSLMappingEntry retval;
+	int counter;
+	StringBuffer keybuffer;
+	StringBuffer valuebuffer;
+}
+ at init {
+	$entry::retval = new AntlrDSLMappingEntry() ;
+	$entry::variables = new HashMap();
+	$entry::keybuffer = new StringBuffer();
+	$entry::valuebuffer = new StringBuffer();
+}
+	: ^(VT_ENTRY scope_section meta_section? key_section {$entry::retval.variables = $entry::variables; $entry::retval.setMappingKey($entry::keybuffer.toString());}
+		value_section)
+	{
+		$entry::retval.setMappingValue($entry::valuebuffer.toString());
+		$mappingEntry = $entry::retval;
+		$mapping_file::retval.addEntry($mappingEntry);
+	}
+	;
+
+
+scope_section 
+	: ^(thescope=VT_SCOPE condition_key? consequence_key? keyword_key? any_key?)
+	;
+
+
+	
+meta_section
+	: ^(VT_META metalit=LITERAL?)
+	{
+		if ( $metalit == null || $metalit.text == null || $metalit.text.length() == 0 ) {
+			$entry::retval.setMetaData(DSLMappingEntry.EMPTY_METADATA);
+		} else {
+        		$entry::retval.setMetaData(new DSLMappingEntry.DefaultDSLEntryMetaData( $metalit.text ));
+	        }
+	}
+	;
+
+key_section
+	: ^(VT_ENTRY_KEY key_sentence+ )
+	;
+ 
+key_sentence
+	: variable_definition
+	| vtl=VT_LITERAL 
+	{
+		$entry::keybuffer.append($vtl.text);
+	}
+	| VT_SPACE
+	{
+		$entry::keybuffer.append("\\s+");
+	}
+	;		
+
+value_section
+ at after{
+	$entry::valuebuffer.append(" ");
+}
+	: ^(VT_ENTRY_VAL value_sentence+ )
+	;
+	
+value_sentence 	
+	: variable_reference
+	| vtl=VT_LITERAL
+	{
+		$entry::valuebuffer.append($vtl.text.replaceAll("\\$", "\\\\\\$"));
+	}
+	| VT_SPACE
+	{
+		$entry::valuebuffer.append(" ");
+	}
+	;	
+
+literal 
+	: theliteral=VT_LITERAL 
+	;	
+
+variable_definition
+	:   ^(VT_VAR_DEF varname=LITERAL pattern=VT_PATTERN? )
+	{
+		$entry::counter++;
+		$entry::variables.put($varname.text, new Integer($entry::counter));
+		$entry::keybuffer.append($pattern != null? "(" + $pattern.text + ")" : "(.*?)");
+	}
+	;
+
+
+variable_reference 
+	: ^(varref=VT_VAR_REF lit=LITERAL ) 
+	{
+		$entry::valuebuffer.append("$" + $entry::variables.get($lit.text));
+	}
+	;	
+
+condition_key
+	: VT_CONDITION
+	{$entry::retval.setSection(DSLMappingEntry.CONDITION);}
+	;
+
+consequence_key 
+	: VT_CONSEQUENCE
+	{$entry::retval.setSection(DSLMappingEntry.CONSEQUENCE);}
+	;
+
+keyword_key 
+	: VT_KEYWORD
+	{$entry::retval.setSection(DSLMappingEntry.KEYWORD);}
+	;
+
+any_key 
+	: VT_ANY
+	{$entry::retval.setSection(DSLMappingEntry.ANY);}
+	;




More information about the jboss-svn-commits mailing list