Revision: 17643
          http://sourceforge.net/p/gate/code/17643
Author:   markagreenwood
Date:     2014-03-12 17:08:05 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
generics in the rest of the jape parser

Modified Paths:
--------------
    gate/trunk/src/main/gate/jape/parser/ParseCpsl.java
    gate/trunk/src/main/gate/jape/parser/ParseCpsl.jj

Modified: gate/trunk/src/main/gate/jape/parser/ParseCpsl.java
===================================================================
--- gate/trunk/src/main/gate/jape/parser/ParseCpsl.java 2014-03-12 16:30:23 UTC 
(rev 17642)
+++ gate/trunk/src/main/gate/jape/parser/ParseCpsl.java 2014-03-12 17:08:05 UTC 
(rev 17643)
@@ -450,6 +450,9 @@
                 "Read error " + mue.toString()));}
             }
 
+            // sptURL can never be null at this point because the only way 
that could
+            // happen would be if an exception occurred above, but that would 
trigger
+            // the ParserException above
             if(sptURL == null){
               {if (true) throw(new ParseException(errorMsgPrefix(phaseNameTok)+
                 "Resource not found: base = " + baseURL.toString() +
@@ -471,7 +474,7 @@
 
           // adding the resultant spt to m
           if(parser != null) {
-                List phases = parser.MultiPhaseTransducer().getPhases();
+                List<Transducer> phases = 
parser.MultiPhaseTransducer().getPhases();
 
             //s = parser.SinglePhaseTransducer();
             //if(s != null)
@@ -480,8 +483,8 @@
             if(phases != null) {
               for(int i=0; i < phases.size(); i++) {
                 m.addPhase(
-                  ((Transducer)phases.get(i)).getName(),
-                  (Transducer)phases.get(i)
+                  phases.get(i).getName(),
+                  phases.get(i)
                   );
               }
             }
@@ -518,7 +521,7 @@
   Token inputTok = null;
   SinglePhaseTransducer t = null;
   Rule newRule = null;
-  bindingNameSet = new HashSet();
+  bindingNameSet = new HashSet<String>();
   Token optionNameTok = null;
   Token optionValueTok = null;
     jj_consume_token(phase);
@@ -1119,7 +1122,6 @@
   Token metaPropertyTok = null;
   AnnotationAccessor accessor = null;
   Token opTok = null;
-  Object attrValObj = null;
   Pair attrValPair = null;
   boolean negate = false;
   Constraint c = null;
@@ -1218,7 +1220,6 @@
 // attribute values: strings, identifers (=strings), integers, floats,
 //                   booleans
   final public Pair AttrVal() throws ParseException {Token attrValTok = null;
-  String attrValString = null;
   Pair val = new Pair();
     switch (jj_nt.kind) {
     case integer:
@@ -1849,18 +1850,6 @@
     finally { jj_save(1, xla); }
   }
 
-  private boolean jj_3R_27()
- {
-    if (jj_scan_token(pling)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_26()
- {
-    if (jj_3R_15()) return true;
-    return false;
-  }
-
   private boolean jj_3R_25()
  {
     Token xsp;
@@ -1900,6 +1889,12 @@
     return false;
   }
 
+  private boolean jj_3R_18()
+ {
+    if (jj_3R_20()) return true;
+    return false;
+  }
+
   private boolean jj_3R_16()
  {
     if (jj_scan_token(colon)) return true;
@@ -1908,15 +1903,16 @@
     return false;
   }
 
-  private boolean jj_3R_18()
+  private boolean jj_3R_17()
  {
-    if (jj_3R_20()) return true;
+    if (jj_scan_token(ident)) return true;
     return false;
   }
 
-  private boolean jj_3R_17()
+  private boolean jj_3R_22()
  {
-    if (jj_scan_token(ident)) return true;
+    if (jj_scan_token(leftBrace)) return true;
+    if (jj_3R_25()) return true;
     return false;
   }
 
@@ -1926,13 +1922,6 @@
     return false;
   }
 
-  private boolean jj_3R_22()
- {
-    if (jj_scan_token(leftBrace)) return true;
-    if (jj_3R_25()) return true;
-    return false;
-  }
-
   private boolean jj_3R_15()
  {
     Token xsp;
@@ -1964,6 +1953,18 @@
     return false;
   }
 
+  private boolean jj_3R_27()
+ {
+    if (jj_scan_token(pling)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_26()
+ {
+    if (jj_3R_15()) return true;
+    return false;
+  }
+
   /** Generated Token Manager. */
   public ParseCpslTokenManager token_source;
   SimpleCharStream jj_input_stream;

Modified: gate/trunk/src/main/gate/jape/parser/ParseCpsl.jj
===================================================================
--- gate/trunk/src/main/gate/jape/parser/ParseCpsl.jj   2014-03-12 16:30:23 UTC 
(rev 17642)
+++ gate/trunk/src/main/gate/jape/parser/ParseCpsl.jj   2014-03-12 17:08:05 UTC 
(rev 17643)
@@ -620,6 +620,9 @@
                 "Read error " + mue.toString()));
             }
 
+            // sptURL can never be null at this point because the only way 
that could
+            // happen would be if an exception occurred above, but that would 
trigger
+            // the ParserException above
             if(sptURL == null){
               throw(new ParseException(errorMsgPrefix(phaseNameTok)+
                 "Resource not found: base = " + baseURL.toString() +
@@ -641,7 +644,7 @@
 
           // adding the resultant spt to m
           if(parser != null) {
-               List phases = parser.MultiPhaseTransducer().getPhases();
+               List<Transducer> phases = 
parser.MultiPhaseTransducer().getPhases();
 
             //s = parser.SinglePhaseTransducer();
             //if(s != null)
@@ -650,8 +653,8 @@
             if(phases != null) {
               for(int i=0; i < phases.size(); i++) {
                 m.addPhase(
-                  ((Transducer)phases.get(i)).getName(),
-                  (Transducer)phases.get(i)
+                  phases.get(i).getName(),
+                  phases.get(i)
                   );
               }
             }
@@ -677,7 +680,7 @@
   Token inputTok = null;
   SinglePhaseTransducer t = null;
   Rule newRule = null;
-  bindingNameSet = new HashSet();
+  bindingNameSet = new HashSet<String>();
   Token optionNameTok = null;
   Token optionValueTok = null;
 }
@@ -1086,7 +1089,6 @@
   Token metaPropertyTok = null;
   AnnotationAccessor accessor = null;
   Token opTok = null;
-  Object attrValObj = null;
   Pair attrValPair = null;
   boolean negate = false;
   Constraint c = null;
@@ -1170,7 +1172,6 @@
 Pair AttrVal() :
 {
   Token attrValTok = null;
-  String attrValString = null;
   Pair val = new Pair();
 }
 {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to