Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.tokens
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.tokens?rev=1229085&r1=1229084&r2=1229085&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.tokens
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.tokens
 Mon Jan  9 10:22:03 2012
@@ -52,101 +52,103 @@ FEATURE=54
 FILL=55
 FILTERMARKUP=56
 FILTERTYPE=57
-FloatTypeSuffix=58
-FloatingPointLiteral=59
-GATHER=60
-GET=61
-GETFEATURE=62
-GETLIST=63
-GREATER=64
-GREATEREQUAL=65
-HexDigit=66
-HexLiteral=67
-IF=68
-INLIST=69
-INTLIST=70
-IS=71
-ISINTAG=72
-Identifier=73
-IntString=74
-IntegerTypeSuffix=75
-JavaIDDigit=76
-LAST=77
-LBRACK=78
-LCURLY=79
-LESS=80
-LESSEQUAL=81
-LINE_COMMENT=82
-LOG=83
-LOGN=84
-LPAREN=85
-Letter=86
-ListIdentifier=87
-LogLevel=88
-MARK=89
-MARKFAST=90
-MARKLAST=91
-MARKONCE=92
-MARKSCORE=93
-MARKTABLE=94
-MATCHEDTEXT=95
-MERGE=96
-MINUS=97
-MOFN=98
-NEAR=99
-NOT=100
-NOTEQUAL=101
-OR=102
-OctalEscape=103
-OctalLiteral=104
-OldColor=105
-PARSE=106
-PARTOF=107
-PARTOFNEQ=108
-PERCENT=109
-PLUS=110
-POSITION=111
-PackageString=112
-QUESTION=113
-RBRACK=114
-RCURLY=115
-REGEXP=116
-REMOVE=117
-REMOVEDUPLICATE=118
-REMOVESTRING=119
-REPLACE=120
-RETAINMARKUP=121
-RETAINTYPE=122
-RPAREN=123
-RessourceLiteral=124
-SCORE=125
-SEMI=126
-SETFEATURE=127
-SIN=128
-SIZE=129
-SLASH=130
-STAR=131
-STARTSWITH=132
-STRINGLIST=133
-ScriptString=134
-StringLiteral=135
-StringString=136
-SymbolString=137
-TAN=138
-THEN=139
-TOTALCOUNT=140
-TRANSFER=141
-TRIE=142
-TRUE=143
-TYPELIST=144
-TypeString=145
-TypeSystemString=146
-UNMARK=147
-UNMARKALL=148
-UnicodeEscape=149
-VBAR=150
-VOTE=151
-WORDLIST=152
-WORDTABLE=153
-WS=154
-XOR=155
+FLOATLIST=58
+FloatString=59
+FloatTypeSuffix=60
+FloatingPointLiteral=61
+GATHER=62
+GET=63
+GETFEATURE=64
+GETLIST=65
+GREATER=66
+GREATEREQUAL=67
+HexDigit=68
+HexLiteral=69
+IF=70
+INLIST=71
+INTLIST=72
+IS=73
+ISINTAG=74
+Identifier=75
+IntString=76
+IntegerTypeSuffix=77
+JavaIDDigit=78
+LAST=79
+LBRACK=80
+LCURLY=81
+LESS=82
+LESSEQUAL=83
+LINE_COMMENT=84
+LOG=85
+LOGN=86
+LPAREN=87
+Letter=88
+ListIdentifier=89
+LogLevel=90
+MARK=91
+MARKFAST=92
+MARKLAST=93
+MARKONCE=94
+MARKSCORE=95
+MARKTABLE=96
+MATCHEDTEXT=97
+MERGE=98
+MINUS=99
+MOFN=100
+NEAR=101
+NOT=102
+NOTEQUAL=103
+OR=104
+OctalEscape=105
+OctalLiteral=106
+OldColor=107
+PARSE=108
+PARTOF=109
+PARTOFNEQ=110
+PERCENT=111
+PLUS=112
+POSITION=113
+PackageString=114
+QUESTION=115
+RBRACK=116
+RCURLY=117
+REGEXP=118
+REMOVE=119
+REMOVEDUPLICATE=120
+REMOVESTRING=121
+REPLACE=122
+RETAINMARKUP=123
+RETAINTYPE=124
+RPAREN=125
+RessourceLiteral=126
+SCORE=127
+SEMI=128
+SETFEATURE=129
+SIN=130
+SIZE=131
+SLASH=132
+STAR=133
+STARTSWITH=134
+STRINGLIST=135
+ScriptString=136
+StringLiteral=137
+StringString=138
+SymbolString=139
+TAN=140
+THEN=141
+TOTALCOUNT=142
+TRANSFER=143
+TRIE=144
+TRUE=145
+TYPELIST=146
+TypeString=147
+TypeSystemString=148
+UNMARK=149
+UNMARKALL=150
+UnicodeEscape=151
+VBAR=152
+VOTE=153
+WORDLIST=154
+WORDTABLE=155
+WS=156
+XOR=157

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/verbalize/ExpressionVerbalizer.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/verbalize/ExpressionVerbalizer.java?rev=1229085&r1=1229084&r2=1229085&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/verbalize/ExpressionVerbalizer.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/verbalize/ExpressionVerbalizer.java
 Mon Jan  9 10:22:03 2012
