test_class.declarator: parser = new DateCalcExpressionParser()
test_class.modifier: private final
test_class.original_string: private final DateCalcExpressionParser parser = new DateCalcExpressionParser();
test_class.type: DateCalcExpressionParser
test_class.var_name: parser
test_class.file: Chapter04/datecalc-lib/src/test/java/com/steeplesoft/datecalc/parser/DateCalcExpressionParserTest.java
test_class.identifier: DateCalcExpressionParserTest
test_case.body: @Test
      public void invalidStringsShouldFail() {
          try {
              parser.parse("2016/12/25 this is nonsense");
              Assert.fail("A DateCalcException should have been thrown (Unable to identify token)");
          } catch (DateCalcException dce) {
  
          }
      }
test_case.class_method_signature: DateCalcExpressionParserTest.invalidStringsShouldFail()
test_case.full_signature: @Test public void invalidStringsShouldFail()
test_case.identifier: invalidStringsShouldFail
test_case.invocations: parse fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void invalidStringsShouldFail()
focal_class.declarator: infos = new ArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final List<InfoWrapper> infos = new ArrayList<>();
focal_class.type: List<InfoWrapper>
focal_class.var_name: infos
focal_class.file: Chapter04/datecalc-lib/src/main/java/com/steeplesoft/datecalc/parser/DateCalcExpressionParser.java
focal_class.identifier: DateCalcExpressionParser
focal_class.class_method_signature: DateCalcExpressionParser.DateCalcExpressionParser()
focal_class.full_signature: public  DateCalcExpressionParser()
focal_class.identifier: DateCalcExpressionParser
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  DateCalcExpressionParser()
focal_class.class_method_signature: DateCalcExpressionParser.parse(String text)
focal_class.full_signature: public Queue<Token> parse(String text)
focal_class.identifier: parse
focal_class.modifiers: public
focal_class.parameters: (String text)
focal_class.return: Queue<Token>
focal_class.signature: Queue<Token> parse(String text)
focal_class.class_method_signature: DateCalcExpressionParser.addTokenInfo(Token.Info info)
focal_class.full_signature: private void addTokenInfo(Token.Info info)
focal_class.identifier: addTokenInfo
focal_class.modifiers: private
focal_class.parameters: (Token.Info info)
focal_class.return: void
focal_class.signature: void addTokenInfo(Token.Info info)
focal_method.body: public Queue<Token> parse(String text) {
          final Queue<Token> tokens = new ArrayDeque<>();
  
          if (text != null) {
              text = text.trim();
              if (!text.isEmpty()) {
                  boolean matchFound = false;
                  for (InfoWrapper iw : infos) {
                      final Matcher matcher = iw.pattern.matcher(text);
                      if (matcher.find()) {
                          matchFound = true;
                          String match = matcher.group().trim();
                          tokens.add(iw.info.getToken(match));
                          tokens.addAll(parse(text.substring(match.length())));
                          break;
                      }
                  }
                  if (!matchFound) {
                      throw new DateCalcException("Could not parse the expression: " + text);
                  }
              }
          }
  
          return tokens;
      }
focal_method.class_method_signature: DateCalcExpressionParser.parse(String text)
focal_method.full_signature: public Queue<Token> parse(String text)
focal_method.identifier: parse
focal_method.invocations: trim isEmpty matcher find trim group add getToken addAll parse substring length
focal_method.modifiers: public
focal_method.parameters: (String text)
focal_method.return: Queue<Token>
focal_method.signature: Queue<Token> parse(String text)