예제 #1
0
 ParseResult internalParse(
     String s, Map<String, Integer> targetUnionDecisions, boolean mustConsumeStr) {
   List<Token.AbstractToken> outputToks = new ArrayList<Token.AbstractToken>();
   String newStr = Tokenizer.attemptParse(tokenClassIdentifier, tokenParameter, s, outputToks);
   if (newStr == null || (mustConsumeStr && newStr.trim().length() != 0)) {
     return null;
   }
   assert (outputToks.size() == 1);
   // outputToks should contain just one result.
   return new ParseResult(
       outputToks.get(0).get(), Token.AbstractToken.hasData(tokenClassIdentifier), newStr);
 }
예제 #2
0
 public String toString() {
   return "Base: " + Token.AbstractToken.getStrDesc(tokenClassIdentifier, tokenParameter) + " ";
 }
예제 #3
0
 Schema computeAvroSchema() {
   return Token.AbstractToken.createAvroSchema(tokenClassIdentifier, tokenParameter, name);
 }
예제 #4
0
 public BaseType(Token.AbstractToken token, List<String> sampleStrs) {
   this.sampleStrs = sampleStrs;
   this.tokenClassIdentifier = token.getClassId();
   this.tokenParameter = token.getParameter();
   this.schema = computeAvroSchema();
 }