@@ -36,12 +36,10 @@ import org.apache.uima.textmarker.expres
 import org.apache.uima.textmarker.expression.list.SimpleNumberListExpression;
 import org.apache.uima.textmarker.expression.list.SimpleStringListExpression;
 import org.apache.uima.textmarker.expression.list.SimpleTypeListExpression;
-import org.apache.uima.textmarker.expression.number.ComposedDoubleExpression;
-import org.apache.uima.textmarker.expression.number.ComposedIntegerExpression;
+import org.apache.uima.textmarker.expression.number.ComposedNumberExpression;
 import org.apache.uima.textmarker.expression.number.NegativeNumberExpression;
 import org.apache.uima.textmarker.expression.number.NumberExpression;
-import org.apache.uima.textmarker.expression.number.ReferenceDoubleExpression;
-import org.apache.uima.textmarker.expression.number.ReferenceIntegerExpression;
+import org.apache.uima.textmarker.expression.number.ReferenceNumberExpression;
 import org.apache.uima.textmarker.expression.number.SimpleNumberExpression;
 import 
org.apache.uima.textmarker.expression.resource.ReferenceWordListExpression;
 import 
org.apache.uima.textmarker.expression.resource.ReferenceWordTableExpression;
@@ -135,17 +133,14 @@ public class ExpressionVerbalizer {
     } else if (expression instanceof NegativeNumberExpression) {
       NegativeNumberExpression e = (NegativeNumberExpression) expression;
       return "-(" + e.getExpression() + ")";
-    } else if (expression instanceof ReferenceDoubleExpression) {
-      ReferenceDoubleExpression e = (ReferenceDoubleExpression) expression;
-      return e.getVar();
-    } else if (expression instanceof ReferenceIntegerExpression) {
-      ReferenceIntegerExpression e = (ReferenceIntegerExpression) expression;
+    } else if (expression instanceof ReferenceNumberExpression) {
+      ReferenceNumberExpression e = (ReferenceNumberExpression) expression;
       return e.getVar();
     } else if (expression instanceof SimpleNumberExpression) {
       SimpleNumberExpression e = (SimpleNumberExpression) expression;
       return e.getNumber().toString();
-    } else if (expression instanceof ComposedDoubleExpression) {
-      ComposedDoubleExpression e = (ComposedDoubleExpression) expression;
+    } else if (expression instanceof ComposedNumberExpression) {
+      ComposedNumberExpression e = (ComposedNumberExpression) expression;
       NumberExpression ne = e.getExpressions().get(0);
       if (ne == null) {
         return "";
@@ -158,17 +153,6 @@ public class ExpressionVerbalizer {
         }
       }
       return result.toString();
-    } else if (expression instanceof ComposedIntegerExpression) {
-      ComposedIntegerExpression e = (ComposedIntegerExpression) expression;
-      NumberExpression ne = e.getExpressions().get(0);
-      if (ne == null) {
-        return "";
-      }
-      String result = verbalize(ne);
-      for (int i = 0; i < e.getOperators().size(); i++) {
-        result += e.getOperators().get(i) + verbalize(e.getExpressions().get(i 
+ 1));
-      }
-      return result;
     }
     return expression.getClass().getSimpleName();
   }

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g?rev=1229085&r1=1229084&r2=1229085&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g
 Mon Jan  9 10:22:03 2012
@@ -340,6 +340,13 @@ variableDeclaration returns [List<Statem
                 stmts.add(StatementFactory.createDeclarationsStatement(type, 
decls, init));
                 }
        |
+       type = FloatString id = Identifier {addVariable(id.getText(), 
type.getText());decls.add(StatementFactory.createFloatVariable(id, type));}
+                       (COMMA id = Identifier {addVariable(id.getText(), 
type.getText());decls.add(StatementFactory.createFloatVariable(id, type));}
+                )* (ASSIGN_EQUAL init = numberExpression)?  SEMI
+               {
+                stmts.add(StatementFactory.createDeclarationsStatement(type, 
decls, init));
+                }
+       |
        type = StringString id = Identifier {addVariable(id.getText(), 
type.getText());decls.add(StatementFactory.createStringVariable(id, type));}
                        (COMMA id = Identifier {addVariable(id.getText(), 
type.getText());decls.add(StatementFactory.createStringVariable(id, type));}
                 )* (ASSIGN_EQUAL init = stringExpression)?  SEMI
@@ -395,6 +402,13 @@ variableDeclaration returns [List<Statem
         decls.add(StatementFactory.createVarListVariable(id,type,list, 
TMTypeConstants.TM_TYPE_NL));
         stmts.add(StatementFactory.createDeclarationsStatement(type, decls, 
list));
         }
