Package org.idpf.epubcheck.util.css.CssTokenList

Examples of org.idpf.epubcheck.util.css.CssTokenList.PrematureEOFException


    }
    catch (NoSuchElementException nse)
    {
      err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF,
          iter.last.location, "'" + errChar + "'"));
      throw new PrematureEOFException();
    }

    if (debug)
    {
      checkState(iter.last.getChar() == '}');
View Full Code Here


      }
      catch (NoSuchElementException nse)
      {
        err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "';' "
            + Messages.get("or") + " '}'"));
        throw new PrematureEOFException();
      }
    }
  }
View Full Code Here

      }
    }
    catch (NoSuchElementException nse)
    {
      err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, ":"));
      throw new PrematureEOFException();
    }

    try
    {
      while (true)
      {
        CssToken value = iter.next();
        if (MATCH_SEMI_CLOSEBRACE.apply(value))
        {
          if (declaration.components.size() < 1)
          {
            err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN,
                iter.last.location, value.getChar(), Messages
                .get("a_property_value")));
            return null;
          }
          else
          {
            return declaration;
          }
        }
        else
        {
          if (!handlePropertyValue(declaration, value, iter, isStyleAttribute))
          {
            err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN,
                iter.last.location, iter.last.getChars()));
            return null;
          }
          else
          {
            if (isStyleAttribute && !iter.hasNext())
            {
              return declaration;
            }
          }
        }
      }
    }
    catch (NoSuchElementException nse)
    {
      err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "';' "
          + Messages.get("or") + " '}'"));
      throw new PrematureEOFException();
    }

  }
View Full Code Here

      // UAs required to close any open constructs on premature EOF
      doc.startAtRule(atRule);
      err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "';' "
          + Messages.get("or") + " '{'"));
      doc.endAtRule(atRule.getName().get());
      throw new PrematureEOFException();
    }

    if (debug)
    {
      checkArgument(MATCH_SEMI_OPENBRACE.apply(iter.last));
      checkArgument(iter.filter() == FILTER_S_CMNT);
    }

    // ending up here only on expected end
    doc.startAtRule(atRule);
    if (atRule.hasBlock)
    {
      try
      {
        if (hasRuleSet(atRule, iter))
        {
          while (!MATCH_CLOSEBRACE.apply(iter.next()))
          {
            if (iter.last.type == CssToken.Type.ATKEYWORD)
            {
              handleAtRule(iter.last, iter, doc, err);
            }
            else
            {
              handleRuleSet(iter.last, iter, doc, err);
            }
          }
        }
        else
        {
          handleDeclarationBlock(iter.next(), iter, doc, err);
        }
      }
      catch (NoSuchElementException nse)
      {
        err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "'}'"));
        doc.endAtRule(atRule.name.get());
        throw new PrematureEOFException();
      }
    }
    doc.endAtRule(atRule.name.get());
  }
View Full Code Here

TOP

Related Classes of org.idpf.epubcheck.util.css.CssTokenList.PrematureEOFException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.