+          |
+        type = FLOATLIST id = Identifier (ASSIGN_EQUAL list = 
numberListExpression)?  SEMI
+        {
+        addVariable(id.getText(), type.getText());
+        decls.add(StatementFactory.createVarListVariable(id,type,list, 
TMTypeConstants.TM_TYPE_NL));
+        stmts.add(StatementFactory.createDeclarationsStatement(type, decls, 
list));
+        }
                 |
         type = STRINGLIST id = Identifier (ASSIGN_EQUAL list = 
stringListExpression)?  SEMI
         {
@@ -461,7 +475,8 @@ declaration returns [List<Statement> stm
                        (
                        obj1 = annotationType{featureTypes.add(obj1);} 
                        | obj2 = StringString{featureTypes.add(obj2);} 
-                       | obj3 = DoubleString{featureTypes.add(obj3);} 
+                       | obj3 = DoubleString{featureTypes.add(obj3);}
+                       | obj6 = FloatString{featureTypes.add(obj6);}  
                        | obj4 = IntString{featureTypes.add(obj4);}
                        | obj5 = BooleanString{featureTypes.add(obj5);}
                        //| obj6 = fsType{featureTypes.add(obj6.getText());}
@@ -473,6 +488,7 @@ declaration returns [List<Statement> stm
                        obj1 = annotationType{featureTypes.add(obj1);} 
                        | obj2 = StringString{featureTypes.add(obj2);} 
                        | obj3 = DoubleString{featureTypes.add(obj3);}
+                       | obj6 = FloatString{featureTypes.add(obj6);}  
                        | obj4 = IntString{featureTypes.add(obj4);}
                        | obj5 = BooleanString{featureTypes.add(obj5);}
                        //| obj6 = fsType{featureTypes.add(obj5.getText());}
@@ -622,6 +638,7 @@ listExpression returns [Expression expr 
        (booleanListExpression)=> e = booleanListExpression {expr = e;}
        | (intListExpression)=> e = intListExpression {expr = e;}
        | (doubleListExpression)=> e = doubleListExpression {expr = e;}
+       | (floatListExpression)=> e = floatListExpression {expr = e;}
        | (stringListExpression)=> e = stringListExpression {expr = e;}
        | (typeListExpression)=> e = typeListExpression {expr = e;}
        ;
@@ -667,6 +684,8 @@ numberListExpression returns [Expression
        :
        (e1 = doubleListExpression)=> e1 = doubleListExpression {expr = e1;}
        |
+       (e1 = floatListExpression)=> e1 = floatListExpression {expr = e1;}
+       |
        e2 = intListExpression {expr = e2;}
        ;
        
@@ -687,6 +706,23 @@ simpleDoubleListExpression returns [Expr
        {expr = ExpressionFactory.createListExpression(var, 
TMTypeConstants.TM_TYPE_NL);}
        ;
 
+floatListExpression returns [Expression expr = null]
+       :
+       e = simpleFloatListExpression {expr = e;}
+       ;
+
+simpleFloatListExpression returns [Expression expr = null]
+@init{
+       List<Expression> list = new ArrayList<Expression>();
+}      :
+       LCURLY (e = simpleNumberExpression {list.add(e);} (COMMA e = 
simpleNumberExpression {list.add(e);})*)?  RCURLY
+       {expr = ExpressionFactory.createListExpression(list, 
TMTypeConstants.TM_TYPE_NL);}
+       |
+       {isVariableOfType(input.LT(1).getText(), "FLOATLIST")}? 
+       var = Identifier 
+       {expr = ExpressionFactory.createListExpression(var, 
TMTypeConstants.TM_TYPE_NL);}
+       ;
+
 
 stringListExpression returns [Expression expr = null]
        :
@@ -764,6 +800,7 @@ listVariable returns [Expression var = n
        :
        {isVariableOfType(input.LT(1).getText(), "BOOLEANLIST")
        ||isVariableOfType(input.LT(1).getText(), "INTLIST")
+       ||isVariableOfType(input.LT(1).getText(), "FLOATLIST")
        ||isVariableOfType(input.LT(1).getText(), "DOUBLELIST")
        ||isVariableOfType(input.LT(1).getText(), "STRINGLIST")
        ||isVariableOfType(input.LT(1).getText(), "TYPELIST")
@@ -1837,6 +1874,7 @@ numberVariable returns [Expression expr 
        :
           ( {isVariableOfType(input.LT(1).getText(), "INT")}? numVarRef = 
Identifier //
         | {isVariableOfType(input.LT(1).getText(), "DOUBLE")}? numVarRef = 
Identifier)
+         | {isVariableOfType(input.LT(1).getText(), "FLOAT")}? numVarRef = 
Identifier)
         {       expr = 
ExpressionFactory.createNumberVariableReference(numVarRef);}
        ;
        catch [Exception e]{expr = 
ExpressionFactory.createNumberVariableReference(input.LT(1));}


Reply via email to